// Destroy cache here
// @TODO Rewrite this to a filter
- if (getOutputMode() == '0') rebuildCacheFile('modules', 'modules');
+ if (getOutputMode() == 0) rebuildCacheFile('modules', 'modules');
// And reload data
unset($GLOBALS['module_status'][$mod]);
//* DEBUG: */ outputHtml(__LINE__.'+'.$type."+<br />");
// Add closing div and br-tag
$OUT .= "</div><br />\n";
- $GLOBALS['nav_depth'] = '0';
+ $GLOBALS['nav_depth'] = 0;
// Run the filter chain
$ret = runFilterChain('post_youhere_line', array('access_level' => $accessLevel, 'type' => $type, 'content' => ""));
}
// Validate the given menu action
-function isMenuActionValid ($mode, $action, $what, $UPDATE=false) {
+function isMenuActionValid ($mode, $action, $what, $updateEntry=false) {
// Is the cache entry there and we shall not update?
- if ((isset($GLOBALS['action_valid'][$mode][$action][$what])) && ($UPDATE === false)) {
+ if ((isset($GLOBALS['action_valid'][$mode][$action][$what])) && ($updateEntry === false)) {
// Count cache hit
incrementStatsEntry('cache_hits');
if ((!isAdmin()) && ($mode != 'admin')) $add = " AND `locked`='N'";
//* DEBUG: */ outputHtml(__LINE__.':'.$mode.'/'.$action.'/'.$what."*<br />");
- if (($mode != 'admin') && ($UPDATE === true)) {
+ if (($mode != 'admin') && ($updateEntry === true)) {
// Update guest or member menu
$sql = SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET counter=counter+1 WHERE `action`='%s' AND `what`='%s'".$add." LIMIT 1",
array($mode, $action, $what), __FUNCTION__, __LINE__, false);
// Run SQL command
$result = SQL_QUERY($sql, __FUNCTION__, __LINE__);
- if ($UPDATE === true) {
+ if ($updateEntry === true) {
// Check updated/affected rows
$ret = (SQL_AFFECTEDROWS() == 1);
} else {
loadTemplate('admin_settings_saved', false, $content);
}
-// Update module counter
-function countModuleHit($mod) {
- // Do count all other modules but not accesses on CSS file css.php!
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `clicks`=`clicks`+1 WHERE `module`='%s' LIMIT 1",
- array($mod), __FUNCTION__, __LINE__);
-}
-
// Get action value from mode (admin/guest/member) and what-value
function getModeAction ($mode, $what) {
// Init status
} elseif ((!isExtensionInstalled('sql_patches')) && ($mode != 'admin')) {
// No sql_patches installed, but maybe we need to register an admin?
if (isAdminRegistered()) {
- // Redirect
- // @TODO Why does this lead into an endless loop but we still need it???
- // @TODO Commented out redirectToUrl('admin.php');
+ // Redirect to admin area
+ redirectToUrl('admin.php');
} // END - if
}
$ret = getMessage('_CATEGORY_404');
// Is the category id set?
- if ($cid == '0') {
+ if ($cid == 0) {
// No category
$ret = getMessage('_CATEGORY_NONE');
} elseif ($cid > 0) {
function countSumTotalData ($search, $tableName, $lookFor = 'id', $whereStatement = 'userid', $countRows = false, $add = '') {
$ret = 0;
//* DEBUG: */ outputHtml($search.'/'.$tableName.'/'.$lookFor.'/'.$whereStatement.'/'.$add.'<br />');
- if ((empty($search)) && ($search != '0')) {
+ if ((empty($search)) && ($search != 0)) {
// Count or sum whole table?
if ($countRows === true) {
// Count whole table
$ret = '0.00000';
} elseif (''.$ret.'' == '') {
// Fix empty result
- $ret = '0';
+ $ret = 0;
}
// Return value
* add_mode = Add points only to $userid or also refs? (WARNING! Changing 'ref' to 'direct'
* for default value will cause no referal will get points ever!!!)
*/
-function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify = false, $rid = '0', $locked = false, $add_mode = 'ref') {
+function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify = false, $rid = 0, $locked = false, $add_mode = 'ref') {
//* DEBUG: */ outputHtml("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
// Convert mode to lower-case
$add_mode = strtolower($add_mode);
// When $userid = 0 add points to jackpot
- if (($userid == '0') && (isExtensionActive('jackpot'))) {
+ if (($userid == 0) && (isExtensionActive('jackpot'))) {
// Add points to jackpot
addPointsToJackpot($points);
return;
'subject' => $subject,
'userid' => $userid,
'points' => $points,
- 'notify' => $notify,
+ 'notify' => $sendNotify,
'rid' => $rid,
'locked' => $locked,
'mode' => 'add',