Project continued with rewrites:
authorRoland Häder <roland@mxchange.org>
Tue, 23 Oct 2012 18:23:13 +0000 (18:23 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 23 Oct 2012 18:23:13 +0000 (18:23 +0000)
- Introduced doHandleExtraValues() to encapsulate more if/elseif/else blocks
- Introduced addKeyValueSql()
- PHP's array_merge() didn't maintain $array2's index, so now merge_array() does
  (optionally) it for us
- Other XML template rewrites

20 files changed:
DOCS/TODOs.txt
inc/callback-functions.php
inc/db/lib-mysql3.php
inc/expression-functions.php
inc/functions.php
inc/language/surfbar_de.php
inc/libs/surfbar_functions.php
inc/modules/admin/admin-inc.php
inc/modules/sponsor/.php
inc/mysql-manager.php
inc/template-functions.php
inc/wrapper-functions.php
inc/xml-functions.php
templates/de/html/admin/admin_edit_surfbar_urls.tpl
templates/de/html/admin/admin_edit_surfbar_urls_row.tpl
templates/de/html/admin/admin_list_surfbar_urls.tpl
templates/de/html/admin/admin_list_surfbar_urls_row.tpl
templates/xml/admin/admin_edit_do_surfbar_urls.xml
templates/xml/admin/admin_edit_show_surfbar_urls.xml
templates/xml/admin/admin_list_surfbar_urls.xml

index 8ba7d29e70e6de6da72f535c9e679eedd6e1769b..dce33cd8fe29c191c598eb2fa68a3fe9539467df 100644 (file)
@@ -10,7 +10,7 @@
 ./inc/daily/daily_birthday.php:99:                     // @TODO 4 is hard-coded here, should we move it out in config?
 ./inc/email-functions.php:109: * @TODO Rewrite this to an extension 'smtp'
 ./inc/email-functions.php:227:// @TODO $rawUserId is currently unused
-./inc/expression-functions.php:170:// @TODO FILTER_COMPILE_CONFIG does not handle call-back functions so we handle it here again
+./inc/expression-functions.php:173:// @TODO FILTER_COMPILE_CONFIG does not handle call-back functions so we handle it here again
 ./inc/expression-functions.php:46:     // @TODO is escapeQuotes() enougth for strings with single/double quotes?
 ./inc/extensions/ext-html_mail.php:136:                // @TODO Move these arrays into config
 ./inc/extensions/ext-menu.php:52:              // @TODO Convert menu-Id to one coding-standard. admin(edit|_add) => admin_menu_(edit|add), mem(edit|_add) => (edit|add)_(admin|guest|member)_menu
 ./inc/filter/bonus_filter.php:56:              // @TODO This query isn't right, it will only update if the user was for a longer time away!
 ./inc/filter/cache_filter.php:94:              // @TODO This should be rewritten not to load the cache file for just checking if it is there for save removal.
 ./inc/filter/forced_filter.php:73:             // @TODO This part is unfinished
-./inc/filters.php:1292:                        // @TODO No banner found, output some default banner
-./inc/functions.php:1090:                      // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
-./inc/functions.php:1176:                      // @TODO Are these convertions still required?
-./inc/functions.php:1197:// @TODO Rewrite this function to use readFromFile() and writeToFile()
-./inc/functions.php:1733:      // @TODO Find a way to cache this
-./inc/functions.php:1838:      // @TODO This is still very static, rewrite it somehow
-./inc/functions.php:2042:      // @TODO Rename column data_type to e.g. mail_status
+./inc/filters.php:1295:                        // @TODO No banner found, output some default banner
+./inc/functions.php:1089:                      // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
+./inc/functions.php:1175:                      // @TODO Are these convertions still required?
+./inc/functions.php:1196:// @TODO Rewrite this function to use readFromFile() and writeToFile()
+./inc/functions.php:1780:      // @TODO Find a way to cache this
+./inc/functions.php:1885:      // @TODO This is still very static, rewrite it somehow
+./inc/functions.php:2095:      // @TODO Rename column data_type to e.g. mail_status
 ./inc/gen_sql_patches.php:95:// @TODO Rewrite this to a filter
 ./inc/header.php:66:// @TODO Find a way to not use direct module comparison
 ./inc/install-functions.php:91:        // @TODO DEACTIVATED: changeDataInLocalConfigurationFile('OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestElement('omode'), 0);
 ./inc/mysql-manager.php:1461:  // @TODO Rewrite this to a filter
 ./inc/mysql-manager.php:1767:                  // @TODO Rewrite this to a filter
 ./inc/mysql-manager.php:1964:                          // @TODO If we can rewrite the EL sub-system to support more than one parameter, this call_user_func_array() can be avoided
-./inc/mysql-manager.php:2098:                  // @TODO Used generic 'userid' here
+./inc/mysql-manager.php:2067:                  // @TODO Used generic 'userid' here
 ./inc/mysql-manager.php:398:   // @TODO Try to rewrite this to one or more functions
 ./inc/mysql-manager.php:44:// @TODO Can we cache this?
 ./inc/purge/purge-inact.php:55:        // @TODO Rewrite these if() blocks to a filter
 ./inc/revision-functions.php:168:// @TODO This function does also set and get in 'cache_array'
-./inc/template-functions.php:1126:                     // @TODO Deprecate this thing
 ./inc/template-functions.php:1137:                     // @TODO Deprecate this thing
-./inc/template-functions.php:1244:     // @TODO This can be easily moved out after the merge from EL branch to this is complete
-./inc/template-functions.php:1293:             // @TODO Add a little more infos here
-./inc/template-functions.php:1668:// @TODO Lame description for this function
-./inc/template-functions.php:1690:                     // @TODO Move this in a filter
-./inc/template-functions.php:197:       * @TODO On some pages this is buggy
-./inc/template-functions.php:2293:     // @TODO Is this needed for e.g. $GLOBALS['template_content'] ? $this->setRawTemplateData($compactedContent);
-./inc/template-functions.php:285:      // @TODO Remove these sanity checks if all is fine
-./inc/template-functions.php:617:// @TODO $simple/$constants are deprecated
-./inc/template-functions.php:715:                      // @TODO $userid is deprecated and should be removed from loadEmailTemplate() and replaced with $content[userid] in all templates
-./inc/wrapper-functions.php:3017:      // @TODO Find a way to not use direct module comparison
-./inc/wrapper-functions.php:494:// @TODO Do some more sanity check here
+./inc/template-functions.php:1148:                     // @TODO Deprecate this thing
+./inc/template-functions.php:1255:     // @TODO This can be easily moved out after the merge from EL branch to this is complete
+./inc/template-functions.php:1304:             // @TODO Add a little more infos here
+./inc/template-functions.php:1679:// @TODO Lame description for this function
+./inc/template-functions.php:1701:                     // @TODO Move this in a filter
+./inc/template-functions.php:203:       * @TODO On some pages this is buggy
+./inc/template-functions.php:2304:     // @TODO Is this needed for e.g. $GLOBALS['template_content'] ? $this->setRawTemplateData($compactedContent);
+./inc/template-functions.php:291:      // @TODO Remove these sanity checks if all is fine
+./inc/template-functions.php:628:// @TODO $simple/$constants are deprecated
+./inc/template-functions.php:726:                      // @TODO $userid is deprecated and should be removed from loadEmailTemplate() and replaced with $content[userid] in all templates
+./inc/wrapper-functions.php:3037:      // @TODO Find a way to not use direct module comparison
+./inc/wrapper-functions.php:506:// @TODO Do some more sanity check here
 ./inc/xml-functions.php:239:   // @TODO Handle characters
 ./mailid.php:102:              // @TODO Rewrite this to a filter
 ./mailid.php:145:                                      // @TODO Rewrite this to a filter
index 4e45cb03e1c27c0259dbdb22767da6ee4f72799c..55616a03685508e7fbbbf87f1b1bbd35e5c5923d 100644 (file)
@@ -319,6 +319,18 @@ function doXmlExtraParameterReloadList ($resource, $attributes) {
        }
 }
 
+// Handles the XML node 'extra-parameter-waiting-list'
+function doXmlExtraParameterWaitingList ($resource, $attributes) {
+       // There should be no attributes
+       if (count($attributes) > 0) {
+               // Please don't add any attributes to foo-list nodes
+               reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
+       } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list']['waiting_list'])) {
+               // This list should be created already
+               reportBug(__FUNCTION__, __LINE__, 'waiting_list should be already created.');
+       }
+}
+
 // Handles the XML node 'extra-parameter-member-list-entry'
 function doXmlExtraParameterMemberListEntry ($resource, $attributes) {
        // There are three attributes, by default
@@ -379,6 +391,36 @@ function doXmlExtraParameterReloadListEntry ($resource, $attributes) {
        addXmlValueToCallbackAttributes('extra_list', $attributes, 'reload_list');
 }
 
+// Handles the XML node 'extra-parameter-waiting-list-entry'
+function doXmlExtraParameterWaitingListEntry ($resource, $attributes) {
+       // There are three attributes, by default
+       if (count($attributes) != 3) {
+               // Not the right count
+               reportBug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
+       } elseif (!isset($attributes['NAME'])) {
+               // 'NAME' not found
+               reportBug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
+       } elseif (!isset($attributes['TYPE'])) {
+               // 'TYPE' not found
+               reportBug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
+       } elseif (!isInvalidXmlType($attributes['TYPE'])) {
+               // No valid type
+               reportBug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
+       } elseif (!isset($attributes['VALUE'])) {
+               // 'VALUE' not found
+               reportBug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
+       } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
+               // Not valid/verifyable
+               reportBug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
+       } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list']['waiting_list'])) {
+               // doXmlCallbackFunction is missing
+               reportBug(__FUNCTION__, __LINE__, 'Required XML node callback-function/extra-parameter-list/waiting-list not included around this node. Please fix your XML.');
+       }
+
+       // Add the entry to the list
+       addXmlValueToCallbackAttributes('extra_list', $attributes, 'waiting_list');
+}
+
 // Handles the XML node 'extra-parameter-added-list'
 function doXmlExtraParameterAddedList ($resource, $attributes) {
        // There should be no attributes
index 9dfdfcf342556f9f52076d2755e9350715f35a30..4d7910d0b9254021e2f7d65afb35880ef755ec24 100644 (file)
@@ -275,7 +275,7 @@ function SQL_QUERY_ESC ($sqlString, $data, $F, $L, $run = TRUE, $strip = TRUE, $
                return FALSE;
        } // END - if
 
-       // Init array for escaped data with SQL string
+       // Init array for escape'd data with SQL string
        $dataSecured = array(
                '__sql_string' => $sqlString
        );
index 4e7c7f264ad73cc89b2786e9051a9b28cd4a53a4..3693439c41aafae59b8065992d2633f7fcfc4c94 100644 (file)
@@ -118,7 +118,7 @@ function doExpressionUrl ($data) {
        $replacer = "{DQUOTE} . encodeUrl('" . $data['matches'][4][$data['key']] . "', " . $data['output_mode'] . ') . {DQUOTE}';
 
        // Debug log
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'replacer=' . $replacer . ',callback=' . $data['callback']);
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'replacer=' . $replacer . ',callback=' . $data['callback'] . ',output_mode=' . $data['output_mode']);
 
        // Replace it
        $code = replaceExpressionCode($data, $replacer);
@@ -162,6 +162,9 @@ function doExpressionExt ($data) {
        // Replace it and insert parameter for GET request
        $code = replaceExpressionCode($data, $replacer);
 
+       // Debug message
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'code=' . $code . ',replacer=' . $replacer . ',key=' . $data['key'] . ',callback=' . $data['callback']);
+
        // Return replaced code
        return $code;
 }
index d13b75ec43a6364b13049dcc36645cfc126c192e..d69c1abdd066a742f6ed1a9188be63ec04e3d6b6 100644 (file)
@@ -1329,6 +1329,54 @@ function handleExtraValues ($filterFunction, $value, $extraValue) {
        return $ret;
 }
 
+// Tries to determine if call-back functions and/or extra values shall be parsed
+function doHandleExtraValues ($filterFunctions, $extraValues, $key, $entries, $userIdColumn, $search) {
+       // Debug message
+       /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',entries=' . $entries . ',userIdColumn=' . $userIdColumn[0] . ',search=' . $search . ',filterFunctions=' . print_r($filterFunctions, TRUE) . ',extraValues=' . print_r($extraValues, TRUE));
+
+       // Send data through the filter function if found
+       if ($key == $userIdColumn[0]) {
+               // Is the userid, we have to process it with convertZeroToNull()
+               $entries = convertZeroToNull($entries);
+       } elseif ((!empty($filterFunctions[$key])) && (isset($extraValues[$key]))) {
+               // Debug mode enabled?
+               if (isDebugModeEnabled()) {
+                       // Then log it
+                       /* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'search=' . $search . ',filterFunctions=' . $filterFunctions[$search] . ',extraValues=' . $extraValues[$key] . ',key=' . $key . ',id=' . $id . ',entries[' . gettype($entries) . ']=' . $entries . ' - BEFORE!');
+               } // END - if
+
+               // Filter function + extra value set
+               $entries = handleExtraValues($filterFunctions[$key], $entries, $extraValues[$key]);
+
+               // Debug mode enabled?
+               if (isDebugModeEnabled()) {
+                       // Then log it
+                       /* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'search=' . $search . ',filterFunctions=' . $filterFunctions[$search] . ',extraValues=' . $extraValues[$key] . ',key=' . $key . ',id=' . $id . ',entries[' . gettype($entries) . ']=' . $entries . ' - AFTER!');
+               } // END - if
+       } elseif (!empty($filterFunctions[$search])) {
+               // Debug mode enabled?
+               if (isDebugModeEnabled()) {
+                       // Then log it
+                       /* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'search=' . $search . ',filterFunctions=' . $filterFunctions[$search] . ',key=' . $key . ',search=' . $search . ',entries[' . gettype($entries) . ']=' . $entries . ' - BEFORE!');
+               } // END - if
+
+               // Handle extra values
+               $entries = handleExtraValues($filterFunctions[$search], $entries, NULL);
+
+               // Debug mode enabled?
+               if (isDebugModeEnabled()) {
+                       // Then log it
+                       /* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'search=' . $search . ',filterFunctions=' . $filterFunctions[$search] . ',key=' . $key . ',search=' . $search . ',entries[' . gettype($entries) . ']=' . $entries . ' - AFTER!');
+               } // END - if
+
+               // Make sure entries is not bool, then something went wrong
+               assert(!is_bool($entries));
+       }
+
+       // Return value
+       return $entries;
+}
+
 // Converts timestamp selections into a timestamp
 function convertSelectionsToEpocheTime (array &$postData, array &$content, &$id, &$skip) {
        // Init test variable
@@ -1872,8 +1920,9 @@ function encodeUrl ($url, $outputMode = '0') {
                        $separator = '?';
                } // END - if
 
-               // Add it to URL
+               // Is the session id set?
                if (session_id() != '') {
+                       // Then add it to URL
                        $url .= $separator . session_name() . '=' . session_id();
                } // END - if
        } // END - if
@@ -1884,10 +1933,15 @@ function encodeUrl ($url, $outputMode = '0') {
                $url = '{?URL?}/' . $url;
        } // END - if
 
+       // Debug message
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'url=' . $url . ',isHtmlOutputMode()=' . intval(isHtmlOutputMode()) . ',outputMode=' . $outputMode);
+
        // Is there to decode entities?
        if ((!isHtmlOutputMode()) || ($outputMode != '0')) {
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'url=' . $url . ' - BEFORE DECODING');
                // Decode them for e.g. JavaScript parts
                $url = decodeEntities($url);
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'url=' . $url . ' - AFTER DECODING');
        } // END - if
 
        // Debug log
index 5486a016c7f1bcc1c900738346085faa57616829..45ee3bea84bf628f654bdb3533fd6ce8ab204564 100644 (file)
@@ -100,6 +100,8 @@ addMessages(array(
        'ADMIN_ENTER_SURFBAR_LIMIT_NOTICE' => "(0 = Unbegrenzt)",
        'ADMIN_SELECT_SURFBAR_WAITING' => "Verweildauer:",
        'ADMIN_SELECT_SURFBAR_RELOAD' => "Reloadzeit:",
+       'ADMIN_CHANGE_SURFBAR_FIXED_RELOAD' => "Neue Reloadzeit einstellen:",
+       'ADMIN_CHANGE_SURFBAR_FIXED_WAITING' => "Neue Verweildauer einstellen:",
        'ADMIN_SURFBAR_URLS_404' => "Es konnten keine URLs in der Surfbar gefunden werden.",
        'ADMIN_SURFBAR_ACTIONS_404' => "Es konnten keine Mitglieder-Aktionen in der Surfbar gefunden werden.",
        'ADMIN_SURFBAR_REWARD' => "Verg&uuml;tung",
@@ -108,6 +110,8 @@ addMessages(array(
        'ADMIN_SURFBAR_VIEWS_TOTAL' => "Gesamtaufrufe",
        'ADMIN_SURFBAR_STATUS' => "URL-Status",
        'ADMIN_SURFBAR_REGISTERED' => "URL aufgenommen",
+       'ADMIN_SURFBAR_FIXED_RELOAD' => "Feste Reloadsperre",
+       'ADMIN_SURFBAR_FIXED_WAITING' => "Fester Mindestauffenthalt",
        'ADMIN_SURFBAR_LAST_LOCKED' => "Zuletzt gesperrt",
        'ADMIN_SURFBAR_LOCK_REASON' => "Sperrgrund",
        'ADMIN_SURFBAR_UNLOCK_DONE' => "Freischaltung ausgew&auml;hlter URL(s) vollst&auml;ndig. :-)",
index 58d118964e48ccc397e6c9bad8368e46c70b0794..b2fd20ea424f88eabe0e75bc46d7e33a4d983553 100644 (file)
@@ -601,7 +601,7 @@ function getSurfbarUrlData ($searchTerm, $column = 'url_id', $order = 'url_id',
        // If the column is 'url_id' there can be only one entry
        $limit = '';
        if ($column == 'url_id') {
-               $limit = "LIMIT 1";
+               $limit = 'LIMIT 1';
        } // END - if
 
        // Look up the record
@@ -1220,7 +1220,7 @@ function updateSurfbarSaltStatistics () {
        updateInsertSurfbarStatisticsRecord();
 
        // Simply store the salt from cache away in database...
-       SQL_QUERY_ESC("UPDATE
+       SQL_QUERY("UPDATE
        `{?_MYSQL_PREFIX?}_surfbar_salts`
 SET
        `salts_last_salt`='{%pipe,getSurfbarSalt%}'
@@ -1389,14 +1389,14 @@ function determineSurfbarWaitingTime () {
        // Get fixed reload lock
        $fixed = getSurfbarFixedWaitingTime();
 
-       // Is the fixed reload time set?
+       // Is the URL's fixed waiting time set?
        if ($fixed > 0) {
                // Return it
                return $fixed;
        } // END - if
 
        // Static time is default
-       $time = getConfig('surfbar_static_time');
+       $time = getSurfbarStaticTime();
 
        // Which payment model do we have?
        if (getSurfbarPaymentModel() == 'DYNAMIC') {
index 860301125b7522138f9a0cc3320a303c37177bf2..9ed9029b2232fc85bac0664a3fcda83bb3a737fb 100644 (file)
@@ -559,7 +559,7 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement
        $skip = FALSE;
 
        // Now, walk through all entries and prepare them for saving
-       //* BUG: */ reportBug(__FUNCTION__, __LINE__, '<pre>'.print_r(postRequestArray(),true).'</pre>');
+       //* BUG: */ reportBug(__FUNCTION__, __LINE__, '<pre>'.print_r(postRequestArray(), TRUE).'</pre>');
        foreach ($postData as $id => $val) {
                // Process only formular field but not submit buttons ;)
                if ($id == 'ok') {
index 8ca0e96a0f07d9896a903f3a78b4f7a00280558d..e020648dcb1d7e0e9b6af0e34c222e0a2c251d2d 100644 (file)
@@ -47,7 +47,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Put all HTML code into $GLOBALS['sponsor_output']!
-// E.g.: $GLOBALS['sponsor_output'] = loadTemplate('sponsor_template', true);
+// E.g.: $GLOBALS['sponsor_output'] = loadTemplate('sponsor_template', TRUE);
 
 // [EOF]
 ?>
index d409f4a3fdec964f233e46d19e26454bc0b10560..8d59df8a9fb59edf9b3d77c04c8ecb59e49079b2 100644 (file)
@@ -2028,39 +2028,8 @@ function doGenericAddEntries ($tableName, $columns = array(), $filterFunctions =
                $sqlColumns[$key] = SQL_ESCAPE($columnName);
                $sqlValues[$key]  = SQL_ESCAPE(postRequestElement($columnName));
 
-               // Send data through the filter function if found
-               if ((isset($filterFunctions[$key])) && (isset($extraValues[$key . '_list']))) {
-                       // Debug mode enabled?
-                       if (isDebugModeEnabled()) {
-                               // Then log it
-                               //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'columnName=' . $columnName . ',sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - BEFORE!');
-                       } // END - if
-
-                       // Filter function set, so run it
-                       $sqlValues[$key] = call_user_func_array($filterFunctions[$key], merge_array(array($columnName), $extraValues[$key . '_list']));
-
-                       // Debug mode enabled?
-                       if (isDebugModeEnabled()) {
-                               // Then log it
-                               //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'columnName=' . $columnName . ',sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - AFTER!');
-                       } // END - if
-               } elseif (isset($filterFunctions[$key])) {
-                       // Debug mode enabled?
-                       if (isDebugModeEnabled()) {
-                               // Then log it
-                               //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'columnName=' . $columnName . ',sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - BEFORE!');
-                       } // END - if
-
-                       // Run through an extra filter
-                       $sqlValues[$key] = handleExtraValues($filterFunctions[$key], $sqlValues[$key], NULL);
-
-                       // Debug mode enabled?
-                       if (isDebugModeEnabled()) {
-                               // Then log it
-                               //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'columnName=' . $columnName . ',sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - AFTER!');
-                       } // END - if
-
-               }
+               // Try to handle call-back functions and/or extra values on the list
+               $sqlValues[$key] = doHandleExtraValues($filterFunctions, $extraValues, $key . '_list', $sqlValues[$key], $userIdColumn, key(search_array($columns, 'column', $key)));
 
                // Is the value not a number?
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key]);
@@ -2109,6 +2078,15 @@ function doGenericAddEntries ($tableName, $columns = array(), $filterFunctions =
 
 // Edit rows by given id numbers
 function doGenericEditEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $editNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array(), $subject = '') {
+       // Is there "time columns"?
+       if (count($timeColumns) > 0) {
+               // Then "walk" through all entries
+               foreach ($timeColumns as $column) {
+                       // Convert all (possible) selections
+                       convertSelectionsToEpocheTimeInPostData($column . '_ye');
+               } // END - foreach
+       } // END - if
+
        // Change them all
        $affected = '0';
        foreach (postRequestElement($idColumn[0]) as $id => $sel) {
@@ -2126,67 +2104,50 @@ function doGenericEditEntriesConfirm ($tableName, $columns = array(), $filterFun
                // "Walk" through all entries
                foreach (postRequestArray() as $key => $entries) {
                        // Skip raw userid which is always invalid
-                       if ($key == $rawUserId[0]) {
+                       if (($key == $rawUserId[0]) || ($key == 'do_edit')) {
                                // Continue with next field
                                //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',idColumn[0]=' . $idColumn[0] . ',rawUserId=' . $rawUserId[0]);
                                continue;
                        } // END - if
 
                        // Debug message
-                       //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',idColumn[0]=' . $idColumn[0] . ',entries=<pre>'.print_r($entries,TRUE).'</pre>');
+                       /* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',id=' . $id . ',idColumn[0]=' . $idColumn[0] . ',entries=<pre>'.print_r($entries,TRUE).'</pre>');
 
                        // Is entries an array?
                        if (($key != $idColumn[0]) && (is_array($entries)) && (isset($entries[$id]))) {
-                               //die($key.'/'.$id.'=<pre>'.print_r($columns,TRUE).'</pre><pre>'.print_r($filterFunctions,TRUE).'</pre>');
                                // Search for the right array index
                                $search = key(search_array($columns, 'column', $key));
 
                                // Add this entry to content
                                $content[$key] = $entries[$id];
 
-                               // Send data through the filter function if found
-                               if ($key == $userIdColumn[0]) {
-                                       // Is the userid, we have to process it with convertZeroToNull()
-                                       $entries[$id] = convertZeroToNull($entries[$id]);
-                               } elseif ((isset($filterFunctions[$key])) && (isset($extraValues[$key]))) {
-                                       // Filter function + extra value set
-                                       $entries[$id] = handleExtraValues($filterFunctions[$key], $entries[$id], $extraValues[$key]);
-                               } elseif (isset($filterFunctions[$search])) {
-                                       // Debug mode enabled?
-                                       if (isDebugModeEnabled()) {
-                                               // Then log it
-                                               //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'search=' . $search . ',filterFunctions=' . $filterFunctions[$search] . ',key=' . $key . ',id=' . $id . ',entries[' . gettype($entries[$id]) . ']=' . $entries[$id] . ' - BEFORE!');
-                                       } // END - if
-
-                                       // Handle extra values
-                                       $entries[$id] = handleExtraValues($filterFunctions[$search], $entries[$id], NULL);
-
-                                       // Debug mode enabled?
-                                       if (isDebugModeEnabled()) {
-                                               // Then log it
-                                               //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'search=' . $search . ',filterFunctions=' . $filterFunctions[$search] . ',key=' . $key . ',id=' . $id . ',entries[' . gettype($entries[$id]) . ']=' . $entries[$id] . ' - AFTER!');
-                                       } // END - if
-
-                                       // Make sure entries[id] is not bool, then something went wrong
-                                       assert(!is_bool($entries[$id]));
-                               }
+                               // Debug message
+                               //* BUG: */ die($key.'/'.$id.'/'.$search.'=<pre>'.print_r($columns,TRUE).'</pre><pre>'.print_r($filterFunctions,TRUE).'</pre>');
 
-                               // Is the value NULL?
-                               if ($entries[$id] == 'NULL') {
-                                       // Add it directly
-                                       $sql .= sprintf(' `%s`=NULL,',
-                                               SQL_ESCAPE($key)
-                                       );
-                               } else {
-                                       // Else add the value covered
-                                       $sql .= sprintf(" `%s`='%s',",
-                                               SQL_ESCAPE($key),
-                                               SQL_ESCAPE($entries[$id])
-                                       );
-                               }
+                               // Handle possible call-back functions and/or extra values
+                               $entries[$id] = doHandleExtraValues($filterFunctions, $extraValues, $key, $entries[$id], $userIdColumn, $search);
+
+                               // Add key/value pair to SQL string
+                               $sql .= addKeyValueSql($key, $entries[$id]);
                        } elseif (($key != $idColumn[0]) && (!is_array($entries))) {
-                               // Add normal entries as well!
-                               $content[$key] =  $entries;
+                               // Search for it
+                               $search = key(search_array($columns, 'column', $key));
+                               //* BUG: */ die($key.'/<pre>'.print_r($search, TRUE).'</pre>=<pre>'.print_r($columns, TRUE).'</pre>');
+
+                               // Debug message
+                               /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',entries[' . gettype($entries) . ']=' . $entries . ',search=' . $search . ' - BEFORE!');
+
+                               // Add normal entries as well
+                               $content[$key] = $entries;
+
+                               // Handle possible call-back functions and/or extra values
+                               $entries = doHandleExtraValues($filterFunctions, $extraValues, $key, $entries, $userIdColumn, $search);
+
+                               // Debug message
+                               /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',entries[' . gettype($entries) . ']=' . $entries . ',search=' . $search . ' - AFTER!');
+
+                               // Add key/value pair to SQL string
+                               $sql .= addKeyValueSql($key, $entries);
                        }
                } // END - foreach
 
@@ -2199,6 +2160,7 @@ function doGenericEditEntriesConfirm ($tableName, $columns = array(), $filterFun
                $sql .= " LIMIT 1";
 
                // Run this query
+               //* BUG: */ die($sql.'<pre>'.print_r(postRequestArray(), TRUE).'</pre>');
                SQL_QUERY($sql, __FUNCTION__, __LINE__);
 
                // Add affected rows
@@ -2277,7 +2239,7 @@ function doGenericDeleteEntriesConfirm ($tableName, $columns = array(), $filterF
        } // END - if
 
        // Delete them all
-       //* BUG: */ die($sql.'<br /><pre>'.print_r($tableName,TRUE).'</pre><pre>'.print_r($columns,TRUE).'</pre><pre>'.print_r($filterFunctions,TRUE).'</pre><pre>'.print_r($extraValues,TRUE).'</pre><pre>'.print_r($deleteNow,TRUE).'</pre><pre>'.print_r($idColumn,TRUE).'</pre>');
+       //* BUG: */ die($sql.'<pre>'.print_r($tableName,TRUE).'</pre><pre>'.print_r($columns,TRUE).'</pre><pre>'.print_r($filterFunctions,TRUE).'</pre><pre>'.print_r($extraValues,TRUE).'</pre><pre>'.print_r($deleteNow,TRUE).'</pre><pre>'.print_r($idColumn,TRUE).'</pre>');
        $idList = '';
        foreach (postRequestElement($idColumn[0]) as $id => $sel) {
                // Is id zero?
@@ -2385,24 +2347,8 @@ function doGenericListBuilder ($prefix, $listType, $tableName, $columns, $filter
                                        $GLOBALS[$prefix . '_list_builder_id_value'] = bigintval($value);
                                } // END - if
 
-                               // Is there a call-back function and extra-value pair?
-                               if ((isset($filterFunctions[$idx])) && (isset($extraValues[$idx]))) {
-                                       // Handle the call in external function
-                                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',fucntion=' . $filterFunctions[$idx] . ',value=' . $value);
-                                       $content[$key] = handleExtraValues(
-                                               $filterFunctions[$idx],
-                                               $value,
-                                               $extraValues[$idx]
-                                       );
-                               } elseif ((isset($columns[$idx]['name'])) && (isset($filterFunctions[$columns[$idx]['name']])) && (isset($extraValues[$columns[$idx]['name']]))) {
-                                       // Handle the call in external function
-                                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',fucntion=' . $filterFunctions[$columns[$idx]['name']] . ',value=' . $value);
-                                       $content[$key] = handleExtraValues(
-                                               $filterFunctions[$columns[$idx]['name']],
-                                               $value,
-                                               $extraValues[$columns[$idx]['name']]
-                                       );
-                               }
+                               // Try to handle call-back functions and/or extra values
+                               $content[$key] = doHandleExtraValues($filterFunctions, $extraValues, $idx, $content[$key], $userIdColumn, $idx);
                        } // END - foreach
 
                        // Then list it
@@ -2461,5 +2407,34 @@ function isUrlBlacklisted ($url) {
        return $listed;
 }
 
+// Adds key/value pair to a working SQL string together
+function addKeyValueSql ($key, $value) {
+       // Init SQL
+       $sql = '';
+
+       // Is it NULL?
+       if (($value == 'NULL') || (is_null($value))) {
+               // Add key with NULL
+               $sql .= sprintf(' `%s`=NULL,',
+                       SQL_ESCAPE($key)
+               );
+       } elseif ((is_double($value)) || (is_float($value)) || (is_int($value))) {
+               // Is a number, so addd it directly
+               $sql .= sprintf(" `%s`=%s,",
+                       SQL_ESCAPE($key),
+                       $value
+               );
+       } else {
+               // Else add the value escape'd
+               $sql .= sprintf(" `%s`='%s',",
+                       SQL_ESCAPE($key),
+                       SQL_ESCAPE($value)
+               );
+       }
+
+       // Return SQL string
+       return $sql;
+}
+
 // [EOF]
 ?>
index 9f84147c1bbbfbbc0b5dab54e05ba4475bbb1e4f..f296be7355dc7e9918f091c3a15b610d05eb574a 100644 (file)
@@ -184,8 +184,14 @@ function compileFinalOutput () {
        addPageHeaderFooter();
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, '__output(length)=' . strlen($GLOBALS['__output']) . ' - After addPageHeaderFooter() call.');
 
-       // Do the final compilation
-       $GLOBALS['__output'] = compileUriCode(doFinalCompilation($GLOBALS['__output']));
+       // Do the final (general) compilation
+       $GLOBALS['__output'] = doFinalCompilation($GLOBALS['__output']);
+
+       // Is the output mode not HTML?
+       if (!isHtmlOutputMode()) {
+               // Then remove entities
+               $GLOBALS['__output'] = compileUriCode($GLOBALS['__output']);
+       } // END - if
 
        // Extension 'rewrite' installed?
        if ((isExtensionActive('rewrite')) && (!isCssOutputMode())) {
@@ -335,20 +341,25 @@ function loadTemplate ($template, $return = FALSE, $content = array(), $compileC
                                        $code = '<!-- Template ' . $template . ' - Start //-->' . $GLOBALS['template_content']['html'][$template] . '<!-- Template ' . $template . ' - End //-->';
 
                                        // Prepare eval() command
+                                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Reached!');
                                        $GLOBALS['template_eval']['html'][$template] = '$ret = "' . getColorSwitchCode($template) . compileCode(escapeQuotes($code), FALSE, TRUE, TRUE, $compileCode) . '";';
                                } elseif (substr($template, 0, 3) == 'js_') {
                                        // JavaScripts don't like entities, dollar signs and timings
+                                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Reached!');
                                        $GLOBALS['template_eval']['html'][$template] = '$ret = decodeEntities("' . compileRawCode(escapeJavaScriptQuotes($GLOBALS['template_content']['html'][$template]), FALSE, TRUE, TRUE, $compileCode) . '");';
                                } else {
                                        // Prepare eval() command, other output doesn't like entities, maybe
+                                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Reached!');
                                        $GLOBALS['template_eval']['html'][$template] = '$ret = decodeEntities("' . compileRawCode(escapeQuotes($GLOBALS['template_content']['html'][$template]), FALSE, TRUE, TRUE, $compileCode) . '");';
                                }
                        } elseif (isHtmlOutputMode()) {
                                // Add surrounding HTML comments to help finding bugs faster
                                $ret = '<!-- Template ' . $template . ' - Start //-->' . $GLOBALS['template_content']['html'][$template] . '<!-- Template ' . $template . ' - End //-->';
+                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Reached!');
                                $GLOBALS['template_eval']['html'][$template] = '$ret = "' . getColorSwitchCode($template) . compileRawCode(escapeQuotes($ret), FALSE, TRUE, TRUE, $compileCode) . '";';
                        } else {
                                // JavaScript again
+                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Reached!');
                                $GLOBALS['template_eval']['html'][$template] = '$ret = decodeEntities("' . compileRawCode(escapeJavaScriptQuotes($GLOBALS['template_content']['html'][$template]), FALSE, TRUE, TRUE, $compileCode) . '");';
                        } // END - if
                } elseif ((isAdmin()) || ((isInstalling()) && (!isInstalled()))) {
@@ -1651,7 +1662,7 @@ function escapeQuotes ($str, $single = FALSE) {
                $str = str_replace(array("\\'", '"', "\\\\"), array(chr(39), "\\\"", chr(92)), $str);
        }
 
-       // Return the escaped string
+       // Return the escape'd string
        return $str;
 }
 
index aaa89c15ddb53d2d03909ed1188ba5fb7c82e5fa..dbc24d16796050d6e84cd70f73d72a078014ead9 100644 (file)
@@ -157,7 +157,7 @@ function decodeEntities ($str, $quote = ENT_NOQUOTES) {
 }
 
 // Merges an array together but only if both are arrays
-function merge_array ($array1, $array2) {
+function merge_array ($array1, $array2, $keepIndex = FALSE) {
        // Are both an array?
        if ((!is_array($array1)) && (!is_array($array2))) {
                // Both are not arrays
@@ -170,8 +170,20 @@ function merge_array ($array1, $array2) {
                reportBug(__FUNCTION__, __LINE__, sprintf("array2 is not an array. array != %s", gettype($array2)));
        }
 
-       // Merge both together
-       return array_merge($array1, $array2);
+       // Maintain index of array2?
+       if ($keepIndex === TRUE) {
+               // Keep index of array2, array_merge() rewrites $key=2 to $key=0 ! :(
+               foreach ($array2 as $key => $value) {
+                       // Add it
+                       $array1[$key] = $value;
+               } // END - foreach
+
+               // Return it
+               return $array1;
+       } else {
+               // Merge both together normally
+               return array_merge($array1, $array2);
+       }
 }
 
 // Check if given FQFN is a readable file
@@ -2867,33 +2879,41 @@ function parseFloat ($floatString){
  * Searches a multi-dimensional array (as used in many places) for given
  * key/value pair as taken from user comments from PHP documentation website.
  *
- * @param      $array          An array with one or more dimensions
- * @param      $key            Key to look for
- * @param      $valur          Value to look for
- * @return     $results        Resulted array or empty array if $array is no array
+ * @param      $array                  An array with one or more dimensions
+ * @param      $key                    Key to look for
+ * @param      $value                  Value to look for
+ * @param      $parentIndex    Parent index (ONLY INTERNAL USE!)
+ * @return     $results                Resulted array or empty array if $array is no array
  * @author     sunelbe<at>gmail<dot>com
  * @link       http://de.php.net/manual/en/function.array-search.php#110120
  */
-function search_array ($array, $key, $value) {
+function search_array ($array, $key, $value, $parentIndex = NULL) {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'array(' . count($array) . ')=' . print_r($array, TRUE) . ',key=' . $key . ',value=' . $value . ',parentIndex[' . gettype($parentIndex) . '=' . $parentIndex . ' - ENTERED!');
        // Init array result
        $results = array();
 
        // Is $array really an array?
        if (is_array($array)) {
-               // Does key and value match?
-               if (isset($array[$key]) && $array[$key] == $value) {
-                       // Then add it as result
-                       $results[] = $array;
-               } // END - if
-
                // Search for whole array
-               foreach ($array as $subArray) {
-                       // Search recursive and merge again
-                       $results = merge_array($results, search_array($subArray, $key, $value));
+               foreach ($array as $idx => $dummy) {
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',value=' . $value . ',idx=' . $idx);
+                       // Is dummy an array?
+                       if (is_array($dummy)) {
+                               // Then search again
+                               $subResult = search_array($dummy, $key, $value, $idx);
+                               //* DEBUG: */ print 'subResult=<pre>' . print_r($subResult, TRUE).'</pre>';
+
+                               // And merge both
+                               $results = merge_array($results, $subResult, TRUE);
+                       } elseif ((isset($array[$key])) && ($array[$key] == $value)) {
+                               // Is found, so add it
+                               $results[$parentIndex] = $array;
+                       }
                } // END - foreach
        } // END - if
 
        // Return resulting array
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'results(' . count($results) . ')=' . print_r($results, TRUE) . ' - EXIT!');
        return $results;
 }
 
index f62de6a6e8d1d59adaee34c4a6709b880d0424e4..217f8e73a0b901fea4a1756624d3d95d66f38ae4 100644 (file)
@@ -328,7 +328,7 @@ function searchXmlArray ($value, $columns, $childKey) {
                assert(isset($columnArray[$childKey]));
 
                // Now is it what we are looking for?
-               if ($columnArray[$childKey] == $value) {
+               if ($columnArray[$childKey] === $value) {
                        // Remember this match
                        $return = $key;
 
index b5e5951e7a6ebe96274723e3c4724c6e3f3fd784..7280cc83430e38e194551267ba56e340fd847f5f 100644 (file)
@@ -2,14 +2,10 @@
 <form accept-charset="UTF-8" action="{%url=modules.php?module=admin&amp;what=list_surfbar_urls%}" method="post">
 <table border="0" cellspacing="0" cellpadding="0" class="table dashed">
 <tr>
-       <td align="center" colspan="2" class="table_header">
+       <td align="center" colspan="2" class="table_header bottom">
                <strong>{--ADMIN_SURFBAR_EDIT_URLS_TITLE--}</strong>
        </td>
 </tr>
-<tr>
-       <td class="header_column bottom right" align="center"><strong>{--_USERID--}</strong></td>
-       <td class="header_column bottom" align="center"><strong>{--ADMIN_TEST_URL--}</strong></td>
-</tr>
 $content
 <tr>
        <td class="table_footer" colspan="2">
index 4baff476c7971164492a7162d4516b23b8d0e4db..d7f9c3b6c3a1adae7b0561ed6fdc07dfa9df32ec 100644 (file)
@@ -1,10 +1,23 @@
 <tr>
        <td align="center" class="bottom right {%template,ColorSwitch%}">
+               <legend for="url_userid">{--_USERID--}</legend>
                <input type="hidden" name="url_id[$content[url_id]]" value="1" />
                <input type="hidden" name="url_userid[$content[url_id]]" value="{%pipe,convertZeroToNull=$content[url_userid_raw]%}" />
                $content[url_userid]
        </td>
        <td align="center" class="bottom right {%template,ColorSwitch%}">
+               <legend for="url">{--ADMIN_TEST_URL--}</legend>
                <input type="text" class="form_field" name="url[$content[url_id]]" size="20" maxlength="255" value="$content[url]" />
        </td>
 </tr>
+
+<tr>
+       <td align="center" class="bottom right {%template,ColorSwitch%}">
+               <legend for="url_fixed_reload">{--ADMIN_CHANGE_SURFBAR_FIXED_RELOAD--}</legend>
+               $content[url_fixed_reload]
+       </td>
+       <td align="center" class="bottom right {%template,ColorSwitch%}">
+               <legend for="url_fixed_waiting">{--ADMIN_CHANGE_SURFBAR_FIXED_RELOAD--}</legend>
+               $content[url_fixed_waiting]
+       </td>
+</tr>
index 13ed58d13a23c00c50d5f23702bdcefcea4f164a..3a9ee6ea7fc0f8e272dc91c8925cbbb6b88361f9 100644 (file)
@@ -2,7 +2,7 @@
 <form accept-charset="UTF-8" action="{%url=modules.php?module=admin&amp;what=list_surfbar_urls%}" method="post">
 <table border="0" cellspacing="0" cellpadding="0" class="table dashed" width="800">
 <tr>
-       <td align="center" colspan="8" class="table_header">
+       <td align="center" colspan="10" class="table_header">
                <strong>{--ADMIN_SURFBAR_LIST_URLS_TITLE--}</strong>
        </td>
 </tr>
        <td class="header_column bottom right" align="center"><strong>{--ADMIN_SURFBAR_VIEWS_TOTAL--}</strong></td>
        <td class="header_column bottom right" align="center"><strong>{--ADMIN_SURFBAR_STATUS--}</strong></td>
        <td class="header_column bottom right" align="center"><strong>{--ADMIN_SURFBAR_REGISTERED--}</strong></td>
+       <td class="header_column bottom right" align="center"><strong>{--ADMIN_SURFBAR_FIXED_RELOAD--}</strong></td>
+       <td class="header_column bottom right" align="center"><strong>{--ADMIN_SURFBAR_FIXED_WAITING--}</strong></td>
        <td class="header_column bottom right" align="center"><strong>{--ADMIN_SURFBAR_LAST_LOCKED--}</strong></td>
        <td class="header_column bottom" align="center"><strong>{--ADMIN_SURFBAR_LOCK_REASON--}</strong></td>
 </tr>
 $content
 <tr>
-       <td class="table_footer" colspan="8">
+       <td class="table_footer" colspan="10">
                <input type="reset" class="form_reset" value="{--UNDO_SELECTIONS--}" />
                <input type="submit" class="form_submit" name="edit" value="{--ADMIN_SURFBAR_EDIT_URL_SUBMIT--}" />
-               <input type="submit" class="form_delete" name="lock" value="{--ADMIN_SURFBAR_UNLOCK_URL_SUBMIT--}" />
+               <input type="submit" class="form_submit" name="lock" value="{--ADMIN_SURFBAR_UNLOCK_URL_SUBMIT--}" />
                <input type="submit" class="form_submit" name="undelete" value="{--ADMIN_SURFBAR_UNDELETE_URL_SUBMIT--}" />
                <input type="submit" class="form_delete" name="delete" value="{--ADMIN_SURFBAR_DELETE_URL_SUBMIT--}" />
        </td>
index b5b90d9ccd7c35279b242730770a2956bb09fa72..ea0b9f39f4623886e551fac9da9cb5043cbeb6e5 100644 (file)
        <td align="center" class="bottom right {%template,ColorSwitch%}">
                $content[url_registered]
        </td>
+       <td align="center" class="bottom right {%template,ColorSwitch%}">
+               {%pipe,createFancyTime=$content[url_fixed_reload]%}
+       </td>
+       <td align="center" class="bottom right {%template,ColorSwitch%}">
+               {%pipe,createFancyTime=$content[url_fixed_waiting]%}
+       </td>
        <td align="center" class="bottom right {%template,ColorSwitch%}">
                $content[url_last_locked]
        </td>
index ebc3a40d2d805baedc91641e85644942dce6ba47..84b0cba77320be015d51c38ce0ad935f2f332893 100644 (file)
@@ -39,12 +39,20 @@ MA  02110-1301  USA
        And all column names to read/write, leave this list tag empty for all (*).
        //-->
        <database-column-list>
+               <database-column-list-entry name="" type="string" table="" value="url_userid" alias="" function="" />
+               <database-column-list-entry name="" type="string" table="" value="url" alias="" function="" />
+               <database-column-list-entry name="" type="string" table="" value="url_fixed_reload" alias="" function="" />
+               <database-column-list-entry name="" type="string" table="" value="url_fixed_waiting" alias="" function="" />
        </database-column-list>
        <!--
        "Filter" call-back functions to call back for piping the fetched data
        through (can be left empty, no call-back function will be called)
        //-->
        <callback-function-list>
+               <callback-function-list-entry name="" type="string" value="" />
+               <callback-function-list-entry name="" type="string" value="" />
+               <callback-function-list-entry name="" type="string" value="bigintval" />
+               <callback-function-list-entry name="" type="string" value="bigintval" />
        </callback-function-list>
        <!--
        Extra parameters (2nd, 3rd, ...) for above call-back functions. If an array
@@ -57,6 +65,8 @@ MA  02110-1301  USA
        Columns for converting single time selections into a timestamp
        //-->
        <time-columns-list>
+               <time-columns-list-entry name="" type="string" value="url_fixed_reload" />
+               <time-columns-list-entry name="" type="string" value="url_fixed_waiting" />
        </time-columns-list>
        <!--
        Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
index 40fba138558c8319452d344665f22f38c0250191..99700ecb50d119e089ac4c3be3e46dc616a0d3c9 100644 (file)
@@ -46,6 +46,8 @@ MA  02110-1301  USA
                <database-column-list-entry name="" type="string" table="" value="url_id" alias="" function="" />
                <database-column-list-entry name="member_list" type="string" table="" value="url_userid" alias="" function="" />
                <database-column-list-entry name="" type="string" table="" value="url" alias="" function="" />
+               <database-column-list-entry name="reload_list" type="string" table="" value="url_fixed_reload" alias="" function="" />
+               <database-column-list-entry name="waiting_list" type="string" table="" value="url_fixed_waiting" alias="" function="" />
        </database-column-list>
        <!--
        "Filter" call-back functions to call back for piping the fetched data
@@ -58,6 +60,8 @@ MA  02110-1301  USA
                <callback-function-list-entry name="" type="string" value="bigintval" />
                <callback-function-list-entry name="member_list" type="string" value="addMemberSelectionBox" />
                <callback-function-list-entry name="" type="string" value="" />
+               <callback-function-list-entry name="reload_list" type="string" value="createTimeSelections" />
+               <callback-function-list-entry name="waiting_list" type="string" value="createTimeSelections" />
        </callback-function-list>
        <!--
        Extra parameters (2nd, 3rd, ...) for above call-back functions. If an array
@@ -102,6 +106,38 @@ MA  02110-1301  USA
                Dummy entry
                //-->
                <extra-parameter-list-entry name="" type="string" value="" />
+               <!--
+               A one-dimensional array with some entries
+               //-->
+               <extra-parameter-list-entry name="" type="array" value="reload">
+                       <!--
+                       Our 'reload' array
+                       //-->
+                       <extra-parameter-reload-list>
+                               <!--
+                               A bool entry in the 'reload' array, all other types are added in a
+                               similar way.
+                               //-->
+                               <extra-parameter-reload-list-entry name="" type="string" value="url_fixed_reload" />
+                               <extra-parameter-reload-list-entry name="" type="string" value="WDhms" />
+                       </extra-parameter-reload-list>
+               </extra-parameter-list-entry>
+               <!--
+               A one-dimensional array with some entries
+               //-->
+               <extra-parameter-list-entry name="" type="array" value="waiting">
+                       <!--
+                       Our 'waiting' array
+                       //-->
+                       <extra-parameter-waiting-list>
+                               <!--
+                               A bool entry in the 'waiting' array, all other types are added in a
+                               similar way.
+                               //-->
+                               <extra-parameter-waiting-list-entry name="" type="string" value="url_fixed_waiting" />
+                               <extra-parameter-waiting-list-entry name="" type="string" value="ms" />
+                       </extra-parameter-waiting-list>
+               </extra-parameter-list-entry>
        </extra-parameter-list>
        <!--
        Columns for converting single time selections into a timestamp
index de5491b0cae5614afb7c41dbd5a9433eb27c042f..aa8a8989756d82b432f02f6e3dd7c352f3199253 100644 (file)
@@ -71,6 +71,8 @@ MA  02110-1301  USA
                        <select-data-from-list-entry type="string" table="" value="url_views_total" alias="" function="" />
                        <select-data-from-list-entry type="string" table="" value="url_status" alias="" function="" />
                        <select-data-from-list-entry type="string" table="" value="url_registered" alias="url_registered" function="UNIX_TIMESTAMP" />
+                       <select-data-from-list-entry type="string" table="" value="url_fixed_reload" alias="" function="" />
+                       <select-data-from-list-entry type="string" table="" value="url_fixed_waiting" alias="" function="" />
                        <select-data-from-list-entry type="string" table="" value="url_last_locked" alias="url_last_locked" function="UNIX_TIMESTAMP" />
                        <select-data-from-list-entry type="string" table="" value="url_lock_reason" alias="" function="" />
                </select-data-from-list>