$hash = generatePassString($hashDB);
if (($hash == get_session('u_hash')) || ($_POST['pass1'] == $_POST['pass2'])) {
// Load user's data
- $result = SQL_QUERY_ESC("SELECT sex, surname, family, street_nr, country, zip, city, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s AND password='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT gender, surname, family, street_nr, country, zip, city, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s AND password='%s' LIMIT 1",
array($GLOBALS['userid'], $hashDB), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Load the data
// Free result
SQL_FREERESULT($result);
- // Translate salutation
- $DATA[0] = TRANSLATE_SEX($DATA[0]);
+ // Translate gender
+ $DATA[0] = TRANSLATE_GENDER($DATA[0]);
// Clear/init the content variable
$content = "";
// Default is not found
$ret = _CATEGORY_404;
- // Lookup the category
- $result = SQL_QUERY_ESC("SELECT cat FROM "._MYSQL_PREFIX."_cats WHERE id=%s LIMIT 1",
- array(bigintval($cid)), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) == 1) {
- // Category found... :-)
- list($ret) = SQL_FETCHROW($result);
- } // END - if
+ // Is the category id set?
+ if (!empty($cid)) {
- // Free result
- SQL_FREERESULT($result);
+ // Lookup the category
+ $result = SQL_QUERY_ESC("SELECT cat FROM "._MYSQL_PREFIX."_cats WHERE id=%s LIMIT 1",
+ array(bigintval($cid)), __FILE__, __LINE__);
+ if (SQL_NUMROWS($result) == 1) {
+ // Category found... :-)
+ list($ret) = SQL_FETCHROW($result);
+ } // END - if
+
+ // Free result
+ SQL_FREERESULT($result);
+ } // END - if
// Return result
return $ret;
// Points updated, maybe I shall send him an email?
if (($send_notify) && ($ref > 0) && (!$locked)) {
- // 0 1 2 3
- $DATA = array($per, bigintval($DEPTH), $ref_points, bigintval($ref));
- $msg = LOAD_EMAIL_TEMPLATE("confirm-referral", "", bigintval($uid));
+ // Prepare content
+ $content = array(
+ 'percent' => $per,
+ 'level' => bigintval($DEPTH),
+ 'points' => $ref_points,
+ 'refid' => bigintval($ref)
+ );
+
+ // Load email template
+ $msg = LOAD_EMAIL_TEMPLATE("confirm-referral", $content, bigintval($uid));
SEND_EMAIL($email, THANX_REFERRAL_ONE, $msg);
} elseif (($send_notify) && ($ref == 0) && (!$locked) && ($add_mode == "direct") && (!defined('__POINTS_VALUE'))) {
if (GET_EXT_VERSION("mediadata") >= "0.0.4") {
// Update database
MEDIA_UPDATE_ENTRY(array("total_points"), "sub", $points);
- }
+ } // END - if
// Now, when we have all his points adds them do the jackpot!
ADD_JACKPOT($points);