Posted on: 08/28/06 02:09pm
By: kreative
Hi,
I would like to have a random tagline in my homepage (like www.airliners.net, check it, do a refresh and you will see a differenw window's title every time).
How can I do that?
Thanks a lot!!
Random tagline, how to do?
Posted on: 08/28/06 02:27pm
By: Dirk
You could overwrite $_CONF['site_slogan'] with in your lib-custom.php. Just put the code outside of any function and it will be executed for every page load.
bye, Dirk
Random tagline, how to do?
Posted on: 08/28/06 02:52pm
By: kreative
Great!!!
And........ how can I make a function to pick up the site slogan for, e.g., a txt file? I don't know php language...
Random tagline, how to do?
Posted on: 08/28/06 05:46pm
By: LWC
Go to my site (click on my name) and download my PHP script "Random Text". It takes a random phrase (could be as short as a line in your case) from a quotes' file.
I've just updated it to be in the shape of a function. Now if you include it in system/lib-custom.php all you have to do is call it from config.php as Dirk said.
Since I've updated it just for you, please beta test the new version.
Random tagline, how to do?
Posted on: 08/29/06 01:51pm
By: kreative
I tried this solution (more simple):
- In config.php I added the following code:
$title[1] = "Title1";
$title[2] = "Title2";
$title[3] = "Title3";
$title[4] = "Title4";
$title[5] = "Title5";
$index = rand(1, count($title));
Then, I modified the following line:
$_CONF['site_slogan'] = $index[$title];
Is this a good tip?
Random tagline, how to do?
Posted on: 08/29/06 02:44pm
By: LWC
I thought you wanted to use an external file that you can just fill up with quotes. If you want to write the quotes manually for your site then I guess your solution is good.