Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as PHP by asdasdasdas ( 12 years ago )
public static function getPostPrices($cityId = 0, $categoryId = 0, $doReturnEmpty = false) {

        $postType = post::getPostTypeByKeyword($cityId);

        if ($postType == post::TYPE_NATIONAL || $postType == post::TYPE_NATIONAL_SPONSORED) {
            return post::getNationalPostPrices($categoryId);
        }

        dbo::includeDBO("postPrice");
        dbo::includeDBO("postCategory");
        dbo::includeDBO("city");
        $postPrices = array();
        $postPrices["hasPromo"] = false;
        $postPrices["promoId"] = 0;
        $postPrices["promoStr"] = "";
        if (!$doReturnEmpty) {

            $city = new city();
            if (!empty($cityId) && is_numeric($cityId)) {
                $city->initById($cityId);
                $parentCityId = $city->getParentCityId();
                if (!empty($parentCityId)) {
                    $cityId = $parentCityId;
                }
            }


            $postPrice = new postPrice();
            $postPrice->initByCity($cityId, $categoryId);
            $postCategory = new postCategory();
             $postSecti postSection();
            if (!empty($categoryId)) {
                $postCategory->initById($categoryId);
                 $postSecti>getPostSection();
            }

            // if the city has less than 10, it is free
//   $totalPosts = 0;
//   if(! empty($cityId) && is_numeric($cityId)){
//    $totalPosts = city::getPostCountByCity($cityId);
//   }
//   if($totalPosts < 10){
//    $postPrices["hasPromo"] = true;
//    $postPrices["promoId"] = 141;
//    $postPrices["promoStr"] = "Posting in this city is free for a limited time.";
//    $postPrices["post"] = 0.00;
//   }
//   else if(! $postSection->isNew() && ! $postSection->isAdult()){
//    $postPrices["hasPromo"] = true;
//    $postPrices["promoId"] = "";
//    $postPrices["promoStr"] = "Posting in this category is free.";
//    $postPrices["post"] = 0.00;
//    
//   }
//   else $postPrices["post"] = (double)$postPrice->getPrice();

            $postPrices["featuredMonth"] = (double) $postPrice->getPriceFeaturedMonth();
            $postPrices["repostMonth"] = (double) $postPrice->getPriceRepostMonth();

            $postPrices["post"] = (double) $postPrice->getPrice();
            $postPrices["featured"] = (double) $postPrice->getPriceFeatured();

            $postPrices["repost"] = (double) $postPrice->getPriceRepost();
            $postPrices["length"] = (double) $postPrice->getLength();
            $postPrices["afPromoMinReviews"] = (int) $postPrice->getAfPromoMinReviews();
            $postPrices["domain"] = 15;
            $postPrices["mobile"] = 3.00;
            $postPrices["id"] = $postPrice->getId();

            $postPrices["announcement"] = $postPrice->getAnnouncement();
            $postPrices["announcementTitle"] = $postPrice->getAnnouncementTitle();

            $postPrices["hasAnnouncement"] = (!empty($postPrices["announcement"]));

            $postPrices["PricePremiumWeek"] = $postPrice->getPricePremiumWeek();
            $postPrices["PricePremiumMonth"] = $postPrice->getPricePremiumMonth();
            $postPrices["PricePremiumSponsoredMonth"] = $postPrice->getPricePremiumSponsoredMonth();
            $postPrices["PricePremiumSponsoredWeek"] = $postPrice->getPricePremiumSponsoredWeek();
            $postPrices["PricePremiumSponsoredDay"] = $postPrice->getPricePremiumSponsoredDay();
            

        } else {
            $postPrices["post"] = 0.00;
            $postPrices["featured"] = 0.00;
            $postPrices["repost"] = 0.00;
            $postPrices["featured-month"] = 0.00;
            $postPrices["repost-month"] = 0.00;
            $postPrices["length"] = 0.00;
            $postPrices["domain"] = 0.00;
            $postPrices["mobile"] = 3.00;
            $postPrices["id"] = false;
            $postPrices["hasAnnouncement"] = false;
            $postPrices["announcement"] = "";
            $postPrices["announcementTitle"] = "";
        }

        return $postPrices;
    }

 

Revise this Paste

Children: 72822
Your Name: Code Language: