2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 08/31/2008 *
4 * =================== Last change: 08/31/2008 *
6 * -------------------------------------------------------------------- *
7 * File : what-list_surfbar_urls.php *
8 * -------------------------------------------------------------------- *
9 * Short description : List all URLs in surfbar and sync from mail pool *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Alle URLs in Surfbar auflisten und syncen *
12 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * Needs to be in all Files and every File needs "svn propset *
18 * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
19 * -------------------------------------------------------------------- *
20 * Copyright (c) 2003 - 2009 by Roland Haeder *
21 * Copyright (c) 2009, 2010 by Mailer Developer Team *
22 * For more information visit: http://www.mxchange.org *
24 * This program is free software; you can redistribute it and/or modify *
25 * it under the terms of the GNU General Public License as published by *
26 * the Free Software Foundation; either version 2 of the License, or *
27 * (at your option) any later version. *
29 * This program is distributed in the hope that it will be useful, *
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
32 * GNU General Public License for more details. *
34 * You should have received a copy of the GNU General Public License *
35 * along with this program; if not, write to the Free Software *
36 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
38 ************************************************************************/
40 // Some security stuff...
41 if ((!defined('__SECURITY')) || (!isAdmin())) {
45 // Add description as navigation point
46 addMenuDescription('admin', __FILE__);
48 // By default show the list...
51 // Check for 'id' element
52 if ((countRequestPost() > 0) && ((!isPostRequestParameterSet('id')) || (!is_array(postRequestParameter('id'))) || (count(postRequestParameter('id')) == 0))) {
53 // Not found so output message
54 loadTemplate('admin_settings_saved', false, getMessage('ADMIN_SURFBAR_NO_SELECTIONS'));
60 // Edit or delete button hit?
61 if (isFormSent('edit')) {
62 // Show entries for editing
63 adminEditEntriesConfirm(
64 postRequestParameter('id'),
66 array('url_id', 'url_userid', 'url'),
67 array('bigintval', 'addMemberSelectionBox', ''),
68 array('', array(false, true, true, 'userid[]'), '')
71 } elseif (isPostRequestParameterSet('do_edit')) {
72 // Change data of entries
73 adminEditEntriesConfirm(
74 postRequestParameter('url_id'),
82 } elseif (isPostRequestParameterSet('delete')) {
83 // Show entries for deletion
84 adminDeleteEntriesConfirm(
85 postRequestParameter('url_id'),
87 array('url_id', 'url_userid', 'url', 'url_registered'),
88 array('bigintval', 'generateUserProfileLink', 'generateFrametesterUrl', ''),
89 array('', '', '', ''),
96 } elseif (isPostRequestParameterSet('do_delete')) {
97 // Remove entries from database
98 adminDeleteEntriesConfirm(postRequestParameter('url_id'), 'surfbar_urls', array(), array(), array(), true, 'url_id');
99 } elseif (isFormSent('lock')) {
100 // Un-/lock selected URLs. This does not work for pending URLs
101 adminLockEntriesConfirm(
102 postRequestParameter('url_id'),
104 array('url_id', 'url_userid', 'url', 'url_registered', 'status'),
105 array('bigintval', 'generateUserProfileLink', 'generateFrametesterUrl', '', 'translateSurfbarUrlStatus'),
106 array('', '', '', '', ''),
111 } elseif (isPostRequestParameterSet('do_lock')) {
112 // Un-/lock selected URLs. This does not work for pending URLs
113 adminLockEntriesConfirm(
114 postRequestParameter('url_id'),
119 array('status' => array('ACTIVE' => 'LOCKED', 'LOCKED' => 'ACTIVE')),
123 } elseif (isPostRequestParameterSet('undelete')) {
124 // Undelete selected URLs. This does only work for deleted URLs... ;-)
125 adminUndeleteEntriesConfirm(
126 postRequestParameter('url_id'),
128 array('url_id', 'url_userid', 'url', 'url_registered', 'status'),
129 array('bigintval', 'generateUserProfileLink', 'generateFrametesterUrl', '', 'translateSurfbarUrlStatus'),
130 array('', '', '', '', ''),
135 } elseif (isPostRequestParameterSet('do_undelete')) {
136 // Undelete selected URLs. This does only work for deleted URLs... ;-)
137 adminUndeleteEntriesConfirm(
138 postRequestParameter('url_id'),
143 array('status' => array('DELETED' => 'ACTIVE')),
150 if ($show === false) return false;
153 $result = SQL_QUERY("SELECT
154 `url_id`, `url_userid`, `url`, `url_views_total`, `url_status`,
155 UNIX_TIMESTAMP(`url_registered`) AS `url_registered`,
156 UNIX_TIMESTAMP(`url_last_locked`) AS `url_last_locked`,
159 `{?_MYSQL_PREFIX?}_surfbar_urls`
161 `url_id` ASC", __FILE__, __LINE__);
163 // Do we have some URLs left?
164 if (SQL_NUMROWS($result) > 0) {
167 while ($content = SQL_FETCHARRAY($result)) {
168 // "Translate"/add content
169 $content['sw'] = $SW;
170 $content['url_registered'] = generateDateTime($content['url_registered'], 2);
171 $content['url_last_locked'] = generateDateTime($content['url_last_locked'], 2);
172 if (empty($content['url_lock_reason'])) $content['url_lock_reason'] = '---';
175 $OUT .= loadTemplate('admin_list_surfbar_urls_row', true, $content);
181 // Load main template
182 loadTemplate('admin_list_surfbar_urls', false, $OUT);
184 // No URLs in surfbar
185 loadTemplate('admin_settings_saved', false, getMessage('ADMIN_SURFBAR_NO_URLS_FOUND'));
189 SQL_FREERESULT($result);