}
// "Getter" for userid array which will return only one entry
-function getArrayFromRefbackLevel ($rid, $level) {
+function getArrayFromRefbackLevel ($refid, $level) {
//* DEBUG: */ print("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
- //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):rid={$rid},level={$level}<br />");
+ //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):refid={$refid},level={$level}<br />");
// Init userids
$userIds = array();
`refid`=%s AND `level`=%s
ORDER BY
`userid` ASC",
- array($rid, $level), __FUNCTION__, __LINE__);
+ array($refid, $level), __FUNCTION__, __LINE__);
// Entries found?
//* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):numRows=".SQL_NUMROWS($result)."<br />");
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Add all
while ($content = SQL_FETCHARRAY($result)) {
- //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):rid={$rid},level={$level},userid={$content['userid']}<br />");
+ //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):refid={$refid},level={$level},userid={$content['userid']}<br />");
$userIds[] = $content['userid'];
} // END - while
} // END - if
SQL_FREERESULT($result);
// Return array
- //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):rid={$rid},count()=".count($userIds)."<br />");
+ //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):refid={$refid},count()=".count($userIds)."<br />");
//* DEBUG: */ print("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
return $userIds;
}
array(bigintval($userid), $GLOBALS['refback_level'], bigintval($GLOBALS['refback_refid'][$GLOBALS['refback_level']])), __FUNCTION__, __LINE__);
// Move to next referal level and count his counter one up!
- $GLOBALS['refback_level']++; updateRefbackTable($GLOBALS['refback_refid'][($GLOBALS['refback_level'] - 1)]);
+ $GLOBALS['refback_level']++;
+ updateRefbackTable($GLOBALS['refback_refid'][($GLOBALS['refback_level'] - 1)]);
} // END - if
// Do we have another level here?
array(bigintval($userid), bigintval($level)), __FUNCTION__, __LINE__);
// Are there some entries?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Fetch all entries
while ($row = SQL_FETCHARRAY($result)) {
// Add row
return $status;
}
+// Checks wether refback is enabled
+function isRefbackEnabled () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = (getConfig('refback_enabled') == 'Y');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
// [EOF]
?>