]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-list_surfbar_urls.php
Rewrites/fixes for handling config entries in SQLs
[mailer.git] / inc / modules / admin / what-list_surfbar_urls.php
index 68efa515e562d09c84f9339e942ad707cbf9321c..ce02758fb2b2b31eae6d50c8ed1c5ce3120c6fb6 100644 (file)
@@ -18,6 +18,7 @@
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -48,7 +49,7 @@ addMenuDescription('admin', __FILE__);
 $show = true;
 
 // Check for 'id' element
-if ((countRequestPost() > 0) && ((!isPostRequestParameterSet('id')) || (!is_array(postRequestParameter('id'))) || (count(postRequestParameter('id')) == '0'))) {
+if ((countRequestPost() > 0) && ((!isPostRequestParameterSet('id')) || (!is_array(postRequestParameter('id'))) || (count(postRequestParameter('id')) == 0))) {
        // Not found so output message
        loadTemplate('admin_settings_saved', false, getMessage('ADMIN_SURFBAR_NO_SELECTIONS'));
 
@@ -57,14 +58,14 @@ if ((countRequestPost() > 0) && ((!isPostRequestParameterSet('id')) || (!is_arra
 } // END - if
 
 // Edit or delete button hit?
-if (isPostRequestParameterSet('edit')) {
+if (isFormSent('edit')) {
        // Show entries for editing
        adminEditEntriesConfirm(
                postRequestParameter('id'),
                'surfbar_urls',
                array('id', 'userid', 'url'),
                array('bigintval', 'addMemberSelectionBox', ''),
-               array('', array(false, true, true), '')
+               array('', array(false, true, true, 'userid[]'), '')
        );
        $show = false;
 } elseif (isPostRequestParameterSet('do_edit')) {
@@ -83,20 +84,20 @@ if (isPostRequestParameterSet('edit')) {
        postRequestParameter('id'),
                'surfbar_urls',
                array('id', 'userid', 'url', 'registered'),
-               array('bigintval', 'generateUserProfileLink', 'FRAMETESTER', ''),
+               array('bigintval', 'generateUserProfileLink', 'generateFrametesterUrl', ''),
                array('', '', '', '')
        );
        $show = false;
 } elseif (isPostRequestParameterSet('do_delete')) {
        // Remove entries from database
        adminDeleteEntriesConfirm(postRequestParameter('id'), 'surfbar_urls', array(), array(), array(), true);
-} elseif (isPostRequestParameterSet('lock')) {
+} elseif (isFormSent('lock')) {
        // Un-/lock selected URLs. This does not work for pending URLs
        adminLockEntriesConfirm(
                postRequestParameter('id'),
                'surfbar_urls',
                array('id', 'userid', 'url', 'registered', 'status'),
-               array('bigintval', 'generateUserProfileLink', 'FRAMETESTER', '', 'translateSurfbarUrlStatus'),
+               array('bigintval', 'generateUserProfileLink', 'generateFrametesterUrl', '', 'translateSurfbarUrlStatus'),
                array('', '', '', '', '')
        );
        $show = false;
@@ -117,7 +118,7 @@ if (isPostRequestParameterSet('edit')) {
                postRequestParameter('id'),
                'surfbar_urls',
                array('id', 'userid', 'url', 'registered', 'status'),
-               array('bigintval', 'generateUserProfileLink', 'FRAMETESTER', '', 'translateSurfbarUrlStatus'),
+               array('bigintval', 'generateUserProfileLink', 'generateFrametesterUrl', '', 'translateSurfbarUrlStatus'),
                array('', '', '', '', '')
        );
        $show = false;
@@ -139,14 +140,14 @@ if ($show === false) return false;
 
 // List all URLs
 $result = SQL_QUERY("SELECT
-       `id`, `userid`, `url`, `views_total`, `status`,
-       UNIX_TIMESTAMP(`registered`) AS registered,
-       UNIX_TIMESTAMP(`last_locked`) AS last_locked,
-       `lock_reason`
+       `url_id`, `url_userid`, `url`, `url_views_total`, `url_status`,
+       UNIX_TIMESTAMP(`url_registered`) AS `url_registered`,
+       UNIX_TIMESTAMP(`url_last_locked`) AS `url_last_locked`,
+       `url_lock_reason`
 FROM
        `{?_MYSQL_PREFIX?}_surfbar_urls`
 ORDER BY
-       `id` ASC", __FILE__, __LINE__);
+       `url_id` ASC", __FILE__, __LINE__);
 
 // Do we have some URLs left?
 if (SQL_NUMROWS($result) > 0) {
@@ -154,13 +155,13 @@ if (SQL_NUMROWS($result) > 0) {
        $OUT = ''; $SW = 2;
        while ($content = SQL_FETCHARRAY($result)) {
                // "Translate"/add content
-               $content['sw']          = $SW;
-               $content['userid']      = generateUserProfileLink($content['userid']);
-               $content['url']         = generateFrametesterUrl($content['url']);
-               $content['views_total'] = translateComma($content['views_total']);
-               $content['status']      = translateSurfbarUrlStatus($content['status']);
-               $content['registered']  = generateDateTime($content['registered'], 2);
-               $content['last_locked'] = generateDateTime($content['last_locked'], 2);
+               $content['sw']              = $SW;
+               $content['url_userid']      = generateUserProfileLink($content['url_userid']);
+               $content['url']             = generateFrametesterUrl($content['url']);
+               $content['views_total']     = translateComma($content['url_views_total']);
+               $content['url_status']      = translateSurfbarUrlStatus($content['url_status']);
+               $content['url_registered']  = generateDateTime($content['url_registered'], 2);
+               $content['url_last_locked'] = generateDateTime($content['url_last_locked'], 2);
                if (empty($content['lock_reason'])) $content['lock_reason'] = '---';
 
                // Load row template