The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
toggle admin option from frontend
i have got this working using
Code:
build_options(); but i have a major issue, when i toggle it, i get a fatal user error i cant solve. im not changing any other options so idk what would cause this. im trying to create a simple toggle for turning a plugin on or off from the front end.product attached in 2nd post it looks a little like this. the toggle: HTML Code:
<if condition="$vboptions[setting_name] == 1"> <a href="#" onclick="setting_off()">ON</a> <else /> <a href="#" onclick="setting_on()">OFF</a> </if> Code:
function setting_off(){ $.ajax({ type: "GET", url: "?do=settingoff" }); } function setting_on(){ $.ajax({ type: "GET", url: "?do=settingon" }); } PHP Code:
the href just switches this yet i actually have to come here and hit save before it really applies. any ideas how to avoid that process so my href takes care of all of that important addition! when i hit save here it seems to be affecting something else also and i have to breakout the tools.php to fix it Quote:
|
#2
|
||||
|
||||
attached product, someone please help =(
DO NOT USE THIS ON A LIVE SITE YOU RISK THE CHANCE OF RUINING YOUR DB!!!!!! |
#3
|
|||
|
|||
Are you still working on this? I think the problem is that your UPDATE query sets all options that had a setting of 0 to 1. What you want is something like
Code:
UPDATE setting SET value=0 WHERE varname='drc_fl' |
#4
|
||||
|
||||
i got it all working already, went about it without ajax and i caught that mysql error, thanks though kev.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|