Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x
Author Message
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1774

PostPosted: Tue Feb 09, 2016 2:03 pm Reply with quote

Since I'm using php 5.5.x I stumbling over an strange issue in the ui-file of the Private Messages. I'm not sure if it is simply based on a newer mysql version, which comes along with the PHP version inside WAMP.

File: modules/Your_Account/includes/ui-0privmsgs.php

There is an query which counts the messages. But it doesn't show the count of messages - it shows the mysql SELECT value of the query. Try a look on the image below.

Image

To make it clearer let us try a look on the code of this query:

php Code:


$sql = 'SELECT 1, COUNT(*) FROM ' . $prefix . '_bbprivmsgs WHERE privmsgs_to_userid = ' . $uid . ' AND privmsgs_type IN (0, 1, 5) UNION '
. 'SELECT 2, COUNT(*) FROM ' . $prefix . '_bbprivmsgs WHERE privmsgs_to_userid = ' . $uid . ' AND privmsgs_type = 0 UNION '
. 'SELECT 3, COUNT(*) FROM ' . $prefix . '_bbprivmsgs WHERE privmsgs_to_userid = ' . $uid . ' AND privmsgs_type = 1 UNION '
. 'SELECT 4, COUNT(*) FROM ' . $prefix . '_bbprivmsgs WHERE privmsgs_from_userid = ' . $uid . ' AND privmsgs_type = 2 UNION '
// . 'SELECT 5, COUNT(*) FROM ' . $prefix . '_bbprivmsgs WHERE privmsgs_to_userid = ' . $uid . ' AND privmsgs_type = 3 UNION '
. 'SELECT 6, COUNT(*) FROM ' . $prefix . '_bbprivmsgs WHERE privmsgs_from_userid = ' . $uid . ' AND privmsgs_type = 4 UNION '
. 'SELECT 7, COUNT(*) FROM ' . $prefix . '_bbprivmsgs WHERE privmsgs_to_userid = ' . $uid . ' AND privmsgs_type = 5';
$result = $db->sql_query($sql);
list(, $ya_totpms) = $db->sql_fetchrow($result); // 1
list(, $ya_oldpms) = $db->sql_fetchrow($result); // 2
list(, $ya_newpms) = $db->sql_fetchrow($result); // 3
list(, $ya_outpms) = $db->sql_fetchrow($result); // 4
// list(, $ya_savpms) = $db->sql_fetchrow($result); // 5
list(, $ya_savpms) = $db->sql_fetchrow($result); // 6
list(, $ya_outpms) = $db->sql_fetchrow($result); // 7


I tested this issue with fresh installations of RN25 and RN251 where are no PMs - the db-table _bbprivmsgs is empty...

Maybe someone can explain me how should it work.

_________________
Github: RavenNuke 
View user's profile Send private message
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6433

PostPosted: Fri Feb 12, 2016 8:19 am Reply with quote

Looks like the SQLs should just be SELECT COUNT(*) from... or SELECT COUNT(1) from...

_________________
I search, therefore I exist...
nukeSEO - nukeFEED - nukePIE - nukeSPAM - nukeWYSIWYG
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x

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 ©