inc/modules/admin/what-list_doubler.php -text svneol=unset#text/plain
inc/modules/admin/what-list_holiday.php -text svneol=unset#text/plain
inc/modules/admin/what-list_links.php -text svneol=unset#text/plain
+inc/modules/admin/what-list_network_api_translation.php svneol=native#text/plain
inc/modules/admin/what-list_network_array_translation.php svneol=native#text/plain
inc/modules/admin/what-list_network_params.php -text svneol=unset#text/plain
inc/modules/admin/what-list_network_translations.php svneol=native#text/plain
templates/de/html/admin/admin_add_max.tpl -text svneol=unset#text/plain
templates/de/html/admin/admin_add_member_menu.tpl -text svneol=unset#text/plain
templates/de/html/admin/admin_add_network.tpl -text svneol=unset#text/plain
+templates/de/html/admin/admin_add_network_api_translation.tpl svneol=native#text/plain
templates/de/html/admin/admin_add_network_array_translation.tpl svneol=native#text/plain
templates/de/html/admin/admin_add_network_params.tpl -text svneol=unset#text/plain
templates/de/html/admin/admin_add_network_type.tpl -text svneol=unset#text/plain
./inc/language/sponsor_de.php:119:// @TODO Rewrite these four constants to one and use sprintf()
./inc/libs/admins_functions.php:432: // @TODO This can be, somehow, rewritten
./inc/libs/beg_functions.php:54: // @TODO Try to rewrite the following unset()
-./inc/libs/bonus_functions.php:204: // @TODO Move this HTML to a template
-./inc/libs/bonus_functions.php:288: // @TODO This query isn't right, it will only update if the user was for a longer time away!
+./inc/libs/bonus_functions.php:201: // @TODO Move this HTML to a template
+./inc/libs/bonus_functions.php:285: // @TODO This query isn't right, it will only update if the user was for a longer time away!
./inc/libs/doubler_functions.php:46:// @TODO Lame description
./inc/libs/doubler_functions.php:94: // @TODO Can't this be moved into EL?
./inc/libs/mailid_functions.php:49: // @TODO Rewrite this to a dynamic include or so
./inc/modules/admin/what-del_email.php:61: // @TODO Unused: cat_id, payment_id
./inc/modules/admin/what-edit_user.php:20: * @TODO Add support for ext-country *
./inc/modules/admin/what-email_stats.php:48:// @TODO Unused at the moment
-./inc/modules/admin/what-extensions.php:369: // @TODO Rewrite this to a filter
+./inc/modules/admin/what-extensions.php:365: // @TODO Rewrite this to a filter
./inc/modules/admin/what-guest_add.php:131: // @TODO This can be somehow rewritten to a function
./inc/modules/admin/what-guest_add.php:69: // @TODO Cant this be rewritten?
./inc/modules/admin/what-guest_add.php:82: // @TODO This can be somehow rewritten to a function
./inc/modules/admin/what-list_cats.php:56: // @TODO No longer needed? define('__CATEGORIES_BASE' , '<a href="{%url=modules.php?module=admin&userid=');
./inc/modules/admin/what-list_cats.php:71: // @TODO Rewrite this to countSum.....() function
./inc/modules/admin/what-list_links.php:57: // @TODO Try to rewrite this to a filter
-./inc/modules/admin/what-list_links.php:89: // @TODO Find a way to rewrite this. See some lines above for different queries
-./inc/modules/admin/what-list_links.php:98: // @TODO Rewrite this to includes/filter
+./inc/modules/admin/what-list_links.php:87: // @TODO Find a way to rewrite this. See some lines above for different queries
+./inc/modules/admin/what-list_links.php:96: // @TODO Rewrite this to includes/filter
./inc/modules/admin/what-list_refs.php:107: // @TODO Try to rewrite some to EL
./inc/modules/admin/what-list_unconfirmed.php:79: // @TODO This constant might be unused? define('__LIST_UNCON_TITLE', '{--ADMIN_LIST_UNCONFIRMED_BONUS_LINKS--}');
./inc/modules/admin/what-list_unconfirmed.php:98: // @TODO "Please do not call me directly." Should be rewritten to a nice selection depending on ext-bonus
./inc/modules/guest/what-mediadata.php:70: // @TODO Find a better formular than this one
./inc/modules/guest/what-rallyes.php:91: // @TODO Reactivate this: $content['admin'] = '<a href="{%url=modules.php?module=index&what=impressum&admin=' . $adminId . '%}">' . $login . '</a>';
./inc/modules/guest/what-sponsor_reg.php:297: // @TODO Maybe a default referal id?
-./inc/modules/guest/what-stats.php:116: // @TODO This can be somehow rewritten
+./inc/modules/guest/what-stats.php:102: // @TODO This can be somehow rewritten
./inc/modules/guest/what-stats.php:76:// @TODO This can be rewritten in a dynamic include
./inc/modules/member/what-beg.php:56:// @TODO Can't this be moved into EL?
./inc/modules/member/what-beg.php:65:// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_userid_timeout')));
./inc/modules/member/what-bonus.php:57: // @TODO Rewrite this to a filter
-./inc/modules/member/what-categories.php:132: // @TODO Rewrite this to use $OUT .= ...
+./inc/modules/member/what-categories.php:130: // @TODO Rewrite this to use $OUT .= ...
./inc/modules/member/what-order.php:428: // @TODO Rewrite this to a filter
./inc/modules/member/what-payout.php:196: // @TODO Rewrite this to a filter
-./inc/modules/member/what-points.php:55:// @TODO Should we rewrite this to a filter?
+./inc/modules/member/what-points.php:57:// @TODO Should we rewrite this to a filter?
./inc/modules/member/what-rallyes.php:91: // @TODO Reactivate this: $content['admin'] = '<a href="{%url=modules.php?module=index&what=impressum&admin=' . $content['admin_id'] . '%}">' . $content['login'] . '</a>';
./inc/modules/member/what-refback.php:126: // @TODO UNUSED: $refRow['status'] = translateUserStatus($refRow['status']);
./inc/modules/member/what-reflinks.php:54:// @TODO Move this into a filter
./inc/reset/reset_beg.php:51:// @TODO This should be converted in a daily beg rallye
./inc/reset/reset_birthday.php:91: // @TODO 4 is hard-coded here, should we move it out in config?
./inc/revision-functions.php:153:// @TODO Please describe this function
-./inc/template-functions.php:1132: // @TODO This can be easily moved out after the merge from EL branch to this is complete
-./inc/template-functions.php:1165: // @TODO Add a little more infos here
-./inc/template-functions.php:1453:// @TODO Lame description for this function
-./inc/template-functions.php:1472: // @TODO Move this in a filter
-./inc/template-functions.php:261: // @TODO Remove this sanity-check if all is fine
-./inc/template-functions.php:572:// @TODO $simple/$constants are deprecated
-./inc/template-functions.php:599: // @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates
+./inc/template-functions.php:1135: // @TODO This can be easily moved out after the merge from EL branch to this is complete
+./inc/template-functions.php:1168: // @TODO Add a little more infos here
+./inc/template-functions.php:1456:// @TODO Lame description for this function
+./inc/template-functions.php:1475: // @TODO Move this in a filter
+./inc/template-functions.php:189: * @TODO On some pages this is buggy
+./inc/template-functions.php:264: // @TODO Remove this sanity-check if all is fine
+./inc/template-functions.php:575:// @TODO $simple/$constants are deprecated
+./inc/template-functions.php:602: // @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates
./inc/wrapper-functions.php:127:// @TODO Implement $compress
./inc/wrapper-functions.php:134:// @TODO Implement $decompress
./inc/wrapper-functions.php:455:// @TODO Do some more sanity check here
./templates/de/html/surfbar/surfbar_frame_textlinks.tpl:5: <!-- @TODO These are static lines and should be replaced by a filter (see ext-sponsor) //-->
### ### DEPRECATION FOLLOWS: ### ###
./inc/modules/admin/admin-inc.php:439:// @DEPRECATED
+./inc/modules/admin/what-list_network_array_translation.php:2:// @DEPRECATED
./templates/de/html/admin/admin_add_banner.tpl:1:<!-- @DEPRECATED //-->
+./templates/de/html/admin/admin_add_network_array_translation.tpl:1:<!-- @DEPRECATED //-->
./templates/de/html/admin/admin_admin_add.tpl:1:<!-- @DEPRECATED //-->
./templates/de/html/admin/admin_admins_add_acl.tpl:1:<!-- @DEPRECATED //-->
./templates/de/html/admin/admin_admins_add.tpl:1:<!-- @DEPRECATED //-->
$lines = false;
// Is the result a valid resource?
- if (is_resource($resource)) {
+ if (isset($GLOBALS['sql_numrows'][$resource])) {
+ // Use cache
+ $lines = $GLOBALS['sql_numrows'][intval($resource)];
+ } elseif (is_resource($resource)) {
// Get the count of rows from database
$lines = mysql_num_rows($resource);
+
+ // Remember it in cache
+ $GLOBALS['sql_numrows'][intval($resource)] = $lines;
} else {
// No resource given, please fix this
debug_report_bug(__FUNCTION__, __LINE__, 'No resource given! result[]=' . gettype($resource) . ',last_sql=' . $GLOBALS['last_sql']);
) TYPE={?_TABLE_TYPE?} COMMENT='Translations for array keys, generic data, DO NOT ALTER!'");
// Array-Element translation tables per type/provider
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_array_translation`');
- addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_array_translation` (
-`network_array_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_api_translation`');
+ addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_api_translation` (
+`network_api_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`network_type_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-`network_array_index` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0,
+`network_api_index` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0,
`network_index_translation` VARCHAR(100) NOT NULL DEFAULT '',
-UNIQUE `provider_type_key` (`network_id`,`network_type_id`,`network_array_index`),
+UNIQUE `provider_type_key` (`network_id`,`network_type_id`,`network_api_index`),
UNIQUE `provider_type_trans` (`network_id`,`network_type_id`,`network_index_translation`),
-PRIMARY KEY (`network_array_id`)
-) TYPE={?_TABLE_TYPE?} COMMENT='Translation of API responses'");
+PRIMARY KEY (`network_api_id`)
+) TYPE={?_TABLE_TYPE?} COMMENT='Translation of API responses, generic data, DO NOT ALTER!'");
// Data from the webmaster (you!)
addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_config`');
addAdminMenuSql('network','list_networks','Auflisten/Verwalten','<strong>Experten-Einstellungen!</strong> Hier ändern Sie die Einstellungen an den Grunddaten (Stammdaten) des jeweiligen Werbenetzwerks ab. Sie sollten hier generell nichts einstellen und <a href="http://forum.mxchange.org/forum-43.html" target="_blank" title="Direktlink zum Forum">im Forum</a> um Hilfe fragen, wenn Sie selber ein Werbenetzwerk einrichten möchten.',6);
addAdminMenuSql('network','list_network_types','Werbearten','<strong>Experten-Einstellungen!</strong> Hier ändern Sie die Einstellungen zu den Werbearten pro Werbenetzwerken. Sie sollten hier generell nichts einstellen und <a href="http://forum.mxchange.org/forum-43.html" target="_blank" title="Direktlink zum Forum">im Forum</a> um Hilfe fragen, wenn Sie selber ein Werbenetzwerk einrichten möchten.',7);
addAdminMenuSql('network','list_network_params','Abfrageparameter','<strong>Experten-Einstellungen!</strong> Hier stellen Sie die Abfrageparameter (wie sie genannt werden müssen, um das API-Script korrekt aufrufen zu können) ein, pro Werbenetzwerk. Sie sollten hier generell nichts einstellen und <a href="http://forum.mxchange.org/forum-43.html" target="_blank" title="Direktlink zum Forum">im Forum</a> um Hilfe fragen, wenn Sie selber ein Werbenetzwerk einrichten möchten.',8);
- addAdminMenuSql('network','list_network_array_translation','Antwort-Array','<strong>Experten-Einstellungen!</strong> Hier stellen Sie die Zuweisungen der aus der analysierten API-Antwort Array-Elementen zu den Datenspalten ein. Sie sollten hier generell nichts einstellen und <a href="http://forum.mxchange.org/forum-43.html" target="_blank" title="Direktlink zum Forum">im Forum</a> um Hilfe fragen, wenn Sie selber ein Werbenetzwerk einrichten möchten.',9);
- addAdminMenuSql('network','list_network_error_codes','Fehlercodes','<strong>Experten-Einstellungen!</strong> Hier stellen Sie die Fehlercodes ein, die im Falle eines Fehlers pro API-Script kommen können. Sie sollten hier generell nichts einstellen und <a href="http://forum.mxchange.org/forum-43.html" target="_blank" title="Direktlink zum Forum">im Forum</a> um Hilfe fragen, wenn Sie selber ein Werbenetzwerk einrichten möchten.',10);
- addAdminMenuSql('network','list_network_translations','Array-Übersetzungen','<strong>Experten-Einstellungen!</strong> Hier richten Sie Array-Index-Übersetzungen für nicht-fehler API-Antworten ein. <strong>Dies sind INTERNE Daten und sollten nur vom Entwicklerteam angepasst werden.</strong> Sie sollten hier generell nichts einstellen und <a href="http://forum.mxchange.org/forum-43.html" target="_blank" title="Direktlink zum Forum">im Forum</a> um Hilfe fragen, wenn Sie selber ein Werbenetzwerk einrichten möchten.',11);
+ addAdminMenuSql('network','list_network_translations','Array-Übersetzungen','<strong>Experten-Einstellungen!</strong> Hier richten Sie Array-Index-Übersetzungen für nicht-fehler API-Antworten ein. <strong>Dies sind INTERNE Daten und sollten nur vom Entwicklerteam angepasst werden.</strong> Sie sollten hier generell nichts einstellen und <a href="http://forum.mxchange.org/forum-43.html" target="_blank" title="Direktlink zum Forum">im Forum</a> um Hilfe fragen, wenn Sie selber ein Werbenetzwerk einrichten möchten.',9);
+ addAdminMenuSql('network','list_network_api_translation','Antwort-Array','<strong>Experten-Einstellungen!</strong> Hier stellen Sie die Zuweisungen der aus der analysierten API-Antwort Array-Elementen zu den Datenspalten ein. Sie sollten hier generell nichts einstellen und <a href="http://forum.mxchange.org/forum-43.html" target="_blank" title="Direktlink zum Forum">im Forum</a> um Hilfe fragen, wenn Sie selber ein Werbenetzwerk einrichten möchten.',10);
+ addAdminMenuSql('network','list_network_error_codes','Fehlercodes','<strong>Experten-Einstellungen!</strong> Hier stellen Sie die Fehlercodes ein, die im Falle eines Fehlers pro API-Script kommen können. Sie sollten hier generell nichts einstellen und <a href="http://forum.mxchange.org/forum-43.html" target="_blank" title="Direktlink zum Forum">im Forum</a> um Hilfe fragen, wenn Sie selber ein Werbenetzwerk einrichten möchten.',11);
addAdminMenuSql('network','list_network_error_types','Fehlertypen','<strong>Experten-Einstellungen!</strong> Hier stellen Sie die Namen von Fehlercodes ein, die Scripte zurückliefern können. <strong>Dies sind INTERNE Daten und sollten nur vom Entwicklerteam angepasst werden.</strong> Stellen Sie an diesen Einstellungen bitte nichts um. Sie sollten hier generell nichts einstellen und <a href="http://forum.mxchange.org/forum-43.html" target="_blank" title="Direktlink zum Forum">im Forum</a> um Hilfe fragen, wenn Sie selber ein Werbenetzwerk einrichten möchten.',12);
// Configuration entries
addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_error_codes`');
addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_error_types`');
addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_translations`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_array_translation`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_api_translation`');
addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_config`');
addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_types_config`');
addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_cache`');
// Member menus
addMemberMenuSql('surfbar',NULL,'Surfbar','N','Y',4);
addMemberMenuSql('surfbar','surfbar_start','Surfbar starten','N','Y',1);
- addMemberMenuSql('surfbar','surfbar_book','URL buchen','N','Y',2);
- addMemberMenuSql('surfbar','surfbar_list','URL-Verwaltung','N','Y',3);
- addMemberMenuSql('surfbar','surfbar_stats','URL-Statistiken','N','Y',4);
+ addMemberMenuSql('surfbar','surfbar_book','Seite buchen','N','Y',2);
+ addMemberMenuSql('surfbar','surfbar_list','Seiten-Management','N','Y',3);
+ addMemberMenuSql('surfbar','surfbar_stats','Seiten-Statistik','N','Y',4);
// Admin menus
addAdminMenuSql('surfbar',NULL,'Surfbar','URLs in der Surfbar verwalten, Einstellungen ändern und vieles mehr.',7);
// Add SQL debug data to array for later output
function addSqlToDebug ($result, $sqlString, $timing, $F, $L) {
- // Already executed?
- if (isset($GLOBALS['debug_sqls'][$F][$L][$sqlString])) {
- // Then abort here, we don't need to profile a query twice
- return;
- } // END - if
-
- // Remeber this as profiled (or not, but we don't care here)
- $GLOBALS['debug_sqls'][$F][$L][$sqlString] = true;
-
// Do we have cache?
if (!isset($GLOBALS['debug_sql_available'])) {
// Check it and cache it in $GLOBALS
return;
} // END - if
+ // Already executed?
+ if (isset($GLOBALS['debug_sqls'][$F][$L][$sqlString])) {
+ // Then abort here, we don't need to profile a query twice
+ return;
+ } // END - if
+
+ // Remeber this as profiled (or not, but we don't care here)
+ $GLOBALS['debug_sqls'][$F][$L][$sqlString] = true;
+
// Generate record
$record = array(
'num_rows' => SQL_NUMROWS($result),
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_bonus_turbo` WHERE `%s`=%s ORDER BY `level` ASC LIMIT {?bonus_lines?}",
array($type, $data), __FUNCTION__, __LINE__);
if (!SQL_HASZERONUMS($result)) {
- // Start generating the ranking list
- $max = SQL_NUMROWS($result);
-
// Output all ranks (levels)
- for ($rank = 1; $rank <= $max; $rank++) {
+ for ($rank = 1; $rank <= SQL_NUMROWS($result); $rank++) {
// Load data
$result_users = SQL_QUERY_ESC("SELECT
`userid`, `points`
}
// Generator (somewhat getter) for (return) array translation
-function generateNetworkArrayTranslationOptions ($default) {
+function generateNetworkTranslationOptions ($default = '') {
// Is it cached?
- if (!isset($GLOBALS['network_array_translation'][$default])) {
+ if (!isset($GLOBALS['network_translation'][$default])) {
// Generate and cache it
- $GLOBALS['network_array_translation'][$default] = generateOptionList(
+ $GLOBALS['network_translation'][$default] = generateOptionList(
'network_translations',
'network_translation',
'network_translation',
sprintf("WHERE `network_type_id`=%s",
bigintval(getRequestParameter('network_type'))
),
- $GLOBALS['network_array_translation_disabled'],
+ $GLOBALS['network_translation_disabled'],
'ADMIN_NETWORK_ARRAY_TRANSLATION_'
);
} // END - if
// Return content
- return $GLOBALS['network_array_translation'][$default];
+ return $GLOBALS['network_translation'][$default];
}
//------------------------------------------------------------------------------
// Part taken from admin optimize module of PHPNuke (http://www.phpnuke.org)
function repairOptimizeDatabase () {
$ret = array();
- $tot_data = '0'; $tabs = '0'; $opts = '0';
- $tot_idx = '0'; $total_gain = '0';
+ $tot_data = '0';
+ $opts = '0';
+ $tot_idx = '0';
+ $total_gain = '0';
$tot_all = '0';
+
+ // Get table status
$result = SQL_QUERY('SHOW TABLE STATUS FROM `{?__DB_NAME?}`', __FUNCTION__, __LINE__);
- $tabs = SQL_NUMROWS($result);
+
+ // Init array
$ret['total_size'] = '0';
- $ret['total_tabs'] = $tabs;
+ $ret['total_tabs'] = SQL_NUMROWS($result);
$ret['tables'] = array();
- if ($tabs > 0) {
+
+ // Do we have entries?
+ if (SQL_NUMROWS($result) > 0) {
+ // Fetch all rows
while ($row = SQL_FETCHARRAY($result)) {
$tot_data = $row['Data_length'];
$tot_idx = $row['Index_length'];
// Run SQL command, get line numbers and free memory
$result = SQL_QUERY($sql, __FUNCTION__, __LINE__);
- // Get rows
- $value = SQL_NUMROWS($result);
-
- // Free result
- SQL_FREERESULT($result);
-
// Prepare array for output
$content = array(
'row_descr' => $DESCRs[$key],
// Rewrite CSS class if not last entry is reached
if ($key < (count($sqls) - 1)) $content['bottom'] = 'bottom';
- if (($value > 0) && (!empty($WHATs[$key]))) {
- if (empty($TITLEs[$key])) $TITLEs[$key] = '{--ADMIN_TASK_UNKNOWN_LIST_TITLE--}';
- $content['row_link'] = '<a href="{%url=modules.php?module=admin&what=' . $WHATs[$key] . '%}" title="' . $TITLEs[$key] . '">' . $value . '</a>';
+ if ((SQL_NUMROWS($result) > 0) && (!empty($WHATs[$key]))) {
+ if (empty($TITLEs[$key])) {
+ $TITLEs[$key] = '{--ADMIN_TASK_UNKNOWN_LIST_TITLE--}';
+ } // END - if
+ $content['row_link'] = '<a href="{%url=modules.php?module=admin&what=' . $WHATs[$key] . '%}" title="' . $TITLEs[$key] . '">' . SQL_NUMROWS($result) . '</a>';
} else {
$content['row_link'] = '0';
}
+ // Free result
+ SQL_FREERESULT($result);
+
// And insert the final string into extras template
$OUT .= loadTemplate('admin_overview_task_rows', true, $content);
} // END- foreach
// Do we edit/delete/change main menus or sub menus?
$AND = "(`what` = '' OR `what` IS NULL)"; $SUB = '';
if (isGetRequestParameterSet('sub')) {
- $AND = sprintf("`action`='%s' AND `what` IS NOT NULL", getRequestParameter('sub'));
+ $AND = sprintf("`action`='%s' AND `what` != '' AND `what` IS NOT NULL", getRequestParameter('sub'));
$SUB = getRequestParameter('sub');
} // END - if
$sel = bigintval($sel);
// Update entry
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET
-`title`='%s',
-`action`='%s',
-`what`='%s',
-`descr`='%s'
-WHERE ".$AND." AND `id`=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE
+ `{?_MYSQL_PREFIX?}_admin_menu`
+SET
+ `title`='%s',
+ `action`='%s',
+ `what`='%s',
+ `descr`='%s'
+WHERE
+ ".$AND." AND
+ `id`=%s
+LIMIT 1",
array(
- $menu,
- postRequestParameter('sel_action', $sel),
- postRequestParameter('sel_what', $sel),
- postRequestParameter('sel_desc', $sel),
- $sel,
+ $menu,
+ postRequestParameter('sel_action', $sel),
+ postRequestParameter('sel_what', $sel),
+ postRequestParameter('sel_desc', $sel),
+ $sel,
), __FILE__, __LINE__);
}
// Get ids
if (isGetRequestParameterSet('w')) {
// Sub menus selected
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
- array(getRequestParameter('act'), bigintval(getRequestParameter('tid'))), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$AND." AND `what` != '%s' AND `sort`=%s LIMIT 1",
+ array(
+ getRequestParameter('w'),
+ bigintval(getRequestParameter('tid'))
+ ), __FILE__, __LINE__);
list($tid) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
- $result = SQL_QUERY("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
- array(getRequestParameter('act'), bigintval(getRequestParameter('fid'))), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$AND." AND `what`='%s' AND `sort`=%s LIMIT 1",
+ array(
+ getRequestParameter('w'),
+ bigintval(getRequestParameter('fid'))
+ ), __FILE__, __LINE__);
list($fid) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
} else {
// Main menu selected
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1",
- array(bigintval(getRequestParameter('tid'))), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action` != %s AND ".$AND." AND `sort`=%s LIMIT 1",
+ array(
+ getRequestParameter('act'),
+ bigintval(getRequestParameter('tid'))
+ ), __FILE__, __LINE__);
list($tid) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1",
- array(bigintval(getRequestParameter('fid'))), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`=%s AND ".$AND." AND `sort`=%s LIMIT 1",
+ array(
+ getRequestParameter('act'),
+ bigintval(getRequestParameter('fid'))
+ ), __FILE__, __LINE__);
list($fid) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
}
+ // Do we have entries found?
if ((!empty($tid)) && (!empty($fid))) {
// Sort menu
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `sort`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
- array(bigintval(getRequestParameter('tid')), bigintval($fid)), __FILE__, __LINE__);
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `sort`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
- array(bigintval(getRequestParameter('fid')), bigintval($tid)), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `sort`=%s WHERE ".$AND." AND `id`=%s LIMIT 1",
+ array(
+ bigintval(getRequestParameter('tid')),
+ bigintval($fid)
+ ), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `sort`=%s WHERE ".$AND." AND `id`=%s LIMIT 1",
+ array(
+ bigintval(getRequestParameter('fid')),
+ bigintval($tid)
+ ), __FILE__, __LINE__);
} // END - if
} // END - if
- // By default list menus
- if (!empty($SUB)) {
- // Sub menus of a main menu
- $result = SQL_QUERY_ESC("SELECT id, action, what, title, sort FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC",
- array($SUB), __FILE__, __LINE__);
- } else {
- // Main menus
- $result = SQL_QUERY("SELECT id, action, what, title, sort FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC", __FILE__, __LINE__);
- }
+ // Run SQL
+ $result = SQL_QUERY("SELECT id, action, what, title, sort FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$AND." ORDER BY `sort` ASC", __FILE__, __LINE__);
- $numMenus = SQL_NUMROWS($result);
- if ($numMenus > 0) {
+ // Do we have entries?
+ if (SQL_NUMROWS($result) > 0) {
// Remember sub value
$content['sub'] = $SUB;
if (($data['sort'] == '0') || (($data['sort'] == 1) && (!empty($SUB)))) {
// Is highest position
$data['navi'] = '<a href="{%url=modules.php?module=admin&what=adminedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']+1) . '&fid=' . $data['sort'] . '%}">{--LOWER--}</a>';
- } elseif ($cnt == $numMenus) {
+ } elseif ($cnt == SQL_NUMROWS($result)) {
// Is lowest position
$data['navi'] = '<a href="{%url=modules.php?module=admin&what=adminedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']-1) . '&fid=' . $data['sort'] . '%}">{--HIGHER--}</a>';
} elseif ($data['sort'] > 0) {
break;
case 'register': // Register new extension
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `assigned_admin`=%s AND `task_type`='EXTENSION' LIMIT 1",
- array(getCurrentAdminId()), __FILE__, __LINE__);
- $task_found = SQL_NUMROWS($result);
-
- // Free result
- SQL_FREERESULT($result);
+ // Do we have some tasks?
+ $numTasks = countSumTotalData(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', true, "AND `task_type`='EXTENSION'");
// Is the id number valid and the task was found?
- if (($taskId > 0) && ($task_found == 1)) {
+ if (($taskId > 0) && ($numTasks > 0)) {
// id is valid so begin with registration, we first want to it's real name from task management (subject column)
$result = SQL_QUERY_ESC("SELECT `subject` FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `id`=%s LIMIT 1",
array(bigintval($taskId)), __FILE__, __LINE__);
// Extension was not found in task management
loadTemplate('admin_settings_saved', false, '{--ADMIN_EXTENSION_REGISTRATION_FAILED_ID_404--}');
}
- } elseif ($task_found == '0') {
+ } elseif ($numTasks == '0') {
// No longer assigned or old task
loadTemplate('admin_settings_saved', false, '{--ADMIN_EXTENSION_REGISTRATION_FAILED_ASSIGED--}');
} else {
// Get ids
if (isGetRequestParameterSet('w')) {
// Sub menus selected
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='%s' AND `sort`=%s LIMIT 1",
array(getRequestParameter('act'), bigintval(getRequestParameter('tid'))), __FILE__, __LINE__);
list($tid) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='%s' AND `sort`=%s LIMIT 1",
array(getRequestParameter('act'), bigintval(getRequestParameter('fid'))), __FILE__, __LINE__);
list($fid) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
} else {
// Main menu selected
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`=%s LIMIT 1",
array(bigintval(getRequestParameter('tid'))), __FILE__, __LINE__);
list($tid) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`=%s LIMIT 1",
array(bigintval(getRequestParameter('fid'))), __FILE__, __LINE__);
list($fid) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
if ((!empty($tid)) && (!empty($fid))) {
// Sort menu
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `sort`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `sort`=%s WHERE ".$AND." AND `id`=%s LIMIT 1",
array(bigintval(getRequestParameter('tid')), bigintval($fid)), __FILE__, __LINE__);
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `sort`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `sort`=%s WHERE ".$AND." AND `id`=%s LIMIT 1",
array(bigintval(getRequestParameter('fid')), bigintval($tid)), __FILE__, __LINE__);
} // END - if
} // END - if
array($SUB), __FILE__, __LINE__);
}
- // Get number of menu entries
- $numMenus = SQL_NUMROWS($result);
- if ($numMenus > 0) {
+ // Do we have entries?
+ if (SQL_NUMROWS($result) > 0) {
// Set sub value
$content['sub'] = $SUB;
if (($data['sort'] == '0') || (($data['sort'] == 1) && (!empty($SUB)))) {
// Is highest position
$NAVI = '<a href="{%url=modules.php?module=admin&what=guestedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']+1) . '&fid=' . $data['sort'] . '%}">{--LOWER--}</a>';
- } elseif ($cnt == $numMenus) {
+ } elseif ($cnt == SQL_NUMROWS($result)) {
// Is lowest position
$NAVI = '<a href="{%url=modules.php?module=admin&what=guestedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']-1) . '&fid=' . $data['sort'] . '%}">{--HIGHER--}</a>';
} elseif ($data['sort'] > 0) {
array(bigintval(getRequestParameter('userid'))), __FILE__, __LINE__);
}
- // Get number of rows from the query
- $nums = SQL_NUMROWS($result);
-
- if ($nums > 0) {
+ // Do we have some entries?
+ if (SQL_NUMROWS($result) > 0) {
// Some unconfirmed mails left
if (getRequestParameter('del') == "all") {
// Delete all unconfirmed mails by this user
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `userid`=%s LIMIT %s",
- array(bigintval(getRequestParameter('userid')), $nums), __FILE__, __LINE__);
+ array(bigintval(getRequestParameter('userid')), SQL_NUMROWS($result)), __FILE__, __LINE__);
// Prepare mail and send it away
- $message = loadEmailTemplate('admin-del_links', $nums, bigintval(getRequestParameter('userid')));
+ $message = loadEmailTemplate('admin-del_links', SQL_NUMROWS($result), bigintval(getRequestParameter('userid')));
sendEmail(getUserData('email'), '{--ADMIN_DELETE_LINK_SUBJECT--}', $message);
// Display message
break;
} // END - switch
+ // Do we have an entry?
if (SQL_NUMROWS($result_data) == 1) {
// Mail was found!
$content = SQL_FETCHARRAY($result_data);
SQL_FREERESULT($result_data);
} // END - while
- // Free memory
- SQL_FREERESULT($result);
-
// Remember list in constant for the template
$content['surname'] = getUserData('surname');
$content['family'] = getUserData('family');
$content['email'] = '<a href="' . generateEmailLink(getUserData('email'), 'user_data') . '">' . getUserData('email') . '</a>';
$content['rows'] = $OUT;
- $content['nums'] = $nums;
+ $content['nums'] = SQL_NUMROWS($result);
$content['userid'] = bigintval(getRequestParameter('userid'));
+ // Free memory
+ SQL_FREERESULT($result);
+
// Load final template
loadTemplate('admin_list_links', false, $content);
}
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 04/22/2010 *
+ * =================== Last change: 04/22/2010 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : what-list_network_api_translation.php *
+ * -------------------------------------------------------------------- *
+ * Short description : List/manage network array index translations *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Verwaltet API-Abfrageparameter *
+ * -------------------------------------------------------------------- *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * Needs to be in all Files and every File needs "svn propset *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team *
+ * For more information visit: http://www.mxchange.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!isAdmin())) {
+ die();
+} // END - if
+
+// Add description as navigation point
+addMenuDescription('admin', __FILE__);
+
+// These are expert settings!
+if (doVerifyExpertSettings() != 'agreed') {
+ // Abort here
+ return;
+} // END - if
+
+// By default we should display list/add new forms
+$GLOBALS['network_display'] = true;
+
+// Handle form here
+doNetworkHandleForm();
+
+// Display forms?
+if ($GLOBALS['network_display'] === false) {
+ // Abort here
+ return;
+} // END - if
+
+// Do we have a network selected?
+if (isGetRequestParameterSet('network')) {
+ // Get its data for template
+ $networkData = getNetworkDataById(getRequestParameter('network'));
+
+ // Is a network type selected?
+ if (!isGetRequestParameterSet('network_type')) {
+ // Then present a new selection form
+ outputHtml(generateAdminNetworkTypeList(getRequestParameter('network'), getRequestParameter('network_type')));
+
+ // Abort any other processing
+ return;
+ } // END - if
+
+ // Init disabled list
+ $GLOBALS['network_api_translation_disabled'] = array();
+
+ // Load all advert codes for given network
+ $result = SQL_QUERY_ESC("SELECT
+ p.`network_api_id`, t.`network_type_id`, t.`network_type_handle`, p.`network_api_index`, p.`network_index_translation`
+FROM
+ `{?_MYSQL_PREFIX?}_network_api_translation` AS p
+INNER JOIN
+ `{?_MYSQL_PREFIX?}_network_types` AS t
+ON
+ p.`network_type_id`=t.`network_type_id`
+WHERE
+ p.`network_id`=%s AND
+ p.`network_type_id`=%s
+ORDER BY
+ t.`network_type_handle` ASC,
+ p.`network_api_id` ASC",
+ array(
+ bigintval(getRequestParameter('network')),
+ bigintval(getRequestParameter('network_type'))
+ ), __FILE__, __LINE__);
+
+ // Do we have entries?
+ if (SQL_NUMROWS($result) > 0) {
+ // List all entries
+ $OUT = '';
+ while ($row = SQL_FETCHARRAY($result)) {
+ // Add it to network if the type matches selected
+ if ($row['network_type_id'] == getRequestParameter('network_type_id')) {
+ // Matches, then add it for disabling this entry
+ $GLOBALS['network_api_translation_disabled'][$row['network_api_index']] = true;
+ } // END - if
+
+ // Add row template and switch color
+ $OUT .= loadTemplate('admin_list_network_api_translation_row', true, $row);
+ } // END - while
+
+ // Prepare data for template
+ $content = array(
+ 'rows' => $OUT,
+ 'network_id' => bigintval(getRequestParameter('network')),
+ 'network_title' => $networkData['network_title'],
+ 'network_reflink' => $networkData['network_reflink'],
+ );
+
+ // Load main template
+ loadTemplate('admin_list_network_api_translation', false, $content);
+ } else {
+ // No entries found
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_NETWORK_ARRAY_TRANSLATION_404', $networkData['network_title']));
+ }
+
+ // Add options list for network type
+ $networkData['translation_index'] = (SQL_NUMROWS($result) + 1);
+ $networkData['type_options'] = generateNetworkTypeOptions(getRequestParameter('network_type_id'));
+
+ // Free result
+ SQL_FREERESULT($result);
+
+ // Add form for adding new array_translation pair
+ loadTemplate('admin_add_network_api_translation', false, $networkData);
+} else {
+ // Generate network list for this script
+ outputHtml(generateAdminNetworkList());
+}
+
+// [EOF]
+?>
<?php
-/************************************************************************
- * Mailer v0.2.1-FINAL Start: 04/22/2010 *
- * =================== Last change: 04/22/2010 *
- * *
- * -------------------------------------------------------------------- *
- * File : what-list_network_array_translation.php *
- * -------------------------------------------------------------------- *
- * Short description : List/manage network array index translations *
- * -------------------------------------------------------------------- *
- * Kurzbeschreibung : Verwaltet API-Abfrageparameter *
- * -------------------------------------------------------------------- *
- * $Revision:: $ *
- * $Date:: $ *
- * $Tag:: 0.2.1-FINAL $ *
- * $Author:: $ *
- * Needs to be in all Files and every File needs "svn propset *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
- * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009, 2010 by Mailer Developer Team *
- * For more information visit: http://www.mxchange.org *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
- * MA 02110-1301 USA *
- ************************************************************************/
-
-// Some security stuff...
-if ((!defined('__SECURITY')) || (!isAdmin())) {
- die();
-} // END - if
-
-// Add description as navigation point
-addMenuDescription('admin', __FILE__);
-
-// These are expert settings!
-if (doVerifyExpertSettings() != 'agreed') {
- // Abort here
- return;
-} // END - if
-
-// By default we should display list/add new forms
-$GLOBALS['network_display'] = true;
-
-// Handle form here
-doNetworkHandleForm();
-
-// Display forms?
-if ($GLOBALS['network_display'] === false) {
- // Abort here
- return;
-} // END - if
-
-// Do we have a network selected?
-if (isGetRequestParameterSet('network')) {
- // Get its data for template
- $networkData = getNetworkDataById(getRequestParameter('network'));
-
- // Is a network type selected?
- if (!isGetRequestParameterSet('network_type')) {
- // Then present a new selection form
- outputHtml(generateAdminNetworkTypeList(getRequestParameter('network'), getRequestParameter('network_type')));
-
- // Abort any other processing
- return;
- } // END - if
-
- // Init disabled list
- $GLOBALS['network_array_translation_disabled'] = array();
-
- // Load all advert codes for given network
- $result = SQL_QUERY_ESC("SELECT
- p.`network_array_id`, t.`network_type_id`, t.`network_type_handle`, p.`network_array_index`, p.`network_index_translation`
-FROM
- `{?_MYSQL_PREFIX?}_network_array_translation` AS p
-INNER JOIN
- `{?_MYSQL_PREFIX?}_network_types` AS t
-ON
- p.`network_type_id`=t.`network_type_id`
-WHERE
- p.`network_id`=%s AND
- p.`network_type_id`=%s
-ORDER BY
- t.`network_type_handle` ASC,
- p.`network_array_id` ASC",
- array(
- bigintval(getRequestParameter('network')),
- bigintval(getRequestParameter('network_type'))
- ), __FILE__, __LINE__);
-
- // Remember the rows
- $rows = SQL_NUMROWS($result);
-
- // Do we have entries?
- if ($rows > 0) {
- // List all entries
- $OUT = '';
- while ($row = SQL_FETCHARRAY($result)) {
- // Add it to network if the type matches selected
- if ($row['network_type_id'] == getRequestParameter('network_type_id')) {
- // Matches, then add it for disabling this entry
- $GLOBALS['network_array_translation_disabled'][$row['network_array_index']] = true;
- } // END - if
-
- // Add row template and switch color
- $OUT .= loadTemplate('admin_list_network_array_translation_row', true, $row);
- } // END - while
-
- // Prepare data for template
- $content = array(
- 'rows' => $OUT,
- 'network_id' => bigintval(getRequestParameter('network')),
- 'network_title' => $networkData['network_title'],
- 'network_reflink' => $networkData['network_reflink'],
- );
-
- // Load main template
- loadTemplate('admin_list_network_array_translation', false, $content);
- } else {
- // No entries found
- loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_NETWORK_ARRAY_TRANSLATION_404', $networkData['network_title']));
- }
-
- // Free result
- SQL_FREERESULT($result);
-
- // Add options list for network type
- $networkData['translation_index'] = ($rows + 1);
- $networkData['type_options'] = generateNetworkTypeOptions(getRequestParameter('network_type_id'));
-
- // Add form for adding new array_translation pair
- loadTemplate('admin_add_network_array_translation', false, $networkData);
-} else {
- // Generate network list for this script
- outputHtml(generateAdminNetworkList());
-}
-
-// [EOF]
+// @DEPRECATED
?>
ORDER BY
`network_translate_id` ASC", __FILE__, __LINE__);
- // Remember the rows
- $rows = SQL_NUMROWS($result);
-
// Do we have entries?
- if ($rows > 0) {
+ if (SQL_NUMROWS($result) > 0) {
// List all entries
$OUT = '';
while ($row = SQL_FETCHARRAY($result)) {
// Add it to network if the type matches selected
if ($row['network_type_id'] == getRequestParameter('network_type_id')) {
// Matches, then add it for disabling this entry
- $GLOBALS['network_translations_disabled'][$row['network_array_index']] = true;
+ $GLOBALS['network_translations_disabled'][$row['network_translate_id']] = true;
} // END - if
// Add row template and switch color
bigintval($poolData['max_rec'])
),__FILE__, __LINE__);
- // Total number of unconfirmed mails
- $unconfirmed = SQL_NUMROWS($result);
-
- if ($unconfirmed > 0) {
+ // Do we have entries?
+ if (SQL_NUMROWS($result) > 0) {
// At least one link left to confirm
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
// Render it in our new listing
$OUT = loadTemplate('admin_list_unconfirmed_list', true, $OUT);
-
- // Free memory
- SQL_FREERESULT($result);
} else {
// All links are confirmed... strange, you shall normally not get a link to this place in this scenario... hmmm.
$OUT = loadTemplate('admin_settings_saved', true, '{--ADMIN_UNCONFIRMED_NO_LINK_LEFT--}');
}
// Prepare content
- $content['unconfirmed'] = $unconfirmed;
+ $content['unconfirmed'] = SQL_NUMROWS($result);
$content['timestamp'] = generateDateTime($poolData['timestamp'], 2);
$content['rows'] = $OUT;
+ // Free memory
+ SQL_FREERESULT($result);
+
// Load final template
loadTemplate('admin_list_unconfirmed', false, $content);
} elseif (getRequestParameter('mid') > 0) {
// Get ids
if (isGetRequestParameterSet('w')) {
// Sub menus selected
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='%s' AND `sort`=%s LIMIT 1",
array(bigintval(getRequestParameter('act')), bigintval(getRequestParameter('tid'))), __FILE__, __LINE__);
list($tid) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='%s' AND `sort`=%s LIMIT 1",
array(bigintval(getRequestParameter('act')), bigintval(getRequestParameter('fid'))), __FILE__, __LINE__);
list($fid) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
} else {
// Main menu selected
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`=%s LIMIT 1",
array(bigintval(getRequestParameter('tid'))), __FILE__, __LINE__);
list($tid) = SQL_FETCHROW($result);
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`=%s LIMIT 1",
array(bigintval(getRequestParameter('fid'))), __FILE__, __LINE__);
list($fid) = SQL_FETCHROW($result);
}
if ((!empty($tid)) && (!empty($fid))) {
// Sort menu
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `sort`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `sort`=%s WHERE ".$AND." AND `id`=%s LIMIT 1",
array(bigintval(getRequestParameter('tid')), bigintval($fid)), __FILE__, __LINE__);
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `sort`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `sort`=%s WHERE ".$AND." AND `id`=%s LIMIT 1",
array(bigintval(getRequestParameter('fid')), bigintval($tid)), __FILE__, __LINE__);
} // END - -fi
} // END - if
$result = SQL_QUERY("SELECT `id`, `action`, `what`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC", __FILE__, __LINE__);
}
- // Get total menu entries
- $numMenus = SQL_NUMROWS($result);
-
// Some are there?
- if ($numMenus > 0) {
+ if (SQL_NUMROWS($result) > 0) {
// Set sub value
$content['sub'] = $SUB;
if (($data['sort'] == '0') || (($data['sort'] == 1) && (!empty($SUB)))) {
// Is highest position
$data['navi'] = '<a href="{%url=modules.php?module=admin&what=adminedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']+1) . '&fid=' . $data['sort'] . '%}">{--LOWER--}</a>';
- } elseif ($cnt == $numMenus) {
+ } elseif ($cnt == SQL_NUMROWS($result)) {
// Is lowest position
$data['navi'] = '<a href="{%url=modules.php?module=admin&what=adminedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']-1) . '&fid=' . $data['sort'] . '%}">{--HIGHER--}</a>';
} elseif ($data['sort'] > 0) {
// @TODO This can be rewritten in a dynamic include
switch (getConfig('guest_stats')) {
case 'MEMBERS': // Statistics about your members
- // Members yesterday / today online
- $ymem = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `last_online` >= {?START_YDAY?} AND `last_online` < {?START_TDAY?} AND `status`='CONFIRMED'", __FILE__, __LINE__));
- $tmem = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `last_online` >= {?START_TDAY?} AND `status`='CONFIRMED'", __FILE__, __LINE__));
-
- // Yesterday / today registered
- $yreg = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `joined` >= {?START_YDAY?} AND `joined` < {?START_TDAY?}", __FILE__, __LINE__));
- $treg = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `joined` >= {?START_TDAY?}", __FILE__, __LINE__));
-
// Only males / females
$male = countSumTotalData('M', 'user_data', 'userid', 'gender', true, " AND `status`='CONFIRMED'");
$female = countSumTotalData('F', 'user_data', 'userid', 'gender', true, " AND `status`='CONFIRMED'");
- // Unconfirmed accounts
- $unconfirmed = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `status` != 'CONFIRMED'", __FILE__, __LINE__));
-
- // Total members
- $total = $male + $female;
-
// List every month
$months = array();
for ($idx = 1; $idx < 13; $idx++) {
} // END - foreach
// Prepare data for the template
- $content['total_users'] = $total;
- $content['unconfirmed'] = $unconfirmed;
+ $content['total_users'] = ($male + $female);
+ $content['unconfirmed'] = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `status` != 'CONFIRMED'", __FILE__, __LINE__));
$content['total_males'] = $male;
$content['total_females'] = $female;
- $content['tmem_count'] = $tmem;
- $content['ymem_count'] = $ymem;
- $content['treg_count'] = $treg;
- $content['yreg_count'] = $yreg;
+ $content['tmem_count'] = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `last_online` >= {?START_TDAY?} AND `status`='CONFIRMED'", __FILE__, __LINE__));
+ $content['ymem_count'] = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `last_online` >= {?START_YDAY?} AND `last_online` < {?START_TDAY?} AND `status`='CONFIRMED'", __FILE__, __LINE__));
+ $content['treg_count'] = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `joined` >= {?START_TDAY?}", __FILE__, __LINE__));
+ $content['yreg_count'] = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `joined` >= {?START_YDAY?} AND `joined` < {?START_TDAY?}", __FILE__, __LINE__));
$content['lmode'] = $lmode;
$content['ltitle'] = $ltitle;
// Get all categories
$result = SQL_QUERY("SELECT `id`, `cat` FROM `{?_MYSQL_PREFIX?}_cats`".$whereStatement." ORDER BY `sort` ASC", __FILE__, __LINE__);
-// Get num rows
-$numCategories = SQL_NUMROWS($result);
-
-if ($numCategories > 0) {
+// Do we have entries?
+if (SQL_NUMROWS($result) > 0) {
$LEAST = false;
if (isFormSent()) {
$cnt = '0';
if ($joined != 'Y') $cnt++;
} // END - foreach
- if (($numCategories - $cnt) < getConfig('least_cats')) {
+ if ((SQL_NUMROWS($result) - $cnt) < getConfig('least_cats')) {
unsetPostRequestParameter('ok');
$LEAST = true;
} // END - if
} // END - if
// Put some data into constants for the template
- $content['rows'] = ($numCategories * 2 + 4);
+ $content['rows'] = (SQL_NUMROWS($result) * 2 + 4);
// Load header template
loadTemplate('member_cats_header', false, $content);
// Query for referal levels and percents
$result_depths = SQL_QUERY("SELECT `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` ORDER BY `level` ASC", __FILE__, __LINE__);
+
+// Get total depths
$numDepths = SQL_NUMROWS($result_depths);
// Add many more rows for the login/turbo/ref/order bonus
} // END - if
// Compress it?
+ /**
+ * @TODO On some pages this is buggy
if (!empty($_SERVER['HTTP_ACCEPT_ENCODING']) && (strpos('gzip', $_SERVER['HTTP_ACCEPT_ENCODING']) !== null)) {
// Compress it for HTTP gzip
- $GLOBALS['output'] = gzencode($GLOBALS['output'], 9, true);
+ $GLOBALS['output'] = gzencode($GLOBALS['output'], 9);
// Add header
sendHeader('Content-Encoding: gzip');
// Add header
sendHeader('Content-Encoding: deflate');
}
+ */
// Add final length
sendHeader('Content-Length: ' . strlen($GLOBALS['output']));
--- /dev/null
+<div align="center">
+<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_network_params&do=addnetworkparam&network=[%network%]&network_type={%pipe,getRequestParameter=network_type%}%}" method="post">
+<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
+ <tr>
+ <td class="admin_title bottom" colspan="2" align="center">
+ <strong>{--ADMIN_NETWORK_ARRAY_TRANSLATION_ADD_TITLE--}</strong>
+ <div class="tiny">
+ (<a href="$content[network_reflink]" title="$content[network_title]" target="_blank">$content[network_title]</a>)
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td align="right" width="250">{--ADMIN_NETWORK_TYPE_SELECT--}:</td>
+ <td>
+ <select name="network_type_id" class="admin_select" size="1">
+ {%pipe,generateNetworkTypeOptions=[%network%]%}
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td align="right" width="250">{--ADMIN_NETWORK_ARRAY_TRANSLATION_INDEX--}:</td>
+ <td>
+ <input type="hidden" name="network_array_index" value="$content[translation_index]" />
+ <strong>$content[translation_index]</strong>
+ </td>
+ </tr>
+ <tr>
+ <td class="bottom" align="right" width="250">{--ADMIN_NETWORK_ARRAY_TRANSLATION_INDEX_TRANSLATION--}:</td>
+ <td class="bottom">
+ <select class="admin_select" name="index_translation" size="1">
+ {%pipe,generateNetworkTranslationOptions%}
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td class="admin_footer" colspan="2" align="center">
+ <input type="reset" class="admin_reset" value="{--CLEAR_FORM--}" />
+ <input type="submit" name="ok" class="admin_submit" value="{--ADMIN_NETWORK_ARRAY_TRANSLATION_ADD--}" />
+ </td>
+ </tr>
+</table>
+</form>
+</div>
+
+<div class="admin_note">
+ {--ADMIN_NETWORK_ARRAY_TRANSLATION_ADD_NOTE--}
+</div>
-<div align="center">
-<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_network_params&do=addnetworkparam&network=[%network%]&network_type={%pipe,getRequestParameter=network_type%}%}" method="post">
-<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
- <tr>
- <td class="admin_title bottom" colspan="2" align="center">
- <strong>{--ADMIN_NETWORK_ARRAY_TRANSLATION_ADD_TITLE--}</strong>
- <div class="tiny">
- (<a href="$content[network_reflink]" title="$content[network_title]" target="_blank">$content[network_title]</a>)
- </div>
- </td>
- </tr>
- <tr>
- <td align="right" width="250">{--ADMIN_NETWORK_TYPE_SELECT--}:</td>
- <td>
- <select name="network_type_id" class="admin_select" size="1">
- {%pipe,generateNetworkTypeOptions=[%network%]%}
- </select>
- </td>
- </tr>
- <tr>
- <td align="right" width="250">{--ADMIN_NETWORK_ARRAY_TRANSLATION_INDEX--}:</td>
- <td>
- <input type="hidden" name="network_array_index" value="$content[translation_index]" />
- <strong>$content[translation_index]</strong>
- </td>
- </tr>
- <tr>
- <td class="bottom" align="right" width="250">{--ADMIN_NETWORK_ARRAY_TRANSLATION_INDEX_TRANSLATION--}:</td>
- <td class="bottom">
- <select class="admin_select" name="index_translation" size="1">
- {%pipe,generateNetworkArrayTranslationOptions%}
- </select>
- </td>
- </tr>
- <tr>
- <td class="admin_footer" colspan="2" align="center">
- <input type="reset" class="admin_reset" value="{--CLEAR_FORM--}" />
- <input type="submit" name="ok" class="admin_submit" value="{--ADMIN_NETWORK_ARRAY_TRANSLATION_ADD--}" />
- </td>
- </tr>
-</table>
-</form>
-</div>
-
-<div class="admin_note">
- {--ADMIN_NETWORK_ARRAY_TRANSLATION_ADD_NOTE--}
-</div>
+<!-- @DEPRECATED //-->