The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#13
|
||||
|
||||
![]()
You cannot do it with a simple conditional, you need to go the hacker way, that's why you are here at vb.org site.
![]() Here, simple like Bonjour. Code:
/** * Checks to see if the IP address of the visiting user is allowed and performs a redirect * * @param string String of allowed IP's */ function check_allowed_ip($iplist = '') { global $vbulletin; if (empty($iplist)) { return; } $user_ipaddress = IPADDRESS . '.'; $addresses = preg_split('#\s+#', $iplist, -1, PREG_SPLIT_NO_EMPTY); foreach ($addresses AS $allowed_ip) { if (strpos($allowed_ip, '*') === false AND $allowed_ip{strlen($allowed_ip) - 1} != '.') { $allowed_ip .= '.'; } $allowed_ip_regex = str_replace('\*', '(.*)', preg_quote($allowed_ip, '#')); // choose where you want to redirect the non-allowed member $vbulletin->url = 'forumdisplay.php?' . $vbulletin->session->vars['sessionurl']; if (preg_match('#^' . $allowed_ip_regex . '#U', $user_ipaddress)) { // choose where you want to redirect the allowed member $vbulletin->url = $vbulletin->options['forumhome'] . '.php?' . $vbulletin->session->vars['sessionurl']; } eval(print_standard_redirect('redirect_updatethanks')); } } // separate allowed IP's by a space, you could define a vB option for that $allowediplist = '127.0.0.* 127.1.1.53'; check_allowed_ip($allowediplist); |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|