Showing online in Memberslist, not just for phpBB part of si

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Showing online in Memberslist, not just for phpBB part of si
Caedus
CZ Newbie
Caedus has been a member for over 20 year's 20 Year Member
netherlands.gif
Gender: Male
Status: Offline
Joined: May 23, 2004
0.00 posts per day
Posts: 14
Points: 1,174
   
I would like some little help with this one. I think it's fairly easy for everyone with some more php & sql knowledge than me.

I downloaded [ Register or login to view links on this board.] and it worked out quite good.

However it only shows the members who are online on the phpBB forum (or any other parts that is from the forum, like the memberslist). I would like it to show who is online on the entire page, and not just on the forum.

The code that is changed in the memberslist i will post here:

#################################################################
## Mod Title:   View Online/Offline Status in Memberlist
## Mod Version: 1.0.0
## Mod Release Date: 6/13/02
## Author:       webmessiah <Jeff K>
## Description:  Combiantion of Online/Offline MOD and Nivisec MOD on members 
##                last post date(http://www.nivisec.com/mods/) This MOD will run without
##               either of those MOD's installed. This will allow you to view who is online/offline
##               in the Member List
##
## Installation Level:  easy
## Installation Time:   10 Minutes
## Files To Edit:       modules/Memberlist/index.php
##                      modules/Forums/lanaguage/lang_english/lang_main.php
##                      modules/Forums/templates/subSilver/memberlist_body.tpl
##                      modules/Forums/templates/subSilver/subSilver.cfg
## Included Files:      N/A
##
## Example: Sorry no example can be provided as my forum is private, but it works!
##
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################
##
## Auth Notes: This the my first MOD and did it by combining the ideas of
##             2 MOD's(Online/Offline MOD & Nivisec Members Last Post Date MOD
##             at http://www.nivisec.com/mods/) to have a list of active people
##             in your forum
##
#################################################################

#
#-----[ OPEN ]------------------------------------------
modules/Forums/Memberlist/index.php

#
#-----[ FIND ]------------------------------------------
   'L_POSTS' => $lang['Posts'],

#
#-----[ ADD AFTER ]------------------------------------------
   'L_VIEW_ONLINE' => $lang['Online Status'],

#
#-----[ FIND ]------------------------------------------
SELECT username, user_id, user_viewemail, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm,

#
#-----[ ADD IMMEDIATELY AFTER ]------------------------------------------
user_allow_viewonline, user_session_time,

#
#-----[ FIND ]------------------------------------------
      $search = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>';

#
#-----[ ADD AFTER ]------------------------------------------
      $view_online_img =  (($row['user_session_time'] >= ( time() - 300 )) && ($row['user_allow_viewonline'])) ? '<img src="' . $images['Online'] . '" alt="' . $lang['Online'] . '" title="' . $lang['Online'] . '" border="0" />' : '<img src="' . $images['Offline'] . '" alt="' . $lang['Offline'] . '" title="' . $lang['Offline'] . '" border="0" />';

#
#-----[ FIND ]------------------------------------------
         'YIM' => $yim,

#
#-----[ ADD AFTER ]------------------------------------------
         'VIEW_ONLINE' => $view_online_img,

#
#-----[ OPEN ]------------------------------------------
modules/Forums/lanaguage/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------
//
// That's all Folks!
//

#
#-----[ ADD BEFORE ]------------------------------------------
// Memberlist Online/Offline
$lang['Online'] = "Online";
$lang['Offline'] = "Offline";
$lang['Online Status'] = "Online Status";

#
#-----[ OPEN ]------------------------------------------
modules/Forums/templates/subSilver/memberlist_body.tpl

#
#-----[ FIND ]------------------------------------------
     <th class="thTop" nowrap="nowrap">{L_POSTS}</th>

#
#-----[ ADD AFTER ]------------------------------------------
     <th class-"thTop" nowrap="nowrap">{L_VIEW_ONLINE}</th>

#
#-----[ FIND ]------------------------------------------
     <td class="{memberrow.ROW_CLASS}" align="center"> ;;{memberrow.PM_IMG} ;;</td>

#
#-----[ ADD AFTER ]------------------------------------------
     <td class="{memberrow.ROW_CLASS}" align="center" valign="middle"><span class="gen">{memberrow.VIEW_ONLINE}</span></td>

#
#-----[ FIND ]------------------------------------------
     <td class="catbottom" colspan="8" height="28"> ;;</td>

#
#-----[ REPLACE WITH ]------------------------------------------
     <td class="catbottom" colspan="9" height="28"> ;;</td>

#
#-----[ OPEN ]------------------------------------------
/templates/subSilver/subSilver.cfg

#
#-----[ FIND ]------------------------------------------ 
//
// Vote graphic length defines the maximum length of a vote result
// graphic, ie. 100% = this length
//

#
#-----[ BEFORE ADD ]------------------------------------------ 
$images['Online'] = "modules/Forums/$current_template_images/online.gif";
$images['Offline'] = "modules/Forums/$current_template_images/offline.gif";

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM


I think that somewhere the sql queries must be changed to fetch the info for the "normal" nukeuser and not just the "forumuser". I posted this here, because on the warpspeed site, nobody was able to help me (or just didn't want to help). So I'm hoping for a bit more positive responses here. I already have some good experiences with this site icon_biggrin.gif!



_________________
icon_arrow.gif Caedus
Back to top Reply with quote
#2   re: Showing online in Memberslist, not just for phpBB part o
Caedus
CZ Newbie
Caedus has been a member for over 20 year's 20 Year Member
netherlands.gif
Gender: Male
Status: Offline
Joined: May 23, 2004
0.00 posts per day
Posts: 14
Points: 1,174
   
Sorry to bump this post, but I would really like some help, and I think that it is quite simple for someone with some moderate php/SQL knowledge. icon_sad.gif




_________________
icon_arrow.gif Caedus
Back to top Reply with quote
#3   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,475
   
I suggest you give it a go and place any questions you might have when and if you get any errors.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#4   
Caedus
CZ Newbie
Caedus has been a member for over 20 year's 20 Year Member
netherlands.gif
Gender: Male
Status: Offline
Joined: May 23, 2004
0.00 posts per day
Posts: 14
Points: 1,174
   


Originally posted by Telli @ Wed Jun 09, 2004 1:46 am:

I suggest you give it a go and place any questions you might have when and if you get any errors.


Yeah, I guess I should try it myself. Will keep you informed.




_________________
icon_arrow.gif Caedus
Back to top Reply with quote
#5   re: Showing online in Memberslist, not just for phpBB part o
Caedus
CZ Newbie
Caedus has been a member for over 20 year's 20 Year Member
netherlands.gif
Gender: Male
Status: Offline
Joined: May 23, 2004
0.00 posts per day
Posts: 14
Points: 1,174
   
I've found this sql query in the User Info block:

$sql = "SELECT uname, guest FROM $prefix"._session." WHERE guest=0";
$result = $db->sql_query($sql);
$member_online_num = $db->sql_numrows($result);
$who_online_now = "";
$i = 1;
while ($session = $db->sql_fetchrow($result)) {
    if (isset($session["guest"]) and $session["guest"] == 0) {
        if ($i < 10) {
            $who_online_now .= "0$i: ;;<A HREF=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$session[uname]\">$session[uname]</a><br>\n";
        } else {
            $who_online_now .= "$i: ;;<A HREF=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$session[uname]\">$session[uname]</a><br>\n";
        }
        $who_online_now .= ($i != $member_online_num ? "  " : "");
        $i++;
    }
}


My problem now is: how can I implant that query in, for example, the Memberlist module, so that it is executed and shown properly?



_________________
icon_arrow.gif Caedus
Back to top Reply with quote
#6   re: Showing online in Memberslist, not just for phpBB part o
Caedus
CZ Newbie
Caedus has been a member for over 20 year's 20 Year Member
netherlands.gif
Gender: Male
Status: Offline
Joined: May 23, 2004
0.00 posts per day
Posts: 14
Points: 1,174
   
I inserted this:

$view_online_img =
$onstatus = $db->sql_fetchrow($db->sql_query("SELECT uname FROM ".$prefix."_session WHERE uname='$username'"));               
$username_pm = $username;
   $username_online = $onstatus['uname'];
   
   if ($username_online == "") {
       $view_online_img = <img src=\"' . $images['Online'] . '\" alt=\"Online\" title=\"' . $lang['Online'] . '\" border=\"0\" />;
   } else {
       $view_online_img = <img src=\"' . $images['Offline'] . '\" alt=\"Offline\" title=\"' . $lang['Offline'] . '\" border=\"0\" />;
   }


But that doesn't work. It gives me an error:
Parse error: parse error, unexpected '<' in /hsphere/local/home/k2664/denvp.nl/modules/Members_List/index.php on line 292


I copied it from the Account module and it didn't work directly (like I expected).

Could someone take a look at that and help me out?



_________________
icon_arrow.gif Caedus
Back to top Reply with quote
#7   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,475
   
Ok so your trying to just insert the who is online names and a link to thier profile say at like the bottom of the memberlist?




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#8   re: Showing online in Memberslist, not just for phpBB part o
Caedus
CZ Newbie
Caedus has been a member for over 20 year's 20 Year Member
netherlands.gif
Gender: Male
Status: Offline
Joined: May 23, 2004
0.00 posts per day
Posts: 14
Points: 1,174
   
I will attach a screenshot I made from my memberlist (currently it only displays members that are online on the forums or related modules, like the memberslist), because it would be difficult to explain otherwise.

What you see is what I want to keep, I just want to change some code, so to display all online users.




2.jpg
 Description:
N/A
 Filesize:  101.88 KB
 Viewed:  12404 Time(s)

2.jpg





_________________
icon_arrow.gif Caedus
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum