PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
CodyG
Life Cycles Becoming CPU Cycles


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

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

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: 16987
Location: Kansas

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

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 Visit poster's website AIM Address Yahoo Messenger
CodyG
Life Cycles Becoming CPU Cycles


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

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

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?
View user's profile Send private message
CodyG
Life Cycles Becoming CPU Cycles


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

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

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.
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
CodyG
Life Cycles Becoming CPU Cycles


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

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

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>
-->
View user's profile Send private message
CodyG
Life Cycles Becoming CPU Cycles


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

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

Dance-Stick
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum