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


PHP Products::getAllHighlighted方法代码示例

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


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

示例1: indexAction

 /**
  * Create a RSS file with the CMS pages and Products
  */
 public function indexAction()
 {
     $out = "";
     try {
         $ISP = Shineisp_Registry::get('ISP');
         $ns = new Zend_Session_Namespace();
         $localeID = $ns->idlang;
         $locale = $ns->lang;
         $feed = new Zend_Feed_Writer_Feed();
         $feed->setTitle($ISP->company);
         $feed->setLink($ISP->website);
         $feed->setFeedLink('http://' . $_SERVER['HTTP_HOST'] . '/rss', 'atom');
         $feed->addAuthor(array('name' => $ISP->company, 'email' => $ISP->email, 'uri' => $ISP->website));
         $feed->setEncoding('UTF8');
         $feed->setDateModified(time());
         $feed->addHub($ISP->website);
         // Get all the cms pages
         $records = CmsPages::getRssPages($locale);
         foreach ($records as $record) {
             $link = 'http://' . $_SERVER['HTTP_HOST'] . '/cms/' . $record['var'] . '.html';
             self::createEntry($feed, $record['title'], $record['body'], $link);
         }
         // Get all the products
         $records = Products::getAllHighlighted($localeID);
         foreach ($records as $record) {
             $title = $record['ProductsData'][0]['name'];
             $descritption = strip_tags($record['ProductsData'][0]['shortdescription']);
             $inserted_at = !empty($record['inserted_at']) ? strtotime($record['inserted_at']) : null;
             $updated_at = !empty($record['updated_at']) ? strtotime($record['updated_at']) : null;
             $link = 'http://' . $_SERVER['HTTP_HOST'] . '/' . $record['uri'] . '.html';
             self::createEntry($feed, $title, $descritption, $link, $inserted_at, $updated_at);
         }
         /**
          * Render the resulting feed to Atom 1.0 and assign to $out.
          * You can substitute "atom" with "rss" to generate an RSS 2.0 feed.
          */
         $out = $feed->export('atom');
     } catch (Zend_Feed_Exception $e) {
         die($e->getMessage());
     }
     die($out);
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:45,代码来源:RssController.php

示例2: fill_content

 /**
  * Prepare the newsletter content
  */
 private static function fill_content()
 {
     $ns = new Zend_Session_Namespace();
     $contents = array();
     // Get all the products
     $contents['products'] = "<ul>";
     $records = Products::getAllHighlighted($ns->idlang);
     foreach ($records as $record) {
         $contents['products'] .= "<b><a href='http://" . $_SERVER['HTTP_HOST'] . "/" . $record['uri'] . ".html'>" . $record['ProductsData'][0]['name'] . "</a></b><p>" . $record['ProductsData'][0]['shortdescription'] . "</p>";
     }
     $contents['products'] .= "</ul>";
     // Get all the cms pages
     $contents['pages'] = "";
     $records = CmsPages::getRssPages($ns->lang);
     foreach ($records as $record) {
         $link = 'http://' . $_SERVER['HTTP_HOST'] . '/cms/' . $record['var'] . '.html';
         $contents['pages'] .= "<p><b><a href='" . $link . "'>" . $record['title'] . "</a></b></p>";
         $contents['pages'] .= Shineisp_Commons_Utilities::truncate($record['body'], 200, "...", false, true);
     }
     $contents['pages'] = str_replace("src=\"/", "src=\"http://" . $_SERVER['HTTP_HOST'] . "/", $contents['pages']);
     return $contents;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:25,代码来源:Newsletters.php


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