Quote:
Originally Posted by antialiasis
Can you give me the code of your "Generate and insert NoSpam! question" plugin on global_start?
|
sure mate..
Here it is for the reference..
PHP Code:
if ($vbulletin->options['nospam_onoff'] AND !$vbulletin->userinfo['userid'])
{
switch (THIS_SCRIPT) {
case 'register':
if ($vbulletin->options['nospam_use_reg']) {
$thetemplate =& $vbulletin->templatecache['register'];
$nospamdo = true;
}
break;
case 'sendmessage':
if ($vbulletin->options['nospam_use_contactus']) {
$thetemplate =& $vbulletin->templatecache['contactus'];
$nospamdo = true;
}
break;
case 'search':
if ($vbulletin->options['nospam_use_search']) {
$vbulletin->templatecache['search_forums'] = str_replace(array('$imagereg</td>', '($imagereg)'), array('$nospamfield\n\n$imagereg</td>', '($imagereg OR ($vbulletin->options[\'nospam_onoff\'] AND $vbulletin->options[\'nospam_use_search\']))'), $vbulletin->templatecache['search_forums']);
$nospamdo = true;
}
break;
case 'newreply':
if ($vbulletin->options['nospam_use_post']) {
$thetemplate =& $vbulletin->templatecache['newreply'];
$nospamdo = true;
}
break;
case 'newthread':
if ($vbulletin->options['nospam_use_post']) {
$thetemplate =& $vbulletin->templatecache['newthread'];
$nospamdo = true;
}
break;
default:
if ($vbulletin->options['nospam_use_reg'] AND $vbulletin->options['quickregister_active']) {
$questions = explode("\n", $vbulletin->options['nospam_questions']);
$nospamnumber = array_rand($questions);
$qanda = explode(":",$questions["$nospamnumber"]);
$nospamquestion = $qanda[0];
}
$nospamdo = false;
}
if ($thetemplate)
{
$thetemplate = str_replace('$imagereg', '$nospamfield\n\n$imagereg', $thetemplate);
}
if ($nospamdo) {
$questions = explode("\n", $vbulletin->options['nospam_questions']);
$nospamnumber = array_rand($questions);
$qanda = explode(":",$questions["$nospamnumber"]);
$nospamquestion = $qanda[0];
eval('$nospamfield = "' . fetch_template('nospam') . '";');
}
}
waiting for your valuable reply
Matthew