]> git.mxchange.org Git - mailer.git/commitdiff
Added (unfinished) a way to edit forced ads, rwritten many XML templates
authorRoland Häder <roland@mxchange.org>
Thu, 11 Aug 2011 01:35:25 +0000 (01:35 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 11 Aug 2011 01:35:25 +0000 (01:35 +0000)
12 files changed:
inc/callback-functions.php
inc/db/lib-mysql3.php
inc/extensions-functions.php
inc/extensions/ext-forced.php
inc/modules/admin/admin-inc.php
inc/xml-functions.php
templates/de/html/admin/admin_list_forced_ads.tpl
templates/de/html/admin/admin_list_forced_ads_row.tpl
templates/xml/admin/admin_edit_show_forced_ads.xml [new file with mode: 0644]
templates/xml/admin/admin_edit_show_surfbar_urls.xml
templates/xml/admin/admin_list_forced_ads.xml
templates/xml/admin_data_template.xml

index 91356f11722b34c03a64b6fb3cabe9aa2cbff555..c8a4e052551721de61a17641bddd9e1649bfe011 100644 (file)
@@ -121,9 +121,9 @@ function doXmlDatabaseColumnList ($resource, $attributes) {
 // Handles the XML node 'database-column-list-entry'
 function doXmlDatabaseColumnListEntry ($resource, $attributes) {
        // There are three attributes, by default
-       if (count($attributes) != 3) {
+       if (count($attributes) != 6) {
                // Not the right count
-               debug_report_bug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
+               debug_report_bug(__FUNCTION__, __LINE__, 'Expected 6 attributes, got ' . count($attributes));
        } elseif (!isset($attributes['NAME'])) {
                // 'NAME' not found
                debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
@@ -133,12 +133,24 @@ function doXmlDatabaseColumnListEntry ($resource, $attributes) {
        } elseif (!isInvalidXmlType($attributes['TYPE'])) {
                // No valid type
                debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
-       } elseif (!isset($attributes['VALUE'])) {
-               // 'VALUE' not found
-               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
-       } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
+       } elseif (!isset($attributes['TABLE'])) {
+               // 'TABLE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TABLE not found.');
+       } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['TABLE'])) {
                // Not valid/verifyable
-               debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
+               debug_report_bug(__FUNCTION__, __LINE__, 'Attribute TABLE does not validate. TYPE=' . $attributes['TYPE'] . ',TABLE=' . $attributes['TABLE']);
+       } elseif (!isset($attributes['ALIAS'])) {
+               // 'ALIAS' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute ALIAS not found.');
+       } elseif (!isset($attributes['FUNCTION'])) {
+               // 'FUNCTION' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute FUNCTION not found.');
+       } elseif ((trim($attributes['ALIAS']) != '') && (!isXmlValueValid($attributes['TYPE'], $attributes['ALIAS']))) {
+               // 'ALIAS' not valid/verifyable
+               debug_report_bug(__FUNCTION__, __LINE__, 'Attribute ALIAS does not validate. ALIAS=' . $attributes['ALIAS']);
+       } elseif ((trim($attributes['FUNCTION']) != '') && (!isXmlValueValid($attributes['TYPE'], $attributes['FUNCTION']))) {
+               // 'FUNCTION' not valid/verifyable
+               debug_report_bug(__FUNCTION__, __LINE__, 'Attribute FUNCTION does not validate. FUNCTION=' . $attributes['FUNCTION']);
        } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_list'])) {
                // doXmlCallbackFunction is missing
                debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function/database-column-list not included around this node. Please fix your XML.');
@@ -274,6 +286,48 @@ function doXmlExtraParameterMemberListEntry ($resource, $attributes) {
        addXmlValueToCallbackAttributes('extra_list', $attributes, 'member_list');
 }
 
+// Handles the XML node 'extra-parameter-added-list'
+function doXmlExtraParameterAddedList ($resource, $attributes) {
+       // There should be no attributes
+       if (count($attributes) > 0) {
+               // Please don't add any attributes to foo-list nodes
+               debug_report_bug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
+       } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list']['added_list'])) {
+               // This list should be created already
+               debug_report_bug(__FUNCTION__, __LINE__, 'added_list should be already created.');
+       }
+}
+
+// Handles the XML node 'extra-parameter-added-list-entry'
+function doXmlExtraParameterAddedListEntry ($resource, $attributes) {
+       // There are three attributes, by default
+       if (count($attributes) != 3) {
+               // Not the right count
+               debug_report_bug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
+       } elseif (!isset($attributes['NAME'])) {
+               // 'NAME' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
+       } elseif (!isset($attributes['TYPE'])) {
+               // 'TYPE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
+       } elseif (!isInvalidXmlType($attributes['TYPE'])) {
+               // No valid type
+               debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
+       } elseif (!isset($attributes['VALUE'])) {
+               // 'VALUE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
+       } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
+               // Not valid/verifyable
+               debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
+       } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list']['added_list'])) {
+               // doXmlCallbackFunction is missing
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function/extra-parameter-list/added-list not included around this node. Please fix your XML.');
+       }
+
+       // Add the entry to the list
+       addXmlValueToCallbackAttributes('extra_list', $attributes, 'added_list');
+}
+
 // Handles the XML node 'status-change-column'
 function doXmlStatusChangeColumn ($resource, $attributes) {
        // There are three attributes, by default
@@ -342,7 +396,7 @@ function doXmlStatusChangeListEntry ($resource, $attributes) {
                debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
        } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['status_list'])) {
                // doXmlCallbackFunction is missing
-               debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function/extra-parameter-list/member-list not included around this node. Please fix your XML.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function/extra-parameter-list/change-list not included around this node. Please fix your XML.');
        }
 
        // Add the entry to the list
@@ -955,12 +1009,6 @@ function addXmlValueToCallbackAttributes ($element, $attributes, $extraKey = '',
                //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'TYPE=' . $attributes['TYPE'] . ',element=' . $element);
                $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['VALUE'] . '_list'] = array();
        } elseif (!empty($extraKey)) {
-               // Is it bool?
-               if (($attributes['TYPE'] == 'bool') && (isset($attributes['VALUE']))) {
-                       // Then convert VALUE
-                       $attributes['VALUE'] = convertStringToBoolean($attributes['VALUE']);
-               } // END - if
-
                // Sub-array (one level only)
                //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ' - ANALYSING...');
                if (trim($attributes['NAME']) == '') {
@@ -986,7 +1034,8 @@ function addXmlValueToCallbackAttributes ($element, $attributes, $extraKey = '',
                        'column'   => trim($attributes['VALUE']),
                        'alias'    => trim($attributes['ALIAS']),
                        'function' => trim($attributes['FUNCTION']),
-                       'table'    => trim($attributes['TABLE'])
+                       'table'    => trim($attributes['TABLE']),
+                       'name'     => trim($attributes['NAME'])
                );
 
                // Add the entry
index 1024b238d513ffc1b6c30553526fd4f008b349ff..c3369299057b789583e7a10acf90de706c26ac60 100644 (file)
@@ -341,8 +341,20 @@ function SQL_RESULT_FROM_ARRAY ($table, $columns, $idRow, $id, $F, $L) {
                return false;
        } // END  - if
 
-       // Prepare the SQL statement
-       $sql = "SELECT `".implode("`,`", $columns)."` FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s`='%s' LIMIT 1";
+       // Is this is a simple array?
+       if ((is_array($columns[0])) && (isset($columns[0]['column']))) {
+               // Begin with SQL query
+               $sql = 'SELECT ';
+
+               // No, it comes from XML, so get it back from it
+               $sql .= getSqlPartFromXmlArray($columns);
+
+               // Finalize it
+               $sql .= " FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s`='%s' LIMIT 1";
+       } else {
+               // Yes, prepare the SQL statement
+               $sql = 'SELECT `' . implode('`,`', $columns) . "` FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s`='%s' LIMIT 1";
+       }
 
        // Return the result
        return SQL_QUERY_ESC($sql,
index 58e0560271cb2ff34fe9bf6268eb01928cd3eaf9..847fcf18f818218096494400f032b2220209922c 100644 (file)
@@ -151,9 +151,6 @@ function loadExtension ($ext_name, $ext_mode, $ext_ver = '0.0.0', $dry_run = fal
        // Extensions are not always active by default
        setExtensionAlwaysActive('N');
 
-       // Extension update notes
-       // @TODO Do we still need this? setExtensionUpdateNotes('');
-
        // Include the extension file
        loadCurrentExtensionInclude();
 
index 7b124a46838e9e0b1f75a69d8742e94de1d129f8..65333c3039d4137caad2cabfcfe0afc24c5c63da 100644 (file)
@@ -69,7 +69,9 @@ switch (getExtensionMode()) {
 `forced_ads_views_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `forced_ads_clicks_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `forced_ads_added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
-PRIMARY KEY (`forced_ads_id`)",
+`forced_ads_userid` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
+PRIMARY KEY (`forced_ads_id`),
+INDEX (`forced_ads_userid`)",
                        'Forced Ads Data');
 
                // - Campaigns
@@ -150,7 +152,7 @@ INDEX (`forced_stats_userid`)",
 
                // Menu systems
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='forced'");
-               addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what` IN ('forced_banner','forced_textlink','book_forced') LIMIT 3");
+               addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what` LIKE '%forced%'");
 
                // Is earning_data there?
                if (isSqlTableCreated('earning_data')) {
index a3f48e84807e750c7f283eb3606d99ae961abf23..e96285a86b54f800033f0906ea96f65b2153ac4e 100644 (file)
@@ -875,14 +875,21 @@ function adminListBuilder ($listType, $tableName, $columns, $filterFunctions, $e
                        // Filter all data
                        foreach ($content as $key => $value) {
                                // Search index
-                               $idx = array_search($key, $columns, true);
+                               $idx = searchXmlArray($key, $columns, 'column');
+
+                               // Skip any missing entries
+                               if ($idx === false) {
+                                       // Skip this one
+                                       //* DEBUG: */ debug_report_bug(__FUNCTION__, __LINE__, 'key=' . $key . ' - SKIPPED!');
+                                       continue;
+                               } // END - if
 
                                // Do we have a userid?
                                //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',userIdColumn=' . $userIdColumn[0]);
                                if ($key == $userIdColumn[0]) {
                                        // Add it again as raw id
                                        //* DEBUG: */ debug_report_bug(__FUNCTION__, __LINE__, 'key=' . $key . ',userIdColumn=' . $userIdColumn[0]);
-                                       $content[$userIdColumn[0]] = bigintval($value);
+                                       $content[$userIdColumn[0]] = makeZeroToNull($value);
                                        $content[$userIdColumn[0] . '_raw'] = $content[$userIdColumn[0]];
                                } // END - if
 
@@ -893,13 +900,24 @@ function adminListBuilder ($listType, $tableName, $columns, $filterFunctions, $e
                                        $GLOBALS['admin_list_builder_id_value'] = $value;
                                } // END - if
 
-                               // Handle the call in external function
-                               //* DEBUG: */ debugOutput('key=' . $key . ',fucntion=' . $filterFunctions[$idx] . ',value=' . $value);
-                               $content[$key] = handleExtraValues(
-                                       $filterFunctions[$idx],
-                                       $value,
-                                       $extraValues[$idx]
-                               );
+                               // Do we have a call-back function and extra-value pair?
+                               if ((isset($filterFunctions[$idx])) && (isset($extraValues[$idx]))) {
+                                       // Handle the call in external function
+                                       //* DEBUG: */ debugOutput('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: */ debugOutput('key=' . $key . ',fucntion=' . $filterFunctions[$columns[$idx]['name']] . ',value=' . $value);
+                                       $content[$key] = handleExtraValues(
+                                               $filterFunctions[$columns[$idx]['name']],
+                                               $value,
+                                               $extraValues[$columns[$idx]['name']]
+                                       );
+                               }
                        } // END - foreach
 
                        // Then list it
@@ -1115,7 +1133,8 @@ function adminEditEntriesConfirm ($tableName, $columns = array(), $filterFunctio
 
        // All valid entries? (We hope so here!)
        //* DEBUG: */ debug_report_bug(__FUNCTION__, __LINE__, 'idColumn=<pre>'.print_r($idColumn,true).'</pre>,tableName<pre>'.print_r($tableName,true).'</pre>,columns=<pre>'.print_r($columns,true).'</pre>,filterFunctions=<pre>'.print_r($filterFunctions,true).'</pre>,extraValues=<pre>'.print_r($extraValues,true).'</pre>,editNow=<pre>'.print_r($editNow,true).'</pre>,userIdColumn=<pre>'.print_r($userIdColumn,true).'</pre>,rawUserId=<pre>'.print_r($rawUserId,true).'</pre>');
-       if ((count($columns) == count($filterFunctions)) && (count($columns) == count($extraValues))) {
+       //if ((count($columns) == count($filterFunctions)) && (count($columns) == count($extraValues))) {
+       if (true) {
                // Shall we change here or list for editing?
                if ($editNow[0] === true) {
                        // Change them all
@@ -1321,30 +1340,12 @@ function adminListEntries ($tableTemplate, $rowTemplate, $noEntryMessageId, $tab
 
        // This is the minimum query, so at least columns and tableName must have entries
        $SQL = 'SELECT ';
-       foreach ($columns as $columnArray) {
-               // Init SQL part
-               $sqlPart = '';
-               // Do we have a table/alias
-               if (!empty($columnArray['table'])) {
-                       // Pre-add it
-                       $sqlPart .= $columnArray['table'] . '.';
-               } // END - if
-
-               // Add column
-               $sqlPart .= '`' . $columnArray['column'] . '`';
 
-               // Is a function and alias set?
-               if ((!empty($columnArray['function'])) && (!empty($columnArray['alias']))) {
-                       // Add both
-                       $sqlPart = $columnArray['function'] . '(' . $sqlPart . ') AS `' . $columnArray['alias'] . '`';
-               } // END - if
-
-               // Add finished SQL part to the query
-               $SQL .= $sqlPart . ',';
-       } // END - foreach
+       // Get the sql part back from given array
+       $SQL .= getSqlPartFromXmlArray($columnArray);
 
        // Remove last commata and add FROM statement
-       $SQL = substr($SQL, 0, -1) . ' FROM `{?_MYSQL_PREFIX?}_' . $tableName[0] . '`';
+       $SQL .= ' FROM `{?_MYSQL_PREFIX?}_' . $tableName[0] . '`';
 
        // Do we have entries from whereColumns to add?
        if (count($whereColumns) > 0) {
index d59207e916ae0357fae647a85af646bc91a5673c..d09e8e11fae32792dc250b08d242ef77ec27cd19 100644 (file)
@@ -243,5 +243,62 @@ function convertXmlContion ($condition) {
        return $return;
 }
 
+// "Getter" for sql part back from given array
+function getSqlPartFromXmlArray ($columns) {
+       // Init SQL
+       $SQL = '';
+
+       // Walk through all entries
+       foreach ($columns as $columnArray) {
+               // Init SQL part
+               $sqlPart = '';
+
+               // Do we have a table/alias
+               if (!empty($columnArray['table'])) {
+                       // Pre-add it
+                       $sqlPart .= $columnArray['table'] . '.';
+               } // END - if
+
+               // Add column
+               $sqlPart .= '`' . $columnArray['column'] . '`';
+
+               // Is a function and alias set?
+               if ((!empty($columnArray['function'])) && (!empty($columnArray['alias']))) {
+                       // Add both
+                       $sqlPart = $columnArray['function'] . '(' . $sqlPart . ') AS `' . $columnArray['alias'] . '`';
+               } // END - if
+
+               // Add finished SQL part to the query
+               $SQL .= $sqlPart . ',';
+       } // END - foreach
+
+       // Return it without last commata
+       return substr($SQL, 0, -1);
+}
+
+// Searches in given XML array for value and returns the parent index
+function searchXmlArray ($value, $columns, $childKey) {
+       // Default is not found
+       $return = false;
+
+       // Walk through whole array
+       foreach ($columns as $key => $columnArray) {
+               // Make sure the element is there
+               assert(isset($columnArray[$childKey]));
+
+               // Now is it what we are looking for?
+               if ($columnArray[$childKey] == $value) {
+                       // Remember this match
+                       $return = $key;
+
+                       // And abort any further searches
+                       break;
+               } // END - foreach
+       } // END - foreach
+
+       // Return key/false
+       return $return;
+}
+
 // [EOF]
 ?>
index dd0a5bada451122192c87188942ca5882cb4bf66..3ef143f0b8a27a6dbc13eaa0eaec2ab5b610baf6 100644 (file)
@@ -2,12 +2,13 @@
 <form accept-charset="UTF-8" action="{%url=modules.php?module=admin&amp;what=list_forced_ads%}" method="post">
 <table border="0" cellspacing="0" cellpadding="0" class="table dashed" width="800">
 <tr>
-       <td align="center" colspan="5" class="table_header">
+       <td align="center" colspan="6" class="table_header">
                <strong>{--ADMIN_LIST_FORCED_ADS_TITLE--}</strong>
        </td>
 </tr>
 <tr>
        <td class="header_column bottom right" align="center"><strong>{--ID_SELECT--}</strong></td>
+       <td class="header_column bottom right" align="center"><strong>{--_USERID--}</strong></td>
        <td class="header_column bottom right" align="center"><strong>{--ADMIN_TEST_URL--}</strong></td>
        <td class="header_column bottom right" align="center"><strong>{--ADMIN_FORCED_ADS_TYPE--}</strong></td>
        <td class="header_column bottom right" align="center"><strong>{--ADMIN_FORCED_ADS_HAS_FRAMEBREAKER--}</strong></td>
@@ -15,7 +16,7 @@
 </tr>
 $content
 <tr>
-       <td class="table_footer" colspan="5">
+       <td class="table_footer" colspan="6">
                <input type="reset" class="form_reset" value="{--UNDO_SELECTIONS--}" />
                <input type="submit" class="form_submit" name="edit" value="{--ADMIN_ACTION_EDIT_SUBMIT--}" />
                <input type="submit" class="form_delete" name="delete" value="{--ADMIN_ACTION_DELETE_SUBMIT--}" />
index 8c7903b2d14bcee647a536a40265992ca40ac1b2..8eaf69c971653680ed190945242d903b75cba4ed 100644 (file)
@@ -2,6 +2,9 @@
        <td align="center" class="bottom right {%template,ColorSwitch%}">
                <input type="checkbox" class="form_field" title="{--ID_SELECT--} $content[forced_ads_id] - $content[forced_ads_alt_text]" name="forced_ads_id[$content[forced_ads_id]]" value="1" />
        </td>
+       <td class="{%template,ColorSwitch%} bottom right" align="center">
+               {%pipe,generateUserProfileLink=$content[forced_ads_userid]%}
+       </td>
        <td align="center" class="bottom right {%template,ColorSwitch%}">
                <a href="{%pipe,generateFrametesterUrl=$content[forced_ads_click_url]%}" target="_blank" title="{--ADMIN_TEST_URL--} - $content[forced_ads_alt_text]">{--ADMIN_TEST_URL--}</a>
        </td>
diff --git a/templates/xml/admin/admin_edit_show_forced_ads.xml b/templates/xml/admin/admin_edit_show_forced_ads.xml
new file mode 100644 (file)
index 0000000..5a8c17a
--- /dev/null
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+This template provides meta data for editing forced ads.
+
+@author                Roland Haeder <webmaster@mxchange.org>
+@version       0.2.1-FINAL
+@copyright     (c) 2003 - 2009 by Roland Haeder
+@copyright     (c) 2009 - 2011 by Mailer Developer Team
+@license       GNU GPL 2.0 or any newer version
+@link          http://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
+//-->
+<admin-entry-meta-data>
+       <!--
+       Call-back function which should all following parameter handled over
+       to. This will always be type of string but we like homogene XMLs.
+       //-->
+       <callback-function type="string" value="adminEditEntriesConfirm" />
+       <!--
+       Name of the database table where the entries should be read/write from/to.
+       //-->
+       <database-table name="" type="string" value="forced_ads" />
+       <!--
+       The following three lists must have the same count of list entries, else an
+       error may occur.
+       //-->
+       <!--
+       And all column names to read/write, leave this list tag empty for all (*).
+       //-->
+       <database-column-list>
+               <!--
+               A column name list entry. The type is always string, or do you have
+               numerical column names?
+               //-->
+               <database-column-list-entry name="" type="string" table="" value="forced_ads_id" alias="" function="" />
+               <database-column-list-entry name="member_list" type="string" table="" value="forced_ads_userid" alias="" function="" />
+               <database-column-list-entry name="added_list" type="string" table="" value="forced_ads_added" alias="forced_ads_added" function="UNIX_TIMESTAMP" />
+               <database-column-list-entry name="" type="string" table="" value="forced_ads_ad_url" alias="" function="" />
+               <database-column-list-entry name="" type="string" table="" value="forced_ads_click_url" alias="" function="" />
+               <database-column-list-entry name="" type="string" table="" value="forced_ads_width" alias="" function="" />
+               <database-column-list-entry name="" type="string" table="" value="forced_ads_height" alias="" function="" />
+               <database-column-list-entry name="" type="string" table="" value="forced_ads_alt_text" alias="" function="" />
+               <database-column-list-entry name="" type="string" table="" value="forced_ads_framebreaker" alias="" function="" />
+               <database-column-list-entry name="" type="string" table="" value="forced_ads_type" alias="" function="" />
+               <database-column-list-entry name="" type="string" table="" value="forced_ads_views_counter" alias="" function="" />
+               <database-column-list-entry name="" type="string" table="" value="forced_ads_clicks_counter" 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>
+               <!--
+               A call-back function list entry
+               //-->
+               <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="added_list" type="string" value="generateDateTime" />
+       </callback-function-list>
+       <!--
+       Extra parameters (2nd, 3rd, ...) for above call-back functions. If an array
+       is provided, we have more than two parameters to handle over to the
+       call-back function. See function handleExtraValues() for details.
+       //-->
+       <extra-parameter-list>
+               <!--
+               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="member">
+                       <!--
+                       Our 'member' array
+                       //-->
+                       <extra-parameter-member-list>
+                               <!--
+                               A bool entry in the 'bar' array, all other types are added in a
+                               similar way.
+                               //-->
+                               <extra-parameter-member-list-entry name="" type="bool" value="false" />
+                               <extra-parameter-member-list-entry name="" type="bool" value="true" />
+                               <extra-parameter-member-list-entry name="" type="bool" value="true" />
+                               <!--
+                               The brackets [] are required for addMemberSelectionBox(),
+                               please read there for details.
+                               //-->
+                               <extra-parameter-member-list-entry name="" type="string" value="forced_ads_userid[]" />
+                       </extra-parameter-member-list>
+               </extra-parameter-list-entry>
+               <!--
+               A one-dimensional array with some entries
+               //-->
+               <extra-parameter-list-entry name="" type="array" value="added">
+                       <!--
+                       Our 'added' array
+                       //-->
+                       <extra-parameter-added-list>
+                               <!--
+                               A bool entry in the 'bar' array, all other types are added in a
+                               similar way.
+                               //-->
+                               <extra-parameter-added-list-entry name="" type="int" value="2" />
+                       </extra-parameter-added-list>
+               </extra-parameter-list-entry>
+       </extra-parameter-list>
+       <!--
+       Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+       //-->
+       <enable-modify-entries name="" type="bool" value="false" />
+       <!--
+       The table column which should be taken for the ids (see first parameter).
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <table-id-column name="" type="string" value="forced_ads_id" />
+       <!--
+       The table column which should be taken for user ids
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <table-userid-column name="" type="string" value="forced_ads_userid" />
+       <!--
+       Raw userid column ($key) to skip which is always an invalid (?) entry
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <raw-userid-column-key name="" type="string" value="forced_ads_userid" />
+</admin-entry-meta-data>
index c79e9a20bbf48cb9d736a8154dff6219c1e7b359..553e9c4c32e418451ba0bc07aa33bba48779ba4b 100644 (file)
@@ -47,9 +47,9 @@ MA  02110-1301  USA
                A column name list entry. The type is always string, or do you have
                numerical column names?
                //-->
-               <database-column-list-entry name="" type="string" value="url_id" />
-               <database-column-list-entry name="member_list" type="string" value="url_userid" />
-               <database-column-list-entry name="" type="string" value="url" />
+               <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>
        <!--
        "Filter" call-back functions to call back for piping the fetched data
index affdf46b69829ea94d0bcc2c134d0536d35741b3..af04ae650afe3187773b11ce6041542717dac1ca 100644 (file)
@@ -65,6 +65,7 @@ MA  02110-1301  USA
                        (can also be left empty) which shall be applied on the column.
                        //-->
                        <select-data-from-list-entry type="string" table="" value="forced_ads_id" alias="" function="" />
+                       <select-data-from-list-entry type="string" table="" value="forced_ads_userid" alias="" function="" />
                        <select-data-from-list-entry type="string" table="" value="forced_ads_click_url" alias="" function="" />
                        <select-data-from-list-entry type="string" table="" value="forced_ads_alt_text" alias="" function="" />
                        <select-data-from-list-entry type="string" table="" value="forced_ads_type" alias="" function="" />
index 30d909cc0a26da66482ae4c2efe6060aa91fabd2..5edb946296aa9558f0ef05d8c638ae653811dac8 100644 (file)
@@ -50,7 +50,7 @@ MA  02110-1301  USA
                A column name list entry. The type is always string, or do you have
                numerical column names?
                //-->
-               <database-column-list-entry name="" type="string" value="foo" />
+               <database-column-list-entry name="" type="string" table="" value="foo" alias="" function="" />
        </database-column-list>
        <!--
        "Filter" call-back functions to call back for piping the fetched data