OK, I was just testing it out on forumhome. I don't really know how hook locations work, but I knew forumhome_start would work for my template in forumhome (I thought so).
The following code, though, works.
PHP Code:
$timestamp = TIMENOW - $vbulletin->options['hourdiff'];
$hourofday = date("G", $timestamp );
if ($hourofday == 6) $message = "6AM";
if ($hourofday == 19) $message = "7PM";
$template_hook['forumhome_above_forums'] .= $message;
But I don't want to do that exactly. I was trying to do it with the condition in a template's if-statement as I said. So this is what I tried:
My plugin with hook location forumhome_start:
PHP Code:
$timestamp = TIMENOW - $vbulletin->options['hourdiff'];
$hourofday = date("G", $timestamp );
Then in my template:
Code:
<vb:if condition="$hourofday==19">stuff to do here</vb:if>
(it was 7PM when I tried it. It's not a problem with the time though, because I also checked if the variable had any value at all and it didn't.)
What I'm really trying to do is change the background (CSS) depending on the time of day. There might be an easier way than the templates... I just don't exactly understand how plugins work because I'm still new to vB.