TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

September 27, 2023, 09:43:31 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 194,549
  • Total Topics: 21,181
  • Online today: 75
  • Online ever: 3,540
  • (September 03, 2022, 01:38:54 AM)
Users Online
Users: 0
Guests: 50
Total: 50

greet visitor by time of day

Started by evulness, April 11, 2008, 09:12:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

troll

Thanks again, now is there a  way to change the forum default time? I just read on SMF that its based on the server time is that right?

JPDeni

It is based on server time, but you can alter it in the admin section.

Add this line to the start of the code:


global $user_info, $modSettings;


And change


$hour = date('G');


to

$time = time() + ($user_info['time_offset'] + $modSettings['time_offset']) * 3600;
$hour = date('G',$time);


This will take into account any adjustments you have made to the time, as well as adjustments that an individual has made through his/her profile.

troll

You are a clever cookie! I dont think I better mess about with all the settings though just to have a few members see it change <<-- *rolls eyes*

They can wait until it changes!!!

JPDeni

Well, I wrote a whole long thing that has a different greeting for every hour of the day and also greets people on holidays, birthdays and their anniversary of joining the site. Also a special greeting for someone's first day on the site. It can also have images.

http://www.tinyportal.net/index.php?topic=9940.0

This code is much simpler, though. I went a little loony with my code.  :o

evulness

wow i'm glad others found this useful lol

i'm surprised no one else has posted something similar.

i liked your custom one you post, but didn't want the pictures.