This minor hack displays, in the shout box, users who have posted in the shout box and who are online.
Everytime a use logs in, if they still have a post in the shout box they will have a little green icon to the left of their name. We have increased our records to a large number so this works out well for us.
See screen shot. You will see a little green dot in front of an online users name.
I am including the gif that I used. You can of course use your own gif and/or change the name the new code refers to.
Code:find this in your shoutbox.php // End of print input box and delete everything below it to the end of the file. Replace the deleted text with this: $query = "SELECT `shoutbox`.`id`, `shoutbox`.`text`, `shoutbox`.`date`, `shoutbox`.`class`, `Profiles`.`NickName`, `Profiles`.`ID` FROM `shoutbox` LEFT JOIN `Profiles` ON `Profiles`.`ID` = `shoutbox`.`id` ORDER BY `shoutbox`.`date` DESC"; $shout_res = db_res( $query ); while ( $shout_arr = mysql_fetch_array($shout_res) ) { $user_is_online = get_user_online_status($shout_arr['ID']); if ( $user_is_online ) { $offline_online = "<img border=0 src='$site[images]onlinenowsmall.gif'>"; $off_on_text = _t("_Online"); } else { $offline_online = ""; } $shout_text = process_smiles( process_line_output( $shout_arr['text'], $maxwordlength) ); $content .= " <tr><td title=\"{$shout_arr['date']}\" class=\"{$shout_arr['class']}\"> <a target=\"_blank\" href=\"{$site['url']}profile.php?ID={$shout_arr['id']}\" class=\"membermenu\">{$offline_online}{$shout_arr['NickName']}</a>: {$shout_text} </td></tr>"; } $content .= " </table> </td></tr> </table> </form>\n"; return $content; } ?>
Prometheus
ps. Almost forgot - though you should know this by now upload the gif to your templates/tmpl_XXX/images_XXX/ folder.


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks