require($INC);
}
+// Add links for selecting some users
function alpha($sortby, $colspan, $return=false)
{
global $_CONFIG;
OUTPUT_HTML($OUT);
}
}
-//
+
+// Add links for sorting
function SortLinks($letter, $sortby, $colspan, $return=false)
{
$OUT = "";
OUTPUT_HTML($OUT);
}
}
-//
+
+// Add page navigation
function ADD_PAGENAV($PAGES, $offset, $show_form, $colspan,$return=false)
{
if (!$show_form)
OUTPUT_HTML($OUT);
}
}
+
// Create email link to user's account
function USER_CREATE_EMAIL_LINK($email, $mod="admin")
{
// Return rewritten (?) email address
return $email;
}
-//
+
+// Selects a random user id as the new referal id if they have at least X confirmed mails in this run
+function SELECT_RANDOM_REFID () {
+ global $_CONFIG;
+
+ // Default is zero refid
+ $refid = 0;
+
+ // Is the extension version fine?
+ if (GET_EXT_VERSION("user") >= "0.3.4") {
+ // Get all user ids
+ $totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true, " AND `rand_confirmed` >= ".$_CONFIG['user_min_confirmed']."");
+
+ // Do we have at least one?
+ if ($totalUsers > 0) {
+ // Then choose random number
+ $randNum = mt_rand(0, ($totalUsers - 1));
+
+ // Look for random user
+ $result = SQL_QUERY_ESC("SELECT `userid` FROM `"._MYSQL_PREFIX."_user_data` WHERE `status`='CONFIRMED' AND `rand_confirmed` >= %s ORDER BY `rand_confirmed` DESC LIMIT %s, 1",
+ array($_CONFIG['user_min_confirmed'], $randNum), __FILE__, __LINE__);
+
+ // Do we have one entry there?
+ if (SQL_NUMROWS($result) == 1) {
+ // Use that userid as new referal id
+ list($refid) = SQL_FETCHROW($result);
+ } // END - if
+
+ // Free result
+ SQL_FREERESULT($result);
+ } // END - if
+ } // END - if
+
+ // Return result
+ return $refid;
+}
+
+// [EOF]
?>