No announcement yet.

IP conditional - Please help - Urgent

  • Filter
  • Time
  • Show
Clear All
new posts

  • IP conditional - Please help - Urgent

    Please help me as this is urgent for me.

    Can i apply ip based conditional?

    for example;

    <- if ip = 99.99.99
    do this html


    do this html ->
    Support Disaster Relief in Haiti

  • #2
    I tried $bbuserinfo[ip] & userid & host and $userinfo[ip] userid & host
    and they all returned empty.
    Perhaps this requires you to set a global_start php code plugin that gets the value and stores it into your own one and then use $myipvalue in the template with a condition.


    • #3
      Floris, Thank you for your help
      i found the solution to my problem.

      to better help for others, can you please change the title of the thread? So that people can easily find this.

      Problem: I wanted to show/hide somethings in my forum template to some visitors that using some specific ip addresses (include ip-a, ip-b, ip-c ..etc). For anytime, you may need this, e.g. for your ads or any message to specific ip addresses...

      Response to problem: You should include .php codes to your templates.

      Please read this useful thread: How to Include a PHP or HTML File

      and this is from

      Download: IPAddressSubnetSniffer.php from and
      add this snippet to the end of the code;
      PHP Code:
       $okay = array( "73""74.11""75.12.58""" );
      //type your own ip addresses, see i am doing somethings for 73.X.X.X., 74.11.X.X, 75.12.58.X and
      $ipsniff = new IPAddressSubnetSniffer$okay );
             if ( ! 
      $ipsniff->ip_is_allowed$_SERVER['REMOTE_ADDR'] ) ){
      //adsense code 
      echo "Your msg or html output goes here - Condition A" ;
      "Your msg or html output goes here - Condition B";

      save the file and upload into your forum home directory.

      As Feldon23 told in ;

      Create a Plug-in for global_start with these contents:

      $includedphp = ob_get_contents();

      and place $includedphp in one of your templates.

      Remember, this process will include a .php file into your templates. So Please use caution.
      Support Disaster Relief in Haiti


      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.