vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=324761

$var = $var unexpected result
by TopFloorDjs
18 Mar 2017 14:39

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.


Dave 18 Mar 2017 14:59

Try

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


TopFloorDjs 18 Mar 2017 15:37

Same result, changes the value to -1

Quote:

Originally Posted by Dave (Post 2584024)
Try

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


MarkFL 18 Mar 2017 16:25

Try putting the statement:


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

within the while loop. :)

TopFloorDjs 18 Mar 2017 16:37

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
]]>

MarkFL 18 Mar 2017 16:46

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.


TopFloorDjs 18 Mar 2017 16:51

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


All times are GMT. The time now is 18:34.

Powered by vBulletin® Version 3.8.14
Copyright © 2021, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.