}
// Get timestamp for given stats type and data
-function getEpocheTimeFromUserStats ($statsType, $statsData, $userid = '0') {
+function getEpocheTimeFromUserStats ($statsType, $statsData, $userid = NULL) {
// Default timestamp is zero
$data['inserted'] = '0';
);
// Initialize the user id
- $userid = '0';
+ $userid = NULL;
// Search for an unconfirmed or confirmed account
$result = SQL_QUERY_ESC("SELECT `userid`, `refid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `user_hash`='%s' AND (`status`='UNCONFIRMED' OR `status`='CONFIRMED') LIMIT 1",
sendEmail($userid, '{--GUEST_THANX_CONFIRM--}', $message);
// Maybe he got "referaled"?
- if (($refid > 0) && ($refid != $userid)) {
+ if ((isValidUserId($refid)) && ($refid != $userid)) {
// Select the referal userid
if (fetchUserData($refid)) {
// Update ref counter...