PDA

View Full Version : display text in whos online but not in online.php


davidallsop
03-22-2008, 01:44 PM
I want to display some text next to the 'Most users ever online was x, 20th January 2008 at 12:53 PM.' text on the index page but do not want it to appear on the /online.php page.

I have written this code but it is showing nothing when implemented into the online phrase: -


Most users ever online was {1}, {2} at {3}.

<?
$url = $_SERVER['REQUEST_URI'];

if($url == 'online.php')
{
echo "front";
}
else
{
echo " | <font color=#045CA7>Administrators</font> | <font color=#55932F>Moderators</font> | <font color=#CD54C1>Premium Members</font>
| Members";}
?>


What am i doing wrong?

Lynne
03-22-2008, 02:56 PM
Where are you putting that code? I do something similar on my site but I just edited the FORUMHOME template to add it in.

davidallsop
03-22-2008, 03:04 PM
this was inside the phrase manager for the most users online.

snunhuck
03-22-2008, 03:17 PM
What have you got <? and ?> in the php file? Surely the file starts with those tags so no need to re-include them.

Lynne
03-22-2008, 03:58 PM
Can you have php code within a phrase? Have you ever done that before? (I am really not sure here.)

davidallsop
03-24-2008, 11:01 AM
im not sure - any suggestions?

Lynne
03-24-2008, 02:52 PM
Well, you could just edit the template. I put this before the most ever online phrase text:
<span style="float:$stylevar[right]">My Extra Stuff</span>

If you don't want to do a template edit, I suppose you could do a 'fake' template edit by using a plugin to do a preg_replace... maybe... I'm not sure I would go about it that way though.

davidallsop
03-24-2008, 03:02 PM
What template is that? and will that change it on just the index or also on the whos online page?

Opserty
03-24-2008, 03:20 PM
Edit the FORUMHOME template...

AdminCP > Styles & Templates > Style Manager > Edit Templates > Forum Home Templates > FORUMHOME.

(You'll be looking for the area around <!-- what's going on box --> comment)