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


PHP PMF_Language::getLanguage方法代码示例

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


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

示例1: getAllRelatedById

 /**
  * Returns all relevant articles for a FAQ record with the same language
  *
  * @param integer $recordId FAQ ID
  * @param string  $question FAQ title
  * @param string  $keywords FAQ keywords
  * 
  * @return array
  */
 public function getAllRelatedById($recordId, $question, $keywords)
 {
     $terms = str_replace('-', ' ', $question) . $keywords;
     $search = PMF_Search_Factory::create($this->language, array('database' => PMF_Db::getType()));
     $search->setDatabaseHandle($this->db)->setTable(SQLPREFIX . 'faqdata AS fd')->setResultColumns(array('fd.id AS id', 'fd.lang AS lang', 'fcr.category_id AS category_id', 'fd.thema AS question', 'fd.content AS answer'))->setJoinedTable(SQLPREFIX . 'faqcategoryrelations AS fcr')->setJoinedColumns(array('fd.id = fcr.record_id', 'fd.lang = fcr.record_lang'))->setConditions(array('fd.active' => "'yes'", 'fd.lang' => "'" . $this->language->getLanguage() . "'"))->setMatchingColumns(array('fd.thema', 'fd.content', 'fd.keywords'));
     $result = $search->search($terms);
     return $this->db->fetchAll($result);
 }
开发者ID:atlcurling,项目名称:tkt,代码行数:17,代码来源:Relation.php

示例2: getAllRelatedById

 /**
  * Returns all relevant articles for a FAQ record with the same language
  *
  * @param integer $record_id FAQ ID
  * @param string  $thema     FAQ title
  * 
  * @return string
  */
 public function getAllRelatedById($record_id, $article_name, $keywords)
 {
     global $sids;
     $relevantslisting = '';
     $begriffe = str_replace('-', ' ', $article_name) . $keywords;
     $search = PMF_Search_Factory::create($this->language, array('database' => PMF_Db::getType()));
     $i = $last_id = 0;
     $search->setDatabaseHandle($this->db)->setTable(SQLPREFIX . 'faqdata AS fd')->setResultColumns(array('fd.id AS id', 'fd.lang AS lang', 'fcr.category_id AS category_id', 'fd.thema AS thema', 'fd.content AS content'))->setJoinedTable(SQLPREFIX . 'faqcategoryrelations AS fcr')->setJoinedColumns(array('fd.id = fcr.record_id', 'fd.lang = fcr.record_lang'))->setConditions(array('fd.active' => "'yes'", 'fd.lang' => "'" . $this->language->getLanguage() . "'"))->setMatchingColumns(array('fd.thema', 'fd.content', 'fd.keywords'));
     $result = $search->search($begriffe);
     while (($row = $this->db->fetchObject($result)) && $i < PMF_Configuration::getInstance()->get('records.numberOfRelatedArticles')) {
         if ($row->id == $record_id || $row->id == $last_id) {
             continue;
         }
         $relevantslisting .= '' == $relevantslisting ? '<ul>' : '';
         $relevantslisting .= '<li>';
         $url = sprintf('%saction=artikel&amp;cat=%d&amp;id=%d&amp;artlang=%s', $sids, $row->category_id, $row->id, $row->lang);
         $oLink = new PMF_Link(PMF_Link::getSystemRelativeUri() . '?' . $url);
         $oLink->itemTitle = $row->thema;
         $oLink->text = $row->thema;
         $oLink->tooltip = $row->thema;
         $relevantslisting .= $oLink->toHtmlAnchor() . '</li>';
         $i++;
         $last_id = $row->id;
     }
     $relevantslisting .= $i > 0 ? '</ul>' : '';
     return '' == $relevantslisting ? '-' : $relevantslisting;
 }
开发者ID:jr-ewing,项目名称:phpMyFAQ,代码行数:35,代码来源:Relation.php

示例3: deleteNews

 /**
  * Deletes a news entry identified by its ID
  *
  * @param integer $id News ID
  * 
  * @return boolean
  */
 function deleteNews($id)
 {
     $query = sprintf("\n            DELETE FROM\n                %sfaqnews\n            WHERE\n                id = %d\n            AND\n                lang = '%s'", SQLPREFIX, $id, $this->language->getLanguage());
     if (!$this->db->query($query)) {
         return false;
     }
     return true;
 }
开发者ID:atlcurling,项目名称:tkt,代码行数:15,代码来源:News.php

示例4: logSearchTerm

 /**
  * Logging of search terms for improvements
  *
  * @param  string $searchterm Search term
  * @return void
  */
 public function logSearchTerm($searchterm)
 {
     if (PMF_String::strlen($searchterm) == 0) {
         return;
     }
     $date = new DateTime();
     $query = sprintf("\n            INSERT INTO\n                %s\n            (id, lang, searchterm, searchdate)\n                VALUES\n            (%d, '%s', '%s', '%s')", $this->_table, $this->db->nextID($this->_table, 'id'), $this->language->getLanguage(), $this->db->escape_string($searchterm), $date->format('Y-m-d H:i:s'));
     $this->db->query($query);
 }
开发者ID:atlcurling,项目名称:tkt,代码行数:15,代码来源:Search.php

示例5: saveCaptcha

 /**
  * Save the Captcha
  *
  * @return   boolean
  */
 private function saveCaptcha()
 {
     $select = sprintf("\n           SELECT \n               id \n           FROM \n               %sfaqcaptcha \n           WHERE \n               id = '%s'", SQLPREFIX, $this->code);
     $result = $this->db->query($select);
     if ($result) {
         $num = $this->db->numRows($result);
         if ($num > 0) {
             return false;
         } else {
             $insert = sprintf("\n                    INSERT INTO \n                        %sfaqcaptcha \n                    (id, useragent, language, ip, captcha_time) \n                        VALUES \n                    ('%s', '%s', '%s', '%s', %d)", SQLPREFIX, $this->code, $this->userAgent, $this->language->getLanguage(), $this->ip, $this->timestamp);
             $this->db->query($insert);
             return true;
         }
     }
     return false;
 }
开发者ID:jr-ewing,项目名称:phpMyFAQ,代码行数:21,代码来源:Captcha.php


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