LoadaCMS - Development - Mysqli

Status
Not open for further replies.

Eymen

New Member
Jan 24, 2012
26
7
Loada is a powerful and open-sourced cms(content managment system) that is being developed and executed in
PHP OOP(Object oriented programming), MySQLi, CSS, HTML and JavaScript. And the shortcut to all of that is LoadaCMS.


The main developer of LoadaCMS is me Eymen Plaiterentire. However other developers can be involved in this project.
Developers who continues on developing this project are highly appreciated. Loada has nothing to do with
sulakes habbo swf files or emulator-servers! users are responsible for any illegal acts that breaks
against the copyright law. Loada is being developed for educational purpose and are totally free!
you can allways download the latest version for free, and if you are a developer that continues
developing loada and are planning to sell it, it's all on your responsibility. Im focusing on keeping the code clean and smooth. The configuration file is powerful and you can manage the client settings, defualt values that users should start with etc. Im working on coding the engine.



[UPDATE: more information about this project]

Alright, i've been working on this for 3 days and the reason for the delay, because i promised som more information within the next 24 hours after this thread was posted is because of some stuff i hade to re-code. Im working very hard on the engine and im trying to keep it very clean, smooth and secure.

Features:

new features-

[new] Pin-code // Every user can choose a unique pin-code that they in case of forgetting the password can use their pin code to be able to reset it.

[new (not sure if this allready exist in ubercms though)] - If a user have a rank that is greater than 6 they'll have to enter pin code in order to access the client. The pin code is created by you and will be given to your staff.

if any new feature are developed i'll add them to the list! :)

features that revcms doesn't have ;) :

- Adding tags (doesn't exist in revcms)
- Commenting system (doesn't exist in revcms)
- Awesome houseekeping (seriously, revcms hk sux).
- More stuff that i cant think of right now...

Code snippets will be shown soon!
and again, sorry for my horribe english :(

This project is an exercise, im not doing this just to get attention or trying to be "PRO".

[UPDATE 2013-08-31]:
The engine is well! :)
im currently working on the design. Here comes some images

index:
2a0cpdv.png


Register:

wvolr6.png


Home:
9uosna.png


Code snippets:
PHP:
class inreg{

            public function Create_user(){
      
            include "Configuration/Language.php";
            #här kollar vi till tomma fält
      
            if(isset($_POST['create'])){
      
            if(empty($_POST['username']) or empty($_POST['password']) or empty($_POST['c_password']) or empty($_POST['email'])){
          
                echo "<div class='error'>".$convert['reg_empty']."</div>";
          
            }else{
          
                include "Configuration/Config.php";
          
                $mysqli = new mysqli($localhost,$root,$password,$database);
                $username = $mysqli->real_escape_string(strip_tags($_POST['username']));
                $password = $mysqli->real_escape_string(strip_tags($_POST['password']));
                $email = $mysqli->real_escape_string(strip_tags($_POST['email']));
          
                $check_username = $mysqli->query("SELECT * From users WHERE username='$username'");
                $check_email = $mysqli->query("SELECT * From users WHERE mail='$email'");
          
                if(mysqli_num_rows($check_username) > 0){
                    echo "<div class='error'>".$convert['username_busy']."</div>";
                }elseif(mysqli_num_rows($check_email) > 0){
                    echo "<div class='error'>".$convert['email_busy']."</div>";
                }elseif(strlen($username) > 15){
                    echo "<div class='error'>".$convert['username_long']."</div>";
                }elseif(strlen($username) < 3){
                    echo "<div class='error'>".$convert['username_short']."</div>";
                }elseif(strlen($password) < 6){
                    echo "<div class='error'>".$convert['password_short']."</div>";
                }elseif( preg_match('/\s/',$username)){
                    echo "<div class='error'>".$convert['username_whitespace']."</div>";
                }else{
          
                        if($password == $_POST['c_password']){
                    $password = $mysqli->real_escape_string(strip_tags(md5(sha1($_POST['password']))));
                    $mysqli->query("INSERT INTO users (username,password,mail,activity_points,motto,credits,look) VALUES ('$username','$password','$email','$pixels','$motto','$credits','$look')");
                    $mysqli->query("UPDATE users SET online='1' WHERE username='$username'");
                    $_SESSION['user'] = $username;
                    header("location: home.php");
                    }else{
                        echo "<div class='error'>".$convert['password_nomatch']."</div>";
                    }
                }
          
          
            }
      
            }
            }

            Public function Login_user(){
      
            include "Configuration/Language.php";
      
            include "Configuration/Config.php";
      
      
            If(isset($_POST['login'])){
            #Checking for empty fields
      
            if( empty($_POST['username']) && empty($_POST['password']) ){
          
                echo "<div class='error'>".$convert['error_emptyall']."</div>";
      
            }elseif(empty($_POST['username']) && $_POST['password']){
          
                echo "<div class='error'>".$convert['error_emptyusername']."</div>";
          
            }elseif(empty($_POST['password']) && $_POST['username']){
      
                echo "<div class='error'>".$convert['error_emptypassword']."</div>";
            }else{
      
                $mysqli = new mysqli($localhost,$root,$password,$database);
          
                $username = $mysqli->real_escape_string(htmlspecialchars($_POST['username']));
                $password = $mysqli->real_escape_string(htmlspecialchars(md5(sha1($_POST['password']))));
          
                $catchUser = $mysqli->query("SELECT * From users WHERE username='$username' AND password='$password'");
          
                if(mysqli_num_rows($catchUser) > 0){
          
                    $_SESSION['user'] = $username;
                    $mysqli->query("UPDATE users SET online='1' WHERE username='$username'");
                    header("location: home.php");
              
                    }else{
                        echo "<div class='error'>".$convert['error_incorrect']."</div>";
                    }
            }
      
      
            }
      
            if(isset($_POST['register'])){
      
                if($registration == false){
          
                    echo "<div class='error'>".$convert['register_off']."</div>";
              
                }elseif($registration == true){
                $_SESSION['reg'] = true;
                header("location: register.php");
                }
            }

    }

}

Im currently working on the articles page, commenting are not shown in this image (not done) still working on it.
vy63gy.png


I know the image looks like crap, but thats becuase of the image uploader.

Your opinions and comments makes a change! im listening to everybody :) people wanted me to add some more padding to the buttons and coloring, here you go:
34sp1k1.png


there you got a little image of the "me" page. It looks a bit empty, i haven't added any special functions to it yet as i am working on the housekeeping and articles.


UPDATE image:
About the commenting system:

Administrators will be able to choose how many comments users will be able to comment on each article.
If you set max_comments to 3 for example, then every user has the limit of commenting on that article at 3.
f296s7.png
 
Last edited:

AssLikeThat

Posting Freak
Jan 27, 2013
765
154
Code snippets from the engine wod be nice to see how its all going to work:)

I know you stated that it has nothing to do with serverfiles/swfs from sulake but the image on the index is from sulake no?

goodluck with this!
 

Evian

Helping noobs since 1996
Feb 17, 2012
139
38
If I am correct this is a Habbo development and should be in the Habbo section. Anyway, best of luck.
 

Eymen

New Member
Jan 24, 2012
26
7
Code snippets from the engine wod be nice to see how its all going to work:)

I know you stated that it has nothing to do with serverfiles/swfs from sulake but the image on the index is from sulake no?

goodluck with this!


Yeah thats true, but you are actually able to change the background image. I was talking about the game itself, the swf files and the emulator servers. Sure, code snippets will come up soon :)! it's all object oriented.
 

AssLikeThat

Posting Freak
Jan 27, 2013
765
154
Yeah thats true, but you are actually able to change the background image. I was talking about the game itself, the swf files and the emulator servers. Sure, code snippets will come up soon :)! it's all object oriented.

Ahh right fair enough:) goodluck
 

Sysode

Front-End Developer
Dec 11, 2012
1,673
848
Any further progress, I know its only been two days but you must of done something :p

Anyway, good luck and hopefully this gets completed and not dropped halfway through.
 

Eymen

New Member
Jan 24, 2012
26
7
Any further progress, I know its only been two days but you must of done something :p

Anyway, good luck and hopefully this gets completed and not dropped halfway through.


Im not dropping it, im working on this thing :D but i hope people could just give me some more time.
 

Eymen

New Member
Jan 24, 2012
26
7
Code snippets from the engine wod be nice to see how its all going to work:)

I know you stated that it has nothing to do with serverfiles/swfs from sulake but the image on the index is from sulake no?

goodluck with this!
There you got some code snippets
 

Eymen

New Member
Jan 24, 2012
26
7
  1. Where does '$convert' come from in your error handling thingy...
  2. The design needs a little more phazaz! You should redo the forms, add a bit more padding, etc.

$convert stands for the array that replaces the keys "long_username" etc. To what the user specified in the language file.
Yes indeed, thanks for your opinion, the design is improving :)
 

academic

Member
Nov 17, 2011
31
6
I don't like how you include your configuration files again and again in each function. Surely their is a much better way, also every time you call a method (create user), a new connection is created. That isn't efficient. Create a database class that handles one connection.
 

jayk

Retired Habbotard.
Sep 4, 2013
517
94
From the screenshots, I have a feeling I know what your going to do, I may be wrong.
It looks clean and simple so far.
Any updates on this?
 

academic

Member
Nov 17, 2011
31
6
I shouldn't say what you're doing is wrong. I just believe that you're making something that can be accomplished simply, harder. It looks like you're thinking to much and adding much more difficulty to it, thus creating a bigger problem for yourself in the future.

For instance, your class structure looks problematic and confusing. This is something that you need to pay much attention to, because this is what will cause problems in the future, and you will end up taking a very long time to fix them, however, it's not fixing them that could be a hassle, they may work perfectly, but you may run into performance issues.

In conclusion, your classes should be simple, and contain minimal HTML. I'm not saying that you can't include HTML in PHP functions. But I believe you should try and steer clear of filling them with HTML because, that's not what your functions should consist of. The classes should be simple, and have a definitive purpose and understanding. That's what classes are suppose to do! Be readable and work!
 

Eymen

New Member
Jan 24, 2012
26
7
I shouldn't say what you're doing is wrong. I just believe that you're making something that can be accomplished simply, harder. It looks like you're thinking to much and adding much more difficulty to it, thus creating a bigger problem for yourself in the future.

For instance, your class structure looks problematic and confusing. This is something that you need to pay much attention to, because this is what will cause problems in the future, and you will end up taking a very long time to fix them, however, it's not fixing them that could be a hassle, they may work perfectly, but you may run into performance issues.

In conclusion, your classes should be simple, and contain minimal HTML. I'm not saying that you can't include HTML in PHP functions. But I believe you should try and steer clear of filling them with HTML because, that's not what your functions should consist of. The classes should be simple, and have a definitive purpose and understanding. That's what classes are suppose to do! Be readable and work!

Thank you for this information, this is one of the reasons im working on this project. I want to learn more :) im 15 and ive been working with php in 1.5 years now xD. I have updated the design, filled it with more content and here comes a list on what im going to upload screens on this next 2 days or something, this is what ive been doing after the update 2013-08-31:

- Home/me page > Character images, motto information etc.
- Articles > Working 100%. When ?id is set to a invalid the query just find the latest articel. Rather than just giving an empty news page like in phoenixphp.
- Improved design
- Working client (Editable from the config file now)
- Internet explorer blocked (Designers doesn't have to worry about internet explorer)
- Mozilla firefox design fix

thats all in my mind right now, images coming up soon.
Thanks for the support guys, without your support i would drop this project. But your comments keeps me motivated :)
 
Status
Not open for further replies.

Users who are viewing this thread

Top