X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_surfbar_urls.php;h=5204455333db2d0fb79f91a1974a4bd3ef2a90de;hb=16b311c338bb4f8436e2ed9e76cb1cd5f3741640;hp=e9964c13cca376b7923a7fb451a2c83201c695fe;hpb=9e3656b7346cd7ba24f241f2e0378b9e4675acd3;p=mailer.git diff --git a/inc/modules/admin/what-list_surfbar_urls.php b/inc/modules/admin/what-list_surfbar_urls.php index e9964c13cc..5204455333 100644 --- a/inc/modules/admin/what-list_surfbar_urls.php +++ b/inc/modules/admin/what-list_surfbar_urls.php @@ -14,11 +14,9 @@ * $Date:: $ * * $Tag:: 0.2.1-FINAL $ * * $Author:: $ * - * Needs to be in all Files and every File needs "svn propset * - * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009, 2010 by Mailer Developer Team * + * Copyright (c) 2009 - 2011 by Mailer Developer Team * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -43,95 +41,205 @@ if ((!defined('__SECURITY')) || (!isAdmin())) { } // END - if // Add description as navigation point -addMenuDescription('admin', __FILE__); +addYouAreHereLink('admin', __FILE__); // By default show the list... $show = true; -// Check for 'id' element -if ((countRequestPost() > 0) && ((!isPostRequestParameterSet('id')) || (!is_array(postRequestParameter('id'))) || (count(postRequestParameter('id')) == 0))) { +// Check for 'url_id' element +if ((countRequestPost() > 0) && ((!isPostRequestParameterSet('url_id')) || (!is_array(postRequestParameter('url_id'))) || (count(postRequestParameter('url_id')) == 0))) { // Not found so output message - loadTemplate('admin_settings_saved', false, getMessage('ADMIN_SURFBAR_NO_SELECTIONS')); + loadTemplate('admin_settings_saved', false, '{--ADMIN_SURFBAR_NO_SELECTIONS--}'); // Abort here return; } // END - if // Edit or delete button hit? -if (isPostRequestParameterSet('edit')) { +if (isFormSent('edit')) { // Show entries for editing adminEditEntriesConfirm( - postRequestParameter('id'), + postRequestParameter('url_id'), 'surfbar_urls', - array('id', 'userid', 'url'), - array('bigintval', 'addMemberSelectionBox', ''), - array('', array(false, true, true, 'userid[]'), '') + array( + 'url_id', + 'url_userid', + 'url' + ), + array( + 'bigintval', + 'addMemberSelectionBox', + '' + ), + array( + '', + array( + false, + true, + true, + 'url_userid[]' + ), + '' + ), + false, + 'url_id', + 'url_userid', + 'url_userid' ); $show = false; } elseif (isPostRequestParameterSet('do_edit')) { // Change data of entries adminEditEntriesConfirm( - postRequestParameter('id'), + postRequestParameter('url_id'), 'surfbar_urls', array(), array(), array(), - true + true, + 'url_id', + 'url_userid', + 'url_userid' ); } elseif (isPostRequestParameterSet('delete')) { // Show entries for deletion adminDeleteEntriesConfirm( - postRequestParameter('id'), + postRequestParameter('url_id'), 'surfbar_urls', - array('id', 'userid', 'url', 'registered'), - array('bigintval', 'generateUserProfileLink', 'generateFrametesterUrl', ''), - array('', '', '', '') + array( + 'url_id', + 'url_userid', + 'url', + 'url_registered' + ), + array( + 'bigintval', + 'generateUserProfileLink', + 'generateFrametesterUrl', + '' + ), + array( + '', + '', + '', + '' + ), + false, + 'url_id', + 'url_userid', + 'url_userid' ); $show = false; } elseif (isPostRequestParameterSet('do_delete')) { // Remove entries from database - adminDeleteEntriesConfirm(postRequestParameter('id'), 'surfbar_urls', array(), array(), array(), true); -} elseif (isPostRequestParameterSet('lock')) { + adminDeleteEntriesConfirm( + postRequestParameter('url_id'), + 'surfbar_urls', + array(), + array(), + array(), + true, + 'url_id' + ); +} elseif (isFormSent('lock')) { // Un-/lock selected URLs. This does not work for pending URLs adminLockEntriesConfirm( - postRequestParameter('id'), + postRequestParameter('url_id'), 'surfbar_urls', - array('id', 'userid', 'url', 'registered', 'status'), - array('bigintval', 'generateUserProfileLink', 'generateFrametesterUrl', '', 'translateSurfbarUrlStatus'), - array('', '', '', '', '') + array( + 'url_id', + 'url_userid', + 'url', + 'url_registered', + 'url_status' + ), + array( + 'bigintval', + 'generateUserProfileLink', + 'generateFrametesterUrl', + '', + 'translateSurfbarUrlStatus' + ), + array( + '', + '', + '', + '', + '' + ), + false, + 'url_id', + 'url_userid', + 'url_userid' ); $show = false; } elseif (isPostRequestParameterSet('do_lock')) { // Un-/lock selected URLs. This does not work for pending URLs adminLockEntriesConfirm( - postRequestParameter('id'), + postRequestParameter('url_id'), 'surfbar_urls', array(), array(), array(), - array('status' => array('ACTIVE' => 'LOCKED', 'LOCKED' => 'ACTIVE')), - true + array( + 'url_status' => array( + 'ACTIVE' => 'LOCKED', + 'LOCKED' => 'ACTIVE' + ) + ), + true, + 'url_id', + 'url_userid', + 'url_userid' ); } elseif (isPostRequestParameterSet('undelete')) { // Undelete selected URLs. This does only work for deleted URLs... ;-) adminUndeleteEntriesConfirm( - postRequestParameter('id'), + postRequestParameter('url_id'), 'surfbar_urls', - array('id', 'userid', 'url', 'registered', 'status'), - array('bigintval', 'generateUserProfileLink', 'generateFrametesterUrl', '', 'translateSurfbarUrlStatus'), - array('', '', '', '', '') + array( + 'url_id', + 'url_userid', + 'url', + 'url_registered', + 'url_status' + ), + array( + 'bigintval', + 'generateUserProfileLink', + 'generateFrametesterUrl', + '', + 'translateSurfbarUrlStatus' + ), + array( + '', + '', + '', + '', + '' + ), + false, + 'url_id', + 'url_userid', + 'url_userid' ); $show = false; } elseif (isPostRequestParameterSet('do_undelete')) { // Undelete selected URLs. This does only work for deleted URLs... ;-) adminUndeleteEntriesConfirm( - postRequestParameter('id'), + postRequestParameter('url_id'), 'surfbar_urls', array(), array(), array(), - array('status' => array('DELETED' => 'ACTIVE')), - true + array( + 'url_status' => array( + 'DELETED' => 'ACTIVE' + ) + ), + true, + 'url_id', + 'url_userid', + 'url_userid' ); } @@ -140,42 +248,33 @@ if ($show === false) return false; // List all URLs $result = SQL_QUERY("SELECT - `id`, `userid`, `url`, `views_total`, `status` AS `url_status`, - UNIX_TIMESTAMP(`registered`) AS url_registered, - UNIX_TIMESTAMP(`last_locked`) AS url_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) { +if (!SQL_HASZERONUMS($result)) { // List all URLs - $OUT = ''; $SW = 2; + $OUT = ''; 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['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 $OUT .= loadTemplate('admin_list_surfbar_urls_row', true, $content); - - // Switch color - $SW = 3 - $SW; } // END - while // Load main template loadTemplate('admin_list_surfbar_urls', false, $OUT); } else { // No URLs in surfbar - loadTemplate('admin_settings_saved', false, getMessage('ADMIN_SURFBAR_NO_URLS_FOUND')); + loadTemplate('admin_settings_saved', false, '{--ADMIN_SURFBAR_NO_URLS_FOUND--}'); } // Free result