[Official BrainCMS] 1.4.0

Status
Not open for further replies.

Sly

I don't break the rules I bend them.
Oct 28, 2016
246
38
Best CMS in the world, and it will overtake RevCMS
 

Sly

I don't break the rules I bend them.
Oct 28, 2016
246
38
I just have one problem with forget.php, whenever I enter my email address to reset it, it doesnt send anything to my email, why
 

MayoMayn

BestDev
Oct 18, 2016
1,423
683
I just have one problem with forget.php, whenever I enter my email address to reset it, it doesnt send anything to my email, why
You have to setup a SMTP server, otherwise you cannot send emails. This you would have to contact your server support for enabling it.
If you want your server to receive emails too, you'd have to setup a POP3 server also.



Sent from my SM-G928F using Tapatalk
 

BrainCMS

Brain is live, Live is Brain
Feb 17, 2014
86
32
You have to setup a SMTP server, otherwise you cannot send emails. This you would have to contact your server support for enabling it.
If you want your server to receive emails too, you'd have to setup a POP3 server also.



Sent from my SM-G928F using Tapatalk
And for gmail enable in your account Allow less secure apps
 

BrainCMS

Brain is live, Live is Brain
Feb 17, 2014
86
32

CMS works now on Arcturus DB/EMU

Set in the config
Code:
    /* Emu Settings */
    $config['hotelEmu'] = 'plusemu'; // plusemu // arcturus
 

Weasel

👄 I'd intercept me
Nov 25, 2011
4,135
2,461
Sorry, but this code is really bad. For example, mixing lowerCamelCasing with UpperCamelCasing, mixing English functions names (errors) and Dutch functions names ("gelukt"). Besides that, it just looks horrible. Take a look at php-fig.org - I beg you.
 

MayoMayn

BestDev
Oct 18, 2016
1,423
683
Sorry, but this code is really bad. For example, mixing lowerCamelCasing with UpperCamelCasing, mixing English functions names (errors) and Dutch functions names ("gelukt"). Besides that, it just looks horrible. Take a look at php-fig.org - I beg you.
Have a look inside class.db.php, the db connection is made outside the class, instead of just making it as a __construct function inside?
Here's my example for what I use in my CMS:
PHP:
if(!defined('IN_INDEX')) { exit(http_response_code(403)); };
class mysql {
    public $db;
    public $pdo;
    private static $inst;

    final public function __construct() {
        global $_CONFIG;
        try {
            $this->pdo = new PDO(
                'mysql:dbname='.$_CONFIG['mysql']['database'].';host='.$_CONFIG['mysql']['hostname'].';charset='.$_CONFIG['mysql']['charset'],
                $_CONFIG['mysql']['username'],
                $_CONFIG['mysql']['password']
            );
            $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
            $this->pdo->exec("SET `time_zone` = '{$this->timeZone()}';");
        } catch(PDOException $e) {
            die($e->getMessage());
        }
    }

    final public function __destruct() {
        // Destruct the connection to DB once finished
        try {
            $this->pdo = null;
        } catch(PDOException $e) {
            die($e->getMessage());
        }
    }

    final public static function PDO() {
        if(!isset(self::$inst)) {
            $class = __CLASS__;
            self::$inst = new $class;
        }
        return self::$inst;
    }

    final public function query($sql) {
        $conn = $this->PDO();
        return $conn->pdo->prepare($sql);
    }

    final public function lastId() {
        return $this->pdo->lastInsertId();
    }

    final public function timeZone() {
        if(!isset($_SESSION['user']['time_zone'])) {
            $now = new \DateTime();
            $mins = $now->getOffset() / 60;

            $sgn = ($mins < 0 ? -1 : 1);
            $mins = abs($mins);
            $hrs = floor($mins / 60);
            $mins -= ($hrs * 60);

            $_SESSION['user']['time_zone'] = sprintf('%+d:%02d', ($hrs * $sgn), $mins);
        }

        return $_SESSION['user']['time_zone'];
    }

}
 

BrainCMS

Brain is live, Live is Brain
Feb 17, 2014
86
32
Sorry, but this code is really bad. For example, mixing lowerCamelCasing with UpperCamelCasing, mixing English functions names (errors) and Dutch functions names ("gelukt"). Besides that, it just looks horrible. Take a look at php-fig.org - I beg you.
Thanks for your message! I made this CMS to learn from it. Can you give an example how I can improve it?
 
Have a look inside class.db.php, the db connection is made outside the class, instead of just making it as a __construct function inside?
Here's my example for what I use in my CMS:
PHP:
if(!defined('IN_INDEX')) { exit(http_response_code(403)); };
class mysql {
    public $db;
    public $pdo;
    private static $inst;

    final public function __construct() {
        global $_CONFIG;
        try {
            $this->pdo = new PDO(
                'mysql:dbname='.$_CONFIG['mysql']['database'].';host='.$_CONFIG['mysql']['hostname'].';charset='.$_CONFIG['mysql']['charset'],
                $_CONFIG['mysql']['username'],
                $_CONFIG['mysql']['password']
            );
            $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
            $this->pdo->exec("SET `time_zone` = '{$this->timeZone()}';");
        } catch(PDOException $e) {
            die($e->getMessage());
        }
    }

    final public function __destruct() {
        // Destruct the connection to DB once finished
        try {
            $this->pdo = null;
        } catch(PDOException $e) {
            die($e->getMessage());
        }
    }

    final public static function PDO() {
        if(!isset(self::$inst)) {
            $class = __CLASS__;
            self::$inst = new $class;
        }
        return self::$inst;
    }

    final public function query($sql) {
        $conn = $this->PDO();
        return $conn->pdo->prepare($sql);
    }

    final public function lastId() {
        return $this->pdo->lastInsertId();
    }

    final public function timeZone() {
        if(!isset($_SESSION['user']['time_zone'])) {
            $now = new \DateTime();
            $mins = $now->getOffset() / 60;

            $sgn = ($mins < 0 ? -1 : 1);
            $mins = abs($mins);
            $hrs = floor($mins / 60);
            $mins -= ($hrs * 60);

            $_SESSION['user']['time_zone'] = sprintf('%+d:%02d', ($hrs * $sgn), $mins);
        }

        return $_SESSION['user']['time_zone'];
    }

}
Thank you I'm going to improve
 

thejust139

New Member
Jun 30, 2013
2
0
Hey,

I have set it up with the SWF and the PlusEMU on your side but the client is immediately at 56% and goes back to the home page ...
What could be the problem?
 

LeZack

Don
Jul 22, 2015
64
16
TAKE DOWN THIS CMS TO MANY EXPLOITS PEOPLE JUST CAN STEAL DATABASE INFORMATION JUST HAPPEND TO MANY I REPEAT DO NOT USE THIS CMS IF YOU WANNA GO BIG !!!
 

MayoMayn

BestDev
Oct 18, 2016
1,423
683
TAKE DOWN THIS CMS TO MANY EXPLOITS PEOPLE JUST CAN STEAL DATABASE INFORMATION JUST HAPPEND TO MANY I REPEAT DO NOT USE THIS CMS IF YOU WANNA GO BIG !!!
You do realize it's PDO?
Nowhere unless codes I've not looked at in the class.db.php outputs any form off database connection errors. The PDO Exception just shows a modified message he have made.
 

Benden

maging ang maganda mamatay
Jun 4, 2010
2,286
1,482
Please remember that a release thread is not a support thread. If you're having trouble look to see if the issue has already been resolved, and if not, make a thread in the appropriate section.
 

F.A.P

New Member
Jan 7, 2012
4
3
Have a look inside class.db.php, the db connection is made outside the class, instead of just making it as a __construct function inside?
Here's my example for what I use in my CMS:

OFT: This code is better than that of the original CMS but you're still using global to get information and this is outdated.

ONT: Great CMS, just needs more OOP and yes also php-fig would help for sure! and cPanel is supported, tested with little edit!
 
Status
Not open for further replies.

Users who are viewing this thread

Top