The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
||||
|
||||
Quote:
|
#12
|
||||
|
||||
Ok, just talking in general here, but you should get the point.
If you look in the hacks database you will see something like this: Code:
<tr align="center"> <td bgcolor="#13486D"><img src="https://vborg.vbsupport.ru/images/folder.gif" align="left"></td> <td bgcolor="#1C5780" align="left" valign="top"><font face="verdana" size="2">[high]<input type="checkbox" name="install[34534]" value="yes" checked>[/high] <a href="index.php?s=&action=showhack&hackid=73">List similar usernames when moderating user registration</a></font></td> <td bgcolor="#13486D"><font face="verdana" size="2"><a href="https://vborg.vbsupport.ru/member.php?s=&action=getinfo&userid=3771">dlst</a></font></td> <td bgcolor="#1C5780" nowrap><font face="verdana" size="1">01-27-02<br><font color="#FF9C58">08:07 PM</font></font></td> <td bgcolor="#13486D" nowrap><font face="verdana" size="1">01-27-02<br><font color="#FF9C58">08:07 PM</font></font></td> <td bgcolor="#1C5780"><a href="javascript:whoinstalled(34534)"><font face="verdana" size="2">1 user</font></a></td> <td bgcolor="#13486D"><img src="https://vborg.vbsupport.ru/images/clear.gif" border="0" alt="0 votes - 0.00 average"></td> </tr> [high]<input type="hidden" name="all[34534]" value="1">[/high] Then there's the real checkbox, that the user can change. That's part of the install[] array, which holds all the ID's of the hacks the user WANTS to have installed. And here's a little bit of code from the page itself, that parses the results: PHP Code:
And then it's really simple logic! If the hack wasn't installed ($was equals 0) and it SHOULD be now ($now equals yes), then we need to install the hack. Otherwise, if the hack WAS installed ($was is 1) but the user un-checked the box (so $now is not yes), we need to un-install the hack. If non of the above is true, it means that the hack is either already installed and the user didn't touch the checbox, or it is not installed but the user didn't check the checkbox neither. *takes a deep breath* Did I say I was talking in general? |
#13
|
||||
|
||||
Thanks Firefly, it works almost 100%.
However one thing: $threadid. Where and how did u defined that one because i get an error: PHP Code:
This is my currently code: PHP Code:
Its a little general |
#14
|
||||
|
||||
1. What's this $kol crap? The checkbox value is always yes!
2. The whole part where you list the array and do your stuff is AFTER you SUBMIT the form, not while printing it. |
#15
|
||||
|
||||
1.
PHP Code:
2. Quote:
Its working perfect now, thank you for your help Firefly. Appreciated. |
#16
|
||||
|
||||
Quote:
How did you defined the value yes? |
#17
|
||||
|
||||
firefly, it works perfect if i have just 1 award but when i have more then 1 award then it updates the database only with the last award, it only listening to the last award. So if i have 2 awards then it updates only the 2nd award and ignores the 1st one. Could u help me with this (hopefully) last problem
I have the currently code: Code before submit: PHP Code:
Code after submit: PHP Code:
|
#18
|
||||
|
||||
Nevermind, i got it working now :up:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|