本文整理汇总了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);
}
示例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&cat=%d&id=%d&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;
}
示例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;
}
示例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);
}
示例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;
}