Welcome, Guest. Please Login or Register.
November 21, 2024, 05:51:03 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Portal Discussion  |  Telling which users are online using SSI.php « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Telling which users are online using SSI.php  (Read 38205 times)
Norman Smiley
Noobie
*
Posts: 2


I'm a llama!

Telling which users are online using SSI.php
« on: September 10, 2003, 04:15:26 PM »
Reply with quote

Is there any way using SSI.php to tell if a member is online, so I can write a conditional like:


if ($username is online)

{
echo "<img src=\"./img/online.gif\">";
}


?
Logged
Valconeye
Full Member
***
Posts: 190


Re:Telling which users are online using SSI.php
« Reply #1 on: September 10, 2003, 04:17:39 PM »
Reply with quote

http://www.yabbse.org/community/ssi_examples.php
Whos Online Function: <? whosOnline(); ?>
Logged
Norman Smiley
Noobie
*
Posts: 2


I'm a llama!

Re:Telling which users are online using SSI.php
« Reply #2 on: September 10, 2003, 04:24:01 PM »
Reply with quote

Quote from: Valconeye on September 10, 2003, 04:17:39 PM
http://www.yabbse.org/community/ssi_examples.php
Whos Online Function: <? whosOnline(); ?>

But is there a way to separate those names so that I can write a conditional for a single user?
Logged
Valconeye
Full Member
***
Posts: 190


Re:Telling which users are online using SSI.php
« Reply #3 on: September 10, 2003, 04:31:39 PM »
Reply with quote

here is some code that helped me, hope it helps you
It's really simple, actually. In your site, design the html or php that will make the panel and put it in there. Then just attach an if statement to the top and bracket/echo your html stuff. Lots of examples within yabbse's code. You can do a simple if they are a moderator, or you can even go specific user(s), something like this:Code:
// HTML BEFORE YOUR BOX

<?PHP
global $db_prefix, $username
$request = mysql_query("SELECT moderators FROM {$db_prefix}boards WHERE moderators='$username' LIMIT 1;") or database_error(__FILE__, __LINE__);

if ($request != 0)
{
echo '
// HTML code to show panel
}
?>
// Other HTML for rest of page

That would be roughly for a moderator of any board. For a specific user or users:Code:
// HTML BEFORE YOUR BOX

<?PHP
global $username

if ($username == 'Youruser')
{
echo '
// HTML code to show panel
}
?>
// Other HTML for rest of page

Logged
TLM45
Noobie
*
Posts: 7


ICQ - 73292328tlm465@hotmail.com
Re:Telling which users are online using SSI.php
« Reply #4 on: December 30, 2003, 03:46:58 AM »
Reply with quote

Include the SSI.php then look at the function OnlineStatus($user) in Subs.php, that should get you started I belive.

* TLM45 goes back to trying to make a function that will work in the forum to return users level (admin/mod/etc..)

*EDIT* - Dummy me did not know about the variable $setting[7] held the info I needed.
« Last Edit: December 30, 2003, 06:20:44 AM by TLM45 » Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Portal Discussion  |  Telling which users are online using SSI.php « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.028 seconds with 20 queries.