php forum
php mysql forum
php mysql smarty
 
Topic Options
#243300 - 04/19/03 12:38 AM Quick Mod: Users Browsing This Forum
PhotoPost Offline
Hacker

Registered: 02/03/02
Posts: 989

   Quick Mod: Users Browsing This Forum to Del.icio.us Add to del.icio.us
  Digg Quick Mod: Users Browsing This Forum Digg it
I dont care for the display which shows the number of people in the forums; I'd rather see who is actually in the forum. <br /> <br />So, I did another Quick Mod: <br /> <br />In postlist.php, around lines 493-514 I replaced that code with (the stuff in bold): <br /> <br />[]// Find out how many are browsing this forum <br /> $query = " <br /> SELECT O_Type,O_Extra,O_Username,O_Uid <br /> FROM {$config['tbprefix']}Online <br /> WHERE O_Extra LIKE '$Board%' <br /> "; <br /> $sth = $dbh -> do_query($query); <br /> $r = ""; <br /> $a = 0; <br /> while (list($Type,$Extra,$Who,$Uid) = $dbh -> fetch_array($sth)) { <br /> if ( $Type == "r" ) { <br /> if ( empty($r) ) $r = "<a href=\"{$config['phpurl']}/showprofile.php?Cat=$Cat&amp;User=$Uid&amp;Board=$Board&amp;what=ubbthreads&amp;page=$page&amp;view=$view&amp;sb=$sb&amp;o=$o\">$Who</a>"; <br /> else $r .= ", <a href=\"{$config['phpurl']}/showprofile.php?Cat=$Cat&amp;User=$Uid&amp;Board=$Board&amp;what=ubbthreads&amp;page=$page&amp;view=$view&amp;sb=$sb&amp;o=$o\">$Who</a>"; <br /> } <br /> else { <br /> $a++; <br /> } <br /> } <br /> if ( !empty($r) ) $r = "Users browsing this forum: $r"; <br /> if ( $a > 0 ) $r .= " (and $a anonymous users)"; <br /> <br />// ------------------------- <br />// Set up some sorting stuff[/] <br /> <br />Then in postlist.tmpl, I added the following likes in bold: <br /> <br />[]<!-- END OF LOOP --> <br /><tr> <br /><td colspan="6" class="tdheader"> <br />$pagejumpers <br /></td></tr> <br />$tbclose <br /><br /> <br /> <br />$tbopen <br /><tr> <br /><td class="darktable"> <br /><table width="100%" cellpadding="3" cellspacing="0"> <br /><tr> <br /><td class="catandforum"> <br /><font class="small">$r</font> <br /></td> <br /></tr> <br /></table> <br /></td> <br /></tr> <br />$tbclose <br /><br /> <br /> <br />$tbopen <br /><tr> <br /><td colspan="3" class="tdheader"> <br />{$ubbt_lang['B_INFO']}[/] <br /> <br />Viola! I nicely formatted box with a display of the users who are browing the forum (and a link to their profiles).


Edited by extremebikini (04/20/03 10:30 AM)
_________________________
[]http://www.danasoft.com/vipersig.jpg[/]
Viper Alley - http://www.viperalley.com
Extreme Fitness - http://www.extremefitness.com[/b]

Top
#243301 - 04/19/03 12:59 AM Re: Quick Mod: Users Browsing This Forum [Re: gailg]
PhotoPost Offline
Hacker

Registered: 02/03/02
Posts: 989
If you are really adventerous and want to allow people to remain hidden (if they so selected) and have Mods and Admins see those people in italics; replace the code in postlist.php with the following instead of the code above:<br /><br />[]// Find out how many are browsing this forum<br /> $query = "<br /> SELECT {$config['tbprefix']}Online.O_Username,{$config['tbprefix']}Online.O_Extra,{$config['tbprefix']}Online.O_Type,{$config['tbprefix']}Users.U_Status,{$config['tbprefix']}Users.U_Visible,{$config['tbprefix']}Users.U_Number<br /> FROM {$config['tbprefix']}Online,{$config['tbprefix']}Users<br /> WHERE {$config['tbprefix']}Online.O_Username = {$config['tbprefix']}Users.U_Username<br /> AND {$config['tbprefix']}Online.O_Extra LIKE '$Board%'<br /> ORDER BY {$config['tbprefix']}Online.O_Last DESC<br /> ";<br /> $sth = $dbh -> do_query($query);<br /> $r = "";<br /> $a = 0;<br /> while (list($Who,$Extra,$Type,$Status,$Visible,$Uid) = $dbh -> fetch_array($sth)) {<br /> if ( ($user['U_Status'] != "Administrator") && ($Visible == "no") ) {<br /> $a++;<br /> continue;<br /> }<br /> <br /> if ( ($user['U_Status'] == "Administrator" || $user['U_Status'] == "Moderator") && ($Visible == "no")) {<br /> if ( $Type == "r" ) {<br /> if ( empty($r) ) $r = "<strong><em><a href=\"{$config['phpurl']}/showprofile.php?Cat=$Cat&amp;User=$Uid&amp;Board=$Board&amp;what=ubbthreads&amp;page=$page&amp;view=$view&amp;sb=$sb&amp;o=$o\">$Who</a></em></strong>";<br /> else $r .= ", <strong><em><a href=\"{$config['phpurl']}/showprofile.php?Cat=$Cat&amp;User=$Uid&amp;Board=$Board&amp;what=ubbthreads&amp;page=$page&amp;view=$view&amp;sb=$sb&amp;o=$o\">$Who</a></em></strong>";<br /> }<br /> else {<br /> $a++;<br /> }<br /> continue; <br /> }<br /> <br /> if ( $Type == "r" ) {<br /> if ( empty($r) ) $r = "<a href=\"{$config['phpurl']}/showprofile.php?Cat=$Cat&amp;User=$Uid&amp;Board=$Board&amp;what=ubbthreads&amp;page=$page&amp;view=$view&amp;sb=$sb&amp;o=$o\">$Who</a>";<br /> else $r .= ", <a href=\"{$config['phpurl']}/showprofile.php?Cat=$Cat&amp;User=$Uid&amp;Board=$Board&amp;what=ubbthreads&amp;page=$page&amp;view=$view&amp;sb=$sb&amp;o=$o\">$Who</a>";<br /> }<br /> else {<br /> $a++;<br /> } <br /> }<br /> <br /> if ( !empty($r) ) $r = "Browsing this forum: $r";<br /> if ( $a > 0 ) $r .= " and $a anonymous users";<br /> <br />// -------------------------<br />// Set up some sorting stuff<br />[/]
_________________________
[]http://www.danasoft.com/vipersig.jpg[/]
Viper Alley - http://www.viperalley.com
Extreme Fitness - http://www.extremefitness.com[/b]

Top
#243302 - 04/19/03 01:29 AM Re: Quick Mod: Users Browsing This Forum [Re: gailg]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Schweet. Thanks Michael. <img src="/forum/images/graemlins/smile.gif" alt="" />
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#243303 - 04/19/03 02:02 AM Re: Quick Mod: Users Browsing This Forum [Re: Daine]
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25434
Loc: Texas
yes, that's a great one, and relatively easy to add. thank you <img src="/forum/images/graemlins/smile.gif" alt="" />
_________________________
- Allen wavey
- What Drives You?

Top
#243304 - 04/19/03 12:24 PM Re: Quick Mod: Users Browsing This Forum [Re: SurfMinister]
Hal9000 Offline
Journeyman

Registered: 11/04/02
Posts: 120
I waited for this one<br />Thanks

Top
#243305 - 04/19/03 04:09 PM Re: Quick Mod: Users Browsing This Forum [Re: dlhanso]
omegatron Offline
Member

Registered: 04/05/01
Posts: 3440
Loc: abingdon,md
Michael I do beleive the code<br /><br />$tbopen<br /><tr><br /><td class="darktable"><br /><table width="100%" cellpadding="3" cellspacing="0"><br /><tr><br /><td class="catandforum"><br /><font class="small">$r</font><br /></td><br /></tr><br />$tbclose<br /></td><br /></tr><br />$tbclose<br /><br /><br /><br />should be<br /><br />$tbopen<br /><tr><br /><td class="darktable"><br /><table width="100%" cellpadding="3" cellspacing="0"><br /><tr><br /><td class="catandforum"><br /><font class="small">$r</font><br /></td><br /></tr><br /></table><br /></td><br /></tr><br />$tbclose<br /><br /><br />
_________________________
Chuck S

DIVE IN AND VISIT ME:

Omegatron\'s Reefs

Administrator at ReefTalk

Top
#243306 - 06/23/04 02:18 PM Re: Quick Mod: Users Browsing This Forum [Re: sf49rminer]
ericgtr Offline
Junior Member

Registered: 05/12/03
Posts: 1109
Anyone know which part of this code is changed in 6.4 (from 6.3)? I would love to use this hack, as it stands in 6.4 it doesn't work.

Top
#243307 - 07/01/04 08:38 PM Re: Quick Mod: Users Browsing This Forum [Re: BlarC]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
OK _ I worked this out for you. <br /> <br />In postlist.php <br /> <br />Above this: <br />
Code:
 <br />// ------------------------- <br />// Set up some sorting stuff <br />
<br /> <br />Add this: <br />
Code:
 <br />// Find out how many are browsing this forum <br />$query = " <br />SELECT t1.O_Username,t1.O_Extra,t1.O_Type,t2.U_Status,t2.U_Visible,t2.U_Number <br />FROM {$config['tbprefix']}Online AS t1, <br />     {$config['tbprefix']}Users AS t2 <br />WHERE t1.O_Username = t2.U_Username <br />AND t1.O_Board = '$Board_q' <br />ORDER BY t1.O_Last DESC <br />"; <br />$sth = $dbh -&gt; do_query($query); <br />$r = ""; <br />while (list($Who,$Extra,$Type,$Status,$Visible,$Uid) = $dbh -&gt; fetch_array($sth)) { <br /> <br />if ( ($user['U_Status'] != "Administrator") &amp;&amp; ($Visible == "no") ) { <br />     $a++; <br />     continue; <br />} <br />	if ( ($user['U_Status'] == "Administrator" || $user['U_Status'] == "Moderator") &amp;&amp; ($Visible == "no")) { <br />		if ( $Type == "r" ) { <br />			if ( empty($r) ) $r = "&lt;strong&gt;&lt;em&gt;&lt;a href=\"{$config['phpurl']}/showprofile.php?Cat=$Cat&amp;amp;User=$Uid&amp;amp;Board=$Board&amp;amp;what=ubbthreads&amp;amp;page=$page&amp;amp;view=$view&amp;amp;sb=$sb&amp;amp;o=$o\"&gt;$Who&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;"; <br />			else $r .= ", &lt;strong&gt;&lt;em&gt;&lt;a href=\"{$config['phpurl']}/showprofile.php?Cat=$Cat&amp;amp;User=$Uid&amp;amp;Board=$Board&amp;amp;what=ubbthreads&amp;amp;page=$page&amp;amp;view=$view&amp;amp;sb=$sb&amp;amp;o=$o\"&gt;$Who&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;"; <br />		} <br />		continue; <br />	} <br /> <br />	if ( $Type == "r" ) { <br />		if ( empty($r) ) $r = "&lt;a href=\"{$config['phpurl']}/showprofile.php?Cat=$Cat&amp;amp;User=$Uid&amp;amp;Board=$Board&amp;amp;what=ubbthreads&amp;amp;page=$page&amp;amp;view=$view&amp;amp;sb=$sb&amp;amp;o=$o\"&gt;$Who&lt;/a&gt;"; <br />		else $r .= ", &lt;a href=\"{$config['phpurl']}/showprofile.php?Cat=$Cat&amp;amp;User=$Uid&amp;amp;Board=$Board&amp;amp;what=ubbthreads&amp;amp;page=$page&amp;amp;view=$view&amp;amp;sb=$sb&amp;amp;o=$o\"&gt;$Who&lt;/a&gt;"; <br />	} <br />} <br /> <br />if ( !empty($r) ) $r = "Browsing: $r"; <br /> <br />
<br /> <br /> <br />Then in postlist.tmpl find this: <br />
Code:
 <br />$r {$ubbt_lang['C_ONLINE2']} $a {$ubbt_lang['C_ONLINE4']} <br />
<br /> <br />Change to this: <br />
Code:
 <br />$r and $a {$ubbt_lang['C_ONLINE4']} <br />


Edited by JoshPet (07/02/04 01:56 PM)
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#243308 - 07/01/04 08:42 PM Re: Quick Mod: Users Browsing This Forum [Re: Daine]
ericgtr Offline
Junior Member

Registered: 05/12/03
Posts: 1109
Thanks Josh!

Top
#243309 - 07/01/04 09:02 PM Re: Quick Mod: Users Browsing This Forum [Re: BlarC]
ericgtr Offline
Junior Member

Registered: 05/12/03
Posts: 1109
Here's an alteration I made to the postlist.tmpl to add this to the top of the forum. <br /> <br />Find: <br />
Code:
 <br />&lt;? //UBBTREMARK <br />echo &lt;&lt;&lt;UBBTPRINT <br />
<br /> <br />Add this just below it: <br />
Code:
 <br />$tbopen <br />&lt;tr&gt; <br />&lt;td class="darktable"&gt; <br />&lt;table width="100%" cellpadding="3" cellspacing="0"&gt; <br />&lt;tr&gt; <br />&lt;td class="catandforum"&gt; <br />$r and $a {$ubbt_lang['C_ONLINE4']} <br />&lt;/td&gt; <br />&lt;/tr&gt; <br />&lt;/table&gt; <br />&lt;/td&gt; <br />&lt;/tr&gt; <br />$tbclose <br />&lt;br /&gt; <br />
<br /> <br />This will put it into a formatted table for you.

Top
#243310 - 07/01/04 09:53 PM Re: Quick Mod: Users Browsing This Forum [Re: BlarC]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
I just edited my post above to fix an issue with the anonymous user count. <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#243311 - 07/02/04 01:14 PM Re: Quick Mod: Users Browsing This Forum [Re: Daine]
Pilgrim Offline
Enthusiast

Registered: 06/17/00
Posts: 325
Loc: Canada
Josh,<br /><br />Usernames of those who have opted to be "invisible" are being displayed with this hack. Is anyone else noticing this too? I got several complaints from members who have invisible enabled and their usernames are appearing in the display. []http://www.the-highway.com/Smileys/wow1.gif[/]<br /><br />Jeff

Top
#243312 - 07/02/04 01:56 PM Re: Quick Mod: Users Browsing This Forum [Re: Tachyon]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Actually - I missed one part of michael's code<br /><br />After the while statement, add this:<br /><br />
Code:
<br />if ( ($user['U_Status'] != "Administrator") &amp;&amp; ($Visible == "no") ) {<br />     $a++;<br />     continue;<br />}<br />
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#243313 - 07/02/04 03:32 PM Re: Quick Mod: Users Browsing This Forum [Re: Daine]
Pilgrim Offline
Enthusiast

Registered: 06/17/00
Posts: 325
Loc: Canada
Thanks, that seems to have fixed the problem. Now, to spend a few days in recovery from all the stones that were thrown at me by invisible users. []http://www.the-highway.com/Smileys/rofl.gif[/]

Top
#243314 - 07/02/04 03:53 PM Re: Quick Mod: Users Browsing This Forum [Re: Tachyon]
slayer60 Offline
Junior Member

Registered: 06/14/03
Posts: 1185
Loc: New Boston, NH
Invisibility is a privledge, not a right. Let this be a lesson to them.<img src="http://www.ubbdev.com/forum/images/graemlins/threaddevil.gif" alt="" />

Top
#243315 - 07/02/04 11:48 PM Re: Quick Mod: Users Browsing This Forum [Re: Daine]
Pilgrim Offline
Enthusiast

Registered: 06/17/00
Posts: 325
Loc: Canada
[]JoshPet said:<br />I just edited my post above to fix an issue with the anonymous user count. <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" /> [/]<br />Is there a way to have the exact number of anonymous users displayed? As it is now, the usernames of registered users browsing the forum are displayed and then it simply says, "and anonymous users are browsing this forum." regardless if there are none or 20.

Top
#243316 - 07/03/04 12:47 AM Re: Quick Mod: Users Browsing This Forum [Re: Tachyon]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
I'd double check your code, make sure you didn't accidentally remove the $a variable, which contains the anonymous count.<br /><br />I did this on erics site and it does contain the number of anonymous users. <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#243317 - 07/03/04 03:57 PM Re: Quick Mod: Users Browsing This Forum [Re: Daine]
DrChaos Offline
Coder

Registered: 09/12/03
Posts: 816
Loc: Hollywood Florida.
I did this on 6.4b1 and it removed where it shows the (3 viewing) on the forums.
_________________________
DrChaos
LeetGamers

Top
#243318 - 07/03/04 05:26 PM Re: Quick Mod: Users Browsing This Forum [Re: Daine]
Pilgrim Offline
Enthusiast

Registered: 06/17/00
Posts: 325
Loc: Canada
Perhaps the problem, which is now resolved was due to the fact that I replaced the default section below with the new stuff? Anyway, I added it back in and now all is fine.<br /><br />
Code:
<br />// Find out how many are browsing this forum<br />   $query = "<br />      SELECT O_Type,O_Board,COUNT(*)<br />      FROM   {$config['tbprefix']}Online<br />      WHERE  O_Board = '$Board_q'<br />      GROUP BY O_Type<br />   ";<br />   $sth = $dbh -&gt; do_query($query);<br />   $a = "0";<br />   $r = "0";<br />   while (list($Type,$Extra,$count) = $dbh -&gt; fetch_array($sth)) {<br />      ${$Type} = $count;<br />   }<br />

Top
#243319 - 07/04/04 05:25 AM Re: Quick Mod: Users Browsing This Forum [Re: Tachyon]
Ian_W Global Moderator Offline
Veteran

Registered: 02/22/02
Posts: 2574
Loc: England
I have reposted this mod (for 6.4) in the modifications forum.<br /><br />http://www.ubbdev.com/forum/showflat.php...;vc=#Post116328<br /><br />(Can a current mod, please close this thread. Thanks)
_________________________
Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)

Top


Who's Online
0 Registered (), 25 Guests and 6 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
Team UBBDev Rides Again!
by AllenAyres
Today at 01:36 PM
Blogs, love em or hate em?
by AllenAyres
10/07/08 02:05 PM
What do you use to edit the files
by Ian_W
10/05/08 03:33 PM
BeyondCompare v3.00
by Ian_W
10/05/08 03:32 PM
Glossy Black Theme with Image Reflection
by Gizmo
10/05/08 02:17 PM
ShareThis
by Gizmo
09/28/08 05:06 AM
[7.3] Viewing MySQL logfiles made easier
by AllenAyres
09/27/08 09:57 PM
New Mods
[7.3] Viewing MySQL logfiles made easier
by blaaskaak
09/24/08 05:39 PM
[7.3.1] add search to showmembers page
by blaaskaak
09/07/08 04:50 AM
Multiple Identity Detector
by
12/30/06 06:39 PM
Newest Members
Kevs, pisa666, ghengis317, NitroX, Dogan
13346 Registered Users
Top Posters Last 30 Days
AllenAyres 11
blaaskaak 7
Ian_W 4
tackaberry 4
Mike L_dup1 4
Gizmo 4
Chris Bale 4

 

 

 
fusionbb message board php hacks