ADD_DESCR("admin", basename(__FILE__));
// Define some variables
-global $DATA, $link;
+global $DATA;
// Check for mails
$result_main = SQL_QUERY("SELECT id, sender, subject, payment_id, timestamp, url, target_send, cat_id FROM "._MYSQL_PREFIX."_pool WHERE data_type='ADMIN' ORDER BY timestamp", __FILE__, __LINE__);
-OPEN_TABLE("100%", "admin_content admin_content_align", "");
if ((SQL_NUMROWS($result_main) > 0) || (isset($_POST['lock']))) {
// Count checked checkboxes
$SEL = 0;
$id = bigintval($id);
// Unlock selected email
- $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_pool SET data_type='NEW' WHERE id=%d AND data_type='ADMIN' LIMIT 1",
+ $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_pool SET data_type='NEW' WHERE id=%s AND data_type='ADMIN' LIMIT 1",
array($id), __FILE__, __LINE__);
// Update wents fine?
- if (SQL_AFFECTEDROWS($link, __FILE__, __LINE__) == 1) {
- // Order placed in queue... 0 1 2 3
- $result = SQL_QUERY_ESC("SELECT po.url, po.subject, po.sender, pay.payment
+ if (SQL_AFFECTEDROWS() == 1) {
+ // Order placed in queue... 0 1 2 3 4
+ $result = SQL_QUERY_ESC("SELECT po.url, po.subject, po.sender, pay.payment, po.payment_id
FROM "._MYSQL_PREFIX."_pool AS po
INNER JOIN "._MYSQL_PREFIX."_payments AS pay
ON po.payment_id=pay.id
-WHERE po.id=%d
+WHERE po.id=%s
LIMIT 1",
array($id), __FILE__, __LINE__);
// Check for bonus extension version >= 0.4.4 for the order bonus
if ((GET_EXT_VERSION("bonus") >= "0.4.4") && ($_CONFIG['bonus_active'] == "Y")) {
// Add points directly
- $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET bonus_order=bonus_order+".$_CONFIG['bonus_order']." WHERE userid=%d LIMIT 1",
+ $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET bonus_order=bonus_order+".$_CONFIG['bonus_order']." WHERE userid=%s LIMIT 1",
array(bigintval($DATA['sender'])), __FILE__, __LINE__);
// Subtract bonus points from system
BONUS_POINTS_HANDLER($_CONFIG['bonus_order']);
- }
+ } // END - if
- // Check for surfbar extension
- if (EXT_IS_ACTIVE("surfbar")) {
- // Add the url
- $insertId = SURFBAR_ADMIN_ADD_URL($DATA['url'], $DATA['sender'], $DATA['payment']);
-
- // Load email template
- $msg_user = LOAD_EMAIL_TEMPLATE("order_accept_sb", $insertId, $DATA['sender']);
- } else {
- // Load email template
- $msg_user = LOAD_EMAIL_TEMPLATE("order-accept", "", $DATA['sender']);
- }
+ // Load email template
+ $msg_user = LOAD_EMAIL_TEMPLATE("order-accept", "", $DATA['sender']);
// Send email
SEND_EMAIL($DATA['sender'], MEMBER_ORDER_ACCEPTED, $msg_user);
- }
- }
+ } // END - if
+ } // END - foreach
// Set message
$MSG = ADMIN_MAILS_ACTIVATED;
if ($SEL > 0) {
// Reject mail orders
$SW = 2; $OUT = "";
- foreach ($_POST['sel'] as $id=>$value) {
+ foreach ($_POST['sel'] as $id => $value) {
// Secure ID number
$id = bigintval($id);
// Load URL and subject from pool
- $result = SQL_QUERY_ESC("SELECT url, subject, sender FROM "._MYSQL_PREFIX."_pool WHERE id=%d LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT url, subject, sender FROM "._MYSQL_PREFIX."_pool WHERE id=%s LIMIT 1",
array($id), __FILE__, __LINE__);
// Load data
if ((empty($_POST['redirect'])) || ($_POST['redirect'] == "http://")) $_POST['redirect'] = URL;
// Redirect URL
- $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_pool SET url='%s', data_type='NEW' WHERE id=%d LIMIT 1",
+ $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_pool SET url='%s', data_type='NEW' WHERE id=%s LIMIT 1",
array($_POST['redirect'], $id),__FILE__, __LINE__);
// Prepare data for the row template
} elseif ((isset($_POST['lock'])) || ($SEL > 0)) {
if ($SEL > 0) {
// Lock URLs
- foreach ($_POST['sel'] as $id=>$url) {
+ foreach ($_POST['sel'] as $id => $url) {
// Lookup in blacklist
$result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_url_blist WHERE url='%s' LIMIT 1",
array($url), __FILE__, __LINE__);
LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NO_MAILS_IN_POOL);
}
-CLOSE_TABLE();
//
?>