* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
* Copyright (c) 2009 - 2011 by Mailer Developer Team *
- * For more information visit: http://www.mxchange.org *
+ * For more information visit: http://mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
if (true) {
//if (($urlData['url_views_allowed'] != $urlData['edit']['limit']) || ($url1 != $url2)) {
// Run the query
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_surfbar_urls` SET `url`='%s', `url_views_allowed`=%s, `url_views_max`=%s WHERE `url_id`=%s AND `status`='%s' LIMIT 1",
- array($urlData['url'], $urlData['edit']['limit'], $urlData['edit']['limit'], $urlData['id'], $urlData['url_status']), __FUNCTION__, __LINE__);
+ SQL_QUERY_ESC("UPDATE
+ `{?_MYSQL_PREFIX?}_surfbar_urls`
+SET
+ `url`='%s',
+ `url_views_allowed`=%s,
+ `url_views_max`=%s
+WHERE
+ `url_id`=%s AND
+ `status`='%s'
+LIMIT 1",
+ array(
+ $urlData['url'],
+ $urlData['edit']['limit'],
+ $urlData['edit']['limit'],
+ $urlData['id'],
+ $urlData['url_status']
+ ), __FUNCTION__, __LINE__);
// All fine
$status = true;
$templateName = 'surfbar_frameset';
// Any frame set? ;-)
- if (isGetRequestParameterSet('frame')) {
+ if (isGetRequestElementSet('frame')) {
// Use the frame as a template name part... ;-)
$templateName = sprintf("surfbar_frame_%s",
- getRequestParameter('frame')
+ getRequestElement('frame')
);
} // END - if
}
// Get total amount of URLs of given status for current user or of ACTIVE URLs by default
-function SURFBAR_GET_TOTAL_URLS ($status = 'ACTIVE', $excludeUserId = '0') {
+function SURFBAR_GET_TOTAL_URLS ($status = 'ACTIVE', $excludeUserId = NULL) {
// Determine depleted user account
$userids = SURFBAR_DETERMINE_DEPLETED_USERIDS();
// Check wether the user is allowed to book more URLs
function SURFBAR_IF_USER_BOOK_MORE_URLS ($userid = NULL) {
// Is this admin and userid is zero or does the user has some URLs left to book?
- return ((($userid == '0') && (isAdmin())) || (SURFBAR_GET_TOTAL_USER_URLS($userid, '', array('REJECTED')) < getSurfbarMaxOrder()));
+ return (((is_null($userid)) && (isAdmin())) || (SURFBAR_GET_TOTAL_USER_URLS($userid, '', array('REJECTED')) < getSurfbarMaxOrder()));
}
// Get total amount of URLs of given status for current user
function SURFBAR_GET_TOTAL_USER_URLS ($userid = NULL, $status = '', $exclude = '') {
// Is the user 0 and user is logged in?
- if (($userid == '0') && (isMember())) {
+ if ((is_null($userid)) && (isMember())) {
// Then use this userid
$userid = getMemberId();
- } elseif ($userid == '0') {
+ } elseif (is_null($userid)) {
// Error!
return (getSurfbarMaxOrder() + 1);
}
}
// Hash it with md5() and salt it with the random string
- $hashedCode = generateHash(md5($urlId . getEncryptSeperator() . getMemberId()), SURFBAR_GET_SALT());
+ $hashedCode = generateHash(md5($urlId . getEncryptSeparator() . getMemberId()), SURFBAR_GET_SALT());
// Finally encrypt it PGP-like and return it
$valHashedCode = encodeHashForCookie($hashedCode);
} // END - if
/* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid='.getMemberId().',reward='.SURFBAR_GET_REWARD());
- // Init referal system here
- initReferalSystem();
+ // Init referral system here
+ initReferralSystem();
// Book it to the user and ignore return status
- addPointsThroughReferalSystem(sprintf("surfbar:%s", getSurfbarPaymentModel()), getMemberId(), SURFBAR_GET_REWARD());
+ addPointsThroughReferralSystem(sprintf("surfbar:%s", getSurfbarPaymentModel()), getMemberId(), SURFBAR_GET_REWARD());
/* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid='.SURFBAR_GET_USERID().',costs='.SURFBAR_GET_COSTS() . ' - EXIT!');
}
// Do we have a limit?
if ($allowed > 0) {
// Then count views_max down!
- $add .= ', `url_views_max`=`url_views_max`-1';
+ $add .= ',`url_views_max`=`url_views_max`-1';
} // END - if
// Update URL stats
// 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') {
+function SURFBAR_DETERMINE_NEXT_ID ($urlId = NULL) {
/* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ' - ENTERED!');
// Default is no id and no random number
$nextId = '0';
$randNum = '0';
// Is the id set?
- if ($urlId == '0') {
+ if (is_null($urlId)) {
// Get array with lock ids
$USE = SURFBAR_GET_LOCK_IDS();