X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Fforced_functions.php;h=8309fc0002adbe9fb3c4f073723e9037e34d2ced;hb=04040e55c05a59a028101ee3afb04721d08cfc0f;hp=6d22963d26cfc1dd248df999d45dd7eb4177796f;hpb=63f159414369b5ea19a8ca75d8cd8033c45d8341;p=mailer.git diff --git a/inc/libs/forced_functions.php b/inc/libs/forced_functions.php index 6d22963d26..8309fc0002 100644 --- a/inc/libs/forced_functions.php +++ b/inc/libs/forced_functions.php @@ -121,16 +121,16 @@ function translateForcedCostsVisibility ($visibility) { 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=
' . print_r($content, true) . '
' . debug_get_printable_backtrace()); + die(__FUNCTION__.':content=
' . print_r($content, TRUE) . '
' . 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 @@ -154,7 +154,7 @@ function generateForcedAdsTypeOptions ($type = NULL) { } // 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 @@ -212,7 +212,7 @@ FROM ORDER BY `forced_ads_id` ASC', __FUNCTION__, __LINE__); - // Do we have at least one entry? + // Is there at least one entry? if (!SQL_HASZERONUMS($result)) { // Get all elements while ($content = SQL_FETCHARRAY($result)) { @@ -252,7 +252,7 @@ FROM ORDER BY `forced_costs_id` ASC", __FUNCTION__, __LINE__); - // Do we have at least one entry? + // Is there at least one entry? if (!SQL_HASZERONUMS($result)) { // Get all elements while ($content = SQL_FETCHARRAY($result)) { @@ -300,7 +300,7 @@ ORDER BY $status ), __FUNCTION__, __LINE__); - // Do we have at least one entry? + // Is there at least one entry? if (!SQL_HASZERONUMS($result)) { // Get all elements while ($content = SQL_FETCHARRAY($result)) { @@ -321,24 +321,24 @@ function doForcedAdminActivateCampaigns () { // 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 @@ -353,7 +353,7 @@ function changeForcedCampaignStatus ($campaignId, $prevStatus, $newStatus, $data $newStatus = strtolower($newStatus); // Prepare array - $filterData = array( + $filterData = array( 'campaign_id' => $campaignId, 'prev_status' => $prevStatus, 'new_status' => $newStatus, @@ -383,7 +383,7 @@ function changeForcedCampaignStatus ($campaignId, $prevStatus, $newStatus, $data // ---------- 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! --------- @@ -395,7 +395,7 @@ function changeForcedCampaignStatus ($campaignId, $prevStatus, $newStatus, $data // 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 @@ -424,9 +424,9 @@ function doForcedNotifyAdmin ($messageType, $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 @@ -468,7 +468,7 @@ function prepareForcedContentForTemplate ($content) { // ---------------------------------------------------------------------------- // 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()); @@ -480,7 +480,7 @@ function doTemplateForcedAdTypeSelectionBox ($templateName, $clear = false, $def } // 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'), @@ -502,7 +502,7 @@ function doTemplateForcedAdSelectionBox ($templateName, $clear, $default = NULL) $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; @@ -514,7 +514,7 @@ function doTemplateForcedCostsSelectionBox ($templateName, $clear, $default = NU $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; @@ -523,7 +523,7 @@ function doTemplateForcedCostsSelectionBox ($templateName, $clear, $default = NU // 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; @@ -537,7 +537,6 @@ function doTemplateForcedCampaignUseridSelectionBox ($templateName, $clear, $def 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'; } @@ -552,7 +551,6 @@ function addXmlSpecialAdminAddDoForcedCampaigns () { 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'; }