//
// Member has added an URL
function SURFBAR_MEMBER_ADD_URL ($url, $limit) {
//
// Member has added an URL
function SURFBAR_MEMBER_ADD_URL ($url, $limit) {
// Alert users which have URLs booked and are low on points amount
function SURFBAR_HANDLE_LOW_POINTS () {
// Alert users which have URLs booked and are low on points amount
function SURFBAR_HANDLE_LOW_POINTS () {
//
// -----------------------------------------------------------------------------
// Generic functions
// -----------------------------------------------------------------------------
//
//
// -----------------------------------------------------------------------------
// Generic functions
// -----------------------------------------------------------------------------
//
// Looks up by an URL
function SURFBAR_LOOKUP_BY_URL ($url, $uid) {
// Now lookup that given URL by itself
// Looks up by an URL
function SURFBAR_LOOKUP_BY_URL ($url, $uid) {
// Now lookup that given URL by itself
// Load URL data by given search term and column
function SURFBAR_GET_URL_DATA ($searchTerm, $column="id", $order="id", $sort="ASC", $group="id", $add="") {
global $lastUrlData;
// Load URL data by given search term and column
function SURFBAR_GET_URL_DATA ($searchTerm, $column="id", $order="id", $sort="ASC", $group="id", $add="") {
global $lastUrlData;
// Registers an URL with the surfbar. You should have called SURFBAR_LOOKUP_BY_URL() first!
function SURFBAR_REGISTER_URL ($url, $uid, $status="PENDING", $addMode="reg", $extraFields = array()) {
// Registers an URL with the surfbar. You should have called SURFBAR_LOOKUP_BY_URL() first!
function SURFBAR_REGISTER_URL ($url, $uid, $status="PENDING", $addMode="reg", $extraFields = array()) {
// Make sure by the user registered URLs are always pending
if ($addMode == "reg") $status = "PENDING";
// Make sure by the user registered URLs are always pending
if ($addMode == "reg") $status = "PENDING";
// Inserts an url by given data array and return the insert id
function SURFBAR_INSERT_URL_BY_ARRAY ($urlData) {
// Get userid
// Inserts an url by given data array and return the insert id
function SURFBAR_INSERT_URL_BY_ARRAY ($urlData) {
// Get userid
// Notify admin(s) with a selected message and content
function SURFBAR_NOTIFY_ADMIN ($messageType, $content) {
// Prepare template name
$templateName = sprintf("admin_surfbar_%s", $messageType);
// Notify admin(s) with a selected message and content
function SURFBAR_NOTIFY_ADMIN ($messageType, $content) {
// Prepare template name
$templateName = sprintf("admin_surfbar_%s", $messageType);
- // Set default subject if following eval() wents wrong
- $subject = ADMIN_SURFBAR_NOTIFY_DEFAULT_SUBJECT;
-
- // Create constant name
- $constantName = sprintf("ADMIN_SURFBAR_NOTIFY_%s_SUBJECT",
+ // Prepare subject
+ $subject = getMessage(sprintf("ADMIN_SURFBAR_NOTIFY_%s_SUBJECT",
- // Prepare subject
- if (defined($constantName)) {
- $subject = constant($constantName);
- } else {
- addFatalMessage(getMessage('ADMIN_SURFBAR_NOTIFY_SUBJECT_404'), $constantName);
- }
+ // Is the subject line there?
+ if ((substr($subject, 0, 1) == "!") && (substr($subject, -1, 1) == "!")) {
+ // Set default subject if following eval() wents wrong
+ $subject = getMessage('ADMIN_SURFBAR_NOTIFY_DEFAULT_SUBJECT');
+ } // END - if
// Translate some data if present
if (isset($content['status'])) $content['status'] = SURFBAR_TRANSLATE_STATUS($content['status']);
// Translate some data if present
if (isset($content['status'])) $content['status'] = SURFBAR_TRANSLATE_STATUS($content['status']);
// Send the notification out
return SEND_ADMIN_NOTIFICATION($subject, $templateName, $content, $content['uid']);
}
// Send the notification out
return SEND_ADMIN_NOTIFICATION($subject, $templateName, $content, $content['uid']);
}
// Notify the user about the performed action
function SURFBAR_NOTIFY_USER ($messageType, $content) {
// Skip notification if userid is zero
// Notify the user about the performed action
function SURFBAR_NOTIFY_USER ($messageType, $content) {
// Skip notification if userid is zero
- // Set default subject if following eval() wents wrong
- $subject = MEMBER_SURFBAR_NOTIFY_DEFAULT_SUBJECT;
-
- // Create constant name
- $constantName = sprintf("MEMBER_SURFBAR_NOTIFY_%s_SUBJECT",
+ // Prepare subject
+ $subject = getMessage(sprintf("MEMBER_SURFBAR_NOTIFY_%s_SUBJECT",
- // Prepare subject
- if (defined($constantName)) {
- $subject = constant($constantName);
- } else {
- addFatalMessage(getMessage('MEMBER_SURFBAR_NOTIFY_SUBJECT_404'), $constantName);
- }
+ // Is the subject line there?
+ if ((substr($subject, 0, 1) == "!") && (substr($subject, -1, 1) == "!")) {
+ // Set default subject if following eval() wents wrong
+ $subject = getMessage('MEMBER_SURFBAR_NOTIFY_DEFAULT_SUBJECT');
+ } // END - if
// Translate some data if present
if (isset($content['status'])) $content['status'] = SURFBAR_TRANSLATE_STATUS($content['status']);
// Translate some data if present
if (isset($content['status'])) $content['status'] = SURFBAR_TRANSLATE_STATUS($content['status']);
// Check if the "reload lock" of the current user is full, call this function
// before you call SURFBAR_CHECK_RELOAD_LOCK().
function SURFBAR_CHECK_RELOAD_FULL() {
// Check if the "reload lock" of the current user is full, call this function
// before you call SURFBAR_CHECK_RELOAD_LOCK().
function SURFBAR_CHECK_RELOAD_FULL() {
}
// Check wether the user is allowed to book more URLs
function SURFBAR_IF_USER_BOOK_MORE_URLS ($uid=0) {
}
// Check wether the user is allowed to book more URLs
function SURFBAR_IF_USER_BOOK_MORE_URLS ($uid=0) {
// Is this admin and userid is zero or does the user has some URLs left to book?
return ((($uid == 0) && (IS_ADMIN())) || (SURFBAR_GET_TOTAL_USER_URLS($uid, "", array("REJECTED")) < getConfig('surfbar_max_order')));
}
// Get total amount of URLs of given status for current user
function SURFBAR_GET_TOTAL_USER_URLS ($uid=0, $status="",$exclude="") {
// Is this admin and userid is zero or does the user has some URLs left to book?
return ((($uid == 0) && (IS_ADMIN())) || (SURFBAR_GET_TOTAL_USER_URLS($uid, "", array("REJECTED")) < getConfig('surfbar_max_order')));
}
// Get total amount of URLs of given status for current user
function SURFBAR_GET_TOTAL_USER_URLS ($uid=0, $status="",$exclude="") {
}
// Generate a validation code for the given id number
function SURFBAR_GENERATE_VALIDATION_CODE ($urlId, $salt="") {
}
// Generate a validation code for the given id number
function SURFBAR_GENERATE_VALIDATION_CODE ($urlId, $salt="") {
}
// Pay points to the user and remove it from the sender if userid is given else it is a "sponsored surf"
function SURFBAR_PAY_POINTS () {
}
// Pay points to the user and remove it from the sender if userid is given else it is a "sponsored surf"
function SURFBAR_PAY_POINTS () {
// Remove it from the URL owner
//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "uid=".SURFBAR_GET_USERID().",costs=".SURFBAR_GET_COSTS()."", false);
if (SURFBAR_GET_USERID() > 0) {
// Remove it from the URL owner
//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "uid=".SURFBAR_GET_USERID().",costs=".SURFBAR_GET_COSTS()."", false);
if (SURFBAR_GET_USERID() > 0) {
// Count all users in surfbar modue and return the value
$result = SQL_QUERY_ESC("SELECT id
FROM `{!_MYSQL_PREFIX!}_surfbar_stats`
// Count all users in surfbar modue and return the value
$result = SQL_QUERY_ESC("SELECT id
FROM `{!_MYSQL_PREFIX!}_surfbar_stats`
}
// Changes the status of an URL from given to other
function SURFBAR_CHANGE_STATUS ($urlId, $prevStatus, $newStatus, $data=array()) {
}
// Changes the status of an URL from given to other
function SURFBAR_CHANGE_STATUS ($urlId, $prevStatus, $newStatus, $data=array()) {
}
// Calculate minimum value for dynamic payment model
function SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE () {
}
// Calculate minimum value for dynamic payment model
function SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE () {
}
// Calculate maximum value for dynamic payment model
function SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE () {
}
// Calculate maximum value for dynamic payment model
function SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE () {
}
// "Getter" for maximum random number
function SURFBAR_GET_MAX_RANDOM ($UIDs, $ADD) {
}
// "Getter" for maximum random number
function SURFBAR_GET_MAX_RANDOM ($UIDs, $ADD) {
// Count max availabe entries
$result = SQL_QUERY("SELECT sbu.id AS cnt
FROM `{!_MYSQL_PREFIX!}_surfbar_urls` AS sbu
// Count max availabe entries
$result = SQL_QUERY("SELECT sbu.id AS cnt
FROM `{!_MYSQL_PREFIX!}_surfbar_urls` AS sbu
// Determine next id for surfbar or get data for given id, always call this before you call other
// getters below this function!!!
function SURFBAR_DETERMINE_NEXT_ID ($urlId = 0) {
// Determine next id for surfbar or get data for given id, always call this before you call other
// getters below this function!!!
function SURFBAR_DETERMINE_NEXT_ID ($urlId = 0) {