Hey guys,
I have been away from Habbo and retros for a while, but I have decided that I wanted to get back into the development, mainly the PHP side of it.
Last night I decided that I'd create a fully functional CMS that works with flat file servers such as Debbo. I started this project earlier on today and am doing reasonably well. The main aim is to make the server editable via the website and so that you can keep track of things much easier.
Throughout the development I will keep you all up to date with the progress that has been made and will occasionally post download links to what has been done. For now I will leave snippets of what has been done.
I really miss old school, and wish to try and revive the community!
Please note that I am making this to work with Debbo v3.5 flat file and it will come bundled with the final product. No edits to the server have been made.
Current progress:
I am working mostly on the classes at the moment to try and build a strong and secure structure.
Thanks for the interest!
eMagic
I have been away from Habbo and retros for a while, but I have decided that I wanted to get back into the development, mainly the PHP side of it.
Last night I decided that I'd create a fully functional CMS that works with flat file servers such as Debbo. I started this project earlier on today and am doing reasonably well. The main aim is to make the server editable via the website and so that you can keep track of things much easier.
Throughout the development I will keep you all up to date with the progress that has been made and will occasionally post download links to what has been done. For now I will leave snippets of what has been done.
I really miss old school, and wish to try and revive the community!
Catalogue class as it stands:
Database class snippets:
Some user class functions:
Set a certain page to admin only:
PHP:
<?php
class Catalogue{
private $path = '';
function __construct($path){
$this->path = $path;
}
public function getCategories(){
$list = $this->path.'/database/catalogue/';
$categories = array();
foreach (new DirectoryIterator($list) as $file){
if($file->isDot()) continue;
if($file->isDir())
{
$categories[] .= $file->getFilename();
}
}
return $categories;
}
public function hasCategory($cate){
return in_array($cate, $this->getCategories());
}
}
?>
Database class snippets:
PHP:
public function getUsers(){
$list = $this->path.'/database/habbos/';
$users = array();
foreach (new DirectoryIterator($list) as $file){
if($file->isDot()) continue;
if($file->isDir())
{
$users[] .= $file->getFilename();
}
}
return $users;
}
public function getCatalogue(){
return new Catalogue($this->path);
}
PHP:
function giveBadge(string $badge){
if(strlen($badge) <= 3){ // check if it's a badge code, normally 3 characters
$this->badges[] .= $badge; // add badge
$this->saveChanges(); // update the habbo
}
return $this->getBadges(); // we return this, not normally used afterwards though
}
function setRank($rank){
$this->rank = $rank;
$this->saveChanges();
return $this->getRank();
}
function saveChanges(){
$link = $this->path.'/database/habbos/'.$usr.'/'; // get the link to the habbo
file_put_contents($link.'credits.txt', $this->getCredits()); // Open credits and put the new stuff in
file_put_contents($link.'hcdays.txt', $this->getHC()); // same with HC
file_put_contents($link.'rank.txt', $this->getRank()); // same with rank
file_put_contents($link.'mission.txt', $this->getMission()); // same with mission
file_put_contents($link.'badges.txt', implode(';',$this->getBadges())); // same with badges, use implode to stick together in same
//way as the server can read them
}
Set a certain page to admin only:
PHP:
<?php setRank('admin'); ?>
ACP - User List
Navbar can change if user doesn't have rank
Logged in as TestAccount and trying to access ACP directly
ACP - Cata list
You must be registered to see links
Navbar can change if user doesn't have rank
You must be registered to see links
Logged in as TestAccount and trying to access ACP directly
You must be registered to see links
ACP - Cata list
You must be registered to see links
Current progress:
- Database - Started
[*]Catalogue - Started
[*]ACP - Started
[*]User registration - Started
[*]Fetch list of all users - Done
[*]User login to website - Done
[*]Fetch list of all Catalogue categories - Done
[*]Check if user exists - Done
[*]Save user to files after updating - Done
[*]Basic user class - Done
[*]Admin only pages - Done
[*]ACP user list - Done
[*]ACP cata list - Done
I am working mostly on the classes at the moment to try and build a strong and secure structure.
Thanks for the interest!
eMagic
Last edited: