X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmysql-manager.php;h=279808c0ce4768053e601a02f005a8883d6cdb76;hp=0739eabb2a66026c6ff1682f2a68bb5de4509c1a;hb=48e59d95b50d7dd13be3c8c9b0d03c47a750120c;hpb=8ba389b59f6d41f88752cae896143135e575f34a diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 0739eabb2a..279808c0ce 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -345,7 +345,7 @@ function ADD_MENU($MODE, $act, $wht) { // Load menu header template LOAD_TEMPLATE($MODE."_menu_title", false, $content); - $result_sub = SQL_QUERY_ESC("SELECT title, what FROM "._MYSQL_PREFIX."_%s_menu WHERE action='%s' AND what != '' AND what IS NOT NULL".$AND." ORDER BY sort", + $result_sub = SQL_QUERY_ESC("SELECT title, what FROM "._MYSQL_PREFIX."_%s_menu WHERE action='%s' AND what != '' AND what IS NOT NULL ".$AND." ORDER BY sort", array($MODE, $main_action), __FILE__, __LINE__); $ctl = SQL_NUMROWS($result_sub); if ($ctl > 0) { @@ -926,20 +926,15 @@ function GET_ACTION ($MODE, &$wht) } elseif (!empty($GLOBALS['action'])) { // Get it directly from URL return $GLOBALS['action']; - } else { - // Everything else will be touched after checking the module has a menu assigned } //* DEBUG: */ echo __LINE__."*".$ret."*
\n"; - if (MODULE_HAS_MENU($MODE)) - { + if (MODULE_HAS_MENU($MODE)) { // Rewriting modules to menu - switch ($MODE) - { + switch ($MODE) { case "index": $MODE = "guest"; break; case "login": $MODE = "member"; break; - break; - } + } // END - switch // Guest and member menu is "main" as the default if (empty($ret)) $ret = "main"; @@ -950,11 +945,11 @@ function GET_ACTION ($MODE, &$wht) if (SQL_NUMROWS($result) == 1) { // Load action value and pray that this one is the right you want... ;-) list($ret) = SQL_FETCHROW($result); - } + } // END - if // Free memory SQL_FREERESULT($result); - } + } // END - if // Return action value return $ret; @@ -965,9 +960,11 @@ function GET_CATEGORY ($cid) { $ret = _CATEGORY_404; // Is the category id set? - if (!empty($cid)) { - - // Lookup the category + if ($cid == "0") { + // No category + $ret = _CATEGORY_NONE; + } elseif ($cid > 0) { + // Lookup the category in database $result = SQL_QUERY_ESC("SELECT cat FROM "._MYSQL_PREFIX."_cats WHERE id=%s LIMIT 1", array(bigintval($cid)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { @@ -1096,7 +1093,7 @@ function GET_TOTAL_DATA($search, $tableName, $lookFor, $whereStatement="userid", * rid = inc/modules/guest/what-confirm.php need this * locked = Shall I pay it to normal (false) or locked (true) points ammount? * add_mode = Add points only to $uid or also refs? (WARNING! Changing "ref" to "direct" - * will cause no referral will get points ever!!!) + * for default value will cause no referral will get points ever!!!) */ function ADD_POINTS_REFSYSTEM($uid, $points, $send_notify=false, $rid="0", $locked=false, $add_mode="ref") { @@ -1125,8 +1122,11 @@ function ADD_POINTS_REFSYSTEM($uid, $points, $send_notify=false, $rid="0", $lock $percents = "percents"; if (isset($_CONFIG['db_percents'])) $percents = $_CONFIG['db_percents']; $table = "refdepths"; if (isset($_CONFIG['db_table'])) $table = $_CONFIG['db_table']; + // Default is "normal" points + $data = "points"; + // Which points, locked or normal? - $data = "points"; if ($locked) $data = "locked_points"; + if ($locked) $data = "locked_points"; // Check user account $result_user = SQL_QUERY_ESC("SELECT refid, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s AND status='CONFIRMED' LIMIT 1",