// Is forced type not NULL?
if (!is_null($forcedType)) {
// Then set proper WHERE
- $where = sprintf("WHERE `forced_ads_type`='%s'", SQL_ESCAPE($forcedType));
+ $where = sprintf("WHERE `forced_ads_type`='%s'", sqlEscapeString($forcedType));
} // END - if
// Search all given types
- $result = SQL_QUERY('SELECT
+ $result = sqlQuery('SELECT
`forced_ads_id`,
`forced_ads_ad_url`,
`forced_ads_click_url`,
`forced_ads_id` ASC', __FUNCTION__, __LINE__);
// Is there at least one entry?
- if (!SQL_HASZERONUMS($result)) {
+ if (!ifSqlHasZeroNums($result)) {
// Get all elements
- while ($content = SQL_FETCHARRAY($result)) {
+ while ($content = sqlFetchArray($result)) {
// Add it
$forcedAds[$content['forced_ads_id']] = $content;
} // END - while
} // END - if
// Free result
- SQL_FREERESULT($result);
+ sqlFreeResult($result);
// Return it
return $forcedAds;
// Is visibility not NULL?
if (!is_null($visibility)) {
// Then add WHERE statement
- $where = sprintf(" WHERE `forced_costs_visibility`='%s'", SQL_ESCAPE($visibility));
+ $where = sprintf(" WHERE `forced_costs_visibility`='%s'", sqlEscapeString($visibility));
} // END - if
// Search all given types
- $result = SQL_QUERY("SELECT
+ $result = sqlQuery("SELECT
`forced_costs_id`,
`forced_costs_price_click`,
`forced_costs_payment_click`,
`forced_costs_id` ASC", __FUNCTION__, __LINE__);
// Is there at least one entry?
- if (!SQL_HASZERONUMS($result)) {
+ if (!ifSqlHasZeroNums($result)) {
// Get all elements
- while ($content = SQL_FETCHARRAY($result)) {
+ while ($content = sqlFetchArray($result)) {
// Add it
$forcedCosts[$content['forced_costs_id']] = $content;
} // END - while
} // END - if
// Free result
- SQL_FREERESULT($result);
+ sqlFreeResult($result);
// Return it
return $forcedCosts;
$forcedCampaigns = array();
// Search all given types
- $result = SQL_QUERY_ESC("SELECT
+ $result = sqlQueryEscaped("SELECT
`forced_campaign_id`,
UNIX_TIMESTAMP(`forced_campaign_created`) AS `forced_campaign_created`,
`forced_campaign_status`,
), __FUNCTION__, __LINE__);
// Is there at least one entry?
- if (!SQL_HASZERONUMS($result)) {
+ if (!ifSqlHasZeroNums($result)) {
// Get all elements
- while ($content = SQL_FETCHARRAY($result)) {
+ while ($content = sqlFetchArray($result)) {
// Add it
$forcedCampaigns[$content['forced_campaign_id']] = $content;
} // END - while
} // END - if
// Free result
- SQL_FREERESULT($result);
+ sqlFreeResult($result);
// Return it
return $forcedCampaigns;
'prev_status' => $prevStatus,
'new_status' => $newStatus,
'data' => $data,
- 'abort' => NULL
+ 'abort' => NULL,
);
// Run pre filter chain
// Update the status now
// ---------- Comment out for debugging/developing member actions! ---------
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_forced_campaigns` SET `forced_campaign_status`='%s' WHERE `forced_campaign_id`=%s LIMIT 1",
+ sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_forced_campaigns` SET `forced_campaign_status`='%s' WHERE `forced_campaign_id`=%s LIMIT 1",
array(
$newStatus,
bigintval($campaignId)
// Was that fine?
// ---------- Comment out for debugging/developing member actions! ---------
- if (SQL_AFFECTEDROWS() != 1) {
+ if (sqlAffectedRows() != 1) {
// No, something went wrong
return FALSE;
} // END - if
// Notify admin(s) with a selected message and content
function doForcedNotifyAdmin ($messageType, $content) {
// Prepare template name
- $templateName = sprintf("admin_forced_%s", $messageType);
+ $templateName = sprintf('admin_forced_%s', $messageType);
+
+ // Is the user id valid?
+ if (!isValidId($content['forced_campaign_userid'])) {
+ // No, then use admin-only template
+ $templateName = sprintf('admin_only_forced_%s', $messageType);
+ } // END - if
// Prepare subject
- $subject = sprintf("{--ADMIN_FORCED_NOTIFY_%s_SUBJECT--}",
- strtoupper($messageType)
- );
+ $subject = sprintf('{--ADMIN_FORCED_NOTIFY_%s_SUBJECT--}', strtoupper($messageType));
// Is the subject line there?
if ((substr($subject, 0, 1) == '!') && (substr($subject, -1, 1) == '!')) {
} // END - if
// Prepare template name
- $templateName = sprintf("member_forced_%s", $messageType);
+ $templateName = sprintf('member_forced_%s', $messageType);
// Prepare subject
- $subject = sprintf("{--MEMBER_FORCED_NOTIFY_%s_SUBJECT--}",
- strtoupper($messageType)
- );
+ $subject = sprintf('{--MEMBER_FORCED_NOTIFY_%s_SUBJECT--}', strtoupper($messageType));
// Is the subject line there?
if ((substr($subject, 0, 1) == '!') && (substr($subject, -1, 1) == '!')) {
$forcedAds = getArrayFromForcedAdsByType();
// Handle it over to generateSelectionBoxFromArray()
- $content = generateSelectionBoxFromArray($forcedAds, 'forced_ads_id', 'forced_ads_id', '', '', '', $default, 'forced_ads_type', FALSE, TRUE);
+ $content = generateSelectionBoxFromArray($forcedAds, 'forced_ads_id', 'forced_ads_id', '', '', '', $default, 'forced_ads_type');
// Return prepared content
return $content;
$forcedCosts = getArrayFromForcedCostsByVisibility();
// Handle it over to generateSelectionBoxFromArray()
- $content = generateSelectionBoxFromArray($forcedCosts, 'forced_costs_id', 'forced_costs_id', '', '', '', $default, '', TRUE, TRUE);
+ $content = generateSelectionBoxFromArray($forcedCosts, 'forced_costs_id', 'forced_costs_id', '', '', '', $default, '', TRUE);
// Return prepared content
return $content;
// Template helper function to create selection box for foreced campaign userid
function doTemplateForcedCampaignUseridSelectionBox ($templateName, $clear, $default = NULL) {
// Generate the selection box without all
- $content = addMemberSelectionBox($default, FALSE, TRUE, TRUE, 'forced_campaign_userid[]');
+ $content = addMemberSelectionBox($default, FALSE, TRUE, TRUE, 'forced_campaign_userid');
// Return prepared content
return $content;