// Add description as navigation point
ADD_DESCR("admin", basename(__FILE__));
-$WHERE = " WHERE visible='Y'";
-if (is_admin()) $WHERE = "";
+$whereStatement = " WHERE visible='Y'";
+if (is_admin()) $whereStatement = "";
$EXT_HTML = EXT_IS_ACTIVE("html_mail");
if (empty($_GET['mode'])) $_GET['mode'] = "select";
// Select category
$CAT_TABS = "LEFT JOIN "._MYSQL_PREFIX."_user_cats AS c ON d.userid=c.userid";
$cat = bigintval($_POST['cat']);
- $CAT_WHERE = " AND c.cat_id=%d";
+ $CAT_WHERE = " AND c.cat_id=%s";
}
if (GET_EXT_VERSION("holiday") >= "0.1.3")
{
{
// Only include HTML receivers
$result = SQL_QUERY_ESC("SELECT d.userid FROM "._MYSQL_PREFIX."_user_data AS d ".$CAT_TABS." WHERE d.status='CONFIRMED' AND d.html='Y'".$CAT_WHERE." ORDER BY d.%s %s LIMIT %s",
- array($cat, $CONFIG['order_select'], $CONFIG['order_mode'], bigintval($_POST['receiver'])), __FILE__, __LINE__);
+ array($cat, $_CONFIG['order_select'], $_CONFIG['order_mode'], bigintval($_POST['receiver'])), __FILE__, __LINE__);
}
else
{
// Include all
$result = SQL_QUERY_ESC("SELECT d.userid FROM "._MYSQL_PREFIX."_user_data AS d ".$CAT_TABS." WHERE d.status='CONFIRMED'".$CAT_WHERE." ORDER BY d.%s %s LIMIT %s",
- array($cat, $CONFIG['order_select'], $CONFIG['order_mode'], bigintval($_POST['receiver'])), __FILE__, __LINE__);
+ array($cat, $_CONFIG['order_select'], $_CONFIG['order_mode'], bigintval($_POST['receiver'])), __FILE__, __LINE__);
}
if ((SQL_NUMROWS($result) == $_POST['receiver']) && ($_POST['receiver'] > 0))
{
// Gettings points is oka, so we can add $USED later from
if ($EXT_HTML)
{
- $HTML = 'N';
- if ($_GET['mode'] == "html") $HTML = 'Y';
+ $HTML = "N";
+ if ($_GET['mode'] == "html") $HTML = "Y";
$result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_bonus
(subject, text, receivers, points, time, data_type, timestamp, url, cat_id, target_send, mails_sent, html_msg)
VALUES ('%s', '%s', '%s', '%s', '%s', 'NEW', UNIX_TIMESTAMP(), '%s', '%s', '%s', '%s', '%s')",
}
// Mail inserted into bonus pool
- LOAD_TEMPLATE ("admin_settings_saved", false, ADMIN_BONUS_SEND);
+ LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BONUS_SEND);
}
else
{
// More entered than can be reached!
- LOAD_TEMPLATE ("admin_settings_saved", false, ADMIN_MORE_SELECTED);
+ LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_MORE_SELECTED);
}
if (!empty($URL))
{
LOAD_URL($URL);
}
} else {
- $result = SQL_QUERY("SELECT id, cat FROM "._MYSQL_PREFIX."_cats".$WHERE." ORDER BY sort", __FILE__, __LINE__);
+ $result = SQL_QUERY("SELECT id, cat FROM "._MYSQL_PREFIX."_cats".$whereStatement." ORDER BY sort", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0)
{
$MORE = "";
{
$CATS['id'][] = $id;
$CATS['name'][] = $cat;
- $result_uids = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_cats WHERE cat_id=%d",
+ $result_uids = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_cats WHERE cat_id=%s",
array(bigintval($id)), __FILE__, __LINE__);
$uid_cnt = "0";
while (list($ucat) = SQL_FETCHROW($result_uids))
{
$result_ver = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data
-WHERE userid=%d AND status='CONFIRMED' AND receive_mails > 0".$MORE." LIMIT 1",
+WHERE userid=%s AND status='CONFIRMED' AND receive_mails > 0".$MORE." LIMIT 1",
array(bigintval($ucat)), __FILE__, __LINE__);
$uid_cnt += SQL_NUMROWS($result_ver);
else
{
// No cateogries are defined yet
- OUTPUT_HTML ("<STRONG><SPAN class=\"member_failed\">".MEMBER_NO_CATS."</SPAN></STRONG>");
+ OUTPUT_HTML("<STRONG><SPAN class=\"member_failed\">".MEMBER_NO_CATS."</SPAN></STRONG>");
}
}