FailPHP

Page 24 of 24 FirstFirst ... 14161718192021222324
Results 346 to 359 of 359
  1. #346
    Ultra Light Beam Makarov is offline
    MemberRank
    Apr 2010 Join Date
    GothamLocation
    3,622Posts

    Re: FailPHP

    Quote Originally Posted by James View Post
    I don't know why you guys are trolling Predict so hard, the codes not that bad, he just needs to patch exploits in his queries etc. Everyone does things different
    In this day in age, mixing html and php is un-necessary.

  2. #347
    Enthusiast Xenous is offline
    MemberRank
    Jan 2012 Join Date
    AustraliaLocation
    44Posts

    Re: FailPHP

    Quote Originally Posted by Makarov View Post
    In this day in age, mixing html and php is un-necessary.
    Still everyone learns their way, just as I showed you on DB

  3. #348
    Account Upgraded | Title Enabled! Kristopher is offline
    MemberRank
    Sep 2011 Join Date
    266Posts

    Re: FailPHP

    :O PM me download link id love to play around with this :D

  4. #349
    Account Upgraded | Title Enabled! Predict is offline
    MemberRank
    Aug 2008 Join Date
    760Posts

    Re: FailPHP

    Quote Originally Posted by James View Post
    I don't know why you guys are trolling Predict so hard, the codes not that bad, he just needs to patch exploits in his queries etc. Everyone does things different
    All queries are secured, therefore $_GET, $_POST and $_REQUEST are not exploitable.

    Quote Originally Posted by Makarov View Post
    In this day in age, mixing html and php is un-necessary.
    It ain't unnecessary because it still functions the same as having PHP and HTML apart?

    Quote Originally Posted by Kristopher View Post
    :O PM me download link id love to play around with this :D
    Check the previous page.

  5. #350
    Ultra Light Beam Makarov is offline
    MemberRank
    Apr 2010 Join Date
    GothamLocation
    3,622Posts

    Re: FailPHP

    It's called cleaner when classes are used correctly to incorporate html and php. What you do is sloppy and was the basis of this section during the phpRetro days. Of course uberCMS changed all of that. I'm just trying to give you tips but you obviously don't want to listen. Waste of time.

  6. #351
    Account Upgraded | Title Enabled! Predict is offline
    MemberRank
    Aug 2008 Join Date
    760Posts

    Re: FailPHP

    Quote Originally Posted by Makarov View Post
    It's called cleaner when classes are used correctly to incorporate html and php. What you do is sloppy and was the basis of this section during the phpRetro days. Of course uberCMS changed all of that. I'm just trying to give you tips but you obviously don't want to listen. Waste of time.
    Wrong, I have listened to what you and a lot of people have said. In fact I made a post (in previous page) stating that I was working on UberCMS. Here's an updated brief on my notes on what I've done. Oh and these notes are kinda out dated, didn't get round to update them because I was busy.


    #Revision 1
    - Removed magic_quotes from global.php
    - Removed uservoice from head-int.tpl (including defined HIDE_FEEDBACK)
    - Added site_name into class.tpl
    - Updated flash_build to 63_1132
    - Updated web_build to 63_1dc60c6d6ea6e089c6893ab4e0541ee0/863
    - Updated web_build_str to 63-BUILD1132 - 15.02.2012 23:05 - com
    - Removed UberCMS overrides (.tpl)
    - Removed Uber Pedo seal
    Progress: http://i.imgur.com/AbuxY.png

    #Revision 2
    Updated http://images.habbo.com/habboweb/%we.../frontpage.css to http://images.habbo.com/habboweb/%we.../frontpage.css
    Updated head-init.tpl (indenting)
    Updated head-bottom.tpl (removed keywords from meta description)
    Progress: http://i.imgur.com/PV8a3.png

    #Revision 3
    Updated case frontpage on class.tpl
    PHP Code:
                case "frontpage":
                
                    
    $this->AddIncludeFile(new IncludeFile('text/css''%www%/templates/css/frontpage.css''stylesheet'));            
                    break; 
    Updated head-init.tpl
    Updated head-bottom.tpl
    Updated page-fp.tpl
    PHP Code:
    <body>
    <
    div id="site-header">
        <
    form action="%www%/account/submit" method="post">
    %
    login_result%
            <
    div id="site-header-content">
                <
    div id="habbo-logo"></div>
                <
    div id="login-form">
                    <
    div id="login-form-email">
                        <
    label class="login-text">Email</label>
                        <
    input type="text" class="login-field" name="credentials.username" id="login-username" maxlength="48">
                    </
    div>
                    <
    div id="login-form-password">
                        <
    label class="login-text">Password</label>
                        <
    input type="password" class="login-field" name="credentials.password" id="login-password" maxlength="32">
                    </
    div>
                    <
    div id="login-form-submit">
                        <
    input type="submit" id="login-submit-button" value="Login" />
                    </
    div>
                    <
    div id="login-onlinecount">
                        
    0 members online
                    
    </div>
                </
    div>
            </
    div>
        </
    form>
    </
    div>
    <
    div id="fp-container">
        <
    div id="tagline">%site_nameHotel... make friendschillaxget noticed!</div>
        <
    div id="frontpage-image-container">
            <
    div id="frontpage-image">
                <
    a href="register" id="frontpage-image-button"></a>
            </
    div>
        </
    div>
    </
    div>
    </
    body>
    </
    html
    Removed generic->footer from index.php
    Progress: http://i.imgur.com/irznm.png
    Updated index.php
    Progress: http://i.imgur.com/KdZZQ.png
    Removed $_SESSION for cookies in index, core and global
    Deleted security_check
    Recoded register.php and page-register.tpl
    PHP Code:
    <body id="register-background">
    <
    div id="site-header">
            <
    div id="site-header-content">
                <
    div id="habbo-logo"></div>
            </
    div>
    </
    div>
    <
    div id="register-container">
        <
    div id="register-box-container">
                %
    post-result%
            <
    form action="%www%/register/submit" method="post">
                <
    div id="register-box">
                    <
    div id="register-box-header">
                        
    Register at %site-nameHotel
                    
    </div>
                    <
    label class="register-text">Username</label>
                    <
    input type="text" name="bean.avatarName" value="%post-username%" maxlength="16" />
                    <
    label class="register-text">Password</label>
                    <
    input type="password" name="bean.password" value="%post-password%" maxlength="32" />
                    <
    label class="register-text">Re-type password</label>
                    <
    input type="password" name="bean.retypedPassword" maxlength="32"/>
                    <
    label class="register-text">Email</label>
                    <
    input type="text" name="bean.email" value="%post-email%" maxlength="48" />
                    <
    div id="register-box-footer">
                        <
    a href="%www%/register/cancel">Go Back</a>
                        <
    input type="submit" value="" />
                    </
    div>
                </
    div>
            </
    form>
        </
    div>
    </
    div>
    </
    body>
    </
    html
    Progress: http://i43.tinypic.com/dzdqv9.png
    Worked on register.php, again..
    Deleted forgot.php
    Deleted register-key.php
    Deleted register-message.php
    Deleted register-cancel.php
    Updated page-register.tpl
    Deleted login-popup.php
    Deleted page-clientlogin.tpl
    Deleted logout-ok.php
    Updated logout.php
    Deleted uberdown.php
    Deleted page-welcome.tpl
    Deleted welcome.php
    Updated register.php
    Updated me.php
    Progress: http://i41.tinypic.com/adkowk.png

    #Revision 4
    Swapped everything around, it was a pain in the arse.
    Progress: http://i41.tinypic.com/124ho3k.png
    Updated global.php
    Updated class.tpl and removed $tpl->WriteIncludeFiles();
    Deleted useless (not being used) code from class.core.php
    Updated code from class.cron.php
    Updated code from class.db.mysql.php

  7. #352
    Ultra Light Beam Makarov is offline
    MemberRank
    Apr 2010 Join Date
    GothamLocation
    3,622Posts

    Re: FailPHP

    http://forum.ragezone.com/f331/rules...7/#post6810116


    I suggest you go back to your own code, It wasn't that bad.
    Last edited by Makarov; 18-02-12 at 06:09 PM.

  8. #353
    Goin Goin Gone! LHaZze is offline
    MemberRank
    Mar 2011 Join Date
    VirginiaLocation
    695Posts

    Re: FailPHP

    What database would I use for this?

  9. #354
    Ultra Light Beam Makarov is offline
    MemberRank
    Apr 2010 Join Date
    GothamLocation
    3,622Posts

    Re: FailPHP

    Phoenix or Uber..

  10. #355
    Goin Goin Gone! LHaZze is offline
    MemberRank
    Mar 2011 Join Date
    VirginiaLocation
    695Posts

    Re: FailPHP

    I tried Phoenix, It wouldn't work. But I SHALL try again.

    It won't letme make a account lol.

  11. #356
    Enthusiast McHabbo is offline
    MemberRank
    Nov 2011 Join Date
    New JerseyLocation
    43Posts

    Re: FailPHP

    I am loving this Project, Please finish it as soon as possible. If done correctly, this CMS will be the best CMS running. Keep up the Good Work, and Good Luck! :)

  12. #357
    ex visor Aaron is offline
    MemberRank
    May 2007 Join Date
    MichiganLocation
    4,028Posts

    Re: FailPHP

    Any updates?

  13. #358
    Account Upgraded | Title Enabled! Predict is offline
    MemberRank
    Aug 2008 Join Date
    760Posts

    Re: FailPHP

    Don't think I'm planning to update this CMS anytime soon, considering I've released in on page 23?

    Although I have been updating uberCMS (reDev) and it's going pretty good.



    class.homes.php
    PHP Code:
    <?php
    class HomesManager
    {
    public static function 
    HomeExists($id)
    {
    return (
    mysql_num_rows(mysql_query("SELECT null FROM homes WHERE home_id = '".mysql_real_escape_string($id)."' LIMIT 1")) > 0) ? true false;
    }
     
    public static function 
    GetHomeId($id)
    {
    if (!
    HomesManager::HomeExists($id))
    {
    return 
    0;
    }
    else
    {
    return 
    mysql_result(mysql_query("SELECT home_id FROM homes WHERE home_id = '".mysql_real_escape_string($id)."' LIMIT 1"), 0);
    }
    }
     
    public static function 
    CreateHome($id)
    {
    mysql_query("INSERT INTO homes (home_id,allow_display) VALUES ($id,'".mysql_real_escape_string($id)."','1')");
     
    $homeId HomesManager::GetHomeId($id);
    $home HomesManager::GetHome($homeId);
     
    $home->AddItem(494251'profile''w_skin_defaultskin'$id);
     
    return 
    $homeId;
    }
     
    public static function 
    GetHomeDataRow($id)
    {
    return 
    mysql_fetch_assoc(mysql_query("SELECT * FROM homes WHERE home_id = '".mysql_real_escape_string($id)."' LIMIT 1"));
    }
     
    public static function 
    GetHome($id)
    {
    $row HomesManager::GetHomeDataRow($id);
     
    if (
    $row == null)
    {
    return 
    null;
    }
    else
    {
    return new 
    Home($row['home_id']);
    }
    }
     
    public static function 
    DisplayHome($id)
    {
    return 
    mysql_fetch_assoc(mysql_query("SELECT allow_display FROM homes WHERE home_id = '".mysql_real_escape_string($id)."' AND allow_display = '1' LIMIT 1"));
    }
     
    public static function 
    GetUserDataRow($id)
    {
    return 
    mysql_fetch_assoc(mysql_query("SELECT username FROM users WHERE id = '".mysql_real_escape_string($id)."' LIMIT 1"));
    }
     
    public static function 
    BadgesExist($id)
    {
    return  
    mysql_num_rows(mysql_query("SELECT id FROM homes_items WHERE data = 'badges' AND home_id = '".mysql_real_escape_string($id)."' LIMIT 1"));
    }
     
    }
     
    class 
    Home
    {
    public 
    $id 0;
    public 
    $homeId 0;
     
    public function 
    Home($id)
    {
    $this->id $id;
    $this->homeId $id;
    }
     
    public function 
    AddItem($x$y$z$data$skin)
    {
    mysql_query("INSERT INTO homes_items (home_id,x,y,z,data,skin) VALUES ('".mysql_real_escape_string($this->id)."','".mysql_real_escape_string($x)."','".mysql_real_escape_string($y)."','".mysql_real_escape_string($z)."','".mysql_real_escape_string($data)."','".mysql_real_escape_string($skin)."')");
    }
     
    public function 
    GetItems($id false)
    {
    if(
    $id == false)
    {
    $list = Array();
    $query mysql_query("SELECT * FROM homes_items WHERE home_id = '".mysql_real_escape_string($this->id)."' ORDER BY z ASC");
     
    while (
    $row mysql_fetch_assoc($query))
    {
    $list[] = new HomeItem($row['id'], $row['home_id'], $row['data'], $row['skin'], $row['x'], $row['y'], $row['z']);
    }
    }
    else
    {
    $query mysql_query("SELECT * FROM homes_items WHERE id = '".$id."' LIMIT 1");
     
    $row mysql_fetch_assoc($query);
     
    $list = new HomeItem($row['id'], $row['home_id'], $row['data'], $row['skin'], $row['x'], $row['y'], $row['z']);
    }
     
    return 
    $list;
    }
    }
     
    class 
    HomeItem
    {
    public 
    $id 0;
    public 
    $homeId 0;
     
    public 
    $data null;
    public 
    $skin null;
     
    public 
    $x 0;
    public 
    $y 0;
    public 
    $z 0;
     
    public function 
    HomeItem($id$homeId$data$skin$x$y$z)
    {
    $this->id $id;
    $this->homeId $homeId;
    $this->data $data;
    $this->skin $skin;
    $this->$x;
    $this->$y;
    $this->$z;
    }
     
    public function 
    GetHome()
    {
    return 
    HomesManager::GetHome($this->homeId);
    }
     
    public function 
    UpdateItem($skinId$stickieId)
    {
    switch(
    $skinId)
    {
    case 
    1:
    $skin 'defaultskin';
    break;
    case 
    2:
    $skin 'speechbubbleskin';
    break;
    case 
    3:
    $skin 'metalskin';
    break;
    case 
    4:
    $skin 'noteitskin';
    break;
    case 
    5:
    $skin 'notepadskin';
    break;
    case 
    6:
    $skin 'goldenskin';
    break;
    case 
    7:
    $skin 'hc_machineskin';
    break;
    case 
    8:
    $skin 'hc_pillowskin';
    break;
    default:
    $skin 'defaultskin';
    break;
    }
     
    mysql_query("UPDATE homes_items SET skin = '".mysql_real_escape_string($skinId)."' WHERE id = '".mysql_real_escape_string($stickieId)."'");
     
    $query mysql_query("SELECT * from homes_items WHERE id = '".mysql_real_escape_string($stickieId)."'");
    $row mysql_fetch_array($query);
    $list = new HomeItem($row['id'], $row['home_id'], $row['data'], $row['skin'], $row['x'], $row['y'], $row['z']);
     
    return 
    $list->GetHtml();
    }
     
    public function 
    GetHtml()
    {
    switch (
    strtolower($this->data))
    {
    case 
    'profile':
    $widget = new Template('widgets/profile');
     
    $query mysql_query("SELECT username, look, account_created, online FROM users WHERE id = '".$this->GetHome()->homeId."' LIMIT 1");
    $row mysql_fetch_assoc($query);
     
    if (
    $row['online'] == 1)
    {
    $status 'online';
    }
    else
    {
    $status 'offline';
    }
     
    $widget->SetParam('profile''<span class="name-text">'.$row['username'].'</span>
    </div>
    <br class="clear" />
    <img src="http://images.habbo.com/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/879/web-gallery/images/myhabbo/profile/habbo_'
    .$status.'.gif" alt="'.$status.'" />
    <div class="birthday text">
    Created on:
    </div>
    <div class="birthday date">
    '
    .$row['account_created'].'
     
    </div>
    <div>
    </div>
    </div>
    <div class="profile-figure">
    <img src="http://www.habbo.co.uk/habbo-imaging/avatarimage?figure='
    .$row['look'].'&direction=4" alt="'.$row['username'].'" />');
    break;
     
    case 
    'badges':
    $widget = new Template('widgets/badges');
     
    $query mysql_query("SELECT badge_id FROM user_badges WHERE user_id = '".$this->GetHome()->homeId."'");
    while(
    $row mysql_fetch_assoc($query))
    {
    $widget->SetParam('badges''<li style="background-image: url(http://habbo.hs.llnwd.net/c_images/album1584/'.$row['badge_id'].'.gif)"></li>');
    }
    break;
    }
     
    $widget->SetParam('id'$this->id);
    $widget->SetParam('pos-x'$this->x);
    $widget->SetParam('pos-y'$this->y);
    $widget->SetParam('pos-z'$this->z);
    $widget->SetParam('skin'$this->skin);
    $widget->SetParam('edit-home'$this->skin);
     
    if (isset(
    $_SESSION['EditHome']))
    {
    if (
    $_SESSION['EditHome'] == $this->GetHome()->homeId)
    {
    $widget->SetParam('edit-home''<h3>
    <img src="'
    .WWW.'/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/879/web-gallery/images/myhabbo/icon_edit.gif" width="19" height="18" class="edit-button" id="widget-'.$this->id.'-edit" />
    <script type="text/javascript">
    var editButtonCallback = function(e)
    {
    openEditMenu(e, '
    .$this->id.', "widget", "widget-'.$this->id.'-edit");
    };
    Event.observe("widget-'
    .$this->id.'-edit", "click", editButtonCallback);
    Event.observe("widget-'
    .$this->id.'-edit", "editButton:click", editButtonCallback);
    </script>'
    );
    }
    }
    else
    {
    $widget->SetParam('edit-home''<h3>');
    }
     
    return 
    $widget->GetHtml();
    }
    }
    ?>








    Doesn't look like much, but it's a great deal compared to how the original was.

    global.php
    PHP Code:
    <?php
    require_once "templates/class.core.php";
    require_once 
    "templates/class.db.mysql.php";
    require_once 
    "templates/class.cron.php";
    require_once 
    "templates/class.users.php";
    require_once 
    "templates/class.tpl.php";

    $core = new uberCore();
    $cron = new uberCron();
    $users = new uberUsers();
    $tpl = new uberTpl();

    session_start();

    require_once 
    "templates/inc.config.php";
    define('WWW'$config['Site']['www']);

    $db = new mysql($config['mysql']['hostname'], $config['mysql']['username'], $config['mysql']['password'], $config['mysql']['database']);
    $db->Connect();

    $cron->Execute();

    if (isset(
    $_SESSION['UBER_USER_N']) && isset($_SESSION['UBER_USER_H']))
    {    
        if (
    $users->ValidateUser($_SESSION['UBER_USER_N'], $_SESSION['UBER_USER_H']))
        {
            
    define('LOGGED_IN'true);
            
    define('USER_NAME'$_SESSION['UBER_USER_N']);
            
    define('USER_ID'$users->name2id($_SESSION['UBER_USER_N']));
            
    define('USER_HASH'$_SESSION['UBER_USER_H']);
            
            
    $users->CacheUser(USER_ID);
        }
        else
        {
            unset(
    $_SESSION['UBER_USER_N']);
            unset(
    $_SESSION['UBER_USER_H']);
            exit;
        }    
    }
    else
    {
        
    define('LOGGED_IN'false);
        
    define('USER_NAME''Guest');
        
    define('USER_ID', -1);
        
    define('USER_HASH'null);
    }

    define('FORCE_MAINTENANCE', ((uberCore::GetMaintenanceStatus() == "1") ? true false));

    if (
    FORCE_MAINTENANCE && !defined('IN_MAINTENANCE'))
    {
        if (!
    LOGGED_IN || !$users->HasFuse(USER_ID'fuse_ignore_maintenance'))
        {
            
    header("Location: ".WWW."/maintenance/");
            exit;
        }
    }

    if ((!
    defined('BAN_PAGE') || !BAN_PAGE) && ($users->IsIpBanned($_SERVER['REMOTE_ADDR']) || (LOGGED_IN && $users->IsUserBanned(USER_NAME))))
    {
        
    header("Location: ".WWW."/banned/");
        exit;
    }    
    ?>
    Please understand that I'm still developing this, so things will change-over time.

    Oh and if you did read UberCMS "notice"

    Code:
    /*=======================================================================
    | UberCMS - Advanced Website and Content Management System for uberEmu
    | #######################################################################
    | Copyright (c) 2010, Roy 'Meth0d'
    | http://www.meth0d.org
    | #######################################################################
    | This program is free software: you can redistribute it and/or modify
    | it under the terms of the GNU General Public License as published by
    | the Free Software Foundation, either version 3 of the License, or
    | (at your option) any later version.
    | #######################################################################
    | This program is distributed in the hope that it will be useful,
    | but WITHOUT ANY WARRANTY; without even the implied warranty of
    | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    | GNU General Public License for more details.
    \======================================================================*/
    The owner gave me permission to edit it and release it.

  14. #359

    Re: FailPHP

    Quote Originally Posted by Predict View Post
    Don't think I'm planning to update this CMS anytime soon, considering I've released in on page 23?

    Although I have been updating uberCMS (reDev) and it's going pretty good.



    class.homes.php
    PHP Code:
    <?php
    class HomesManager
    {
    public static function 
    HomeExists($id)
    {
    return (
    mysql_num_rows(mysql_query("SELECT null FROM homes WHERE home_id = '".mysql_real_escape_string($id)."' LIMIT 1")) > 0) ? true false;
    }
     
    public static function 
    GetHomeId($id)
    {
    if (!
    HomesManager::HomeExists($id))
    {
    return 
    0;
    }
    else
    {
    return 
    mysql_result(mysql_query("SELECT home_id FROM homes WHERE home_id = '".mysql_real_escape_string($id)."' LIMIT 1"), 0);
    }
    }
     
    public static function 
    CreateHome($id)
    {
    mysql_query("INSERT INTO homes (home_id,allow_display) VALUES ($id,'".mysql_real_escape_string($id)."','1')");
     
    $homeId HomesManager::GetHomeId($id);
    $home HomesManager::GetHome($homeId);
     
    $home->AddItem(494251'profile''w_skin_defaultskin'$id);
     
    return 
    $homeId;
    }
     
    public static function 
    GetHomeDataRow($id)
    {
    return 
    mysql_fetch_assoc(mysql_query("SELECT * FROM homes WHERE home_id = '".mysql_real_escape_string($id)."' LIMIT 1"));
    }
     
    public static function 
    GetHome($id)
    {
    $row HomesManager::GetHomeDataRow($id);
     
    if (
    $row == null)
    {
    return 
    null;
    }
    else
    {
    return new 
    Home($row['home_id']);
    }
    }
     
    public static function 
    DisplayHome($id)
    {
    return 
    mysql_fetch_assoc(mysql_query("SELECT allow_display FROM homes WHERE home_id = '".mysql_real_escape_string($id)."' AND allow_display = '1' LIMIT 1"));
    }
     
    public static function 
    GetUserDataRow($id)
    {
    return 
    mysql_fetch_assoc(mysql_query("SELECT username FROM users WHERE id = '".mysql_real_escape_string($id)."' LIMIT 1"));
    }
     
    public static function 
    BadgesExist($id)
    {
    return  
    mysql_num_rows(mysql_query("SELECT id FROM homes_items WHERE data = 'badges' AND home_id = '".mysql_real_escape_string($id)."' LIMIT 1"));
    }
     
    }
     
    class 
    Home
    {
    public 
    $id 0;
    public 
    $homeId 0;
     
    public function 
    Home($id)
    {
    $this->id $id;
    $this->homeId $id;
    }
     
    public function 
    AddItem($x$y$z$data$skin)
    {
    mysql_query("INSERT INTO homes_items (home_id,x,y,z,data,skin) VALUES ('".mysql_real_escape_string($this->id)."','".mysql_real_escape_string($x)."','".mysql_real_escape_string($y)."','".mysql_real_escape_string($z)."','".mysql_real_escape_string($data)."','".mysql_real_escape_string($skin)."')");
    }
     
    public function 
    GetItems($id false)
    {
    if(
    $id == false)
    {
    $list = Array();
    $query mysql_query("SELECT * FROM homes_items WHERE home_id = '".mysql_real_escape_string($this->id)."' ORDER BY z ASC");
     
    while (
    $row mysql_fetch_assoc($query))
    {
    $list[] = new HomeItem($row['id'], $row['home_id'], $row['data'], $row['skin'], $row['x'], $row['y'], $row['z']);
    }
    }
    else
    {
    $query mysql_query("SELECT * FROM homes_items WHERE id = '".$id."' LIMIT 1");
     
    $row mysql_fetch_assoc($query);
     
    $list = new HomeItem($row['id'], $row['home_id'], $row['data'], $row['skin'], $row['x'], $row['y'], $row['z']);
    }
     
    return 
    $list;
    }
    }
     
    class 
    HomeItem
    {
    public 
    $id 0;
    public 
    $homeId 0;
     
    public 
    $data null;
    public 
    $skin null;
     
    public 
    $x 0;
    public 
    $y 0;
    public 
    $z 0;
     
    public function 
    HomeItem($id$homeId$data$skin$x$y$z)
    {
    $this->id $id;
    $this->homeId $homeId;
    $this->data $data;
    $this->skin $skin;
    $this->$x;
    $this->$y;
    $this->$z;
    }
     
    public function 
    GetHome()
    {
    return 
    HomesManager::GetHome($this->homeId);
    }
     
    public function 
    UpdateItem($skinId$stickieId)
    {
    switch(
    $skinId)
    {
    case 
    1:
    $skin 'defaultskin';
    break;
    case 
    2:
    $skin 'speechbubbleskin';
    break;
    case 
    3:
    $skin 'metalskin';
    break;
    case 
    4:
    $skin 'noteitskin';
    break;
    case 
    5:
    $skin 'notepadskin';
    break;
    case 
    6:
    $skin 'goldenskin';
    break;
    case 
    7:
    $skin 'hc_machineskin';
    break;
    case 
    8:
    $skin 'hc_pillowskin';
    break;
    default:
    $skin 'defaultskin';
    break;
    }
     
    mysql_query("UPDATE homes_items SET skin = '".mysql_real_escape_string($skinId)."' WHERE id = '".mysql_real_escape_string($stickieId)."'");
     
    $query mysql_query("SELECT * from homes_items WHERE id = '".mysql_real_escape_string($stickieId)."'");
    $row mysql_fetch_array($query);
    $list = new HomeItem($row['id'], $row['home_id'], $row['data'], $row['skin'], $row['x'], $row['y'], $row['z']);
     
    return 
    $list->GetHtml();
    }
     
    public function 
    GetHtml()
    {
    switch (
    strtolower($this->data))
    {
    case 
    'profile':
    $widget = new Template('widgets/profile');
     
    $query mysql_query("SELECT username, look, account_created, online FROM users WHERE id = '".$this->GetHome()->homeId."' LIMIT 1");
    $row mysql_fetch_assoc($query);
     
    if (
    $row['online'] == 1)
    {
    $status 'online';
    }
    else
    {
    $status 'offline';
    }
     
    $widget->SetParam('profile''<span class="name-text">'.$row['username'].'</span>
    </div>
    <br class="clear" />
    <img src="http://images.habbo.com/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/879/web-gallery/images/myhabbo/profile/habbo_'
    .$status.'.gif" alt="'.$status.'" />
    <div class="birthday text">
    Created on:
    </div>
    <div class="birthday date">
    '
    .$row['account_created'].'
     
    </div>
    <div>
    </div>
    </div>
    <div class="profile-figure">
    <img src="http://www.habbo.co.uk/habbo-imaging/avatarimage?figure='
    .$row['look'].'&direction=4" alt="'.$row['username'].'" />');
    break;
     
    case 
    'badges':
    $widget = new Template('widgets/badges');
     
    $query mysql_query("SELECT badge_id FROM user_badges WHERE user_id = '".$this->GetHome()->homeId."'");
    while(
    $row mysql_fetch_assoc($query))
    {
    $widget->SetParam('badges''<li style="background-image: url(http://habbo.hs.llnwd.net/c_images/album1584/'.$row['badge_id'].'.gif)"></li>');
    }
    break;
    }
     
    $widget->SetParam('id'$this->id);
    $widget->SetParam('pos-x'$this->x);
    $widget->SetParam('pos-y'$this->y);
    $widget->SetParam('pos-z'$this->z);
    $widget->SetParam('skin'$this->skin);
    $widget->SetParam('edit-home'$this->skin);
     
    if (isset(
    $_SESSION['EditHome']))
    {
    if (
    $_SESSION['EditHome'] == $this->GetHome()->homeId)
    {
    $widget->SetParam('edit-home''<h3>
    <img src="'
    .WWW.'/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/879/web-gallery/images/myhabbo/icon_edit.gif" width="19" height="18" class="edit-button" id="widget-'.$this->id.'-edit" />
    <script type="text/javascript">
    var editButtonCallback = function(e)
    {
    openEditMenu(e, '
    .$this->id.', "widget", "widget-'.$this->id.'-edit");
    };
    Event.observe("widget-'
    .$this->id.'-edit", "click", editButtonCallback);
    Event.observe("widget-'
    .$this->id.'-edit", "editButton:click", editButtonCallback);
    </script>'
    );
    }
    }
    else
    {
    $widget->SetParam('edit-home''<h3>');
    }
     
    return 
    $widget->GetHtml();
    }
    }
    ?>








    Doesn't look like much, but it's a great deal compared to how the original was.

    global.php
    PHP Code:
    <?php
    require_once "templates/class.core.php";
    require_once 
    "templates/class.db.mysql.php";
    require_once 
    "templates/class.cron.php";
    require_once 
    "templates/class.users.php";
    require_once 
    "templates/class.tpl.php";

    $core = new uberCore();
    $cron = new uberCron();
    $users = new uberUsers();
    $tpl = new uberTpl();

    session_start();

    require_once 
    "templates/inc.config.php";
    define('WWW'$config['Site']['www']);

    $db = new mysql($config['mysql']['hostname'], $config['mysql']['username'], $config['mysql']['password'], $config['mysql']['database']);
    $db->Connect();

    $cron->Execute();

    if (isset(
    $_SESSION['UBER_USER_N']) && isset($_SESSION['UBER_USER_H']))
    {    
        if (
    $users->ValidateUser($_SESSION['UBER_USER_N'], $_SESSION['UBER_USER_H']))
        {
            
    define('LOGGED_IN'true);
            
    define('USER_NAME'$_SESSION['UBER_USER_N']);
            
    define('USER_ID'$users->name2id($_SESSION['UBER_USER_N']));
            
    define('USER_HASH'$_SESSION['UBER_USER_H']);
            
            
    $users->CacheUser(USER_ID);
        }
        else
        {
            unset(
    $_SESSION['UBER_USER_N']);
            unset(
    $_SESSION['UBER_USER_H']);
            exit;
        }    
    }
    else
    {
        
    define('LOGGED_IN'false);
        
    define('USER_NAME''Guest');
        
    define('USER_ID', -1);
        
    define('USER_HASH'null);
    }

    define('FORCE_MAINTENANCE', ((uberCore::GetMaintenanceStatus() == "1") ? true false));

    if (
    FORCE_MAINTENANCE && !defined('IN_MAINTENANCE'))
    {
        if (!
    LOGGED_IN || !$users->HasFuse(USER_ID'fuse_ignore_maintenance'))
        {
            
    header("Location: ".WWW."/maintenance/");
            exit;
        }
    }

    if ((!
    defined('BAN_PAGE') || !BAN_PAGE) && ($users->IsIpBanned($_SERVER['REMOTE_ADDR']) || (LOGGED_IN && $users->IsUserBanned(USER_NAME))))
    {
        
    header("Location: ".WWW."/banned/");
        exit;
    }    
    ?>
    Please understand that I'm still developing this, so things will change-over time.

    Oh and if you did read UberCMS "notice"

    Code:
    /*=======================================================================
    | UberCMS - Advanced Website and Content Management System for uberEmu
    | #######################################################################
    | Copyright (c) 2010, Roy 'Meth0d'
    | http://www.meth0d.org
    | #######################################################################
    | This program is free software: you can redistribute it and/or modify
    | it under the terms of the GNU General Public License as published by
    | the Free Software Foundation, either version 3 of the License, or
    | (at your option) any later version.
    | #######################################################################
    | This program is distributed in the hope that it will be useful,
    | but WITHOUT ANY WARRANTY; without even the implied warranty of
    | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    | GNU General Public License for more details.
    \======================================================================*/
    The owner gave me permission to edit it and release it.
    Like youre developing!



Advertisement