The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
How to insert a pre-defined number into user db
Using the useradmin_edit_column2 and the userdata_start plugins, I need to insert 3 values into the user table. The trick is that 2 of them are input values and one of them is the same value as one of the input values. So like this:
$value_1 goes into field_1 $value_2 goes into field_2 $value_3 = $value_2 $value_3 goes into field_3 I know how to use input rows for the useradmin_edit_column2 hook, but I don't know what to use or how to format value 3 (which needs to be the same as value 2 and silently go into field 3). I've tried using standard PHP code, but it's not working. I think there's a vb class that I just don't know. Any help would be appreciated. Thanks! |
#2
|
|||
|
|||
One idea, assuming strings...
Code:
$db->query_write("INSERT INTO " . TABLE_PREFIX . "user (field_1, field_2, field_3) VALUES ( '" . $db->escape_string($value_1) . "' '" . $db->escape_string($value_2) . "' '" . $db->escape_string($value_2) . "' ) "); |
#3
|
|||
|
|||
1. a plugin at hook: userdata_start
PHP Code:
PHP Code:
|
#4
|
||||
|
||||
Quote:
Quote:
|
#5
|
|||
|
|||
Perhaps try the construct_hidden_code function.
|
#6
|
|||
|
|||
ups
I havent seen that you need a hidden row look into adminfunktions.php there you see all the functios available |
#7
|
||||
|
||||
Thanks -- I'll keep working on this and let you know what I find out. It's for a hack that I think a lot of people will like.
|
#8
|
|||
|
|||
a "give me every month 1000$ on my konto" hack?
yea i'll love it but i don't understand for what should be hidden fields used in this example they can't do something usefull |
#9
|
||||
|
||||
Quote:
I need to insert the same value from one input box into two database fields. I have my reasons -- I don't feel like explaining the whole hack. I can do this easily with regular sql queries, but with the hook system I'm having trouble (still learning). That's why I'm asking for help. No biggie -- I'll figure it out eventually. |
#10
|
|||
|
|||
ok ok*g*
i'll see it after you publish it |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|