* -------------------------------------------------------------------- *
* *
* -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder *
+ * Copyright (c) 2003 - 2008 by Roland Haeder *
* For more information visit: http://www.mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
// Add description as navigation point
ADD_DESCR("admin", basename(__FILE__));
+// By default show the list...
+$show = true;
+
+// Edit or delete button hit?
+if (isset($_POST['edit'])) {
+ // Show entries for editing
+ ADMIN_EDIT_ENTRIES_CONFIRM(
+ $_POST['id'],
+ "surfbar_urls",
+ array("id", "userid", "url", "reward", "costs"),
+ array("bigintval", "ADD_MEMBER_SELECTION_BOX", "", "TRANSLATE_COMMA", "TRANSLATE_COMMA"),
+ array("", array(false, true, true), "", "", "")
+ );
+ $show = false;
+} elseif (isset($_POST['do_edit'])) {
+ // Change data of entries
+ ADMIN_EDIT_ENTRIES_CONFIRM(
+ $_POST['id'],
+ "surfbar_urls",
+ array("", ""),
+ array('reward' => "REVERT_COMMA", 'costs' => "REVERT_COMMA"),
+ array('reward' => "", 'costs' => ""),
+ true
+ );
+} elseif (isset($_POST['delete'])) {
+ // Show entries for deletion
+ ADMIN_DELETE_ENTRIES_CONFIRM(
+ $_POST['id'],
+ "surfbar_urls",
+ array("id", "userid", "url", "registered"),
+ array("bigintval", "ADMIN_USER_PROFILE_LINK", "FRAMETESTER", "MAKE_DATETIME"),
+ array("", "", "", "2")
+ );
+ $show = false;
+} elseif (isset($_POST['do_delete'])) {
+ // Remove entries from database
+ ADMIN_DELETE_ENTRIES_CONFIRM($_POST['id'], "surfbar_urls", array(), array(), array(), true);
+} elseif (isset($_POST['lock'])) {
+ // Un-/lock selected URLs. This does not work for pending URLs
+ ADMIN_LOCK_ENTRIES_CONFIRM(
+ $_POST['id'],
+ "surfbar_urls",
+ array("id", "userid", "url", "registered", "status"),
+ array("bigintval", "ADMIN_USER_PROFILE_LINK", "FRAMETESTER", "MAKE_DATETIME", "SURFBAR_TRANSLATE_STATUS"),
+ array("", "", "", "2", "")
+ );
+ $show = false;
+} elseif (isset($_POST['do_lock'])) {
+ // Un-/lock selected URLs. This does not work for pending URLs
+ ADMIN_LOCK_ENTRIES_CONFIRM(
+ $_POST['id'],
+ "surfbar_urls",
+ array(),
+ array(),
+ array(),
+ array("status" => array("CONFIRMED" => "LOCKED", "LOCKED" => "CONFIRMED")),
+ true
+ );
+}
+
+// Show entries?
+if (!$show) return false;
+
// List all URLs
-$result = SQL_QUERY("SELECT id, userid, url, reward, views_total, status, UNIX_TIMESTAMP(registered) AS registered, UNIX_TIMESTAMP(last_locked) AS last_locked, lock_reason
+$result = SQL_QUERY("SELECT id, userid, url, reward, costs, views_total, status, UNIX_TIMESTAMP(registered) AS registered, UNIX_TIMESTAMP(last_locked) AS last_locked, lock_reason
FROM "._MYSQL_PREFIX."_surfbar_urls
ORDER BY id ASC", __FILE__, __LINE__);
$content['userid'] = ADMIN_USER_PROFILE_LINK($content['userid']);
$content['url'] = FRAMETESTER($content['url']);
$content['reward'] = TRANSLATE_COMMA($content['reward']);
+ $content['costs'] = TRANSLATE_COMMA($content['costs']);
$content['views_total'] = TRANSLATE_COMMA($content['views_total']);
$content['status'] = SURFBAR_TRANSLATE_STATUS($content['status']);
$content['registered'] = MAKE_DATETIME($content['registered'], 2);