当前位置: 首页>>代码示例>>PHP>>正文


PHP Social::social_post_featured_ad方法代码示例

本文整理汇总了PHP中Social::social_post_featured_ad方法的典型用法代码示例。如果您正苦于以下问题:PHP Social::social_post_featured_ad方法的具体用法?PHP Social::social_post_featured_ad怎么用?PHP Social::social_post_featured_ad使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Social的用法示例。


在下文中一共展示了Social::social_post_featured_ad方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: confirm_payment

 /**
  * confirm payment for order
  *
  * @param string    $id_order [unique indentifier of order]
  * @param string    $txn_id id of the transaction depending on provider
  */
 public function confirm_payment($paymethod = 'paypal', $txn_id = NULL)
 {
     // update orders
     if ($this->loaded()) {
         $this->status = self::STATUS_PAID;
         $this->pay_date = Date::unix2mysql();
         $this->paymethod = $paymethod;
         $this->txn_id = $txn_id;
         try {
             $this->save();
         } catch (Exception $e) {
             throw HTTP_Exception::factory(500, $e->getMessage());
         }
         //if saved delete coupon from session and -- number of coupons.
         Model_Coupon::sale($this->coupon);
         //for membership plans
         if ($this->id_product >= 100) {
             Model_Subscription::new_order($this);
             $replace_email = array('[AD.TITLE]' => $this->description, '[URL.AD]' => Route::url('pricing'), '[ORDER.ID]' => $this->id_order, '[PRODUCT.ID]' => $this->id_product, '[VAT.COUNTRY]' => (isset($this->VAT) and $this->VAT > 0) ? $this->VAT_country : '', '[VAT.NUMBER]' => (isset($this->VAT) and $this->VAT > 0) ? $this->VAT_number : '', '[VAT.PERCENTAGE]' => (isset($this->VAT) and $this->VAT > 0) ? $this->VAT : '');
         } else {
             $ad = $this->ad;
             //depending on the product different actions
             switch ($this->id_product) {
                 case Model_Order::PRODUCT_AD_SELL:
                     $ad->sale($this);
                     break;
                 case Model_Order::PRODUCT_TO_TOP:
                     $ad->to_top();
                     break;
                 case Model_Order::PRODUCT_TO_FEATURED:
                     $ad->to_feature($this->featured_days);
                     Social::social_post_featured_ad($ad);
                     break;
                 case Model_Order::PRODUCT_CATEGORY:
                     $ad->paid_category();
                     break;
             }
             $url_ad = Route::url('ad', array('category' => $ad->category->seoname, 'seotitle' => $ad->seotitle));
             $replace_email = array('[AD.TITLE]' => $ad->title, '[URL.AD]' => $url_ad, '[ORDER.ID]' => $this->id_order, '[PRODUCT.ID]' => $this->id_product, '[VAT.COUNTRY]' => (isset($this->VAT) and $this->VAT > 0) ? $this->VAT_country : '', '[VAT.NUMBER]' => (isset($this->VAT) and $this->VAT > 0) ? $this->VAT_number : '', '[VAT.PERCENTAGE]' => (isset($this->VAT) and $this->VAT > 0) ? $this->VAT : '');
         }
         //send email to site owner! new sale!!
         if (core::config('email.new_ad_notify') == TRUE) {
             Email::content(core::config('email.notify_email'), core::config('general.site_name'), core::config('email.notify_email'), core::config('general.site_name'), 'ads-sold', $replace_email);
         }
     }
 }
开发者ID:kotsios5,项目名称:openclassifieds2,代码行数:52,代码来源:order.php


注:本文中的Social::social_post_featured_ad方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。