Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Project H - A bit of the past! [PHP, MySQLi, APC, WinCache]

Status
Not open for further replies.
"(still lacks brains)"
Loyal Member
Joined
Sep 2, 2011
Messages
2,371
Reaction score
1,361
Project H - A bit of the past! [PHP, MySQLi, APC, WinCache, Multilingual]

MAnuGa0 - Project H - A bit of the past! [PHP, MySQLi, APC, WinCache] - RaGEZONE Forums



What is Project H?
Project H is an advanced Habbo content management system built upon an older version of Project Baal. The goal of this project is to bring back the old Habbo design but remain up to date with the current release of Habbo. Project H is going to be released completely open source for anyone to make modifications to, however I request that the original copyright be remained intact but feel free to add yourself to the contributors list. Throughout the development cycle there will be a live test, link(s) will be posted in the future, the live test will also allow people to access the client so it's not just a website viewing. Project H is built upon an older source of Project Baal's CMS from around October 2011 that TheJacob and I worked on. I have been working on this project, slowly and on and off for about a month now and I thought it would be time to post a thread about it.

On a side note, some of the code in Project H may be out dated due to when Project Baal was released, around about 2012, this will be updated in patches that shall be released. Also, on some of the screenshots features may not be enabled at the time of taking them so it may not show the features you are looking for. If you have any requests for features then feel free to reply to the thread.

This will also, hopefully, be my final release in the Habbo section - I'll still roam around and post occasionally but that's about it. Once this is released, I'll release patches and updates for it but there will be no more projects from me.

Current Features
The list below are features that have been coded and completed. This list will always be kept up to date.

Green - Completed
Orange - In progress
Red - Planned

Frontpage
Quick-register
Hot campaign
Hot rooms
News items
News comments
Account settings


  • Modify motto
  • Enable friend requests
  • Disable friend requests
  • Change online status
  • Change your trading settings
  • Change who can follow you
  • Change your password
  • Change your email
  • Friend Management
Habbo Club / VIP
Community
Random Habbos
Staff
Badge shop
Client access
FAQ / Help
Installation system
Homes
Social
Article likes
Groups
Privacy Policy
Terms of Service
Contact Us
Error page
Habbo Way
Safety Tips

Minimail
Maintenance

Different Languages

  • Norwegian
  • English
  • Dutch
  • Brazilian
  • Swedish
  • Finnish
  • French
  • German
  • Spanish
Administration
  • Post a news item
  • Ban a user
  • Submit an issue
  • Check for an update
  • Standalone package

Note: The Administrative panel will be locked to people rank 6 or above, this can also be user defined - meaning the Hotel owner can choose.

Updating to the latest theme
Updating to the latest theme will be done nearer the end of the development process, it will be a completely separate theme (yes, it has a multi-theme selection feature). Pretty much right at the end once most, if not all, features have been completed.

Credits / Contributors
TheJacob
Joopie

FAQ
Some questions I have recently been asked, decided to put this here to clear things up with people wondering - and to stop people bugging me.

Q: When will Project H be released?
A: Quite a while from now, I estimate probably about a month or two since there are currently still a lot of features missing and I need to document, organise and make sure it is safe to use.

Q: Will it be completely bug free upon release?
A: Of course not, you try and find a CMS which is completely bug free. There are thousands of lines of code powering Project H making it what it is. I'll work my butt off trying to make sure the bugs are minimal however.

Q: What languages will it be available in?
A: Hopefully about 9 different languages to choose from; ranging from English all the way to Finnish.

Q: How many different styles will there be available?
A: As many as the community would like since it's up to them to use their creativity. Upon release there will only be Habbo 2011 style available, I shall be working on the 2014/15 version though.

Screenshots / Code previews

Here is 229 lines out of 1204 lines of the template system:

Code:
[COLOR=#000000]    /*[/COLOR]     * 
     * Public Function buildFact.
     * 
     * Builds the did you know fact HTML from the database.
     * 
     * @[I][B][URL="http://forum.ragezone.com/members/850422.html"]return[/URL][/B][/I]:     $result     string      Fact HTML.
     * 
     */
    final public function buildFact()
    {
        global $ir;
        
        $result = null;
        
        $query = $ir->db->executeQuery("SELECT f.fact
                                            FROM " . TABLE_PREFIX . "facts f
                                            ORDER BY RAND() ASC;");
        
        if ($ir->db->numRows($query) > 0)
        {
            $result = $ir->db->fetchObject($query)->fact;
        }
        
        return $result;
    }
    
    /*
     * 
     * Public Function buildTopNavigation.
     * 
     * Builds the top navigation HTML from the database.
     * 
     * @[I][B][URL="http://forum.ragezone.com/members/850422.html"]return[/URL][/B][/I]:     $result     string      Top navigation HTML.
     * 
     */
    final public function buildTopNavigation()
    {
        global $ir;
        
        $result = '';
        
        $query = $ir->db->executeQuery("SELECT n.id AS id, n.name AS name, n.url AS url
                                            FROM " . TABLE_PREFIX . "navigation n
                                            WHERE n.type = '1'
                                                AND n.rank <= '{$ir->habbo->getField('rank', H_USER)}'
                                            ORDER BY n.order_number ASC;");
        
        if ($ir->db->numRows($query) > 0)
        {
            while ($row = $ir->db->fetchObject($query))
            {
                if ($row->id == THIS_PARENT_ID)
                {   
                    $result .= '<li class="metab selected">
                                    <strong>' . $row->name . '</strong>
                                    <span></span>
                                </li>';
                }
                elseif ($row->id == 1)
                {
                    $result .= '<li class="metab">
                                    <a href="' . SITE_URL . $row->url . '">' . $row->name . '</a>
                                    <span></span>
                                </li>';
                }
                else
                {
                    $result .= '<li>
                                    <a href="' . SITE_URL . $row->url . '">' . $row->name . '</a>
                                    <span></span>
                                </li>';
                }
            }
        }
        
        return $result;
    }
    
    /*
     * 
     * Public Function buildSubNavigation.
     * 
     * Builds the sub navigation HTML from the database.
     * 
     * @[I][B][URL="http://forum.ragezone.com/members/850422.html"]return[/URL][/B][/I]:     $result     string      Sub navigation HTML.
     * 
     */
    final public function buildSubNavigation()
    {
        global $ir;
        
        $result = '';
        
        $query = $ir->db->executeQuery("SELECT n.id AS id, n.name AS name, n.url AS url, n.new AS new
                                            FROM " . TABLE_PREFIX . "navigation n
                                            WHERE n.parent_id = '" . THIS_PARENT_ID . "'
                                                AND n.type = '2'
                                                AND n.rank <= '{$ir->habbo->getField('rank', H_USER)}'
                                            ORDER BY n.order_number ASC;");
        
        if (($count = $ir->db->numRows($query)) > 0)
        {
            $loopcount = 1;
            
            while ($row = $ir->db->fetchObject($query))
            {
                if ($row->id == THIS_SUB_ID)
                {
                    if ($count == $loopcount)
                    {
                        $result .= '<li class="selected last">
                                        ' . $row->name . '
                                    </li>';
                    }
                    else
                    {
                        $result .= '<li class="selected">
                                        ' . $row->name . '
                                    </li>';
                    }
                }
                elseif ($count == $loopcount)
                {
                    $result .= '<li class="last">
                                    <a href="' . SITE_URL . $row->url . '">' . $row->name . '</a>' . (($row->new == 0) ? '' : ' <span style="float: right; color: red; font-size: 8px;">  new</span>') . '
                                </li>';
                }
                else
                {
                    $result .= '<li>
                                    <a href="' . SITE_URL . $row->url . '">' . $row->name . '</a>' . (($row->new == 0) ? '' : ' <span style="float: right; color: red; font-size: 8px;">  new</span>') . '
                                </li>';
                }
                
                $loopcount++;
            }
        }
        
        return $result;
    }
    
    /*
     * 
     * Public Function buildEvents.
     * 
     * Builds the events HTML from the database.
     * 
     * @[I][B][URL="http://forum.ragezone.com/members/850422.html"]return[/URL][/B][/I]:     $result     string      Events HTML.
     * 
     */
    final public function buildEvents()
    {
        global $ir;
        
        $result = '';
        
        $result = '<li class="small" id="feed-hc-reminder">This feature is currently disabled.</li>';
        
        return $result;
    }
    
    /*
     * 
     * Public Function buildImageSelect.
     * 
     * Builds the image select HTML from the database.
     * 
     * @[I][B][URL="http://forum.ragezone.com/members/850422.html"]return[/URL][/B][/I]:     $result     string      Image Select HTML.
     * 
     * @[I][B][URL="http://forum.ragezone.com/members/6887.html"]Tod[/URL][/B][/I]o: take out the caching and use the handler object.
     * 
     */
    final public function buildImageSelect()
    {
        global $ir;
        
        $result = '';
        $spath = CWD . '/images/top_stories/';
        $wpath = SITE_URL . '/images/top_stories/';
        
        $result .= '<select name="n.image_url">';
        
        if ($ir->cache->existsCache('ts_Images') == false)
        {
            $folder = opendir($spath);

            $pic_types = array('gif', 'png');

            $index = array();

            while ($file = readdir($folder))
            {
                if (in_array(substr(strtolower($file), strrpos($file, '.') + 1), $pic_types) == true)
                {
                    array_push($index, $file);
                }
            }

            closedir($folder);
            
            $ir->cache->addCache('ts_Images', $index, 0);
        }
        else
        {
            $index = $ir->cache->fetchCache('ts_Images');
        }
        
        foreach ($index AS $value)
        {
            $result .= '<option value="' . ($wpath . $value) . '">' . $value . '</option>';
        }
        
        $result .= '</select>';
        
        return $result;
    }
    
    /*
     * 
     * Public Function buildHotCampaigns.
     * 
     * Builds the hot campaigns HTML from the database.
     * 
     * @[I][B][URL="http://forum.ragezone.com/members/2000120221.html"]Par[/URL][/B][/I]am:      $max        int         Maximum number of results to return.
     * 
     * @[I][B][URL="http://forum.ragezone.com/members/850422.html"]return[/URL][/B][/I]:     $result     string      Hot campaigns HTML.
     *  [COLOR=#000000]     */[/COLOR]


4ifMRUz - Project H - A bit of the past! [PHP, MySQLi, APC, WinCache] - RaGEZONE Forums

vDn59MQ - Project H - A bit of the past! [PHP, MySQLi, APC, WinCache] - RaGEZONE Forums


MnuYXu4 - Project H - A bit of the past! [PHP, MySQLi, APC, WinCache] - RaGEZONE Forums


MEYMTCo - Project H - A bit of the past! [PHP, MySQLi, APC, WinCache] - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Last edited:
Experienced Elementalist
Joined
Jun 16, 2010
Messages
249
Reaction score
76
Re: Project H - A bit of the past! [PHP, MySQLi, APC]

Good luck Ash! Reserved for any future comments I may have about your project -- when the source is available.
 
Experienced Elementalist
Joined
May 30, 2013
Messages
288
Reaction score
242
Re: Project H - A bit of the past! [PHP, MySQLi, APC]

>1024 LoC for the template system only?! Two queries for the menu?! Unneeded iterations?! TheJacob as contributor (as if he could 'help', rofl)?! You really don't give a duck about performance and user end perception, do you? or maybe this is truly 'a bit of the past', in which case; job well done.
 
Last edited:
"(still lacks brains)"
Loyal Member
Joined
Sep 2, 2011
Messages
2,371
Reaction score
1,361
Re: Project H - A bit of the past! [PHP, MySQLi, APC]

>1024 LoC for the template system only?! Two queries for the menu?! Unneeded iterations?! TheJacob as contributor (as if he could 'help', rofl)?! You really don't give a duck about performance and user end perception, do you? or maybe this is truly 'a bit of the past', in which case; job well done.

1204*

If I didn't care about the performance why would I be using APC?
 
Experienced Elementalist
Joined
May 30, 2013
Messages
288
Reaction score
242
Re: Project H - A bit of the past! [PHP, MySQLi, APC]

If I didn't care about the performance why would I be using APC?
APC is a runtime plugin for PHP. It makes PHP perform more reasonable. It won't speed up any loops nor queries however, getting rid of unnessecary code does.
 
Junior Spellweaver
Joined
Mar 6, 2012
Messages
102
Reaction score
15
Re: Project H - A bit of the past! [PHP, MySQLi, APC]

Excited to see more. Bring back the "trading is turned on/off" function will you? :)
 
Initiate Mage
Joined
Feb 21, 2015
Messages
2
Reaction score
0
Re: Project H - A bit of the past! [PHP, MySQLi, APC]

Is there any reason as to why you're conflating database queries with 'template' code?
 
"(still lacks brains)"
Loyal Member
Joined
Sep 2, 2011
Messages
2,371
Reaction score
1,361
Re: Project H - A bit of the past! [PHP, MySQLi, APC]

Email changing completed.

b0uAUTb - Project H - A bit of the past! [PHP, MySQLi, APC, WinCache] - RaGEZONE Forums


Is there any reason as to why you're conflating database queries with 'template' code?

The template files (HTML) are stored within the Database (`prjh_templates`) so they can be modified by the Hotel owner within the Administration panel, it's all cached however.



So, I ended up breaking the Random Habbos feature, took me a while to find the cause. Turns out I'm blind. Here is the current Community page, there is more to be added here.

LjmzACD - Project H - A bit of the past! [PHP, MySQLi, APC, WinCache] - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Last edited:

pel

Skilled Illusionist
Joined
Jan 27, 2012
Messages
382
Reaction score
343
Re: Project H - A bit of the past! [PHP, MySQLi, APC]

What is APC?
Are you using a MVC-System?
 
R.I.P Millercent
Loyal Member
Joined
Nov 6, 2012
Messages
2,230
Reaction score
314
Re: Project H - A bit of the past! [PHP, MySQLi, APC]

Few cool features would be bringing back the ability of the server settings via the HK (For instance if using Phoenix, the credits and pixels timer, amount, MOTD message etc etc). Another thing would be making character settings in client a thing as well :eek: I miss those (so you can have multiple avatars and all)
 
"(still lacks brains)"
Loyal Member
Joined
Sep 2, 2011
Messages
2,371
Reaction score
1,361
Re: Project H - A bit of the past! [PHP, MySQLi, APC]

Few cool features would be bringing back the ability of the server settings via the HK (For instance if using Phoenix, the credits and pixels timer, amount, MOTD message etc etc). Another thing would be making character settings in client a thing as well :eek: I miss those (so you can have multiple avatars and all)

I have a list of things for the Administration on my desktop which I made today, on top of that I have a new design in my head for the Administration. I shall update the thread with what I can remember off the top of my head. I'll be sure to add those to the list, I'll make sure everything in the `server_settings` table will be editable via the Administration, these particular settings will be for Rank 7+ by default since it's delicate - however the Hotel owner will be able to adjust this to suit their needs.
 
R.I.P Millercent
Loyal Member
Joined
Nov 6, 2012
Messages
2,230
Reaction score
314
Re: Project H - A bit of the past! [PHP, MySQLi, APC]

I have a list of things for the Administration on my desktop which I made today, on top of that I have a new design in my head for the Administration. I shall update the thread with what I can remember off the top of my head. I'll be sure to add those to the list, I'll make sure everything in the `server_settings` table will be editable via the Administration, these particular settings will be for Rank 7+ by default since it's delicate - however the Hotel owner will be able to adjust this to suit their needs.

Editing what rank has access to what HK page via a page in the HK would also be great! :D:
 
"(still lacks brains)"
Loyal Member
Joined
Sep 2, 2011
Messages
2,371
Reaction score
1,361
Editing what rank has access to what HK page via a page in the HK would also be great! :D:

Funny enough, that was in the paragraph but this Quick Reply glitched and deleted it all so I had to retype it, missed that off. It was already planned. :thumbup:

Forgot to mention, Administrators will be able to set the minimum rank required for each of the navigation pages on the main part of the website. This includes sub-navigation items and main navigation tabs. It is also already in the database.

Type settings
1 = Main navigation
2 = Sub navigation
3 = Hidden

You can also set the order of the tabs so you can display them by choice, along with that set the minimum required rank and the parent IDs. There is also a 'new' feature which looks like this when enabled:

IxGjPa - Project H - A bit of the past! [PHP, MySQLi, APC, WinCache] - RaGEZONE Forums


SdQLDk - Project H - A bit of the past! [PHP, MySQLi, APC, WinCache] - RaGEZONE Forums


Spent a while thinking about this, I think I have decided to make use of Google's Material Design. Found this neat project on GitHub of a guy who put Material Design in Bootstrap so all the elements are easy to use. You can use the link below to check out the design.



Also, I'm fairly ill at the moment so there will be very little progress today. Probably just sit in bed watching anime for a while. Even though it's almost 4pm...

---

Some more screenshots:

yOxQlF5 - Project H - A bit of the past! [PHP, MySQLi, APC, WinCache] - RaGEZONE Forums


y4p9A3Z - Project H - A bit of the past! [PHP, MySQLi, APC, WinCache] - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Last edited by a moderator:
I don't even know
Loyal Member
Joined
Apr 7, 2010
Messages
1,699
Reaction score
420
Re: Project H - A bit of the past! [PHP, MySQLi, APC]

Spent a while thinking about this, I think I have decided to make use of Google's Material Design. Found this neat project on GitHub of a guy who put Material Design in Bootstrap so all the elements are easy to use. You can use the link below to check out the design.


That design lacks a bit of polish, I think KuntaCMS nailed the Material design. There's a bit too much shadow and padding everywhere too be honest.
It's supposed to be a Habbo CMS right? Using Material for Habbo, a site that is/was most frequently visited by 9-14 year old people wouldn't attract a lot of people. If you want to switch designs, you should consider using the new Habbo Beta design :rolleyes:

Offtopic: What kind of anime do you watch? :eek:tt1:
 
"(still lacks brains)"
Loyal Member
Joined
Sep 2, 2011
Messages
2,371
Reaction score
1,361
Re: Project H - A bit of the past! [PHP, MySQLi, APC]

That design lacks a bit of polish, I think KuntaCMS nailed the Material design. There's a bit too much shadow and padding everywhere too be honest.
It's supposed to be a Habbo CMS right? Using Material for Habbo, a site that is/was most frequently visited by 9-14 year old people wouldn't attract a lot of people. If you want to switch designs, you should consider using the new Habbo Beta design :rolleyes:

Offtopic: What kind of anime do you watch? :eek:tt1:

It's only going to be for the Administration side, not the entire website. I was originally planning to release it with the Administration like this - which is still tempting since it's simple. Note; this is an old picture.

kSFouLu - Project H - A bit of the past! [PHP, MySQLi, APC, WinCache] - RaGEZONE Forums


Off-topic: Currently watching Darker than Black. I watch way too much anime. :p
 

Attachments

You must be registered for see attachments list
☮TAKU????
Loyal Member
Joined
Nov 16, 2009
Messages
866
Reaction score
580
Re: Project H - A bit of the past! [PHP, MySQLi, APC]

Why did you decide to use APC when it is deprecated in newer versions of PHP?
 
"(still lacks brains)"
Loyal Member
Joined
Sep 2, 2011
Messages
2,371
Reaction score
1,361
Re: Project H - A bit of the past! [PHP, MySQLi, APC]

Why did you decide to use APC when it is deprecated in newer versions of PHP?

The base project already came with APC, including classes and on some pages. It's a planned change but it's not very important right now and not my main focus since there is WinCache support as well.

---

Made the subnavi smaller, like on the current Habbo website.

Habbo Way:

eciFJMe - Project H - A bit of the past! [PHP, MySQLi, APC, WinCache] - RaGEZONE Forums


---

Found out that the WinCacheManager class wasn't functioning properly, fixed the issue.
 

Attachments

You must be registered for see attachments list
Last edited:
Status
Not open for further replies.
Back
Top