Welcome, Guest. Please Login or Register.
November 17, 2017, 11:36:15 PM
Home Help Search Login Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Portal Discussion  |  Topic: 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 10011 times)
Norman Smiley
Noobie
*
Posts: 2


I'm a llama!


Telling which users are online using SSI.php
« on: September 10, 2003, 11:15:26 AM »
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, 11:17:39 AM »
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, 11:24:01 AM »
Reply with quote

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, 11:31:39 AM »
Reply with quote

here is some code that helped me, hope it helps you
Code: [Select]
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



Re:Telling which users are online using SSI.php
« Reply #4 on: December 29, 2003, 10:46:58 PM »
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, 01:20:44 AM by TLM45 » Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Portal Discussion  |  Topic: 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.0.12 | SMF © 2016, Simple Machines
Valid XHTML 1.0! Valid CSS!
Page created in 0.03 seconds with 19 queries.