break;
case '0.0.5': // SQL queries for v0.0.5
- addGuestMenuSql('online',NULL,'Jetzt Online','Y','N',2);
+ // Add guest menu
+ addGuestMenuSql('online', NULL, 'Jetzt Online', 'Y', 'N', 2);
// Register filter
registerFilter('init', 'UPDATE_ONLINE_LIST', false, true, getExtensionDryRun());
$GLOBALS['template_eval'][$template] = $eval;
} elseif ((isAdmin()) || ((isInstalling()) && (!isInstalled()))) {
// Only admins shall see this warning or when installation mode is active
- $ret = '<br /><span class="guest_failed">{--TEMPLATE_404--}</span><br />
-(' . $template . ')<br />
-<br />
-{--TEMPLATE_CONTENT--}
-<pre>' . print_r($content, true) . '</pre>
-{--TEMPLATE_DATA--}
-<pre>' . print_r($DATA, true) . '</pre>
-<br /><br />';
+ $ret = '<div class="para">
+ <span class="guest_failed">{--TEMPLATE_404--}</span>
+</div>
+<div class="para">
+ (' . $template . ')
+</div>
+<div class="para">
+ {--TEMPLATE_CONTENT--}
+ <pre>' . print_r($content, true) . '</pre>
+ {--TEMPLATE_DATA--}
+ <pre>' . print_r($DATA, true) . '</pre>
+</div>';
} else {
// No file!
$GLOBALS['template_eval'][$template] = '404';
eval($GLOBALS['tpl_content']);
} elseif (!empty($template)) {
// Template file not found!
- $newContent = '{--TEMPLATE_404--}: ' . $template . '<br />
-{--TEMPLATE_CONTENT--}
-<pre>' . print_r($content, true) . '</pre>
-{--TEMPLATE_DATA--}
-<pre>' . print_r($DATA, true) . '</pre>
-<br /><br />';
+ $newContent = '<div class="para">
+ {--TEMPLATE_404--}: ' . $template . '
+</div>
+<div class="para">
+ {--TEMPLATE_CONTENT--}
+ <pre>' . print_r($content, true) . '</pre>
+ {--TEMPLATE_DATA--}
+ <pre>' . print_r($DATA, true) . '</pre>
+</div>';
// Debug mode not active? Then remove the HTML tags
if (!isDebugModeEnabled()) $newContent = secureString($newContent);
// Calculate 2-seconds timestamp
$stamp = round($timestamp);
- //* DEBUG: */ print("*" . $stamp.'/' . $timestamp."*<br />");
+ //* DEBUG: */ print('*' . $stamp .'/' . $timestamp . '*<br />');
// Do we have a leap year?
$SWITCH = '0';
$M2 = date('m', (time() + $timestamp));
// If so and if current time is before 02/29 and estimated time is after 02/29 then add 86400 seconds (one day)
- if ((floor($TEST) == $TEST) && ($M1 == "02") && ($M2 > "02")) $SWITCH = getConfig('ONE_DAY');
+ if ((floor($TEST) == $TEST) && ($M1 == '02') && ($M2 > '02')) $SWITCH = getConfig('ONE_DAY');
// First of all years...
$Y = abs(floor($timestamp / (31536000 + $SWITCH)));
return $ret;
}
-// Generates a navigation row for listing emails
-function addEmailNavigation ($PAGES, $offset, $show_form, $colspan, $return=false) {
- $TOP = '';
- if ($show_form === false) {
- $TOP = ' top';
- } // END - if
-
- $NAV = '';
- for ($page = 1; $page <= $PAGES; $page++) {
- // Is the page currently selected or shall we generate a link to it?
- if (($page == getRequestParameter('page')) || ((!isGetRequestParameterSet('page')) && ($page == 1))) {
- // Is currently selected, so only highlight it
- $NAV .= '<strong>-';
- } else {
- // Open anchor tag and add base URL
- $NAV .= '<a href="{%url=modules.php?module=admin&what=' . getWhat() . '&page=' . $page . '&offset=' . $offset;
-
- // Add userid when we shall show all mails from a single member
- if ((isGetRequestParameterSet('userid')) && (bigintval(getRequestParameter('userid')) > 0)) $NAV .= '&userid=' . bigintval(getRequestParameter('userid'));
-
- // Close open anchor tag
- $NAV .= '%}">';
- }
- $NAV .= $page;
- if (($page == getRequestParameter('page')) || ((!isGetRequestParameterSet('page')) && ($page == 1))) {
- // Is currently selected, so only highlight it
- $NAV .= '-</strong>';
- } else {
- // Close anchor tag
- $NAV .= '</a>';
- }
-
- // Add seperator if we have not yet reached total pages
- if ($page < $PAGES) {
- // Add it
- $NAV .= '|';
- } // END - if
- } // END - for
-
- // Define constants only once
- $content['nav'] = $NAV;
- $content['span'] = $colspan;
- $content['top'] = $TOP;
-
- // Load navigation template
- $OUT = loadTemplate('admin_email_nav_row', true, $content);
-
- if ($return === true) {
- // Return generated HTML-Code
- return $OUT;
- } else {
- // Output HTML-Code
- outputHtml($OUT);
- }
-}
-
// Extract host from script name
function extractHostnameFromUrl (&$script) {
// Use default SERVER_URL by default... ;) So?
}
// Add page navigation
-function addPageNavigation ($pages, $offset, $showForm, $colspan, $return=false) {
+function addPageNavigation ($numPages, $offset, $showForm, $colspan, $return=false) {
// @TODO These two constants are no longer used, maybe we reactivate this code?
//if ($showForm === true) {
// // Load form for changing number of lines
//}
$OUT = '';
- for ($page = 1; $page <= $pages; $page++) {
+ for ($page = 1; $page <= $numPages; $page++) {
if (($page == getRequestParameter('page')) || ((!isGetRequestParameterSet('page')) && ($page == 1))) {
$OUT .= '<strong>-';
} else {
$OUT .= '</a>';
}
- if ($page < $pages) $OUT .= '|';
+ if ($page < $numPages) $OUT .= '|';
} // END - for
// Remember the list
return $OUT;
}
+// Generates a navigation row for listing emails
+function addEmailNavigation ($numPages, $offset, $show_form, $colspan, $return=false) {
+ // Don't do anything if $numPages is 1
+ if ($numPages == 1) {
+ // Abort here with empty content
+ return '';
+ } // END - if
+
+ $TOP = '';
+ if ($show_form === false) {
+ $TOP = ' top';
+ } // END - if
+
+ $NAV = '';
+ for ($page = 1; $page <= $numPages; $page++) {
+ // Is the page currently selected or shall we generate a link to it?
+ if (($page == getRequestParameter('page')) || ((!isGetRequestParameterSet('page')) && ($page == 1))) {
+ // Is currently selected, so only highlight it
+ $NAV .= '<strong>-';
+ } else {
+ // Open anchor tag and add base URL
+ $NAV .= '<a href="{%url=modules.php?module=admin&what=' . getWhat() . '&page=' . $page . '&offset=' . $offset;
+
+ // Add userid when we shall show all mails from a single member
+ if ((isGetRequestParameterSet('userid')) && (bigintval(getRequestParameter('userid')) > 0)) $NAV .= '&userid=' . bigintval(getRequestParameter('userid'));
+
+ // Close open anchor tag
+ $NAV .= '%}">';
+ }
+ $NAV .= $page;
+ if (($page == getRequestParameter('page')) || ((!isGetRequestParameterSet('page')) && ($page == 1))) {
+ // Is currently selected, so only highlight it
+ $NAV .= '-</strong>';
+ } else {
+ // Close anchor tag
+ $NAV .= '</a>';
+ }
+
+ // Add seperator if we have not yet reached total pages
+ if ($page < $numPages) {
+ // Add it
+ $NAV .= '|';
+ } // END - if
+ } // END - for
+
+ // Define constants only once
+ $content['nav'] = $NAV;
+ $content['span'] = $colspan;
+ $content['top'] = $TOP;
+
+ // Load navigation template
+ $OUT = loadTemplate('admin_email_nav_row', true, $content);
+
+ if ($return === true) {
+ // Return generated HTML-Code
+ return $OUT;
+ } else {
+ // Output HTML-Code
+ outputHtml($OUT);
+ }
+}
+
// [EOF]
?>
$result = SQL_QUERY($sql, __FILE__, __LINE__);
// Calculate pages
-$pages = round(SQL_NUMROWS($result_maximum) / getConfig('mails_page') + 0.5);
+$numPages = round(SQL_NUMROWS($result_maximum) / getConfig('mails_page') + 0.5);
// Free the result which we don't need
SQL_FREERESULT($result_maximum);
// Mail orders are in pool so we can display them
// Add navigation table rows
- $content['top_email_nav'] = '';
- $content['bottom_email_nav'] = '';
- if ($pages > 1) {
- $content['top_email_nav'] = addEmailNavigation($pages, getConfig('mails_page'), true , 3, true);
- $content['bottom_email_nav'] = addEmailNavigation($pages, getConfig('mails_page'), false, 3, true);
- } // END - if
+ $content['top_email_nav'] = addEmailNavigation($numPages, getConfig('mails_page'), true , 3, true);
+ $content['bottom_email_nav'] = addEmailNavigation($numPages, getConfig('mails_page'), false, 3, true);
// List all entries
$OUT = ''; $SW = 2;
SQL_FREERESULT($result_mails);
// Unconfirmed mails
- $pool['unconfirmed'] = $pool['max_rec'] - $pool['clicks'];
- if ($pool['unconfirmed'] > 0) {
- // Add link to list_unconfirmed what-file
- $pool['unconfirmed'] = '<strong><a href="{%url=modules.php?module=admin&what=list_unconfirmed&mid=' . $pool['id'] . '%}">' . $pool['unconfirmed'] . '</a></strong>';
- } // END - if
+ $pool['unconfirmed'] = generateUnconfirmedAdminLink($pool['id'], ($pool['max_rec'] - $pool['clicks']), 'mid');
// Prepare data for the row template
$content['sw'] = $SW;
$WHO = getMessage('USER_ID') . ': ' . getRequestParameter('userid');
}
+// Init result_bonus
+$result_bonus = false;
+
if ((isExtensionActive('bonus')) && ($WHO == getMessage('_ALL'))) {
// Check for maximum pages
$result_bonus = SQL_QUERY("SELECT
if ((!empty($SQL2)) && ($WHO == getMessage('_ALL'))) $result_bonus = SQL_QUERY($SQL2, __FILE__, __LINE__);
// Calculate pages
-$PAGES = '0';
+$numPages = '0';
if (isConfigEntrySet('mails_page')) {
- $PAGES = round(SQL_NUMROWS($result_normal) / getConfig('mails_page') + 0.3);
+ $numPages = round(SQL_NUMROWS($result_normal) / getConfig('mails_page') + 0.3);
} // END - if
// Free result
SQL_FREERESULT($result_list);
// Add navigation (with change box and colspan=3)
- $content['nav'] = '';
- if ($PAGES > 1) $content['nav'] = addEmailNavigation($PAGES, getConfig('mails_page'), false, 3, true);
+ $content['nav'] = addEmailNavigation($numPages, getConfig('mails_page'), false, 3, true);
// Prepare content
$content['rows'] = $OUT;
$MAIL = true;
if ((isExtensionActive('bonus')) && ($WHO == getMessage('_ALL'))) {
- // Check only if bonus extension is active
+ // Only check if bonus extension is active
if (SQL_NUMROWS($result_bonus) > 0) outputHtml('<br /><br />');
} // END - if
}
// Load bonus mails only when extension is active
if (SQL_NUMROWS($result_bonus) > 0) {
// Calculate pages
- $PAGES = round(SQL_NUMROWS($result_bonus) / getConfig('mails_page') + 0.5);
+ $numPages = round(SQL_NUMROWS($result_bonus) / getConfig('mails_page') + 0.5);
// List emails
$OUT = '';
} // END - while
// Add navigation (without change box but with colspan=3)
- $content['nav'] = '';
- if ($PAGES > 1) $content['nav'] = addEmailNavigation($PAGES, getConfig('mails_page'), false, 3, true);
+ $content['nav'] = addEmailNavigation($numPages, getConfig('mails_page'), false, 3, true);
// Prepare content
$content['rows'] = $OUT;
// Load bonus mails only when extension is active
if (SQL_NUMROWS($result_bonus) > 0) {
// Calculate pages
- $PAGES = round(SQL_NUMROWS($result_bonus) / getConfig('mails_page') + 0.5);
+ $numPages = round(SQL_NUMROWS($result_bonus) / getConfig('mails_page') + 0.5);
// List emails
$OUT = ''; $content = array();
} // END - if
// Add navigation (without change box but with colspan=3)
- $content['nav'] = '';
- if ($PAGES > 1) $content['nav'] = addEmailNavigation($PAGES, getConfig('mails_page'), false, 3, true);
+ $content['nav'] = addEmailNavigation($numPages, getConfig('mails_page'), false, 3, true);
// Prepare content
$content['rows'] = $OUT;
sendEmail(getUserData('email'), getMessage('MEMBER_PAYOUT_ACCEPTED_SUBJECT'), $message);
} else {
// Something goes wrong... :-(
- $content = implode("<br />", $ret);
+ $content = implode('<br />', $ret);
loadTemplate('admin_payout_failed_transfer', false, $content);
}
} else {
} // END - if
// Activate the extension please!
- $PAGES = round(SQL_NUMROWS($result_master) / getConfig('user_limit') + 0.5);
+ $numPages = round(SQL_NUMROWS($result_master) / getConfig('user_limit') + 0.5);
if (!isGetRequestParameterSet('page')) setGetRequestParameter('page' , 1);
if (!isGetRequestParameterSet('offset')) setGetRequestParameter('offset', getConfig('user_limit'));
$templateContent['sort_links'] = addSortLinks(getRequestParameter('letter'), getRequestParameter('sortby'), ($colspan + 1), true);
$templateContent['page_nav'] = '';
- if ($PAGES > 1) {
- $templateContent['page_nav'] = addPageNavigation($PAGES, getConfig('user_limit'), true, $colspan, true);
+ if ($numPages > 1) {
+ $templateContent['page_nav'] = addPageNavigation($numPages, getConfig('user_limit'), true, $colspan, true);
} // END - if
// Column with nickname when nickname extension is present