If it's what Redlinemotorsports said, this is very easy.
Use this function:
PHP Code:
/**
* Checks to see if the IP address of the visiting user is allowed and defines a conditional
*
* @param string String of allowed IP's
*/
function check_allowed_ip($iplist = '')
{
global $show;
if (empty($iplist))
{
return;
}
$show['allowedip'] = false;
$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, '#'));
if (preg_match('#^' . $allowed_ip_regex . '#U', $user_ipaddress))
{
$show['allowedip'] = true;
}
}
}
Function Usage
PHP Code:
// 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);
In your template, all you have to do is add this condition:
Code:
<if condition="$show['allowedip']">
... do your stuff for allowed users only ...
</if>
In other words, users who have an IP starting with 127.0.0.* or users with the exact IP 127.1.1.53 will be able to see your stuff.
Hope that helps.
BTW, this was not tested, it was done off my mind.