<?php if (!defined('IN_INDEX')) { die(header('location: ../404')); }
class engine {
private $connected;
public $mysqli;
public function Initiate() {}
public function __construct() {
global $core, $config;
if (!$this->connected) {
$this->mysqli = new mysqli($config->mysql->hostname, $config->mysql->username, $config->mysql->password, $config->mysql->database) or exit($core->systemError('MySQLi Engine', 'MySQLi could not connect to host or database'));
$this->connected = true;
}
}
public function disconnect() {
global $core;
if ($this->connected) {
if ($this->mysqli->close()) {
$this->connected = false;
} else {
$core->systemError('MySQLi Engine', 'MySQLi could not disconnect.');
}
}
}
public function secure($var) {
return $this->mysqli->real_escape_string(stripslashes(htmlspecialchars($var)));
}
public function query($sql) {
return $this->mysqli->query($sql) or die($this->mysqli->error);
}
}
?>
How to make your own theme?
Spoiler:
Code:
- enter src/view/views
- create folder
<theme name>
-> admin
-> src
-> css (place your .css files here)
-> js (place your .js files here)
-> img (place your image files here)
-> src
-> css (place your .css files here)
-> js (place your .js files here)
-> img (place your image files here)
-> hotel (needed for client, use the one provided in base theme)
-> hotel.php (used to be client.php, use the one provided in base theme)
-> logout.php (use the one provided in base theme)
- need anything, just grab it from base theme
Credits
- MinCMS -> dimaklt
- RevCMS -> Kryptos
13-07-17
Konquer
Re: MinCMS - The RevCMS Edit you've been waiting for!
Not to whine but.. You took away the two reasons people still use Rev
1. They already know the structure and how to get it up and running easily.
2. The massive amount of out of the box compatible themes it has.
The second being the most important imo.
Adding prepared statements is nice and all, but most of the guys that use rev isn't going to know what that is and how to use it when they add raw php into their views because, hey, that's how rev folks roll.
On a better note, what other plans do you have for it?
13-07-17
dimaklt
Re: MinCMS - The RevCMS Edit you've been waiting for!
Quote:
Originally Posted by Konquer
Not to whine but.. You took away the two reasons people still use Rev
1. They already know the structure and how to get it up and running easily.
2. The massive amount of out of the box compatible themes it has.
The second being the most important imo.
Adding prepared statements is nice and all, but most of the guys that use rev isn't going to know what that is and how to use it when they add raw php into their views because, hey, that's how rev folks roll.
On a better note, what other plans do you have for it?
1. It's easy to set up and I will make some themes for it (Priv like theme for example).
2. Out of the box compatible themes won't really work with Arcturus and RevCMS itself isn't made for the Arcturus database.
I'd like to keep some basics like {hotelname} and add more (if possible).
I thought about Bootstrap, but I don't really like it.
Housekeeping will be the next I work on after I finish user settings and homes in my theme (demo hotel will be available soon).
Suggestions are accepted :)
13-07-17
NoBrain
Re: MinCMS - RevCMS for Arcturus
Just make an entirely new CMS with unique features rather than beating on the dead horse which is RevCMS.
13-07-17
Konquer
Re: MinCMS - The RevCMS Edit you've been waiting for!
Quote:
Originally Posted by dimaklt
I will make some themes for it (Priv like theme for example).
They don't want a few themes, they want all the themes.
If you are going to edit rev, make it unique. Add some new features that makes this cms worth using. Right now you're offering prepared statements for hundreds of themes. Not really a trade most users are going to take.
13-07-17
dimaklt
Re: MinCMS - The RevCMS Edit you've been waiting for!
Quote:
Originally Posted by Konquer
They don't want a few themes, they want all the themes.
If you are going to edit rev, make it unique. Add some new features that makes this cms worth using. Right now you're offering prepared statements for hundreds of themes. Not really a trade most users are going to take.
There are already new features and more to come.
- language system
- clean code
- beautiful urls ~ /home/<username> instead of /index.php?url=home&user=<username>
- more config options
- Arcturus compatibility
- MySQLi
- ..
Most themes I saw were just image edits of habbos old theme with really bad and unsecure code.
Honestly.. I don't like PHP that much. But I wanted to recode Rev for years now. I'm still a beginner with PHP and MySQL.
13-07-17
The General
Re: MinCMS - RevCMS for Arcturus
Stop giving him an hard time. Just appreciate that he is actually trying to contribute in some way. He could have also kept this private and nobody would have known.
He is just trying to learn more about PHP & MySQL (which we should encourage).
14-07-17
Emily
Re: MinCMS - RevCMS for Arcturus
I was excited when I saw the Arcturus CMS part, it went a bit down when I saw it's based on RevCMS. Nonetheless, good luck with your development! Maybe you should go over to a scratch CMS, but if you don't, I still would encourage you to finish it.
Try to be consistent, avoid global variables and use spaces not tabs. Try to comment your code as well, it's good practice and helps even the most experienced developer. Also try to avoid doing the following using if statements:
Try to be consistent, avoid global variables and use spaces not tabs. Try to comment your code as well, it's good practice and helps even the most experienced developer. Also try to avoid doing the following using if statements:
<?php if (!defined('IN_INDEX')) { die(header('location: ../404')); }
class engine {
private $connected;
public $mysqli;
public function Initiate() {}
public function __construct() {
global $core, $config;
if (!$this->connected) {
$this->mysqli = new mysqli($config->mysql->hostname, $config->mysql->username, $config->mysql->password, $config->mysql->database) or exit($core->systemError('MySQLi Engine', 'MySQLi could not connect to host or database'));
$this->connected = true;
}
}
public function disconnect() {
global $core;
if ($this->connected) {
if ($this->mysqli->close()) {
$this->connected = false;
} else {
$core->systemError('MySQLi Engine', 'MySQLi could not disconnect.');
}
}
}
public function secure($var) {
return $this->mysqli->real_escape_string(stripslashes(htmlspecialchars($var)));
}
public function query($sql) {
return $this->mysqli->query($sql) or die($this->mysqli->error);
}
}
?>
How to make your own theme?
Spoiler:
Code:
- enter src/view/views
- create folder
<theme name>
-> admin
-> src
-> css (place your .css files here)
-> js (place your .js files here)
-> img (place your image files here)
-> src
-> css (place your .css files here)
-> js (place your .js files here)
-> img (place your image files here)
-> hotel (needed for client, use the one provided in base theme)
-> hotel.php (used to be client.php, use the one provided in base theme)
-> logout.php (use the one provided in base theme)
- need anything, just grab it from base theme
Credits
- MinCMS -> dimaklt
- RevCMS -> Kryptos
Nice work, good code, i'll check it out! ;)
I have nice themes from Mitchel in HTML & CSS
Take an look, it will be nice if its on the cms
UPDATE
I have fixed that its generate users for the Plus db now
24-07-17
dimaklt
Re: MinCMS - RevCMS for Arcturus
I'll have a look at them and may add one or two :)
27-07-17
ovflowd
Re: MinCMS - RevCMS for Arcturus
I wish good luck to you.
But I need to advise: Add in your opening message that you are a newbie in programming and this is also for learning. This will likely avoid bad criticism.
Also, try to read some PHP guides. I know that someway learning with practice it's the best way. But some of the bad codes found on your CMS are from Rev, and not yours, so it's not fair you receive the guilty of bad code from RevCMS.
The best way of avoiding Global Variables it's creating Factories, or Storages. Likely Factories for Settings and things like that.
Global variables actually on php 5.6+ are "secure", but it's good following new coding patterns to make a equity and clean code.
Good luck.
01-08-17
dimaklt
Re: MinCMS - RevCMS for Arcturus
Quote:
Originally Posted by saamus
I wish good luck to you.
But I need to advise: Add in your opening message that you are a newbie in programming and this is also for learning. This will likely avoid bad criticism.
Also, try to read some PHP guides. I know that someway learning with practice it's the best way. But some of the bad codes found on your CMS are from Rev, and not yours, so it's not fair you receive the guilty of bad code from RevCMS.
The best way of avoiding Global Variables it's creating Factories, or Storages. Likely Factories for Settings and things like that.
Global variables actually on php 5.6+ are "secure", but it's good following new coding patterns to make a equity and clean code.
Good luck.
Thank you.
I made some changes that may be on Github soon.
- no nested ifs in register and login anymore
- small fixes
I decided to pause/stop this project and make my own CMS from scratch. Therefore I will learn PHP or use another language (JavaScript) for it.
01-08-17
NoBrain
Re: MinCMS - RevCMS for Arcturus
Quote:
Originally Posted by dimaklt
Thank you.
I made some changes that may be on Github soon.
- no nested ifs in register and login anymore
- small fixes
I decided to pause/stop this project and make my own CMS from scratch. Therefore I will learn PHP or use another language (JavaScript) for it.
I suggest you learn a proper framework while developing this, for example Laravel or CakePHP 3, rather than writing something from scratch. This will also help you in enterprise workplaces if you ever decide to go down that route in the far future as a career. Learning multiple frameworks is a big plus. You will also realise how clean frameworks can keep things :)