| Author |
Message |
Zhen-Xjell
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939
|
Posted:
Thu Jan 16, 2003 3:04 pm |
  |
Find the following code:
| Quote: |
$newpms = $db->sql_numrows($db->sql_query("SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND privmsgs_type='5'"));
$oldpms = $db->sql_numrows($db->sql_query("SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND privmsgs_type!='5'"));
|
And change it to:
| Quote: |
$newpms = $db->sql_numrows($db->sql_query("SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND privmsgs_type='1' OR privmsgs_type='5'"));
$oldpms = $db->sql_numrows($db->sql_query("SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND privmsgs_type='0'"));
|
Both "1" and "5" indicate unread messages.. however, what is the difference? Simple.. "1" is assigned before either of these modules are accessed by the user: PM or Forums. Once they are accessed, the number switches to a "5".
"0" indicates a read PM. |
_________________ Paul Laudanski, Microsoft MVP Windows-Security
CastleCops: [de] [en] [wiki] |
|
     |
 |
Zhen-Xjell
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939
|
Posted:
Thu Jan 16, 2003 3:14 pm |
  |
|
     |
 |
Imago
Captain


Joined: Jan 17, 2003
Posts: 629
Location: Europe
|
Posted:
Fri Jan 17, 2003 12:43 am |
  |
Dear Zhen-Xjell,
I'd like first to thank you for your dedicate support to us, newkers. May Buddha bless you with free time enough to share with us.
I've just registered and thought you have sent me a welcoming PM 'cause the Unread line reads : 1
Yet the PM box is empty. This seems to be a new bug.
Would it be difficult for you to replace the number of unread messages with a rotating letter when new PMs arrive?
Thank you |
|
|
    |
 |
Imago
Captain


Joined: Jan 17, 2003
Posts: 629
Location: Europe
|
Posted:
Fri Jan 17, 2003 12:55 am |
  |
PS. Now the number of unread msgs has changed to 0 (zero).
Anyway, the first value made me think of an automatic PM to all new members where we could give them some specific instructions. Where could this feature belong to?
PPS. When I tried to edit the first message, the answer was "I don't like you"  |
Last edited by Imago on Fri Jan 17, 2003 1:34 am; edited 1 time in total |
|
    |
 |
Zhen-Xjell
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939
|
Posted:
Fri Jan 17, 2003 1:28 am |
  |
Ahh.. you ran into a bug as I was testing some security filtering code. You should be able to edit the post now because I'm done testing for now.
As for the 1 PM, hmm.. that is interesting. Is all ok now?
Welcome aboard & thanks. |
_________________ Paul Laudanski, Microsoft MVP Windows-Security
CastleCops: [de] [en] [wiki] |
|
     |
 |
Imago
Captain


Joined: Jan 17, 2003
Posts: 629
Location: Europe
|
Posted:
Fri Jan 17, 2003 1:51 am |
  |
Yes, it's OK now.
And the PM's counting precisely.
I'm using 6.0 and so have replaced in $result2 only:
| Code: |
| and privmsgs_type='5' |
with
| Code: |
| and privmsgs_type='1' OR privmsgs_type='5' |
As a result a WARNING desappeared from the bottom of the page when you have any PMs in the box, BUT
the number of the unread msgs is 4, while "You have new msgs" in the Forums Menu is followed by the correct "1"
PS. Bug fixed.
in $result2 only:
change
| Code: |
| and privmsgs_type='5' |
to
| Code: |
| and privmsgs_type='5' OR privmsgs_type='1' |
The entire block for Nuke 6.0 and phpBB2 0.6 is here:
http://www.orientalgate.org/modules.php?name=Downloads&d_op=getit&lid=40 |
|
|
    |
 |
Br00klynzzFinest
Guest

|
Posted:
Fri Jan 17, 2003 7:57 am |
  |
Well I installed the update phpnuke6 vr.. and its still miss reporting the # of Privates Messages. No by 2 anymore, but by 1. I tells me there is still 1 msg when thier isnt
FYI Im using the PHPBB2 Port.
Any suggestions ? |
|
|
 |
 |
Br00klynzzfinest
Guest

|
Posted:
Fri Jan 17, 2003 8:04 am |
  |
Nevermind I corrected the problem.
Imago you may want to change the code in your download to reflect the changes you've shown.
Your D/L still has
| Code: |
| and privmsgs_type='5' OR privmsgs_type='1'" |
But it should have
| Code: |
| and privmsgs_type='1' OR privmsgs_type='5'" |
Just incase ya didnt realize the d/l wasnt with the new code ya showed us. |
|
|
 |
 |
Zhen-Xjell
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939
|
Posted:
Fri Jan 17, 2003 8:18 am |
  |
Now that's odd because I've fully tested the code piece here before releasing it and that SQL code was the key. I found that there *may* be a browser caching issue, so if you force a page reload it displays fine.
In testing I found that the numbers 0, 1, and 5 were all needed due to the reasons stated above by me. So if you kept the 0, that is good.. it'll give you the exact number of messages that you have read. Why exact? Because a message can only have a single value. |
_________________ Paul Laudanski, Microsoft MVP Windows-Security
CastleCops: [de] [en] [wiki] |
|
     |
 |
Zhen-Xjell
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939
|
Posted:
Sun Jan 19, 2003 4:28 pm |
  |
Ok, the code needs to be adjusted just slightly as per my note:
| Quote: |
0 = PM is read in the Inbox
1 = PM is in the Outbox
2 = PM is in the Sentbox
5 = PM is unread in the Inbox
1, 5 are both Unread New Message
Here is how I see it working:
1) User A composes a PM to user B and sends it.
2) PM gets placed into user A's Outbox.
3) User B sees the PM as a new unread message, and is tagged a type 1.
4) Once user B accesses the PM mod, the PM gets tagged a type 5, and is shown in User A's Sentbox and user B's Inbox. (Its the same post)
5) Once user B reads the message, it gets redefined as type 0 (read PM).
|
Now, instead of AND x OR y, change it to AND (x OR y). [x, y being the privmsgs_type='1', privmsgs_type='5'].
Anywho, I updated the download. |
_________________ Paul Laudanski, Microsoft MVP Windows-Security
CastleCops: [de] [en] [wiki] |
|
     |
 |
Imago
Captain


Joined: Jan 17, 2003
Posts: 629
Location: Europe
|
Posted:
Mon Jan 20, 2003 1:54 am |
  |
10x everybody! The code has been changed and tested with six other members. Now, it does precisely reflect the number of the unread and read messages in the Inbox.
Download for Nuke 6.0 & phpBB2 0.6 User Info Block updated.
PS. As for the WARNING bottom message, it proved to be a very old bug in the Nuke 6.0 footer.php
change
| Code: |
$messres = sql_query("SELECT * FROM ".$prefix."_priv_msgs where to_userid='$uid' and read_msg='0'", $dbi);
$messnum = sql_num_rows($messres, $dbi);
if ($messnum == 1) {
echo "<script language=\"javascript\">{ alert('"._YOUHAVEONEMSG."'); }</script>";
}
if ($messnum > 1) {
echo "<script language=\"javascript\">{ alert('"._YOUHAVE." $messnum "._NEWPMSG."'); }</script>"; |
to
| Code: |
$result1 = sql_query("select user_new_privmsg from ".$user_prefix."_users where uname='$uname'", $dbi);
list($numrow) = sql_fetch_row($result1, $dbi);
if ($numrow > 0) {
echo "<script language='javascript'>\n";
echo "<!--\n";
echo "var win = window.open('modules.php?name=Private_Messages&popup=1&mode=newpm', '', 'height=180,width=360')";
echo "//-->\n";
echo "</script>"; |
|
|
|
    |
 |
|
|