[DEV] InsanityCMS - v1.0 [MySQLi | PHP | SQL]

Status
Not open for further replies.

Stormy

Member
Apr 11, 2013
69
11
Hello guys!

A few days ago I started making a simple CMS, you can expand it later yourself if you wish.

Let's start with the screenshots:

Index (login and register):
Myaccount:
Administrator dashboard:

The project is not finished yet. When it is finished it'll be released for everyone!

Snippets:

PHP:
<?php
/*
* _____                       _ _        
*|_   _|                     (_) |       
*  | |  _ __  ___  __ _ _ __  _| |_ _   _
*  | | | '_ \/ __|/ _` | '_ \| | __| | | |
* _| |_| | | \__ \ (_| | | | | | |_| |_| |
* _____|_| |_|___/\__,_|_| |_|_|\__|\__, |
*                                   __/ |
*                                  |___/
* ----------------------------------------------------
* InsanityCMS a simple homemade CMS by Stormy aka Rob!
* -----------------------------------------------------
* Copyright © Rob 2014
* -----------------------------------------------------
* Version: 1
* -----------------------------------------------------
*/
session_start();

//Database connection //
$host = "localhost"; // Your host //
$user = "root"; // Your database user //
$pass = ""; // Your database password //
$db = "db"; // Your database name //

$connect = new mysqli($host, $user, $pass, $db);
if ($connect->connect_errno) {
    echo "Failed to connect to MySQL: (" . $connect->connect_errno . ") " . $connect->connect_error;
}

// website settings //
$version = "1.0";
$url = "http://localhost";
$sitename = "InsanityCMS";
$maintenance = false;
$welcomemessage = true;
$importantnotice = true;
$admindashboardmessage = true;
?>

PHP:
if(isset($_SESSION['name'])) {
    $settings = $connect->query("SELECT * FROM users WHERE username='".$_SESSION["name"]."'");
    $row = mysqli_fetch_assoc($settings);
    $motto = $row['motto'];
    $coins = $row['coins'];
    $email = $row['email'];
    $rank =  $row['rank'];
    $pf_description = $row['profile_description'];
} else {
    echo "";
}

if(isset($_POST["update"])) {
    $motto1 = $connect->real_escape_string($_POST["motto"]);
    $email1 = $connect->real_escape_string($_POST["email"]);
    $update = $connect->query("UPDATE users SET motto WHERE username='".$_SESSION["name"]."', motto= '".$motto1."', email= '".$email1."' ");
}

Greetings me!
 

Doge

Active Member
Jan 12, 2012
174
40
Hopefully you'll translate it. Don't like the badges idea:- make that a plugin maybe?
Hopefully this InsanityCMS will make me go insane when (if) I download it.
 

Markshall

Русский Стандарт
Contributor
Dec 18, 2010
2,638
2,393
At this point I can't make out whether this is just a normal CMS or a Habbo retro CMS, so I will keep it in this section until it is clearer as to what it is.

Looks good, however -- DevBest is an English speaking forum, so please either change the main language to English, or add a language changer that supports English.
 

Doge

Active Member
Jan 12, 2012
174
40
At this point I can't make out whether this is just a normal CMS or a Habbo retro CMS, so I will keep it in this section until it is clearer as to what it is.

Looks good, however -- DevBest is an English speaking forum, so please either change the main language to English, or add a language changer that supports English.
Motto and Coins. Must be a copy of Wordpress.

lelelelell
 

Vanish

Rising Java Developer
Dec 8, 2013
630
94
At this point I can't make out whether this is just a normal CMS or a Habbo retro CMS, so I will keep it in this section until it is clearer as to what it is.

Looks good, however -- DevBest is an English speaking forum, so please either change the main language to English, or add a language changer that supports English.
Considering the snippet has some habbo related crap. it's obviously a habbo cms.
Code:
if(isset($_SESSION['name'])) {
    $settings = $connect->query("SELECT * FROM users WHERE username='".$_SESSION["name"]."'");
    $row = mysqli_fetch_assoc($settings);
    $motto = $row['motto'];
    $coins = $row['coins'];
    $email = $row['email'];
    $rank =  $row['rank'];
    $pf_description = $row['profile_description'];
} else {
    echo "";
}

if(isset($_POST["update"])) {
    $motto1 = $connect->real_escape_string($_POST["motto"]);
    $email1 = $connect->real_escape_string($_POST["email"]);
    $update = $connect->query("UPDATE users SET motto WHERE username='".$_SESSION["name"]."', motto= '".$motto1."', email= '".$email1."' ");
}
 

Markshall

Русский Стандарт
Contributor
Dec 18, 2010
2,638
2,393
Motto and Coins. Must be a copy of Wordpress.

lelelelell

Considering the snippet has some habbo related crap. it's obviously a habbo cms.
Code:
if(isset($_SESSION['name'])) {
    $settings = $connect->query("SELECT * FROM users WHERE username='".$_SESSION["name"]."'");
    $row = mysqli_fetch_assoc($settings);
    $motto = $row['motto'];
    $coins = $row['coins'];
    $email = $row['email'];
    $rank =  $row['rank'];
    $pf_description = $row['profile_description'];
} else {
    echo "";
}

if(isset($_POST["update"])) {
    $motto1 = $connect->real_escape_string($_POST["motto"]);
    $email1 = $connect->real_escape_string($_POST["email"]);
    $update = $connect->query("UPDATE users SET motto WHERE username='".$_SESSION["name"]."', motto= '".$motto1."', email= '".$email1."' ");
}

Doesn't necessarily mean it's Habbo you pair of fucking idiots.
 

Stormy

Member
Apr 11, 2013
69
11
This is not a CMS Habbo! With the coins you can buy badges (this will become a plug-in).
Additionally, you can choose the language: Dutch and English (not finished yet)

Admin panel screens:


not finished yet
 

GarettM

Posting Freak
Aug 5, 2010
833
136
Considering the snippet has some habbo related crap. it's obviously a habbo cms.
Code:
if(isset($_SESSION['name'])) {
    $settings = $connect->query("SELECT * FROM users WHERE username='".$_SESSION["name"]."'");
    $row = mysqli_fetch_assoc($settings);
    $motto = $row['motto'];
    $coins = $row['coins'];
    $email = $row['email'];
    $rank =  $row['rank'];
    $pf_description = $row['profile_description'];
} else {
    echo "";
}

if(isset($_POST["update"])) {
    $motto1 = $connect->real_escape_string($_POST["motto"]);
    $email1 = $connect->real_escape_string($_POST["email"]);
    $update = $connect->query("UPDATE users SET motto WHERE username='".$_SESSION["name"]."', motto= '".$motto1."', email= '".$email1."' ");
}
I use the stripped Habbo Phoenix SQL file for the base of my projects, does not mean its HabboCMS. I do this because i am familiar with the sql structure ;)
 

Doge

Active Member
Jan 12, 2012
174
40
Seems like you're going to get a few downloads from those that think it's a Habbo CMS then. Good luck with this.
 

Stormy

Member
Apr 11, 2013
69
11
I use the stripped Habbo Phoenix SQL file for the base of my projects, does not mean its HabboCMS. I do this because i am familiar with the sql structure ;)
Okay.

Users page finished:
 
Last edited by a moderator:

Weasel

👄 I'd intercept me
Nov 25, 2011
4,135
2,461
Alright, as there aren't that much snippets I can't really give any feedback on the backend of the CMS, though there are some things, such as the following:
PHP:
} else {
 echo "";
}
For some reason, if the username session is not set, you do a else echo nothing? It's unneeded code.

PHP:
$update = $connect->query("UPDATE users SET motto WHERE username='".$_SESSION["name"]."', motto= '".$motto1."', email= '".$email1."' ");
As far as I know... this shouldn't work. It should be something like SET `motto` = '".$motto1."' WHERE `username` = '".$_SESSION["name"]."' - and I'm also not really sure why you send along the email POST if there is no sign of updating it.

I'm sure there are more things, but because there is not a current dev build released there's not much else I can say about the code. Some thing I saw on a screenshot, it looks like you have a special page to delete the news. Why not make a news overview, and put the "Edit" and "Delete" links there together.

Anyways - good luck with developing.
 

Stormy

Member
Apr 11, 2013
69
11
Alright, as there aren't that much snippets I can't really give any feedback on the backend of the CMS, though there are some things, such as the following:
PHP:
} else {
echo "";
}
For some reason, if the username session is not set, you do a else echo nothing? It's unneeded code.

PHP:
$update = $connect->query("UPDATE users SET motto WHERE username='".$_SESSION["name"]."', motto= '".$motto1."', email= '".$email1."' ");
As far as I know... this shouldn't work. It should be something like SET `motto` = '".$motto1."' WHERE `username` = '".$_SESSION["name"]."' - and I'm also not really sure why you send along the email POST if there is no sign of updating it.

I'm sure there are more things, but because there is not a current dev build released there's not much else I can say about the code. Some thing I saw on a screenshot, it looks like you have a special page to delete the news. Why not make a news overview, and put the "Edit" and "Delete" links there together.

Anyways - good luck with developing.
Thank you. And some unnecessary codes are improved.
 
Status
Not open for further replies.

Users who are viewing this thread

Top