Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's
Author Message
CodyG
Life Cycles Becoming CPU Cycles



Joined: Jan 02, 2003
Posts: 714
Location: Vancouver Island

PostPosted: Wed Apr 14, 2004 3:47 pm Reply with quote

In nuke_users table there is the column:
user_allow_viewonline
The default is 1, I assume 1 means do not hide online status.

But... and it's a biggy, this only works for the forums "who is online" section.

What I need to know is how I can modify blocks that show users online.

For example... I use User Menu as a login block, and Last Seen, and Instant Messenger (Site Messenger). All of these blocks show all users who are online.

I would like to modify these blocks to read the user_allow_viewonline table and then not show the user in these blocks if the user chooses not to be shown. IOW, if someone doesn't want to be shown online, they are not shown online.


Here is a bit of code from User Menu where the users are listed.

Code:
$result = sql_query("SELECT uname, guest FROM $prefix"._session." WHERE guest=0 AND `uname`!= ''", $dbi);

$member_online_num = sql_num_rows($result, $dbi);
$who_online_now = "";
$i = 1;
while ($session = sql_fetch_array($result, $dbi)) {
        list($uid) = sql_fetch_row(sql_query("SELECT user_id FROM $user_prefix"._users." WHERE username='$session[uname]'", $dbi));
    if (isset($session["guest"]) and $session["guest"] == 0) {
        if ($i < 10) {


How could I match that against the value in the user_allow_viewonline table in nuke_users?

Is it possible?

If I could just figure out where and how with !=
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Wed Apr 14, 2004 9:05 pm Reply with quote

Change this
Code:
        list($uid) = sql_fetch_row(sql_query("SELECT user_id FROM $user_prefix"._users." WHERE username='$session[uname]'", $dbi));
to this
Code:
        list($uid) = sql_fetch_row(sql_query("SELECT user_id FROM $user_prefix"._users." WHERE username='$session[uname]' and user_allow_viewonline = '1'", $dbi));
 
View user's profile Send private message
CodyG







PostPosted: Wed Apr 21, 2004 3:47 pm Reply with quote

Sometimes it takes me awhile to actually implement something and then find the bugs.

I implemented it and user was still in site info block and Site Messenger. Then I started getting odd "sorry user doesn't exist errors" when trying to get user profiles.

Question Is there anyway to globalize the show online and offline status for nuke users? Without a rewriting Your Account module and core files?
 
CodyG







PostPosted: Tue Nov 14, 2006 6:32 pm Reply with quote

I'm back to this issue again.
I would like to just remove the form field for $viewonline in the forum profile section. If I just comment out the html and the user doesn't know the option exists then it's all good.

I've been looking for that bit of html with the check box for Hide Online, for what seems like days, and I still haven't found it.

Would someone please pass me a clue.

Thanks.
 
Raven







PostPosted: Tue Nov 14, 2006 6:47 pm Reply with quote

Try modules/Forums/templates/subSilver/profile_add_body.tpl and look for the code
Code:
   <tr> 

     <td class="row1"><span class="gen">{L_HIDE_USER}:</span></td>
     <td class="row2">
      <input type="radio" name="hideonline" value="1" {HIDE_USER_YES} />
      <span class="gen">{L_YES}</span>&nbsp;&nbsp;
      <input type="radio" name="hideonline" value="0" {HIDE_USER_NO} />
      <span class="gen">{L_NO}</span></td>
   </tr>

and delete it or comment it out like this:
Code:
   <!-- tr> 

     <td class="row1"><span class="gen">{L_HIDE_USER}:</span></td>
     <td class="row2">
      <input type="radio" name="hideonline" value="1" {HIDE_USER_YES} />
      <span class="gen">{L_YES}</span>&nbsp;&nbsp;
      <input type="radio" name="hideonline" value="0" {HIDE_USER_NO} />
      <span class="gen">{L_NO}</span></td>
   </tr -->


If you are using a theme that has its own forums, then you will also need to find this code in themes/THEME_NAME/forums/profile_add_body.tpl and delete it or comment it out. Please notice that this example is from the fisubice theme and your theme code may not look exactly the same.
Code:
<tr>

<td class="row1">{L_HIDE_USER}:</td>
<td class="row2">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="radio" name="hideonline" value="1" {HIDE_USER_YES} />&nbsp;</td>
<td>{L_YES}&nbsp;&nbsp;</td>
<td><input type="radio" name="hideonline" value="0" {HIDE_USER_NO} />&nbsp;</td>
<td>{L_NO}</td>
</tr>
</table>
</td>
</tr>


There could be other templates that have this code but you should be able to locate them now Wink
 
CodyG







PostPosted: Tue Nov 14, 2006 8:14 pm Reply with quote

Thanks Raven ... you rock.
All my themes have forums.
Here is my solution in /themes/theme/forums/profile_add_body.tpl

Code:


<!--Comment out Hide Online Option as it is useless due to other mods and blocks -->
<!--
<tr>
<td class="row1"><span class="explaintitle">{L_HIDE_USER}:</span></td>
<td class="row2">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="radio" name="hideonline" value="1" {HIDE_USER_YES} />&nbsp;</td>
<td>{L_YES}&nbsp;&nbsp;</td>
<td><input type="radio" name="hideonline" value="0" {HIDE_USER_NO} />&nbsp;</td>
<td>{L_NO}</td>
</tr>
</table>

</td>
</tr>
-->
 
CodyG







PostPosted: Wed Nov 15, 2006 10:55 am Reply with quote

Dance-Stick
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's

View next topic
View previous topic
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 can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©