Author |
Message |
CodyG
Life Cycles Becoming CPU Cycles
Joined: Jan 02, 2003
Posts: 714
Location: Vancouver Island
|
Posted:
Wed Apr 14, 2004 3:47 pm |
|
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 != |
|
|
|
|
Raven
Site Admin/Owner
Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Wed Apr 14, 2004 9:05 pm |
|
Change thisCode: list($uid) = sql_fetch_row(sql_query("SELECT user_id FROM $user_prefix"._users." WHERE username='$session[uname]'", $dbi));
| to thisCode: list($uid) = sql_fetch_row(sql_query("SELECT user_id FROM $user_prefix"._users." WHERE username='$session[uname]' and user_allow_viewonline = '1'", $dbi));
|
|
|
|
|
|
CodyG
|
Posted:
Wed Apr 21, 2004 3:47 pm |
|
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.
Is there anyway to globalize the show online and offline status for nuke users? Without a rewriting Your Account module and core files? |
|
|
|
|
CodyG
|
Posted:
Tue Nov 14, 2006 6:32 pm |
|
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
|
Posted:
Tue Nov 14, 2006 6:47 pm |
|
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>
<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>
<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} /> </td>
<td>{L_YES} </td>
<td><input type="radio" name="hideonline" value="0" {HIDE_USER_NO} /> </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 |
|
|
|
|
CodyG
|
Posted:
Tue Nov 14, 2006 8:14 pm |
|
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} /> </td>
<td>{L_YES} </td>
<td><input type="radio" name="hideonline" value="0" {HIDE_USER_NO} /> </td>
<td>{L_NO}</td>
</tr>
</table>
</td>
</tr>
-->
|
|
|
|
|
|
CodyG
|
Posted:
Wed Nov 15, 2006 10:55 am |
|
|
|
|
|