You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 26 guest(s) and 1 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - 6.5 block-User_Info.php PM Fix [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
Zhen-Xjell
Nuke Cops Founder
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939


PostPosted: Thu Jan 16, 2003 3:04 pm Reply with quoteBack to top

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]
Find all posts by Zhen-XjellView user's profileSend private messageSend e-mailVisit poster's website
Zhen-Xjell
Nuke Cops Founder
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939


PostPosted: Thu Jan 16, 2003 3:14 pm Reply with quoteBack to top

Ahh, you can also download it here:

http://nukecops.com/modules.php?name=Downloads&d_op=getit&lid=4

Its optimized for Nuke 6.5.

_________________
Paul Laudanski, Microsoft MVP Windows-Security
CastleCops: [de] [en] [wiki]
Find all posts by Zhen-XjellView user's profileSend private messageSend e-mailVisit poster's website
Imago
Captain
Captain


Joined: Jan 17, 2003
Posts: 629

Location: Europe

PostPosted: Fri Jan 17, 2003 12:43 am Reply with quoteBack to top

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
Find all posts by ImagoView user's profileSend private messageVisit poster's website
Imago
Captain
Captain


Joined: Jan 17, 2003
Posts: 629

Location: Europe

PostPosted: Fri Jan 17, 2003 12:55 am Reply with quoteBack to top

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" Very Happy


Last edited by Imago on Fri Jan 17, 2003 1:34 am; edited 1 time in total
Find all posts by ImagoView user's profileSend private messageVisit poster's website
Zhen-Xjell
Nuke Cops Founder
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939


PostPosted: Fri Jan 17, 2003 1:28 am Reply with quoteBack to top

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]
Find all posts by Zhen-XjellView user's profileSend private messageSend e-mailVisit poster's website
Imago
Captain
Captain


Joined: Jan 17, 2003
Posts: 629

Location: Europe

PostPosted: Fri Jan 17, 2003 1:51 am Reply with quoteBack to top

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
Find all posts by ImagoView user's profileSend private messageVisit poster's website
Br00klynzzFinest
Guest






PostPosted: Fri Jan 17, 2003 7:57 am Reply with quoteBack to top

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 ?
Find all posts by Anonymous
Br00klynzzfinest
Guest






PostPosted: Fri Jan 17, 2003 8:04 am Reply with quoteBack to top

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.
Find all posts by Anonymous
Zhen-Xjell
Nuke Cops Founder
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939


PostPosted: Fri Jan 17, 2003 8:18 am Reply with quoteBack to top

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]
Find all posts by Zhen-XjellView user's profileSend private messageSend e-mailVisit poster's website
Zhen-Xjell
Nuke Cops Founder
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939


PostPosted: Sun Jan 19, 2003 4:28 pm Reply with quoteBack to top

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]
Find all posts by Zhen-XjellView user's profileSend private messageSend e-mailVisit poster's website
Imago
Captain
Captain


Joined: Jan 17, 2003
Posts: 629

Location: Europe

PostPosted: Mon Jan 20, 2003 1:54 am Reply with quoteBack to top

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>";
Find all posts by ImagoView user's profileSend private messageVisit poster's website
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next 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



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.383 Seconds - 318 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::