The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
How to modify a function (PHP) between hooks
Ok hi
I'm trying to write my first product, and it would be a small extension to the thank you hack... Is a very small thing and can be achieve by just changing a line in the code, but I wanted to do it by using the product system... Things is I don't exactly know exactly how to begin with the thing I want to modify is PHP Code:
PHP Code:
PHP Code:
[See attachment for the whole modification] I', not sure if I'm being clear enough... I just can figure out what to put in the hooks to make the thing work... I hope someone can lend me just few mins to teach me how to do it ^^ Thank you mates |
#2
|
|||
|
|||
If the function you posted doesn't have any extra code you can comment out the statement.
In the first hook add Code:
/* In the second hook add Code:
*/ if (is_member_of($vbulletin->userinfo['usergroupid'], explode("|", $vbulletin->options['post_thanks_who_delete_all']))) { return true; } |
#3
|
||||
|
||||
Nice workaround, I wouldn't have ever though of that.
|
#4
|
||||
|
||||
I had tried that idea /* */ problem is you get an error message at evaluation (see attachment) obviously those two lines are the ones related to the hooks ^^
Besides that I couldn't think of anything else. Any other solution? I really appreciate the help |
#5
|
|||
|
|||
In the second hook add
PHP Code:
|
#6
|
|||
|
|||
Why not just place this in the first hook location?
PHP Code:
2) usergroupid 6 is the admin group so there is no real reason to work around that code. Either way it's sitting there doing nothing (assuming usergroupid 6 is in $vbulletin->options['post_thanks_who_delete_all']) The work around is nice but it won't play well in an enviroment using multiple products. |
#7
|
||||
|
||||
THANK YOU ALOT!!!!!!!!!!!!!!
Both solutions work perfectly ^^ Thank you guys ^^ |
#8
|
|||
|
|||
well, you could always change the value of usergroup id to say 'a' in the first hook then change it back in the second.
1st hook PHP Code:
PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|