Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 18 Mar 2017, 14:39
TopFloorDjs's Avatar
TopFloorDjs TopFloorDjs is offline
 
Join Date: Sep 2008
Real name: Brad
$var = $var unexpected result

I run a vBulletin plugin that has always worked fine until recently i upgraded Apache and PHP from 5.4 to 5.5 and suddonly a calculation isnt working the way it should do:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Instead of $RuserMinus being the result of $Ruser -1 it's replacing the value with -1 so $RUserMinus = "-1" instead of the result.

FULL SCRIPT


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Last edited by TopFloorDjs; 18 Mar 2017 at 15:57.
Reply With Quote
  #2  
Old 18 Mar 2017, 14:59
Dave Dave is offline
 
Join Date: Jun 2010
Real name: Dave
Try

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
https://technidev.com - security, development, exploits, vBulletin
dave[at]technidev[dot]com

Contact me for custom vBulletin 3/4 work & server/website management.
Reply With Quote
  #3  
Old 18 Mar 2017, 15:37
TopFloorDjs's Avatar
TopFloorDjs TopFloorDjs is offline
 
Join Date: Sep 2008
Real name: Brad
Same result, changes the value to -1

Originally Posted by Dave View Post
Try

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
Reply With Quote
  #4  
Old 18 Mar 2017, 16:25
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
Try putting the statement:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

within the while loop.
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
  #5  
Old 18 Mar 2017, 16:37
TopFloorDjs's Avatar
TopFloorDjs TopFloorDjs is offline
 
Join Date: Sep 2008
Real name: Brad
Database Error
]]> Database error in vBulletin 4.2.3
Invalid SQL: UPDATE user SET reputation= WHERE userid=2;
MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE userid=2' at line 1
Error Number : 1064
Request Date : Saturday, March 18th 2017 @ 03:37:01 PM
Error Date : Saturday, March 18th 2017 @ 03:37:01 PM
Script : http://literecords.com/sandbox/post_thanks.php
Referrer : http://literecords.com/sandbox/showt...php?2-rep-test
Classname : vB_Database_MySQLi
MySQL Version : 5.5.54-cll
]]>
Reply With Quote
  #6  
Old 18 Mar 2017, 16:46
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
Rather than use a db query to get the browsing user's reputation, I would simply use:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Thus, your code becomes:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
  #7  
Old 18 Mar 2017, 16:51
TopFloorDjs's Avatar
TopFloorDjs TopFloorDjs is offline
 
Join Date: Sep 2008
Real name: Brad
Im not sure if that work as i use 2 queries in the full plugin script is:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

--------------- Added 18 Mar 2017 at 16:56 ---------------

AHHHH it f*cking works!! You absolute legend! Do you make music? I'll give you a privileged account haha!

--------------- Added 18 Mar 2017 at 16:59 ---------------

When i did it for the -1 part it worked great but when i adapted to the +1 part it give me the same database error as earlier ^^


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

--------------- Added 18 Mar 2017 at 17:05 ---------------


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I think i see the problem. This line grabs the replying member's reputation. I need to find the thread starter's reputation.

--------------- Added 18 Mar 2017 at 17:08 ---------------

It's deducting -1 from thread starter's reputation instead of +1

Last edited by TopFloorDjs; 18 Mar 2017 at 17:09.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 02:53.

Layout Options | Width: Wide Color: