Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 06:55 pm EDT

Geeklog Forums

Random tagline, how to do?


Status: offline

kreative

Forum User
Chatty
Registered: 08/15/04
Posts: 53
Location:Verona, Italy
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!! Wink
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
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
 Quote

Status: offline

kreative

Forum User
Chatty
Registered: 08/15/04
Posts: 53
Location:Verona, Italy
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... Razz
 Quote

Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
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.
 Quote

Status: offline

kreative

Forum User
Chatty
Registered: 08/15/04
Posts: 53
Location:Verona, Italy
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?
 Quote

Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
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.
 Quote

All times are EDT. The time is now 06:55 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content