X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmysql-manager.php;h=e4ef99b7002818d881166f91de7c301e61aa6422;hb=b2fff4de774cc58dfae0b8dd2a291af28f254833;hp=edd8cdaf193d1421941348b6bc869754b239760e;hpb=fb7120ffa230b62b54895bcf95952e1cf30f8594;p=mailer.git
diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php
index edd8cdaf19..e4ef99b700 100644
--- a/inc/mysql-manager.php
+++ b/inc/mysql-manager.php
@@ -38,28 +38,28 @@
// Some security stuff...
if (!defined('__SECURITY')) {
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+ $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
require($INC);
}
// Returns the title for given module
function ADD_MODULE_TITLE ($mod) {
// Init variables
- $name = "";
+ $name = '';
$result = false;
// Is the script installed?
if (isInstalled()) {
// Check if cache is valid
- if ((GET_EXT_VERSION("cache") >= "0.1.2") && (isset($GLOBALS['cache_array']['modules']['module'])) && (in_array($mod, $GLOBALS['cache_array']['modules']['module']))) {
+ if ((GET_EXT_VERSION('cache') >= '0.1.2') && (isset($GLOBALS['cache_array']['modules']['module'])) && (in_array($mod, $GLOBALS['cache_array']['modules']['module']))) {
// Load from cache
$name = $GLOBALS['cache_array']['modules']['title'][$mod];
// Update cache hits
incrementConfigEntry('cache_hits');
- } elseif (!EXT_IS_ACTIVE("cache")) {
+ } elseif (!EXT_IS_ACTIVE('cache')) {
// Load from database
- $result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_mod_reg` WHERE module='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_mod_reg` WHERE `module`='%s' LIMIT 1",
array($mod), __FUNCTION__, __LINE__);
list($name) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
@@ -86,11 +86,11 @@ function ADD_MODULE_TITLE ($mod) {
// Check validity of a given module name (no file extension)
function checkModulePermissions ($mod) {
// Filter module name (names with low chars and underlines are fine!)
- $mod = preg_replace("/[^a-z_]/", "", $mod);
+ $mod = preg_replace("/[^a-z_]/", '', $mod);
// Check for prefix is a extension...
$modSplit = explode("_", $mod);
- $extension = ""; $mod_chk = $mod;
+ $extension = ''; $mod_chk = $mod;
//* DEBUG: */ echo __LINE__."*".count($modSplit)."*/".$mod."*
";
if (count($modSplit) == 2) {
// Okay, there is a seperator (_) in the name so is the first part a module?
@@ -118,7 +118,7 @@ function checkModulePermissions ($mod) {
$found = false;
// Check if cache is latest version
- if (GET_EXT_VERSION("cache") >= "0.1.2") {
+ if (GET_EXT_VERSION('cache') >= '0.1.2') {
// Is the cache there?
if (!isset($GLOBALS['cache_array']['modules'])) {
// This should normally not happen...
@@ -140,9 +140,9 @@ function checkModulePermissions ($mod) {
// No, then we have to update it!
$ret = "cache_miss";
}
- } elseif (!EXT_IS_ACTIVE("cache")) {
+ } elseif (!EXT_IS_ACTIVE('cache')) {
// Check for module in database
- $result = SQL_QUERY_ESC("SELECT locked, hidden, admin_only, mem_only FROM `{!_MYSQL_PREFIX!}_mod_reg` WHERE module='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT locked, hidden, admin_only, mem_only FROM `{!_MYSQL_PREFIX!}_mod_reg` WHERE `module`='%s' LIMIT 1",
array($mod_chk), __FUNCTION__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Read data
@@ -157,16 +157,16 @@ function checkModulePermissions ($mod) {
// Check returned values against current access permissions
//
// Admin access ----- Guest access ----- --- Guest or member? ---
- if ((IS_ADMIN()) || (($locked == "N") && ($admin == "N") && (($mem == "N") || (IS_MEMBER())))) {
+ if ((IS_ADMIN()) || (($locked == 'N') && ($admin == 'N') && (($mem == 'N') || (IS_MEMBER())))) {
// If you are admin you are welcome for everything!
$ret = "done";
- } elseif ($locked == "Y") {
+ } elseif ($locked == 'Y') {
// Module is locked
$ret = "locked";
- } elseif (($mem == "Y") && (!IS_MEMBER())) {
+ } elseif (($mem == 'Y') && (!IS_MEMBER())) {
// You have to login first!
$ret = "mem_only";
- } elseif (($admin == "Y") && (!IS_ADMIN())) {
+ } elseif (($admin == 'Y') && (!IS_ADMIN())) {
// Only the Admin is allowed to enter this module!
$ret = "admin_only";
} else {
@@ -185,7 +185,7 @@ function checkModulePermissions ($mod) {
// ----- Legacy module ----- ---- Module in base folder ---- --- Module with extension's name ---
if ((FILE_READABLE(sprintf("%sinc/modules/%s.php", constant('PATH'), $mod))) || (FILE_READABLE(sprintf("%s%s.php", constant('PATH'), $mod))) || (FILE_READABLE(sprintf("%s%s/%s.php", constant('PATH'), $extension, $mod)))) {
// Data is missing so we add it
- if (GET_EXT_VERSION("sql_patches") >= "0.3.6") {
+ if (GET_EXT_VERSION('sql_patches') >= '0.3.6') {
// Since 0.3.6 we have a has_menu column, this took me a half hour
// to find a loop here... *sigh*
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_mod_reg`
@@ -235,9 +235,9 @@ function ADD_DESCR ($ACC_LVL, $FQFN, $return = false, $output = true) {
$file = basename($FQFN);
// Init variables
- $LINK_ADD = "";
- $OUT = "";
- $AND = "";
+ $LINK_ADD = '';
+ $OUT = '';
+ $AND = '';
// First we have to do some analysis...
if (substr($file, 0, 7) == "action-") {
@@ -245,29 +245,29 @@ function ADD_DESCR ($ACC_LVL, $FQFN, $return = false, $output = true) {
$type = "action";
$search = substr($file, 7);
switch ($ACC_LVL) {
- case "admin":
- $modCheck = "admin";
+ case 'admin':
+ $modCheck = 'admin';
break;
- case "sponsor":
- case "guest":
- case "member":
+ case 'sponsor':
+ case 'guest':
+ case 'member':
$modCheck = $GLOBALS['module'];
break;
}
- $AND = " AND (what='' OR `what` IS NULL)";
+ $AND = " AND (`what`='' OR `what` IS NULL)";
} elseif (substr($file, 0, 5) == "what-") {
// This is an admin what file!
$type = "what";
$search = substr($file, 5);
- $AND = "";
+ $AND = '';
switch ($ACC_LVL) {
- case "admin":
- $modCheck = "admin";
+ case 'admin':
+ $modCheck = 'admin';
break;
- case "guest":
- case "member":
+ case 'guest':
+ case 'member':
$modCheck = $GLOBALS['module'];
if (!IS_ADMIN()) {
$AND = " AND `visible`='Y' AND `locked`='N'";
@@ -276,18 +276,18 @@ function ADD_DESCR ($ACC_LVL, $FQFN, $return = false, $output = true) {
}
$dummy = substr($search, 0, -4);
$AND .= " AND `action`='".GET_ACTION($ACC_LVL, $dummy)."'";
- } elseif (($ACC_LVL == "sponsor") || ($ACC_LVL == "engine")) {
+ } elseif (($ACC_LVL == 'sponsor') || ($ACC_LVL == "engine")) {
// Sponsor / engine menu
$type = "what";
$search = $file;
$modCheck = $GLOBALS['module'];
- $AND = "";
+ $AND = '';
} else {
// Other
$type = "menu";
$search = $file;
$modCheck = $GLOBALS['module'];
- $AND = "";
+ $AND = '';
}
// Begin the navigation line
@@ -296,7 +296,7 @@ function ADD_DESCR ($ACC_LVL, $FQFN, $return = false, $output = true) {
$prefix = "
"); + | ");
//* DEBUG: */ echo __LINE__."/".$main_cnt."/".$content['action']."/".$content['sub_what'].":".$GLOBALS['what']."* \n"; LOAD_INC($INC_BLOCK); //* DEBUG: */ echo __LINE__."/".$main_cnt."/".$content['action']."/".$content['sub_what'].":".$GLOBALS['what']."* \n"; - if ((!EXT_IS_ACTIVE($content['action'])) || ($content['action'] == "online")) OUTPUT_HTML(" |
+ if ((!EXT_IS_ACTIVE($content['action'])) || ($content['action'] == 'online')) OUTPUT_HTML("