templates/de/html/removeip_level.tpl -text
templates/de/html/runtime_fatal_row.tpl -text
templates/de/html/runtime_fatal_table.tpl -text
+templates/de/html/select/.htaccess -text
+templates/de/html/select/select_network_box.tpl -text
templates/de/html/show_bonus.tpl -text
templates/de/html/show_bonus_footer.tpl -text
templates/de/html/show_bonus_header.tpl -text
eval($GLOBALS['template_eval'][$template]);
} 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 />
+ $ret = '<br /><span class="guest_failed">{--TEMPLATE_404--}</span><br />
(' . $template . ')<br />
<br />
{--TEMPLATE_CONTENT--}
// Default is empty
$extraPath = '';
- // Check for admin/guest/member templates
- if (substr($template, 0, 6) == 'admin_') {
- // Admin template found
- $extraPath = 'admin/';
- } elseif (substr($template, 0, 6) == 'guest_') {
- // Guest template found
- $extraPath = 'guest/';
- } elseif (substr($template, 0, 7) == 'member_') {
- // Member template found
- $extraPath = 'member/';
- } elseif (substr($template, 0, 8) == 'install_') {
- // Installation template found
- $extraPath = 'install/';
- } elseif (substr($template, 0, 4) == 'ext_') {
- // Extension template found
- $extraPath = 'ext/';
- } elseif (substr($template, 0, 3) == 'la_') {
- // 'Logical-area' template found
- $extraPath = 'la/';
- } elseif (substr($template, 0, 3) == 'js_') {
- // JavaScript template found
- $extraPath = 'js/';
- } elseif (substr($template, 0, 5) == 'menu_') {
- // Menu template found
- $extraPath = 'menu/';
- } else {
- // Test for extension
- $test = substr($template, 0, strpos($template, '_'));
+ // Do we have cache?
+ if (!isset($GLOBALS['extra_path'][$template])) {
+ // Check for admin/guest/member/etc. templates
+ if (substr($template, 0, 6) == 'admin_') {
+ // Admin template found
+ $extraPath = 'admin/';
+ } elseif (substr($template, 0, 6) == 'guest_') {
+ // Guest template found
+ $extraPath = 'guest/';
+ } elseif (substr($template, 0, 7) == 'member_') {
+ // Member template found
+ $extraPath = 'member/';
+ } elseif (substr($template, 0, 7) == 'select_') {
+ // Selection template found
+ $extraPath = 'select/';
+ } elseif (substr($template, 0, 8) == 'install_') {
+ // Installation template found
+ $extraPath = 'install/';
+ } elseif (substr($template, 0, 4) == 'ext_') {
+ // Extension template found
+ $extraPath = 'ext/';
+ } elseif (substr($template, 0, 3) == 'la_') {
+ // 'Logical-area' template found
+ $extraPath = 'la/';
+ } elseif (substr($template, 0, 3) == 'js_') {
+ // JavaScript template found
+ $extraPath = 'js/';
+ } elseif (substr($template, 0, 5) == 'menu_') {
+ // Menu template found
+ $extraPath = 'menu/';
+ } else {
+ // Test for extension
+ $test = substr($template, 0, strpos($template, '_'));
- // Probe for valid extension name
- if (isExtensionNameValid($test)) {
- // Set extra path to extension's name
- $extraPath = $test . '/';
- } // END - if
- }
+ // Probe for valid extension name
+ if (isExtensionNameValid($test)) {
+ // Set extra path to extension's name
+ $extraPath = $test . '/';
+ } // END - if
+ }
+
+ // Store it in cache
+ $GLOBALS['extra_path'][$template] = $extraPath;
+ } // END - if
// Return result
- return $extraPath;
+ return $GLOBALS['extra_path'][$template];
}
// Loads an email template and compiles it
loadTemplate('admin_settings_saved', false, $content);
}
+// Generates a 'selection box' from given array
+function generateSelectionBoxFromArray ($options, $name, $optionValue, $optionContent) {
+ // Start the output
+ $OUT = '<select name="' . $name . '" size="1" class="admin_select">
+<option value="X" disabled="disabled">{--PLEASE_SELECT--}</option>';
+
+ // Walk through all options
+ foreach ($options as $option) {
+ // Add the <option> entry
+ $OUT .= '<option value="' . $option[$optionValue] . '">' . $option[$optionContent] . '</option>';
+ } // END - foreach
+
+ // Finish selection box
+ $OUT .= '</select>';
+
+ // Prepare output
+ $content = array(
+ 'selection_box' => $OUT,
+ 'module' => getModule(),
+ 'what' => getWhat()
+ );
+
+ // Load template and return it
+ return loadTemplate('select_' . $name . '_box', true, $content);
+}
+
+// Get a module from filename and access level
+function getModuleFromFileName ($file, $accessLevel) {
+ // Default is 'invalid';
+ $modCheck = 'invalid';
+
+ // @TODO This is still very static, rewrite it somehow
+ switch ($accessLevel) {
+ case 'admin':
+ $modCheck = 'admin';
+ break;
+
+ case 'sponsor':
+ case 'guest':
+ case 'member':
+ $modCheck = getModule();
+ break;
+
+ default: // Unsupported file name / access level
+ debug_report_bug('Unsupported file name=' . basename($file) . '/access level=' . $accessLevel);
+ break;
+ }
+
+ // Return result
+ return $modCheck;
+}
+
//////////////////////////////////////////////////
// AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS //
//////////////////////////////////////////////////
'ADMIN_EXTENSIONS_REMOVED' => "Es wurden <span class=\"data\">%s</span> Erweiterungen aus Ihrem {?mt_word?} entfernt.",
'ADMIN_WARNING_SQL_PATCHES_MISSING' => "Eine essentielle Erweiterung <span=\"data\">sql_patches</span> ist noch nicht installiert. Bitte erledigen Sie dies bald, da Ihr {?mt_word?} sonst nicht funktioniert.",
'ADMIN_EXTENSION_IS_NON_PRODUCTIVE' => "Die von Ihnen ausgewählte Erweiterung <span=\"data\">%s</span> ist noch nicht für den produktiven Betrieb freigegeben und befindet sich somit noch in der Entwicklung. Bitte nur verwenden, wenn Sie wissen, was Sie tun.",
+ 'ADMIN_ENTRIES_404' => "Es wurden keine Einträge gefunden.",
'MEMBER_MAIL_BONUS_CONFIRMED_ON' => "Sie haben diese Bonusmail <span class=\"data\">%s</span> bestätigt.",
'MEMBER_MAIL_NORMAL_CONFIRMED_ON' => "Sie haben diese Klickmail <span class=\"data\">%s</span> bestätigt.",
'ADMIN_NETWORK_ADD_TITLE' => "Neues Werbenetzwerk hinzufügen - Allgemeine Daten",
'ADMIN_NETWORK_EDIT_TITLE' => "Werbenetzwerk editieren - Allgemeine Daten",
'ADMIN_NETWORK_DELETE_TITLE' => "Werbenetzwerk löschen - Allgemeine Daten",
+ 'ADMIN_NETWORK_SELECT_TITLE' => "Werbenetzwerk auswählen",
// - Link titles
'ADMIN_NETWORK_LIST_TYPES_LINK_TITLE' => "Weiter zu den Werbearten",
'ADMIN_NETWORK_LIST_PARAMS_LINK_TITLE' => "Weiter zu den Abfrageparametern",
'ADMIN_NETWORK_CHANGE' => "Daten ändern",
'ADMIN_NETWORK_DELETE' => "Löschen",
'ADMIN_NETWORK_REMOVE' => "Daten entfernen",
+ 'ADMIN_NETWORK_CHOOSE' => "Werbenetzwerk auswählen",
// - Success nots
'ADMIN_NETWORK_UPDATED' => "Es wurden <span class=\"data\">%s</span> Einträge in den allgemeinen Daten aktualisiert.",
'ADMIN_NETWORK_REMOVED' => "Es wurden <span class=\"data\">%s</span> Einträge aus den allgemeinen Dateen gelöscht.",
return SQL_AFFECTEDROWS();
}
+// Generates a list of networks for given script and returns it
+function generateAdminNetworkList () {
+ // Init output
+ $content = '';
+
+ // Query for all networks
+ $result = SQL_QUERY("SELECT
+ `network_id`, `network_title`
+FROM
+ `{?_MYSQL_PREFIX?}_network_data`
+ORDER BY
+ `network_title` ASC", __FILE__, __LINE__);
+
+ // Do we have entries?
+ if (SQL_NUMROWS($result) > 0) {
+ // List all entries
+ $rows = array();
+ while ($row = SQL_FETCHARRAY($result)) {
+ // Is this valid, then add it
+ if ((is_array($row)) && (isset($row['network_id']))) $rows[] = $row;
+ } // END - while
+
+ // Generate the selection box
+ $content = generateSelectionBoxFromArray($rows, 'network', 'network_id', 'network_title');
+ } else {
+ // Nothing selected
+ $content = loadTemplate('admin_settings_saved', false, getMessage('ADMIN_ENTRIES_404'));
+ }
+
+ // Free the result
+ SQL_FREERESULT($result);
+
+ // Return the list
+ return $content;
+}
+
//------------------------------------------------------------------------------
// Call-back functions
//------------------------------------------------------------------------------
// Add description as navigation point
addMenuDescription('admin', __FILE__);
+// Do we have a network selected?
+if (isGetRequestElementSet('network')) {
+ // Get its data for template
+ $networkData = getNetworkDataById(getRequestElement('network'));
+ print('<pre>'.print_r($networkData, true).'</pre>');
+} else {
+ // Generate network list for this script
+ outputHtml(generateAdminNetworkList());
+}
+
// [EOF]
?>
// Some security stuff...
if ((!defined('__SECURITY')) || (!isAdmin())) {
die();
-}
+} // END - if
// Add description as navigation point
addMenuDescription('admin', __FILE__);
loadTemplate('admin_settings_saved', false, getMessage('PAYOUT_FAILED_OBTAIN_TASK_ID'));
}
} else {
- if (!isGetRequestElementSet('do')) setRequestGetElement('do', '');
-
if (getRequestElement('do') == 'delete') {
// Delete all requests
$result = SQL_QUERY("TRUNCATE `{?_MYSQL_PREFIX?}_user_payouts`", __FILE__, __LINE__);
// Some security stuff...
if ((!defined('__SECURITY')) || (!isAdmin())) {
die();
-}
+} // END - if
// Add description as navigation point
addMenuDescription('admin', __FILE__);
-// If var is empty set it to empty
-if (!isGetRequestElementSet('mod')) setRequestGetElement('mod', '');
-
// Check if module was selected
if ((getRequestElement('mod') == 'index') || (getRequestElement('mod') == 'login')) {
// Select menu system
// This is an action file!
$type = 'action';
$search = substr($file, 7);
- switch ($accessLevel) {
- case 'admin':
- $modCheck = 'admin';
- break;
-
- case 'sponsor':
- case 'guest':
- case 'member':
- $modCheck = getModule();
- break;
- }
+
+ // Get access level from it
+ $modCheck = getModuleFromFileName($file, $accessLevel);
+
+ // Add what
$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 = '';
- switch ($accessLevel) {
- case 'admin':
- $modCheck = 'admin';
- break;
-
- case 'guest':
- case 'member':
- $modCheck = getModule();
- if (!isAdmin()) {
- $AND = " AND `visible`='Y' AND `locked`='N'";
- }
- break;
- }
+ $AND = " AND `visible`='Y' AND `locked`='N'";
+
+ // Get access level from it
+ $modCheck = getModuleFromFileName($file, $accessLevel);
+
+ // Do we have admin? Then display all
+ if (isAdmin()) $AND = '';
$dummy = substr($search, 0, -4);
$AND .= " AND `action`='".getModeAction($accessLevel, $dummy)."'";
- } elseif (($accessLevel == 'sponsor') || ($accessLevel == "engine")) {
+ } elseif (($accessLevel == 'sponsor') || ($accessLevel == 'engine')) {
// Sponsor / engine menu
$type = 'what';
$search = $file;
// Query the database
$result = SQL_QUERY_ESC("SELECT `%s`, `%s`".$SPEC." FROM `{?_MYSQL_PREFIX?}_%s` ".$where." ORDER BY `%s` ASC",
- array($id, $name, $table, $name), __FUNCTION__, __LINE__);
+ array(
+ $id,
+ $name,
+ $table,
+ $name
+ ), __FUNCTION__, __LINE__);
// Do we have rows?
if (SQL_NUMROWS($result) > 0) {
if (!empty($add)) $add = ' ('.$add.')';
$ret .= '>' . $title . $add . '</option>';
} // END - while
-
- // Free memory
- SQL_FREERESULT($result);
} else {
// No data found
$ret = '<option value="x">{--SELECT_NONE--}</option>';
}
+
+ // Free memory
+ SQL_FREERESULT($result);
}
// Return - hopefully - the requested data
--- /dev/null
+Deny from all
--- /dev/null
+<div align="center">
+<form accept-charset="utf-8" action="{?URL?}/modules.php" method="GET">
+<input type="hidden" name="module" value="$content[module]" />
+<input type="hidden" name="what" value="$content[what]" />
+<div class="admin_table dashed">
+ <div class="admin_title bottom">
+ <strong>{--ADMIN_NETWORK_SELECT_TITLE--}</strong>
+ </div>
+ <div class="bottom">
+ $content[selection_box]
+ </div>
+ <div class="admin_footer">
+ <input type="submit" class="admin_submit" value="{--ADMIN_NETWORK_CHOOSE--}" />
+ </div>
+</div>
+</form>
+</div>