Recent Topics

1 Jul 02, 2006 10:54    

Hello Crowd,
[if this is in the wrong place here, please admin it to one better suited, thanks.]

An entirely non-vital idea crossed my mind and I wonder how this could be accomplished: to change the blog name issued to the title in <head> and the header area (the identifying short name and stub name would always remain "Garten" for operational reasons) according to season of year; actually just make an addition to it, coming to think about it.

I intend to have a blog called "Garten" (garden). In the times of year, when there's not much sun around, I'd like it to dub itself "Wintergarten" (winter garden). Conceptually, this doesn't look too hard to me, but I don't know the right coding to actually make work.
/me thinks it would have to be something like:

[i]
{if blog number equals X and
   {if month is either november, december, january or february
 echo "Winter" (in front of Garten);
   }
}[i]


and have this bit put into the title tag and the title in the header. What would be the correct way do code this in PHP?

As I said, this is totally not vital, just a playful notion. However, if anyone has any ideas on how to best do this, I'd be very pleased :-)
Thank you very much + best regards,

'lex

2 Jul 02, 2006 12:41

Since the blogtitle is grabbed from what you put in in the backoffice, you can yourself change the title of your blog the first of november.
You can change the title of your blog as often as you want...
Wouldn't that solf your needs ?

3 Jul 02, 2006 12:53

skins/<skin name>/_main.php

if( !defined('DB_USER') ) die( 'Please, do not access this page directly.' );
$season = '';
if( $Blog->ID == ## )
{
	$month = date( 'm' );
		
	switch( true )
	{
		case ( $month < 3 ) :
			$season = 'Winter ';
			break;
		case ( $month < 6 ) :
			$season = 'Spring ';
			break;
		case ( $month < 9 ) :
			$season = 'Summer ';
			break;
		case ( $month < 12 ):
			$season = 'Autumn ';
			break;
		default :
			$season = 'Winter ';
	}
}?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php locale_lang() ?>" lang="<?php locale_lang() ?>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php locale_charset() ?>" />
<title><?php
echo $season;

<h1 id="pageTitle"><?php
echo $season;
 $Blog->disp( 'name', 'htmlbody' ) ?></h1>

Change the ## to the ID of the blog you want.

¥

4 Jul 02, 2006 16:51

Hello! :-)

@Topanga: yeah, I could do it by hand, sure. But that's true for so many things that a software does for me these days ;) So why not explore the possibility?! :)

@Yabba: that looks very promising! :-) Thank you! I'll give that a shot as soon as I can manage! :)

Best regards, sends

'lex

5 Jul 03, 2006 00:21

I live in Phoenix so for me it's much easier.

$season = 'summer';
if( hell_froze_over )
{
    $season = 'mild summer ';
}

6 Jul 03, 2006 02:19

Would that be Phoenix alpha? In which case it'd be if( $season <= 'hell_froze_over'). Or Phoenix beta? In which case that'd be if( $greenpeace == 'complaining at the melt rate of hell'). Or Phoenix? In which case yer original if() is correct ? :p

¥

7 Jul 03, 2006 06:26

Offtopic:
¥åßßå, that is one awesome switch statement :D

Edit:
Back on topic, what about the people on the other hemisphere.... As the seasons are reversed....

8 Jul 06, 2006 11:10

balupton wrote:

Back on topic, what about the people on the other hemisphere.... As the seasons are reversed....

I'm guessing that you can work that one out .... if not then the simplest solution is to move to america ;)

¥


Form is loading...