The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
||||
|
||||
Hi JorgeX,
The function defines a boolean condition (true/false), based on the string you input. Then, you simply use that condition into your templates. You can use arbitrary IP values, as described in the above script comments. The script has a failsafe feature. If for some reason you use something like: $allowediplist = ''; check_allowed_ip($allowediplist); the script will not execute any code. I made this thinking that someone might add a vbulletin option and leave it emply by default. In this way the function will not burden the server with un-needed executed code. |
#12
|
|||
|
|||
No that didnt work thanks for the effort any other ideas ?
|
#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 | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|