Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 4 of 5 FirstFirst 12345 LastLast
Results 31 to 40 of 43
  1. #31
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default

    Quote Originally Posted by 01101101entor View Post
    If your can boast about oop learn it properly, I can see without even reading its wasting alot of oops features, for one you have an call to a classes inialise method, When a object is defined it should automatically run that method if done properly (with php i belive it just uses a method shareing the classes name)
    1) Don't venture in to php territory against a person who's had ~3 years experience
    2) I need to call it in other places, you can't see where it's being called from (different places)
    3) That's perfectly fine OOP, as I said, need to call it in other places, so don't want it always on.

    Quote Originally Posted by 01101101entor View Post
    OOP isnt dont because it looks cleaner/nicer. no one gives a crap about that, proper indenting and commenting can do that without oop useage anyway. Its is powerful features, ease of updating and efficany it can add which would be the use.
    WELL WHY DO YOU THINK I USED IT?

    Quote Originally Posted by 01101101entor View Post
    Why have 2 simlar functions in full when u can just one full and inhert to get the other?
    I don't have 2 similar functions in full.


    visit my internet web site on the internet
    http://dong.engineer/
    it is just videos by bill wurtz videos you have been warned

  2. #32
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Quote Originally Posted by Lolcopters View Post
    1) Don't venture in to php territory against a person who's had ~3 years experience
    2) I need to call it in other places, you can't see where it's being called from (different places)
    3) That's perfectly fine OOP, as I said, need to call it in other places, so don't want it always on.
    1) wow, arnt you great, 3 years... Apart from the fact ive probably been programming longer than you, the time youve been useing it really doesn't make any odds.
    2)No very well programmed then is it :p
    3) Ok, that didnt make much sense, so im guessing your repeating number 2 so bulk up you bullet points count?

    WELL WHY DO YOU THINK I USED IT?
    Well for the reasons you said you did when asked:
    "good organization"
    "Clean code"

    I don't have 2 similar functions in full.
    I never said you did, i just said said thats why people usually do use oop though, as opposed to just organization and clean code.



    Plus, you forgot to respond to my last point... i wonder why. I certainly learnt my lesson against venturing in to php territory against someone with *lightning flash* ~3 years experence **lightning flash*

    Also, why do you feel so threatened by them if your "so much better"? or is there some other reason your trolling the thread?
    Last edited by Mentor; 08-06-2007 at 07:13 PM.

  3. #33
    Join Date
    May 2007
    Location
    Nebo, NC, USA
    Posts
    2,517
    Tokens
    0

    Latest Awards:

    Default

    Dan seems to think he knows everything about PHP. Bag and Nets are the two most expierenced here. Alot older then you also, and I believe they are friends IRL.

    Don't act like a ***** and think you know everything because its just gonna get you flamed AND proven wrong.

    Okay, if a company asked you to say, design/code them a poll application for their business website, then they most likely do not know PHP. (hence they they are asking you)

    So if they do not know php, why would they care if the code is not clean nor organized. If you are so good a PHP you shouldn't have to debug it, you can format it from dirty to clean code with the push of a button.

    So why would someone care if the code is dirty/unorganized. Most of the time all a company wants is something that WORKS and is SECURE not CLEAN AND ORGANIZED.

    They dont care as long as it is safe secure and works.

    Your not better then us, someone with 3 months expierence can be way better then you.

    I remember when you were learning "PHP + MySQL for dummies" long after I started PHP.

    (copied carl) *lightning flash* ~3 years * lightning flash*

    So don't act like a ***** after he proved you wrong many times, why decode an encoded script thats already been encrypted by MD5. You can't decode that... when you could just easily salt it.

  4. #34
    Join Date
    Aug 2005
    Location
    Tunbridge Wells, Kent
    Posts
    5,063
    Tokens
    1,624

    Latest Awards:

    Default

    This is exciting...
    Never argue with an idiot, he'll drag you down to his level, and beat you with experience.

    Quote Originally Posted by Recursion
    *oh trust me
    *I would NEVER go ATi
    And 15 mins later...
    Sapphire ATI Radeon HD 5850 1024MB GDDR5 PCI-Express Graphics Card £195.73 1 £195.73
    *ordered.

  5. #35
    Join Date
    Dec 2006
    Posts
    521
    Tokens
    0

    Default

    Quote Originally Posted by Lolcopters View Post
    PHP Code:
    <?php
    /**
     ####################################################################
     # Kristall Panel Core Class
     # Handles _most_ of this basics.
     # Getting browser info and general information etc.
     # Date Started: 30th April 2007 - 19:14 GMT
     ####################################################################
     # @package        Default
     # @copyright    Kristall Services, Org.
     # @author        Enumeric
     # @version        1.0.0
     ####################################################################
    **/

    /**
     * Unfreeze / initialise sessions ready for use.
     **/

    if( !defined"KP_Core" ) )
    {
        exit;
        
    // Exit, give them no reason, should throw them off a bit.
    }

    session_start();

    include(
    "class_config.php");
    include(
    "class_clean.php");
    include(
    "class_bbcode.php");

    $config = new main_config;
    $config->initialise();

    /**
     * This will put the get_opts script into debug mode
     * instead of returning the sql, it will exit with the result
     * to enable you to fix a problem, should it arise, with relative ease.
     * LEAVE THIS ALONE UNLESS YOU KNOW HOW TO DEBUG PHP AND MySQL
     * 
     * Case insensitive too for future reference.
     **/
    define"EXITSQL"0true );
    class 
    panel_core
    {
        
    /**
         * Set core variables
         **/

        // Gets information from the database and sets options
        
    function get_opts$option )
        {

            
    // Make the $option variable lowercase to stop "BBCode" or "OnOff" (for example) being ignored.
            
    $option strtolower$option );
            
    // Get needed settings from database (Which just so happens to be.. wait for it... all of them :D)
            
    $getsettings = @mysql_fetch_arraymysql_query"SELECT * FROM `" TABLEPREFIX "settings`" ) )
            or 
    $this->log"MySQL Error"mysql_error( ), );
            
    // Put the settings into a big ol' array
            
    $settings = array(  "bbcode"     => $getsettings["bbcode"],         //     Should return integer
                                
    "emoticons" => $getsettings["emotes"],        //     Should return integer
                                
    "onoff"     => $getsettings["onoff"],         //      Should return integer
                                
    "filter"     => $getsettings["filter"],        //     Should return integer
                                
    "sitename"    => $getsettings["sitename"],    //     Should return string
                                
    "siteurl"     => $getsettings["siteurl"],     //      Should return string
                                
    "welcome"     => $getsettings["welcome"],     //      Should return string
                                
    "clean"     => $getsettings["clean"],        //     Should return integer
                                
    "css"        => $getsettings["css_tag"]
                              );
            
            
    // Gotta make sure what we're after is a valid setting...
            
    if( $settings["$option"] != "" )
            {
                if( 
    EXITSQL == // Looks like we're debugging
                
    {
                    
    $exit gettype$settings["$option"] );
                    exit( 
    "MySQL Returned type $exit.<br />result: {$settings["$option"]}); // Exit with the type returned from sql (Like boolean etc etc) and show them it with the result!
                
    }
                else 
    // Ah, glorious non-debugging-action-which-is-taking-up-this-comment-space.
                
    {
                    return 
    $settings["$option"]; // Just return the sql result and let it get on with whatever.
                
    }
            }
            else 
    // Not a valid setting, that makes me & the script :(
            
    {
                return 
    false// Return false and let's get out of here.
            
    }
        }

        
    /**
         * Tag cleaning decider function
         * 
         * Decides what functions to call (What level of cleaning)
         * for cleaning string passed into it, then cleans it.
         **/
        
    function clean$string$forcelevel null$sql null )
        {
            if( 
    $forcelevel != null )
            {
                
    $getlevel $forcelevel;
            }
            else 
            {
                
    $getlevel $this->get_opts"clean" );
            }
            switch( 
    $getlevel )
            {
                default:
                    
    $string panel_clean::max_clean$string );
                case 
    4// Panicking
                    
    $string panel_clean::max_clean$string ); // Welcome back $string, we missed you!
                
    break; // No need to carry on from here, it's instantly protected beyond any "hackers" playing around.
                
    case 3// Nervous
                    
    $string panel_clean::med_clean$string );
                    
    $string panel_clean::base_clean$string );
                    
    $string panel_clean::core_clean$string );
                    
    $donl2br 0;
                break;
                case 
    2// Cool, calm and default
                    
    $string panel_clean::base_clean$string );
                    
    $string panel_clean::core_clean$string );
                break;
                case 
    1// Why panic when you have KOOL-AIDS (lol aids)
                    
    $string panel_clean::core_clean$string );
                break;
            }
            if( 
    $this->get_opts"bbcode" ) == // Are we parsing bbcode?
                    
    {
                        
    // We are, but we need to parse it _last_ to make sure the parsed code isn't cleaned!
                        
    $string panel_bbcode::parse_main_bb$string$this->get_opts"emoticons" ) );
                    }
            return 
    $string// Give em it back :(
        
    }
        
        
    /**
         * Ok, lets get on with getting basic user info.
         **/
        
    function get_info$requested )
        {
            
    // Convert to lowercase to stop case insensitive problems.
            
    $requested strtolower$requested );
            
            
    $available = array( "username" => $_SESSION["p_username"],
                                
    "level" => $_SESSION["p_level"],
                                
    "auth" => $_SESSION["p_randauth"],
                                
    "passhash" => $_SESSION["p_hash"],
                                
    "ip" => $_SESSION["p_ip"], // Lol pips
                                
    "lusername" => $_SESSION["p_lusername"]
                                 );
                                 
            if( 
    $available["$requested"] != "" // It's in there, give them the stuff they asked for.
            
    {
                    return 
    $available["$requested"];
            }
            else 
            {
                
    // Eh, after something that's not there :(
                
    return "Not Available.";
                
            }
        }
        
        function 
    check_user$username )
        {
            if( 
    $username == "" )
            {
                return 
    false;
            }
            
    // Simple function to get user information dependant on if the password is supplied or not.
                // Looks like we're checking info based on just the username (Probably an auth check in the panel)
                
    $username strtolower$this->clean$username ) ); // Clean up the username.
                
    $sql = @mysql_query"SELECT * FROM `" TABLEPREFIX "users` WHERE `lusername` = '$username'" )
                or 
    $this->log"MySQL Error"mysql_error( ), );
                if( @
    mysql_num_rows$sql ) == )
                {
                    return 
    false;
                }
                else 
                {
                    
    $fetch = @mysql_fetch_array$sql )
                    or 
    $this->log"MySQL Error"mysql_error( ), );
                    
    $storedinfo = array( "password" => $this->get_info"passhash" ),
                                         
    "randauth" => $this->get_info"auth" ),
                                         
    "getuseip" => $this->get_info"ip" ),
                                         
    "gtuselvl" => $this->get_info"level" )
                                         );
                    if( 
    $storedinfo["password"] != md5$fetch["password"] ) /*|| $storedinfo["randauth"] != $fetch["randauth"]*/ || $storedinfo["getuseip"] != $_SERVER["REMOTE_ADDR"] || $storedinfo["gtuselvl"] != $fetch["level"] )
                    {
                        return 
    false// Ha, not giving the right stuff eh? Better kick em out!
                    
    }
                    else 
                    {
                        return 
    true;
                    }
                }
        }
        
        function 
    notice$header$message$url // Standard notice, don't need to touch this.
        
    {
            @
    header("Refresh: 9;url=".$url);
            echo(
    "<html>

    <head>
    <title>" 
    $this->phrase$header ) . "</title>
    </head>
    <style type=\"text/css\">
    body
    {
        text-align: center;
        width: 100%;
        margin: 0px;
        background: #ffffff;
    }
    div, a, a:link, a:active
    {
        font-family: verdana;
        font-size: 10px;
        color: #000000;
        text-decoration: none;
    }
    a:hover
    {
        font-weight: bold;
    }
    .wrapper
    {
        margin-top: 150px;
        width: 371px;
        margin-left: auto;
        margin-right: auto;
    }
    .construct
    {
        text-align: left;
        width: 371px;
        position: relative;
        margin-left: auto;
        margin-right: auto;
    }
    .header, .message, .topheader
    {
        background: #f0f5fa;
        padding: 2px;
    }
    .header
    {
        border: 1px solid #c2cfdf;
    }
    .topheader
    {
        text-align: center;
        border: 1px solid #c2cfdf;
    }
    .message
    {
        color: #000000;
        border-left: 1px solid #c2cfdf;
        border-right: 1px solid #c2cfdf;
    }
    .upper
    {
        text-transform: uppercase;
    }
    </style>
    <body>
    <div class=\"wrapper\">
    <div class=\"construct\">
    <div class=\"topheader\"><strong class=\"upper\">" 
    $this->phrase$header ) . "</strong></div>
    <div class=\"message\">" 
    $this->phrase$message ) . "</div>
    <div class=\"header\">" 
    $this->phrase"redirect" ) . " Click <a href=\"$url\">here</a> to go immediatley.</div>
    </div>
    </div>
    </body>

    </html>"
    );
            exit;
        }
        
        function 
    phrase$phrase )
        {
            
    $phrase $this->clean$phrase );
            
    $sql = @mysql_query"SELECT * FROM `" TABLEPREFIX "phrases` WHERE `phrasename` = '$phrase'" ); // SQL to get the query from the database...
            
    if( mysql_num_rows$sql ) == )
            {
                return 
    "Phrase not available.";
            }
            else 
            {
                
    $sql mysql_fetch_array$sql );
            }
            
            
    $replaceable = array( "/{website}/i" ,
                                  
    "/{username}/i",
                                  
    "/{date}/i",
                                  
    "/{level}/i",
                                  
    "/{ip}/i");
            
    $replacewith = array( $this->get_opts"sitename" ),
                                  
    $this->get_info"username" ),
                                  
    gmdate"d/m/Y - h:i:s" ),
                                  
    $this->get_info"level" ),
                                  
    $this->get_info"ip" ), );
            
            
    $getit $sql["phrase"];
            
    $replaceit preg_replace$replaceable$replacewith$getit );
            
    $replaceit str_replace"[apos]""'"$replaceit );
            
            return 
    $replaceit;
        }
        
        function 
    encrypt$string // Let's begin encryption.
        
    {
            
    $holda $string;
            
    $holdb $string;
            
            
    $holdc $holda $holdb;
            
    $holdc sha1md5 $holdc ) );
            
    $holdb strlen$string );
            
    $holdb md5$holdb $holdc $holda );
            
            
            
    $holda crypt$holdb"LivePanel!CoreEncryt1.0\$Revision1" ); // LOL WUT? Edit: Need to change this to kristallpanel before release
            
            
    return $holda;
        }
        
        
    /**
         * Time to begin action logging.
         */
        
    function log$username$did$force null )
        {
            if( 
    main_config::config_setting"use_http_logs" ) == "1" || $force == )
            {
                
    // Begin http logging
                
                
    echo("<html>

    <head>
    <title>Error Logging.</title>
    </head>
    <style type=\"text/css\">
    body
    {
        text-align: center;
        width: 100%;
        margin: 0px;
        background: #ffffff;
    }
    div, a, a:link, a:active
    {
        font-family: verdana;
        font-size: 10px;
        color: #000000;
        text-decoration: none;
    }
    a:hover
    {
        font-weight: bold;
    }
    .wrapper
    {
        margin-top: 150px;
        width: 371px;
        margin-left: auto;
        margin-right: auto;
    }
    .construct
    {
        text-align: left;
        width: 371px;
        position: relative;
        margin-left: auto;
        margin-right: auto;
    }
    .header, .message, .topheader
    {
        background: #f0f5fa;
        padding: 2px;
    }
    .header
    {
        border: 1px solid #c2cfdf;
        text-align: center;
    }
    .topheader
    {
        text-align: center;
        border: 1px solid #c2cfdf;
    }
    .message
    {
        color: #000000;
        border-left: 1px solid #c2cfdf;
        border-right: 1px solid #c2cfdf;
    }
    .upper
    {
        text-transform: uppercase;
    }
    </style>
    <body>
    <div class=\"wrapper\">
    <div class=\"construct\">
    <div class=\"topheader\"><strong class=\"upper\">Error Logging</strong></div>
    <div class=\"message\">Please wait, we're now doing a few checks to make sure you have the log file ready."
    );
                
    #########
                
    $date gmdate("d/m/Y - h:i:s") . "GMT";
                if( 
    file_exists"http_error/error.log" ) )
                {
                    
    // Looks like we're gonna be writing to an already active log file.
                    
    echo("<br />--| File exists, opening now.");
                    
    $fopen = @fopen"http_error/error.log""at" );
                    if( 
    $fopen )
                    {
                        echo(
    "<br />---| File opened, writing error.");
                        @
    fwrite$fopen"\n$username ({$_SERVER["REMOTE_ADDR"]}) - [ $date ] => $did);
                        echo(
    "<br />----| Error logged, you may now navigate away.");
                        @
    fclose$fopen );
                    }
                }
                else 
                {
                    echo(
    "<br />--| File does not exist, attemnpting to create and open for writing.");
                    
    $fopen = @fopen"http_error/error.log""x+t" );
                    if( 
    $fopen )
                    {
                        echo(
    "<br />---| File created and opened, writing error.");
                        @
    fwrite$fopen"Kristall Panel ERROR LOGS\n$username ({$_SERVER["REMOTE_ADDR"]}) - [ $date ] => $did);
                        echo(
    "<br />----| Error logged, you may now navigate away.");
                        @
    fclose$fopen );
                    }
                }
                
                
    #########
    echo("</div>
    <div class=\"header\">Powered by Kristall Panel</div>
    </div>
    </div>
    </body>

    </html>"
    );
                exit;
            }
            else 
            {
                
    $date gmdate"d/m/Y - h:i:s" );
                @
    mysql_query"INSERT INTO `" TABLEPREFIX "log` (`username`, `did`, `date`, `ip`) VALUES ('$username', '$did', '$date', '{$_SERVER["REMOTE_ADDR"]}')" )
                or 
    $this->log"MySQL Error"mysql_error( ), );
            }
        }
        
        function 
    nav$level null )
        {
            if( 
    $level == "normal" )
            {
                
    $_SESSION["nav"] = "normal";
            }
            elseif( 
    $level == "admin" && $this->get_info"level" ) == "Administrator" || $level == "admin" && $this->get_info"level" ) == "Super Administrator")
            {
                
    $_SESSION["nav"] = "admin";
            }
            else 
            {
                
    $_SESSION["nav"] = "normal";
            }
        }
        
        function 
    get_nav()
        {
            if( 
    $_SESSION["nav"] == "admin" )
            {
                echo(
    "<div class=\"selectmenuleft\"><a href=\"?nav=normal\">Main Links</a></div>
                        <div class=\"selectmenurightg\"><a href=\"?nav=admin\">Admin Links</a></div>"
    );
            }
            else 
            {
                echo(
    "<div class=\"selectmenuleftg\"><a href=\"?nav=normal\">Main Links</a></div>
                        <div class=\"selectmenuright\"><a href=\"?nav=admin\">Admin Links</a></div>"
    );
            }
        }
        
        function 
    get_content$page null )
        {
            if( 
    $page == "" )
            {
                include( 
    "pages/welcome.php" );
            }
            else
            {
                
    $page $this->clean$page);
                if( 
    file_exists"pages/$page.php" ) )
                {
                    include( 
    "pages/$page.php" );
                }
                else
                {
                    
    $this->log$this->get_info"username" ), "attempted to access a faulty page, the page was ( $page.php )" );
                    include( 
    "404.php" );
                }
            }
        }
        
        function 
    meta_redirect$url$time )
        {
            
    $url $this->clean$url );
            echo( 
    "<meta http-equiv=\"refresh\" content=\"$time;url=main.php$url\">" );
        }
        
        function 
    gmt_curtime() // Because php time is **** and wont record DST
        
    {
            
    $checkdst date"I" );
            
    $date gmdate"H:i:s" );
            if( 
    $checkdst == )
            {
                
    $splittime split":"$date );
                
    $hour $splittime[0] + 1;
                if(
    $hour 23// Are we at 11pm (E.g, is it reporting 24:00 instead of 23:00)
                
    {
                    
    $hour "00";
                }
                
    $newdate $hour ":" $splittime[1] . ":" $splittime[2];
                return( 
    "$newdate);
            }
            else 
            {
                return( 
    "$date);
            }
        }
        
        function 
    is_admin$for null // Specific page admins :P
        
    {
            
    $for $this->clean$for ); // Clean it up (do in mr bean voice, funny).
            
    $for strtolower$for ); // Case ******ry.
            
            
    if( $for == "timetable" )
            {
                
    $levels = array( "Super Administrator" => true,
                                 
    "Administrator" => true,
                                 
    "Head DJ" => true,
                                 
    "Senior DJ" => false,
                                 
    "DJ" => false,                         
                                );
                if( 
    $levels[$this->get_info(" level" )] == true )
                {
                    return 
    true;
                }
                else 
                {
                    return 
    false;
                }
            }
        }
    }

    ?>
    SAY IT AGAIN, GO ON, SAY IT AGAIN
    IT AGAIN, GO ON, SAY IT AGAIN

  6. #36
    Oni Guest

    Default

    Dan you cant seriously think you know more than carl or josh?

  7. #37
    Join Date
    May 2007
    Location
    Nebo, NC, USA
    Posts
    2,517
    Tokens
    0

    Latest Awards:

    Default

    lol thats what I said, lol that just made alot of people lose respect for him.

  8. #38
    Join Date
    Oct 2006
    Location
    Northampton
    Posts
    694
    Tokens
    142

    Default

    I find it pathetic how some people put experience over knowledge.
    Good-bye signature, I love <NOT ALLOWED NAME AT ALL> despite the infraction his last name got me.

    Free speech? Not anymore, you gotta' love this forum.

  9. #39
    Join Date
    Oct 2006
    Location
    London
    Posts
    1,780
    Tokens
    0

    Latest Awards:

    Default

    If the support is like, one person (support guy) checks the E-mails and like if its to do with lets say, programming then the support guy sends the email to the programming leader etc so everything gets sent to the right place.. If its like that i can do it


  10. #40
    Join Date
    May 2007
    Location
    Nebo, NC, USA
    Posts
    2,517
    Tokens
    0

    Latest Awards:

    Default

    If you would like to help out and make some $$$ PM me with what you can do,

    support, advertising, designing, coding.

Page 4 of 5 FirstFirst 12345 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •