From: Roland Häder Date: Fri, 6 Nov 2009 17:23:40 +0000 (+0000) Subject: Fix for marking categories in registration page X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7db7d1ad72783bf7650fbb39a0a00a447b0c147a;p=mailer.git Fix for marking categories in registration page --- diff --git a/inc/libs/register_functions.php b/inc/libs/register_functions.php index cc4ecaeb8c..2c2a4c1b04 100644 --- a/inc/libs/register_functions.php +++ b/inc/libs/register_functions.php @@ -89,12 +89,6 @@ function registerGenerateCategoryTable ($mode, $return=false) { $SW = 2; $OUT .= "\n"; while ($content = SQL_FETCHARRAY($result)) { - // Is the array element not set? - if (!isPostRequestElementSet('cat', $content['id'])) { - // Then set it - setRequestPostElement('cat', array($content['id'] => '')); - } // END - if - // Prepare array for the template $content = array( 'sw' => $SW, @@ -104,6 +98,7 @@ function registerGenerateCategoryTable ($mode, $return=false) { 'id' => $content['id'], ); + // Mark categories if ((postRequestElement('cat', $content['id']) == 'Y') || ((getConfig('register_default') == 'Y') && (!isPostRequestElementSet('cat', $content['id'])))) { $content['def_y'] = ' checked="checked"'; } else { diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 2a3f33ac87..4b7d94ccc4 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -1869,7 +1869,10 @@ function generateCategoryOptionsList ($mode) { ); // Get categories - $result = SQL_QUERY("SELECT id, cat FROM `{?_MYSQL_PREFIX?}_cats`".$whereStatement." ORDER BY `sort`", __FUNCTION__, __LINE__); + $result = SQL_QUERY("SELECT `id`, `cat` FROM `{?_MYSQL_PREFIX?}_cats`".$whereStatement." ORDER BY `sort` ASC", + __FUNCTION__, __LINE__); + + // Do we have entries? if (SQL_NUMROWS($result) > 0) { // ... and begin loading stuff while ($content = SQL_FETCHARRAY($result)) { @@ -1890,7 +1893,9 @@ function generateCategoryOptionsList ($mode) { FROM `{?_MYSQL_PREFIX?}_user_data` WHERE - `userid`=%s AND `status`='CONFIRMED' AND `receive_mails` > 0".runFilterChain('exclude_users', $mode)." + `userid`=%s AND + `status`='CONFIRMED' AND + `receive_mails` > 0".runFilterChain('exclude_users', $mode)." LIMIT 1", array(bigintval($ucat)), __FUNCTION__, __LINE__);