return $return;
}
-// "Getter" for an array of data from all Forced-PopUps except user's
+// "Getter" for an array of data from all forced-popups except user's own
function getForcedPopupDataByEarningArray ($content) {
- die('content=<pre>' . print_r($content, true) . '</pre>' . debug_get_printable_backtrace());
+ die(__FUNCTION__.':content=<pre>' . print_r($content, TRUE) . '</pre>' . debug_get_printable_backtrace());
// Finally return the content
return $content;
}
// Generator (somewhat getter) for forced-ads type options
-function generateForcedAdsTypeOptions ($type = NULL) {
+function generateForcedAdsTypeOptions ($type = NULL) {
// Is this cached?
if (!isset($GLOBALS[__FUNCTION__][$type])) {
// Generate output and cache it
}
// Generator (somewhat getter) for forcec-costs visibility options
-function generateForcedCostsVisibilityOptions ($visibility = NULL) {
+function generateForcedCostsVisibilityOptions ($visibility = NULL) {
// Is this cached?
if (!isset($GLOBALS[__FUNCTION__][$visibility])) {
// Generate output and cache it
// Do some sanity checks
if (!isAdmin()) {
// Not allowed to call
- return false;
+ return FALSE;
} elseif (countPostSelection('forced_campaign_id') == 0) {
// No selections made
- return false;
+ return FALSE;
}
// Get an array from all pending campaigns
$forcedCampaigns = getArrayFromForcedCampaignsByArray(array_keys(postRequestElement('forced_campaign_id')), 'PENDING');
// By default all worked (at this point)
- $activated = true;
+ $activated = TRUE;
// Run through all entries
foreach ($forcedCampaigns as $campaignId => $campaignData) {
// Change the status of this campaign
if (!changeForcedCampaignStatus($campaignId, 'PENDING', 'ACTIVE', $campaignData)) {
// One didn't work, but continue with others
- $activated = false;
+ $activated = FALSE;
} // END - if
} // END - foreach
$newStatus = strtolower($newStatus);
// Prepare array
- $filterData = array(
+ $filterData = array(
'campaign_id' => $campaignId,
'prev_status' => $prevStatus,
'new_status' => $newStatus,
// ---------- Comment out for debugging/developing member actions! ---------
if (SQL_AFFECTEDROWS() != 1) {
// No, something went wrong
- return false;
+ return FALSE;
} // END - if
// ---------- Comment out for debugging/developing member actions! ---------
// All done!
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'campaignId=' . $campaignId . ',prevStatus=' . $prevStatus . ',newStatus=' . $newStatus . ' - EXIT!');
- return true;
+ return TRUE;
}
// Notify admin(s) with a selected message and content
// Notify the user about the performed action
function doForcedNotifyMember ($messageType, $content) {
// Skip notification if userid is NULL
- if (is_null($content['forced_campaign_userid'])) {
+ if (!isValidId($content['forced_campaign_userid'])) {
// NULL is silently ignored
- return true;
+ return TRUE;
} // END - if
// Prepare template name
// ----------------------------------------------------------------------------
// Template helper function to create selection box for all forced-ad types
-function doTemplateForcedAdTypeSelectionBox ($templateName, $clear = false, $default = NULL) {
+function doTemplateForcedAdTypeSelectionBox ($templateName, $clear = FALSE, $default = NULL) {
// Add all types through the filter
$forcedAdTypes = runFilterChain('add_forced_ads_types', array());
}
// Template helper function to create selection box for costs visibility
-function doTemplateForcedCostsVisiblitySelectionBox ($templateName, $clear = false, $default = NULL) {
+function doTemplateForcedCostsVisiblitySelectionBox ($templateName, $clear = FALSE, $default = NULL) {
// Init array
$costsVisibility = array(
0 => array('visibility' => 'ALL'),
$forcedAds = getArrayFromForcedAdsByType();
// Handle it over to generateSelectionBoxFromArray()
- $content = generateSelectionBoxFromArray($forcedAds, 'forced_ads_id', 'forced_ads_id', '', '', '', $default, 'forced_ads_type');
+ $content = generateSelectionBoxFromArray($forcedAds, 'forced_ads_id', 'forced_ads_id', '', '', '', $default, 'forced_ads_type', FALSE, TRUE);
// Return prepared content
return $content;
$forcedCosts = getArrayFromForcedCostsByVisibility();
// Handle it over to generateSelectionBoxFromArray()
- $content = generateSelectionBoxFromArray($forcedCosts, 'forced_costs_id', 'forced_costs_id', '', '', '', $default, '', true);
+ $content = generateSelectionBoxFromArray($forcedCosts, 'forced_costs_id', 'forced_costs_id', '', '', '', $default, '', TRUE, 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;
function addXmlSpecialAdminAddDoForcedAds () {
// So set it all here
$GLOBALS['__COLUMN_INDEX']['doXmlCallbackFunction'] = 'column';
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_values'] = array();
$GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_index'] = 'column';
}
function addXmlSpecialAdminAddDoForcedCosts () {
// So set it all here
$GLOBALS['__COLUMN_INDEX']['doXmlCallbackFunction'] = 'column';
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_values'] = array();
$GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_index'] = 'column';
}