+ Reply to Thread
Results 1 to 4 of 4

Thread: Combining The Codes :P please help

  1. #1
    Shadow121's Avatar
    Shadow121 is offline x10 Lieutenant Shadow121 is an unknown quantity at this point
    Join Date
    Jul 2006
    Location
    Centerville
    Posts
    455

    Combining The Codes :P please help

    I have a big code here that i want simplified and stuck into one big code. When i did it, it wasn't showing my layout So, heres the code.
    PHP Code:
    <?
    ob_start
    ();
    include(
    "config.php"); 
    if(!
    $logged[username] && $setting[status] == Offline){  // Checks to see if the person is logged in and if the status is offline
    exit("$setting[reason]");
    }elseif(
    $logged[username] && $setting[status] == Offline && $setting[immunity] == 1){ // If they ARE logged in and the status is offline and the immunity is on, we check their level.
    if($logged[username] && $logged[level] != $setting[immune_lvl]){ // If their level does NOT equal the immune level, we exit.
    exit("$setting[reason]");
    }else{ 
    // If the person is immune, we show them the site :D
    }
    }elseif(
    $setting[status] == Offline && $setting[immunity] == 0){ // If the status equals offline AND the immunity feature is off, we exit.
    exit("$setting[reason]");
    }elseif(
    $setting[status] == Online){ // If the status is online, we show them the site :D

       if (
    $logged[username])
       {
          echo(
    "");
       }
       else
       {
          echo(
    "<meta http-equiv=\"Refresh\" content=\"0; URL=http://hrwp.hrwp.exofire.net/\"/>");
       }
    ?> 
    <?
       ob_start
    ();
       include(
    "config.php");
       if (
    $logged[level] == 2)
       {
          echo(
    "<meta http-equiv=\"Refresh\" content=\"0; URL=http://hrwp.hrwp.exofire.net/\"/>");
       }
       else
       {
          echo(
    "");
       }
    ?> 
    <?php
    ob_start
    ();
    include(
    "config.php");
    if (
    $logged[banned] == banned
    {
    echo 
    "<meta http-equiv=\"Refresh\" content=\"0; URL=http://hrwp.hrwp.exofire.net/banned.php\"/>";
    }else{
    echo 
    "";
    }
    ?>

  2. #2
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: Combining The Codes :P please help

    A few suggestions that may help you fix your code:
    1. Clean up your array, specifically the way you are using them. ($settings['key'] rather than $settings[key])
    2. Use only one ob_start(), and end the script with ob_end_flush().
    3. Get rid of the multiple includes for your config.php file, you only need one.
    4. Align and indent your code, and use parentheses in your if statements.
    5. Get rid of all of your echo's that aren't doing anything, you don't need them.

    If you clean it up and it's still not working for you, post it back here and I'll take a look at it.
    Last edited by Bryon; 09-20-2006 at 06:24 PM.

  3. #3
    Shadow121's Avatar
    Shadow121 is offline x10 Lieutenant Shadow121 is an unknown quantity at this point
    Join Date
    Jul 2006
    Location
    Centerville
    Posts
    455

    Re: Combining The Codes :P please help

    Nope, it doesn't work its not showing me the layout still.

    PHP Code:
    <?php
        ob_start
    ();
                include(
    "config.php");
            if(!
    $logged[username] && $setting[status] == Offline){
        exit(
    "$setting[reason]");
                }elseif(
    $logged[username] && $setting[status] == Offline && $setting[immunity] == 1){
            }elseif(
    $logged[username] && $logged[level] != $setting[immune_lvl]){
        exit(
    "$setting[reason]");
                }elseif(
    $logged[username] && $logged[leve] == $setting[immune_lvl]){
            }elseif(
    $setting[status] == Offline && $setting[immunity] == 0){
        exit(
    "$setting[reason]");
                }elseif(
    $logged[username] && $setting[status] == Online){
            }elseif(!
    $logged[username]){
        echo 
    "<meta http-equiv=\"Refresh\" content=\"0; URL=http://hrwp.hrwp.exofire.net/\"/>";
                }elseif(
    $logged[username] && $logged[level] == && $logged[banned] == banned){
            echo 
    "<meta http-equiv=\"Refresh\" content=\"0; URL=http://hrwp.hrwp.exofire.net/banned.php\"/>";
        }else{
                }
            
    ob_end_flush();
    ?>
    Last edited by Shadow121; 09-20-2006 at 06:33 PM.

  4. #4
    jensen's Avatar
    jensen is offline x10 Lieutenant jensen is an unknown quantity at this point
    Join Date
    Nov 2005
    Location
    At my desk
    Posts
    438

    Re: Combining The Codes :P please help

    Hve you tried...

    content=\"0; URL=\"http://hrwp.hrwp.exofire.net/\"\"/>
    "For I am not ashamed of the gospel of Christ: for it is the power of God unto salvation to every one that believeth" Romans 1:16

+ Reply to Thread

Similar Threads

  1. Forced Ad codes
    By N2PGames in forum Free Hosting
    Replies: 4
    Last Post: 06-19-2006, 05:40 PM
  2. Ad codes not displaying popertly?
    By XColl in forum Free Hosting
    Replies: 6
    Last Post: 07-27-2005, 09:18 PM
  3. Ad Codes Errors
    By hahoozhafax in forum Free Hosting
    Replies: 1
    Last Post: 07-27-2005, 07:02 PM
  4. Phpbb Forum Codes..how to add.
    By bernhardt in forum Free Hosting
    Replies: 1
    Last Post: 03-02-2005, 12:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers