The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
What is wrong with this query?
I'm trying to custom write a user title color hack and I almost got it... However when the page loads online and I update the settings for some reason it's not making changes to the database row in the user table which is called titlecolor.
// ############################### Edit Title Color ############################### if ($_REQUEST['do'] == 'edittitlecolor') { $templatename = 'titlecolor'; } // ############################### Update Title Color ############################### if ($_POST['do'] == 'updatetitlecolor') { globalize($_POST, array('titlecolor' => STR)); // Support tags HTML grog6 $titlecolor = strip_tags($titlecolor); $DB_site->query(" UPDATE " . TABLE_PREFIX . "user SET titlecolor = '" . addslashes($titlecolor) ."' WHERE userid = $bbuserinfo[userid] "); echo "titlecolor"; $url = "usercp.php?$session[sessionurl]"; eval(print_standard_redirect('redirect_updatethank s')); } |
#2
|
||||
|
||||
good question...
do you have global.php required? And do you make sure somewhere, that the user is logged in? (not that $bbuserinfo[userid] is empty) are you getting any error messages anywhere? |
#3
|
|||
|
|||
add echo statements to see if it's actually getting the variable. (I notice you're missing the $ in your echo statement)
Other than that the code looks fine, so I would say it's on the html form side of the script. |
#4
|
||||
|
||||
Script's going through and I just used that echo statement as an example. I edited a row on my user in phpmyadmin and like changed the "titlecolor" to silver... went online on the page it was there and it showed silver, I then changed it to white and clicked save and then it went back to being blank where $usertitle should of been. So for some reason it's not saving through the database as text *shrugs*
|
#5
|
|||
|
|||
$titlecolor is probably not being set.
post the html of your form that submits to script, the problem is probably in there. |
#6
|
||||
|
||||
Can you format you code with tabs to make it a little easier for us to read ?
|
#7
|
||||
|
||||
Okay here's the complete non working script.
Under the template definitions at the top of profile.php I have added this... Quote:
And to finish it off I have this template... Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|