The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
Again, my code in paidsub_build doesn't seem to work (still) :s
So, here's the code I've come up with: Code:
include_once("./vb_plugin.php"); //global $vbulletin; //require_once('./global.php'); $uid_ps = $user['userid']; //$userid_ps = fetch_userinfo($uid_ps); $query = "UPDATE characters SET mgroup = 11 WHERE id = '" .$uid_ps. "'"; print_log("Applying Premium for: User ID - {$uid_ps} Changing group to - {$sub['nusergroupid']}"); $db->query_write($query); However, for the actual $query, the $uid_ps is still not being interpreted. I really just need to find out how to call the userid so I can use it in the query and be done with it, haha. So if anyone can help me out on how to fetch a user's id for use in the paidsub_build plugin, I'd appreciate it. Also, if I'm doing this completely wrong, let me know. If you have any sort of tutorial on how to execute a query in paidsub_plugin, also let me know ![]() Thanks in advance for everything, Mark. |
#2
|
|||
|
|||
![]()
Why do you believe that $uid_ps is not being interpreted? Maybe you should print the $query string in to your log.
The query looks right to me but I assume that your characters db table is a custom table so we can't know for sure without seeing it. Edit: Did you try using $this->registry->db->query_write($query) ? $db probably isn't defined because that hook is called from inside a function. |
Благодарность от: | ||
Lynne |
#3
|
||||
|
||||
![]() Quote:
Also, characters is a custom table, and when a user purchases a paid subscription, their mgroup value should change to 11 from 2, but it doesn't do it successfully, hence why I concluded $uid_ps isn't being interpreted correctly. --------------- Added [DATE]1333293566[/DATE] at [TIME]1333293566[/TIME] --------------- It works now, woot! Thanks a bunch kh99 ![]() |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|