summaryrefslogtreecommitdiff
path: root/inc/mod
diff options
context:
space:
mode:
authorMichael Save <savetheinternet@tinyboard.org>2012-08-27 21:50:15 +1000
committerMichael Save <savetheinternet@tinyboard.org>2012-08-27 21:50:15 +1000
commit913010cff5d09311ca6c8bc7a139d5deee82ba38 (patch)
treecbd95c15bde1c684d4e6a960e41a934c77764f31 /inc/mod
parenteb146d92015e3bfe7b2fad68dd4b8c29542a31b3 (diff)
minor consistency cleanup
Diffstat (limited to 'inc/mod')
-rw-r--r--inc/mod/auth.php8
-rw-r--r--inc/mod/pages.php22
2 files changed, 15 insertions, 15 deletions
diff --git a/inc/mod/auth.php b/inc/mod/auth.php
index 6144a17d..9a13b3bb 100644
--- a/inc/mod/auth.php
+++ b/inc/mod/auth.php
@@ -24,7 +24,7 @@ function mkhash($username, $password, $salt = false) {
$hash = substr(base64_encode(md5($username . $config['cookies']['salt'] . sha1($username . $password . $salt . ($config['mod']['lock_ip'] ? $_SERVER['REMOTE_ADDR'] : ''), true), true)), 0, 20);
if (isset($generated_salt))
- return Array($hash, $salt);
+ return array($hash, $salt);
else
return $hash;
}
@@ -43,7 +43,7 @@ function login($username, $password, $makehash=true) {
$query->execute() or error(db_error($query));
if ($user = $query->fetch()) {
- return $mod = Array(
+ return $mod = array(
'id' => $user['id'],
'type' => $user['type'],
'username' => $username,
@@ -114,7 +114,7 @@ if (isset($_COOKIE[$config['cookies']['mod']])) {
error($config['error']['malformed']);
}
- $mod = Array(
+ $mod = array(
'id' => $user['id'],
'type' => $user['type'],
'username' => $cookie[0],
@@ -137,7 +137,7 @@ function create_pm_header() {
$query->execute() or error(db_error($query));
if ($pm = $query->fetch())
- $header = Array('id' => $pm['id'], 'waiting' => $query->rowCount() - 1);
+ $header = array('id' => $pm['id'], 'waiting' => $query->rowCount() - 1);
else
$header = true;
diff --git a/inc/mod/pages.php b/inc/mod/pages.php
index 19ff8806..88ff3dd5 100644
--- a/inc/mod/pages.php
+++ b/inc/mod/pages.php
@@ -1678,9 +1678,9 @@ function mod_themes_list() {
if (!hasPermission($config['mod']['themes']))
error($config['error']['noaccess']);
- if(!is_dir($config['dir']['themes']))
+ if (!is_dir($config['dir']['themes']))
error(_('Themes directory doesn\'t exist!'));
- if(!$dir = opendir($config['dir']['themes']))
+ if (!$dir = opendir($config['dir']['themes']))
error(_('Cannot open themes directory; check permissions.'));
$query = query('SELECT `theme` FROM `theme_settings` WHERE `name` IS NULL AND `value` IS NULL') or error(db_error());
@@ -1707,14 +1707,14 @@ function mod_theme_configure($theme_name) {
if (!hasPermission($config['mod']['themes']))
error($config['error']['noaccess']);
- if(!$theme = loadThemeConfig($theme_name)) {
+ if (!$theme = loadThemeConfig($theme_name)) {
error($config['error']['invalidtheme']);
}
- if(isset($_POST['install'])) {
+ if (isset($_POST['install'])) {
// Check if everything is submitted
- foreach($theme['config'] as &$conf) {
- if(!isset($_POST[$conf['name']]) && $conf['type'] != 'checkbox')
+ foreach ($theme['config'] as &$conf) {
+ if (!isset($_POST[$conf['name']]) && $conf['type'] != 'checkbox')
error(sprintf($config['error']['required'], $c['title']));
}
@@ -1723,7 +1723,7 @@ function mod_theme_configure($theme_name) {
$query->bindValue(':theme', $theme_name);
$query->execute() or error(db_error($query));
- foreach($theme['config'] as &$conf) {
+ foreach ($theme['config'] as &$conf) {
$query = prepare("INSERT INTO `theme_settings` VALUES(:theme, :name, :value)");
$query->bindValue(':theme', $theme_name);
$query->bindValue(':name', $conf['name']);
@@ -1737,17 +1737,17 @@ function mod_theme_configure($theme_name) {
$result = true;
$message = false;
- if(isset($theme['install_callback'])) {
+ if (isset($theme['install_callback'])) {
$ret = $theme['install_callback'](themeSettings($theme_name));
- if($ret && !empty($ret)) {
- if(is_array($ret) && count($ret) == 2) {
+ if ($ret && !empty($ret)) {
+ if (is_array($ret) && count($ret) == 2) {
$result = $ret[0];
$message = $ret[1];
}
}
}
- if(!$result) {
+ if (!$result) {
// Install failed
$query = prepare("DELETE FROM `theme_settings` WHERE `theme` = :theme");
$query->bindValue(':theme', $theme_name);