Recent Topics

1 Apr 13, 2006 11:49    

I searched around and couldn't find anybody else who'd done this, so I guess I get to be the first one! (-:

In the _main.php file for your chosen skin, look for the line that says:

<?php $Blog->disp( 'tagline', 'htmlbody' ) ?>


and replace it with:


<?php 
global $Taglinecount;
$Taglinelist=file('http://www.yoursite.com/your_taglines');
$Taglinecount=0;
foreach($Taglinelist as $Tagline)
{ $Taglinecount++; }
echo $Taglinelist[rand(0,($Taglinecount-1))];
?>

replace "www.yoursite.com/your_taglines" with the file on your site containing taglines. Taglines should be one-liners only. By the way, I've even included HTML tags in one of the taglines in my file, and they came through nicely, so one-liner javascripts, special effects, etc., are not out of the quetion, here.

Enjoy!

EDIT: Whoops, forgot. Here's the [url=http://penguinpetes.com/b2evo/index.php]beast in action[/url].

2 Apr 13, 2006 16:58

Nice. Do you need the "global $Taglinecount" bit in there?

I thought about taking my random quote selector from http://wonderwinds.com/Hang_Gliding/index.php (three quotes in the sidebar) and using it to pull one quote as a tagline. I think your way will be much easier.

Oh and if you put the "your_taglines" file in your custom skin folder you'll be able to edit the file from your back office templates tab. I think!

3 Apr 13, 2006 17:13

Do you need the "global $Taglinecount" bit in there?

If I understand this correctly, I do: http://www.php.net/manual/en/language.variables.scope.php , because it goes out of scope inside the loop.

That back office templates maneuver sounds interesting. However, my webhost has a good enough interface, I just edit everything directly, anyway.


Form is loading...