X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_cats.php;h=05e1c856d98047aba2ce17d33a2125f2492f4dfc;hb=9e604ce404fe7d2d8dafc259a5fb8cd826aec5e6;hp=268998ec45c13728101c9b86aafb34b7286820cf;hpb=a090e351c49fe021fb3064325694da03402332e0;p=mailer.git
diff --git a/inc/modules/admin/what-list_cats.php b/inc/modules/admin/what-list_cats.php
index 268998ec45..05e1c856d9 100644
--- a/inc/modules/admin/what-list_cats.php
+++ b/inc/modules/admin/what-list_cats.php
@@ -39,7 +39,7 @@
// Some security stuff...
if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+ $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
require($INC);
}
@@ -48,7 +48,7 @@ ADD_DESCR('admin', __FILE__);
if (REQUEST_ISSET_GET('uid')) {
// Check if the user already exists
- $result = SQL_QUERY_ESC("SELECT surname, family, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `surname`, `family`, `email` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
array(bigintval(REQUEST_GET('uid'))), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Loads surname, family's name and the email address
@@ -58,19 +58,19 @@ if (REQUEST_ISSET_GET('uid')) {
// Prepare constants
define('__CATS_BASE' , "".$sname." ".$fname."");
+ define('__MEMBER_LINKS', generateMemberAdminActionLinks(constant('__UID')));
+ define('__EMAIL' , "".$sname." ".$fname."");
// Ok, list categories of this user
- $result_cats = SQL_QUERY("SELECT id, cat FROM `{!_MYSQL_PREFIX!}_cats` ORDER BY `sort`", __FILE__, __LINE__);
+ $result_cats = SQL_QUERY("SELECT `id`, `cat` FROM `{!_MYSQL_PREFIX!}_cats` ORDER BY `sort` ASC", __FILE__, __LINE__);
if (SQL_NUMROWS($result_cats) > 0) {
// List categories
$cnt = 1; $OUT = ''; $SW = 2;
while ($content = SQL_FETCHARRAY($result_cats)) {
// Check user's selection
- $result_user = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE userid=%s AND cat_id=%s LIMIT 1",
- array(bigintval(REQUEST_GET('uid')), bigintval($content['id'])), __FILE__, __LINE__);
+ $result_user = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE `userid`=%s AND `cat_id`=%s LIMIT 1",
+ array(bigintval(REQUEST_GET('uid')), bigintval($content['id'])), __FILE__, __LINE__);
// Set selection
$selection = "{--NO--}";
@@ -82,7 +82,7 @@ if (REQUEST_ISSET_GET('uid')) {
$content['sel'] = $selection;
// Load row template and switch colors + count up
- $OUT .= LOAD_TEMPLATE("admin_list_cats_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('admin_list_cats_row', true, $content);
$SW = 3 - $SW; $cnt++;
} // END - while
@@ -93,10 +93,10 @@ if (REQUEST_ISSET_GET('uid')) {
define('__CATS_ROWS', $OUT);
// Load main template
- LOAD_TEMPLATE("admin_list_cats");
+ LOAD_TEMPLATE('admin_list_cats');
} else {
// No categories selected! :-(
- LOAD_TEMPLATE("admin_list_cats_404");
+ LOAD_TEMPLATE('admin_list_cats_404');
}
} else {
// User not found