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


PHP PMF_Link::getSEOItemTitle方法代码示例

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


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

示例1: showAllRecords

 /**
  * This function returns all not expired records from one category
  *
  * @param integer $categoryId Category ID
  * @param string  $orderby    Order by
  * @param string  $sortby     Sorty by
  *
  * @return string
  */
 public function showAllRecords($categoryId, $orderby = 'id', $sortby = 'ASC')
 {
     global $sids;
     $numPerPage = $this->_config->get('records.numberOfRecordsPerPage');
     $page = PMF_Filter::filterInput(INPUT_GET, 'seite', FILTER_VALIDATE_INT, 1);
     $output = '';
     $title = '';
     if ($orderby == 'visits') {
         $currentTable = 'fv';
     } else {
         $currentTable = 'fd';
     }
     // If random FAQs are activated, we don't need an order
     if (true === $this->_config->get('records.randomSort')) {
         $order = '';
     } else {
         $order = sprintf("ORDER BY fd.sticky DESC, %s.%s %s", $currentTable, $this->_config->getDb()->escape($orderby), $this->_config->getDb()->escape($sortby));
     }
     $now = date('YmdHis');
     $query = sprintf("\n            SELECT\n                fd.id AS id,\n                fd.lang AS lang,\n                fd.sticky AS sticky,\n                fd.thema AS thema,\n                fcr.category_id AS category_id,\n                fv.visits AS visits\n            FROM\n                %sfaqdata AS fd\n            LEFT JOIN\n                %sfaqcategoryrelations AS fcr\n            ON\n                fd.id = fcr.record_id\n            AND\n                fd.lang = fcr.record_lang\n            LEFT JOIN\n                %sfaqvisits AS fv\n            ON\n                fd.id = fv.id\n            AND\n                fv.lang = fd.lang\n            LEFT JOIN\n                %sfaqdata_group AS fdg\n            ON\n                fd.id = fdg.record_id\n            LEFT JOIN\n                %sfaqdata_user AS fdu\n            ON\n                fd.id = fdu.record_id\n            WHERE\n                fd.date_start <= '%s'\n            AND\n                fd.date_end   >= '%s'\n            AND\n                fd.active = 'yes'\n            AND\n                fcr.category_id = %d\n            AND\n                fd.lang = '%s'\n            %s\n            %s", PMF_Db::getTablePrefix(), PMF_Db::getTablePrefix(), PMF_Db::getTablePrefix(), PMF_Db::getTablePrefix(), PMF_Db::getTablePrefix(), $now, $now, $categoryId, $this->_config->getLanguage()->getLanguage(), $this->queryPermission($this->groupSupport), $order);
     $result = $this->_config->getDb()->query($query);
     $num = $this->_config->getDb()->numRows($result);
     $pages = (int) ceil($num / $numPerPage);
     if ($page == 1) {
         $first = 0;
     } else {
         $first = $page * $numPerPage - $numPerPage;
     }
     if ($num > 0) {
         if ($pages > 1) {
             $output .= sprintf('<p><strong>%s %s %s</strong></p>', $this->pmf_lang['msgPage'] . $page, $this->pmf_lang['msgVoteFrom'], $pages . $this->pmf_lang['msgPages']);
         }
         $output .= '<ul class="phpmyfaq_ul">';
         $counter = 0;
         $displayedCounter = 0;
         $renderedItems = array();
         while (($row = $this->_config->getDb()->fetchObject($result)) && $displayedCounter < $numPerPage) {
             $counter++;
             if ($counter <= $first) {
                 continue;
             }
             $displayedCounter++;
             if (empty($row->visits)) {
                 $visits = 0;
             } else {
                 $visits = $row->visits;
             }
             $title = $row->thema;
             $url = sprintf('%s?%saction=artikel&amp;cat=%d&amp;id=%d&amp;artlang=%s', PMF_Link::getSystemRelativeUri(), $sids, $row->category_id, $row->id, $row->lang);
             $oLink = new PMF_Link($url, $this->_config);
             $oLink->itemTitle = $oLink->text = $oLink->tooltip = $title;
             // If random FAQs are activated, we don't need sticky FAQs
             if (true === $this->_config->get('records.randomSort')) {
                 $row->sticky = 0;
             }
             $renderedItems[$row->id] = sprintf('<li%s>%s<span id="viewsPerRecord"><br /><small>(%s)</small></span></li>', $row->sticky == 1 ? ' class="sticky-faqs"' : '', $oLink->toHtmlAnchor(), $this->plr->GetMsg('plmsgViews', $visits));
         }
         // If random FAQs are activated, shuffle the FAQs :-)
         if (true === $this->_config->get('records.randomSort')) {
             shuffle($renderedItems);
         }
         $output .= implode("\n", $renderedItems);
         $output .= '</ul><span class="totalFaqRecords hide">' . $num . '</span>';
     } else {
         return false;
     }
     if ($pages > 1) {
         // Set rewrite URL, if needed
         if ($this->_config->get('main.enableRewriteRules')) {
             $link = new PMF_Link(PMF_Link::getSystemRelativeUri('index.php'), $this->_config);
             $useRewrite = true;
             $rewriteUrl = sprintf("%scategory/%d/%%d/%s.html", PMF_Link::getSystemRelativeUri('index.php'), $categoryId, $link->getSEOItemTitle($title));
         } else {
             $useRewrite = false;
             $rewriteUrl = '';
         }
         $baseUrl = sprintf("%s?%saction=show&amp;cat=%d&amp;seite=%d", PMF_Link::getSystemRelativeUri(), empty($sids) ? '' : $sids, $categoryId, $page);
         $options = array('baseUrl' => $baseUrl, 'total' => $num, 'perPage' => $this->_config->get('records.numberOfRecordsPerPage'), 'useRewrite' => $useRewrite, 'rewriteUrl' => $rewriteUrl, 'pageParamName' => 'seite');
         $pagination = new PMF_Pagination($this->_config, $options);
         $output .= $pagination->render();
     }
     return $output;
 }
开发者ID:kapljr,项目名称:Jay-Kaplan-Farmingdale-BCS-Projects,代码行数:92,代码来源:Faq.php


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