NolF
06-07-2007, 10:26 AM
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
function can_delete_all_thanks()
{
global $vbulletin;
($hook = vBulletinHook::fetch_hook('post_thanks_function_ca n_delete_all_thanks_start')) ? eval($hook) : false;
if ($vbulletin->userinfo['usergroupid'] == '6')
{
return true;
}
($hook = vBulletinHook::fetch_hook('post_thanks_function_ca n_delete_all_thanks_end')) ? eval($hook) : false;
return false;
}
and it would basically be to change "if ($vbulletin->userinfo['usergroupid'] == '6')" into
if (is_member_of($vbulletin->userinfo['usergroupid'], explode("|", $vbulletin->options['post_thanks_who_delete_all'])))
(pS: options['post_thanks_who_delete_all'] is an option created by the modification which is used to insert the usergroups)
[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
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
function can_delete_all_thanks()
{
global $vbulletin;
($hook = vBulletinHook::fetch_hook('post_thanks_function_ca n_delete_all_thanks_start')) ? eval($hook) : false;
if ($vbulletin->userinfo['usergroupid'] == '6')
{
return true;
}
($hook = vBulletinHook::fetch_hook('post_thanks_function_ca n_delete_all_thanks_end')) ? eval($hook) : false;
return false;
}
and it would basically be to change "if ($vbulletin->userinfo['usergroupid'] == '6')" into
if (is_member_of($vbulletin->userinfo['usergroupid'], explode("|", $vbulletin->options['post_thanks_who_delete_all'])))
(pS: options['post_thanks_who_delete_all'] is an option created by the modification which is used to insert the usergroups)
[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