Reserved for finished mod.
Geoserv
![]() |
| | LinkBack | Thread Tools | Display Modes |
| |||
| Currently logged in |
| |||
|
What is wrong here: in libs/smartyvariables.php: Code: // show count users logged in
$queued = $db->get_var('SELECT user_login from ' . table_users . ' where user_logged_in');
$main_smarty->assign('loggedin', $loggedin);
Code: {$loggedin}
I know the query works. Any ideas? Geoserv. |
| |||
|
Do I need to insert an echo in there somewhere? Geoserv. |
| |||
| Quote:
|
| |||
|
I have also worked on something. Similar but different approach yours might be better. Code: function do_viewallside() {
global $db, $user, $the_template,$current_user,$main_smarty;
$online2 = 1;
$idle2 = 2;
$onlineLimit2 = time() - $online2*60;
$idleLimit2 = time() - $idle2*60;
$sql = "SELECT user_login, user_modification, user_lastactivity, user_logged_in FROM " . table_users . " WHERE user_logged_in = 1";
$list_users = $db->get_results($sql);
echo "<table border=\"0\" style=\"margin-bottom:25px\">";
echo "<tr><th colspan=\"3\" style=\"text-align=center\">Who is Online</th></tr>";
if($list_users) {
foreach($list_users as $row) {
$lastactivity = strtotime($row->user_modification);
if ($idleLimit2 < $lastactivity) {
if($onlineLimit2 < $lastactivity) {
echo "<tr>";
echo "<td><a href=\"".my_base_url."/user.php?login=$row->user_login&view=profile\">$row->user_login</a></td>";
echo '<td><img src='.my_pligg_base.'/templates/'.$the_template.'/images/friends_online.ico alt="online" style="margin-left:4px"></td>';
echo '</tr>';
} else {
}
}
}
}
echo "<table>";
}
But the IF statement highlighted don't work well for some reason. So it doesn't detect if user has no activity for some time. Meaning that if he doesn't logout himself it will detect him as Online, I think maybe it hasn't taken effect yet, but I set the value low, so I think it should have. ANy Help thanks. This was taken from the Friend module by AnAlien http://forums.pligg.com/pligg-tutori...-activity.html Last edited by manya1011; 02-04-2008 at 09:58 PM.. |
| |||
|
I have noticed something that could be the cause for the if statement issue, When I get the current time time(); it is completely different from a user recently modified time. Way Way off... All I did was Add both the Users and an option for the time to display on the page, and they have a huge difference, Am i calling the time wrong?? Any ideas... |
| |||
|
/bumpy to get other ideas..
|
| |||
|
I donīt fully understand your code.It works if everyone would logout instead of being idle or just close the browser window? But it displays if someone logs in in every case, right? Where does it fit in the Pligg architecture (tpl files or something)? |
| |||
|
Just add the function to AnAlien's sidebar_friends.php Then do a call to the function in the following like this Code: echo "<div class=\"tlb\" style=\"margin-top:-15px\"><span><a onclick=\"new Effect.toggle('sidefriends','blind', {queue: 'end'}); \"> <img src=\"".my_base_url."/templates/" . $the_template . "/images/expand.png\" width=\"30\" height=\"29\"/></a></span><a href=\"".my_base_url."/user.php?login=test&view=viewfriends\">".$main_smarty->get_config_vars('PLIGG_Visual_Friends')."</a></div><div id=sidefriends>";
do_viewfriendsside();
do_viewallside();
echo "<table>";
echo "<tr>";
echo "<td>test</td><td>what</td>";
echo "</tr>";
echo "</table>";
echo "<li class=\"rmore\"><a href=\"".my_base_url."/user.php?view=viewfriends\">".$main_smarty->get_config_vars("PLIGG_Visual_What_Is_Pligg_Read_More")."</a></li>";
echo "</div>";
|
| |||
|
If someone manually logs out then it will show user off line, basically not list him in the list. If he doesn't logout, thats where the problem lies because the time thing is way off so it doesn't detect the 20minutes or 10minutes
|
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Is there a reason incomplete submits are logged in the DB? | swiper | Modification Tutorials | 2 | 01-24-2008 01:29 PM |
| EVB option always says I'm logged out! | bbrian017 | General Help | 5 | 01-18-2008 04:12 PM |
| Successfully logged out message | formicin | Suggestions | 1 | 03-08-2007 12:48 PM |
| Ajax dialog if user tries to vote without being logged in (digg-like) | elder | Modification Tutorials | 12 | 12-03-2006 03:52 PM |





Linear Mode

