-
Re: [REL] SuperCMS [REL]
intval(mysql_query("SELECT users_online FROM server_status LIMIT 1"))
Dafuq? Does this work? (Converting a mysql result to int)
__
Use exit instead of die, just like you use echo instead of print
__
MySQL: First you connect, then you check for blank fields in the config 
__
mysql_close($this->conn);
Not needed unless you use pconnect
__
unset($this->conn);
PHP has an automatic garbage collector
__
public function clean($string)
{
return mysql_real_escape_string(strip_tags(stripslashes(htmlspecialchars($string))));
}
If you filter everything with that you can't use html chars etc anymore in for example your motto
__
Just some things I notice. I'm not flaming, it's a very good base.
__
Another thing which really makes a time difference:
public function filter($param)
{
foreach($this->value as $replace => $value)
{
$param = str_replace("%" . $replace . "%", $value, $param);
}
return $param;
}
public function append($key, $value)
{
$this->value[$key] = $value;
}
Change it to
public function filter($param)
{
return str_replace(array_keys($this->value), array_values($this->value), $param);
}
public function append($key, $value)
{
$this->value['%'.$key.'%'] = $value;
}
__
By the way where is the environment.php?
Last edited by azaidi; 31-12-12 at 10:32 AM.