本文整理汇总了PHP中PMF_Link类的典型用法代码示例。如果您正苦于以下问题:PHP PMF_Link类的具体用法?PHP PMF_Link怎么用?PHP PMF_Link使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PMF_Link类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: searchEngine
$record_ids = $tagging->getRecordsByTagId($inputTag);
$printResult = $faq->showAllRecordsByIds($record_ids);
}
//
// Handle the full text search stuff
//
if (!is_null($inputSearchTerm) || !is_null($search)) {
if (!is_null($inputSearchTerm)) {
$inputSearchTerm = $db->escapeString(strip_tags($inputSearchTerm));
}
if (!is_null($search)) {
$inputSearchTerm = $db->escapeString(strip_tags($search));
}
$printResult = searchEngine($inputSearchTerm, $inputCategory, $allLanguages);
$inputSearchTerm = stripslashes($inputSearchTerm);
$faqsearch->logSearchTerm($inputSearchTerm);
}
// Change a little bit the $searchCategory value;
$inputCategory = '%' == $inputCategory ? 0 : $inputCategory;
$faqsession->userTracking('fulltext_search', $inputSearchTerm);
$openSearchLink = sprintf('<a class="searchplugin" href="#" onclick="window.external.AddSearchProvider(\'%s/opensearch.php\');">%s</a>', PMF_Link::getSystemUri('/index.php'), $PMF_LANG['opensearch_plugin_install']);
$mostPopularSearches = '';
$mostPopularSearchData = $faqsearch->getMostPopularSearches($faqconfig->get('main.numberSearchTerms'));
foreach ($mostPopularSearchData as $searchItem) {
if (PMF_String::strlen($searchItem['searchterm']) > 0) {
$mostPopularSearches .= sprintf('<li><a href="?search=%s&submit=Search&action=search">%s</a> (%dx)</li>', urlencode($searchItem['searchterm']), $searchItem['searchterm'], $searchItem['number']);
}
}
$categoryLayout = new PMF_Category_Layout(new PMF_Category_Tree_Helper(new PMF_Category_Tree($categoryData)));
$tpl->processTemplate('writeContent', array('msgSearch' => $tagSearch ? $PMF_LANG['msgTagSearch'] : $PMF_LANG['msgSearch'], 'searchString' => PMF_String::htmlspecialchars($inputSearchTerm, ENT_QUOTES, 'utf-8'), 'searchOnAllLanguages' => $PMF_LANG['msgSearchOnAllLanguages'], 'checkedAllLanguages' => $allLanguages ? ' checked="checked"' : '', 'selectCategories' => $PMF_LANG['msgSelectCategories'], 'allCategories' => $PMF_LANG['msgAllCategories'], 'printCategoryOptions' => $categoryLayout->renderOptions(array($inputCategory)), 'writeSendAdress' => '?' . $sids . 'action=search', 'msgSearchWord' => $PMF_LANG['msgSearchWord'], 'printResult' => $printResult, 'openSearchLink' => $openSearchLink, 'msgMostPopularSearches' => $PMF_LANG['msgMostPopularSearches'], 'printMostPopularSearches' => '<ul class="phpmyfaq_ul">' . $mostPopularSearches . '</ul>'));
$tpl->includeTemplate('writeContent', 'index');
示例2: XMLWriter
$rss = new XMLWriter();
$rss->openMemory();
$rss->setIndent(true);
$rss->startDocument('1.0', 'utf-8');
$rss->startElement('rss');
$rss->writeAttribute('version', '2.0');
$rss->startElement('channel');
$rss->writeElement('title', $faqConfig->get('main.titleFAQ') . ' - ');
$rss->writeElement('description', html_entity_decode($faqConfig->get('main.metaDescription')));
$rss->writeElement('link', $faqConfig->get('main.referenceURL'));
if (is_array($records)) {
foreach ($records as $item) {
$link = str_replace($_SERVER['SCRIPT_NAME'], '/index.php', $item['record_link']);
if (PMF_RSS_USE_SEO) {
if (isset($item['record_title'])) {
$oLink = new PMF_Link($link, $faqConfig);
$oLink->itemTitle = $item['record_title'];
$link = $oLink->toString();
}
}
$rss->startElement('item');
$rss->writeElement('title', html_entity_decode($item['record_title'] . ' (' . $item['visits'] . ' ' . $PMF_LANG['msgViews'] . ')', ENT_COMPAT, 'UTF-8'));
$rss->startElement('description');
$rss->writeCdata($item['record_preview']);
$rss->endElement();
$rss->writeElement('link', $faqConfig->get('main.referenceURL') . $link);
$rss->writeElement('pubDate', PMF_Date::createRFC822Date($item['record_date'], true));
$rss->endElement();
}
}
$rss->endElement();
示例3: buildSitemapNode
// Sitemap header
$sitemap = '<?xml version="1.0" encoding="UTF-8"?>' . '<urlset xmlns="http://www.google.com/schemas/sitemap/0.84"' . ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' . ' xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84' . ' http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">';
// 1st entry: the faq server itself
$sitemap .= buildSitemapNode(PMF_Link::getSystemUri('/sitemap.google.php'), PMF_Date::createISO8601Date($_SERVER['REQUEST_TIME'], false), PMF_SITEMAP_GOOGLE_CHANGEFREQ_DAILY, PMF_SITEMAP_GOOGLE_PRIORITY_MAX);
// nth entry: each faq
foreach ($items as $item) {
$priority = PMF_SITEMAP_GOOGLE_PRIORITY_DEFAULT;
if ($visitsMax - $visitMin > 0) {
$priority = sprintf('%.1f', PMF_SITEMAP_GOOGLE_PRIORITY_DEFAULT * (1 + ($item['visits'] - $visitMin) / ($visitsMax - $visitMin)));
}
// a. We use plain PMF urls w/o any SEO schema
$link = str_replace($_SERVER['SCRIPT_NAME'], '/index.php', $item['url']);
// b. We use SEO PMF urls
if (PMF_SITEMAP_GOOGLE_USE_SEO) {
if (isset($item['thema'])) {
$oL = new PMF_Link($link);
$oL->itemTitle = $item['thema'];
$link = $oL->toString();
}
}
$sitemap .= buildSitemapNode(PMF_Link::getSystemUri('/sitemap.google.php') . $link, PMF_Date::createISO8601Date($item['date']), PMF_SITEMAP_GOOGLE_CHANGEFREQ_DAILY, $priority);
}
$sitemap .= '</urlset>';
$getgezip = PMF_Filter::filterInput(INPUT_GET, PMF_SITEMAP_GOOGLE_GET_GZIP, FILTER_VALIDATE_INT);
if (!is_null($getgezip) && 1 == $getgezip) {
if (function_exists('gzencode')) {
$sitemapGz = gzencode($sitemap);
header('Content-Type: application/x-gzip');
header('Content-Disposition: attachment; filename="' . PMF_SITEMAP_GOOGLE_FILENAME_GZ . '"');
header('Content-Length: ' . strlen($sitemapGz));
print $sitemapGz;
示例4: foreach
// Search for href attributes only
$linkArray = $oLnk->getUrlpool();
if (isset($linkArray['href'])) {
foreach (array_unique($linkArray['href']) as $_url) {
if (!(strpos($_url, 'index.php?action=artikel') === false)) {
// Get the Faq link title
$matches = array();
preg_match('/id=([\\d]+)/ism', $_url, $matches);
$_id = $matches[1];
$_title = $faq->getRecordTitle($_id, false);
$_link = substr($_url, 9);
// Move the link to XHTML
if (strpos($_url, '&') === false) {
$_link = str_replace('&', '&', $_link);
}
$oLink = new PMF_Link(PMF_Link::getSystemRelativeUri() . $_link);
$oLink->itemTitle = $oLink->tooltip = $_title;
$newFaqPath = $oLink->toString();
$fixedContent = str_replace($_url, $newFaqPath, $fixedContent);
}
}
}
$content = $fixedContent;
// Check for the languages for a faq
$arrLanguage = PMF_Utils::languageAvailable($record_id);
$switchLanguage = '';
$check4Lang = '';
$num = count($arrLanguage);
if ($num > 1) {
foreach ($arrLanguage as $language) {
$check4Lang .= "<option value=\"" . $language . "\"";
示例5: Footer
/**
* The footer of the PDF file
*
* @return void
*/
public function Footer()
{
global $PMF_LANG;
$faqconfig = PMF_Configuration::getInstance();
$currentTextColor = $this->TextColor;
$this->SetTextColor(0, 0, 0);
$this->SetY(-25);
$this->SetFont('dejavusans', '', 10);
$this->Cell(0, 10, $PMF_LANG['ad_gen_page'] . ' ' . $this->PageNo() . ' / ' . $this->getAliasNbPages(), 0, 0, 'C');
$this->SetY(-20);
$this->SetFont('dejavusans', 'B', 8);
$this->Cell(0, 10, "(c) " . date("Y") . " " . $faqconfig->get('main.metaPublisher') . " <" . $faqconfig->get('main.administrationMail') . ">", 0, 1, "C");
if ($this->enableBookmarks == false) {
$this->SetY(-15);
$this->SetFont('dejavusans', '', 8);
$baseUrl = '/index.php';
if (is_array($this->faq) && !empty($this->faq)) {
$baseUrl .= '?action=artikel&cat=' . $this->categories[$this->category]['id'];
$baseUrl .= '&id=' . $this->faq['id'];
$baseUrl .= '&artlang=' . $this->faq['lang'];
}
$url = PMF_Link::getSystemScheme() . $_SERVER['HTTP_HOST'] . $baseUrl;
$urlObj = new PMF_Link($url);
$urlObj->itemTitle = $this->thema;
$_url = str_replace('&', '&', $urlObj->toString());
$this->Cell(0, 10, 'URL: ' . $_url, 0, 1, 'C', 0, $_url);
}
$this->TextColor = $currentTextColor;
}
示例6: startInstall
//.........这里部分代码省略.........
echo '<p class="alert alert-danger"><strong>Error:</strong> Your password and retyped password are too short.' . ' Please set your password and your retyped password with a minimum of 6 characters.</p>';
PMF_System::renderFooter(true);
}
if ($password != $password_retyped) {
echo '<p class="alert alert-danger"><strong>Error:</strong> Your password and retyped password are not equal.' . ' Please check your password and your retyped password.</p>';
PMF_System::renderFooter(true);
}
$language = PMF_Filter::filterInput(INPUT_POST, 'language', FILTER_SANITIZE_STRING, 'en');
$realname = PMF_Filter::filterInput(INPUT_POST, 'realname', FILTER_SANITIZE_STRING, '');
$email = PMF_Filter::filterInput(INPUT_POST, 'email', FILTER_SANITIZE_EMAIL, '');
$permLevel = PMF_Filter::filterInput(INPUT_POST, 'permLevel', FILTER_SANITIZE_STRING, 'basic');
$instanceSetup = new PMF_Instance_Setup();
$instanceSetup->setRootDir(PMF_ROOT_DIR);
// Write the DB variables in database.php
if (!$instanceSetup->createDatabaseFile($dbSetup)) {
echo "<p class=\"alert alert-danger\"><strong>Error:</strong> Setup cannot write to ./config/database.php.</p>";
$this->_system->cleanInstallation();
PMF_System::renderFooter(true);
}
// check LDAP if available
if (extension_loaded('ldap') && !is_null($ldapEnabled)) {
if (!$instanceSetup->createLdapFile($ldapSetup, '')) {
echo "<p class=\"alert alert-danger\"><strong>Error:</strong> Setup cannot write to ./config/ldap.php.</p>";
$this->_system->cleanInstallation();
PMF_System::renderFooter(true);
}
}
// connect to the database using config/database.php
require PMF_ROOT_DIR . '/config/database.php';
$db = PMF_Db::factory($dbSetup['dbType']);
$db->connect($DB['server'], $DB['user'], $DB['password'], $DB['db']);
if (!$db) {
echo "<p class=\"alert alert-danger\"><strong>DB Error:</strong> " . $db->error() . "</p>\n";
$this->_system->cleanInstallation();
PMF_System::renderFooter(true);
}
require PMF_ROOT_DIR . '/setup/assets/sql/' . $dbSetup['dbType'] . '.sql.php';
// CREATE TABLES
require PMF_ROOT_DIR . '/setup/assets/sql/stopwords.sql.php';
// INSERTs for stopwords
$this->_system->setDatabase($db);
echo '<p>';
// Erase any table before starting creating the required ones
if (!PMF_System::isSqlite($dbSetup['dbType'])) {
$this->_system->dropTables($uninst);
}
// Start creating the required tables
$count = 0;
foreach ($query as $executeQuery) {
$result = @$db->query($executeQuery);
if (!$result) {
echo '<p class="alert alert-danger"><strong>Error:</strong> Please install your version of phpMyFAQ once again or send
us a <a href=\\"http://www.phpmyfaq.de\\" target=\\"_blank\\">bug report</a>.</p>';
printf('<p class="alert alert-danger"><strong>DB error:</strong> %s</p>', $db->error());
printf('<code>%s</code>', htmlentities($executeQuery));
$this->_system->dropTables($uninst);
$this->_system->cleanInstallation();
PMF_System::renderFooter(true);
}
usleep(2500);
$count++;
if (!($count % 10)) {
echo '| ';
}
}
$link = new PMF_Link(null, $configuration);
// add main configuration, add personal settings
$this->_mainConfig['main.metaPublisher'] = $realname;
$this->_mainConfig['main.administrationMail'] = $email;
$this->_mainConfig['main.language'] = $language;
$this->_mainConfig['security.permLevel'] = $permLevel;
foreach ($this->_mainConfig as $name => $value) {
$configuration->add($name, $value);
}
$configuration->update(array('main.referenceURL' => $link->getSystemUri('/setup/index.php')));
$configuration->add('security.salt', md5($configuration->get('main.referenceURL')));
// add admin account and rights
$admin = new PMF_User($configuration);
if (!$admin->createUser($loginname, $password, 1)) {
printf("<p class=\"alert alert-danger\"><strong>Fatal installation error:</strong><br>" . "Couldn't create the admin user: %s</p>\n", $admin->error());
$this->_system->cleanInstallation();
PMF_System::renderFooter(true);
}
$admin->setStatus('protected');
$adminData = array('display_name' => $realname, 'email' => $email);
$admin->setUserData($adminData);
// add default rights
foreach ($this->_mainRights as $right) {
$admin->perm->grantUserRight(1, $admin->perm->addRight($right));
}
// Add anonymous user account
$instanceSetup->createAnonymousUser($configuration);
// Add master instance
$instanceData = array('url' => $link->getSystemUri($_SERVER['SCRIPT_NAME']), 'instance' => $link->getSystemRelativeUri('setup/index.php'), 'comment' => 'phpMyFAQ ' . PMF_System::getVersion());
$faqInstance = new PMF_Instance($configuration);
$faqInstance->addInstance($instanceData);
$faqInstanceMaster = new PMF_Instance_Master($configuration);
$faqInstanceMaster->createMaster($faqInstance);
echo '</p>';
}
示例7: usleep
usleep(10000);
$count++;
if (!($count % 10)) {
ob_flush();
}
}
echo "</div>";
}
// Clear the array with the queries
unset($query);
$query = [];
//
// 2nd UPDATES FROM 2.8.0-alpha2
//
if (version_compare($version, '2.8.0-alpha2', '<')) {
$link = new PMF_Link(null, $faqConfig);
$instanceData = array('url' => $link->getSystemUri($_SERVER['SCRIPT_NAME']), 'instance' => $link->getSystemRelativeUri('setup/update.php'), 'comment' => $faqConfig->get('main.titleFAQ'));
$faqInstance = new PMF_Instance($faqConfig);
$faqInstance->addInstance($instanceData);
$faqInstanceMaster = new PMF_Instance_Master($faqConfig);
$faqInstanceMaster->createMaster($faqInstance);
$faqConfig->add('records.autosaveActive', 'false');
$faqConfig->add('records.autosaveSecs', '180');
$faqConfig->add('main.maintenanceMode', 'false');
$faqConfig->add('security.salt', md5($faqConfig->get('main.referenceURL')));
}
//
// UPDATES FROM 2.8.0-alpha3
//
if (version_compare($version, '2.8.0-alpha3', '<')) {
$query[] = "DROP TABLE " . PMF_Db::getTablePrefix() . "faqlinkverifyrules";
示例8: getPath
/**
* Gets the path from root to child as breadcrumbs
*
* @param integer $id Category ID
* @param string $separator Path separator
* @param boolean $renderAsMicroData Renders breadcrumbs as HTML5 microdata
* @param string $useCssClass Use CSS class "breadcrumb"
* @return string
*/
public function getPath($id, $separator = ' / ', $renderAsMicroData = false, $useCssClass = 'breadcrumb')
{
global $sids;
$ids = $this->getNodes($id);
$num = count($ids);
$temp = $catid = $desc = $breadcrumb = [];
for ($i = 0; $i < $num; $i++) {
$t = $this->getLineCategory($ids[$i]);
if (array_key_exists($t, $this->treeTab)) {
$temp[] = $this->treeTab[$this->getLineCategory($ids[$i])]['name'];
$catid[] = $this->treeTab[$this->getLineCategory($ids[$i])]['id'];
$desc[] = $this->treeTab[$this->getLineCategory($ids[$i])]['description'];
}
}
if (isset($this->treeTab[$this->getLineCategory($id)]['name'])) {
$temp[] = $this->treeTab[$this->getLineCategory($id)]['name'];
$catid[] = $this->treeTab[$this->getLineCategory($id)]['id'];
$desc[] = $this->treeTab[$this->getLineCategory($id)]['description'];
}
// @todo Maybe this should be done somewhere else ...
if ($renderAsMicroData) {
foreach ($temp as $k => $category) {
$url = sprintf('%s?%saction=show&cat=%d', PMF_Link::getSystemRelativeUri(), $sids, $catid[$k]);
$oLink = new PMF_Link($url, $this->_config);
$oLink->text = sprintf('<span itemprop="title">%s</span>', $category);
$oLink->itemTitle = $category;
$oLink->tooltip = $desc[$k];
$oLink->setItemProperty('url');
if (0 == $k) {
$oLink->setRelation('index');
}
$breadcrumb[] = sprintf('<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">%s</li>', $oLink->toHtmlAnchor());
}
$temp = $breadcrumb;
return sprintf('<ul class="%s">%s</ul>', $useCssClass, implode('', $temp));
} else {
return implode($separator, $temp);
}
}
示例9: PMF_User
if (!isset($sent[$userId])) {
// TODO: Move this code to Category.php
$oUser = new PMF_User();
$oUser->getUserById($userId);
$catOwnerEmail = $oUser->getUserData('email');
$mail = new PMF_Mail();
$mail->unsetFrom();
$mail->setFrom($usermail);
$mail->addTo($faqconfig->get('main.administrationMail'));
// Let the category owner get a copy of the message
if ($faqconfig->get('main.administrationMail') != $catOwnerEmail) {
$mail->addCc($catOwnerEmail);
}
$mail->subject = '%sitename%';
// TODO: let the email contains the faq article both as plain text and as HTML
$mail->message = html_entity_decode($PMF_LANG['msgMailCheck']) . "\n\n" . $faqconfig->get('main.titleFAQ') . ": " . PMF_Link::getSystemUri('/index.php') . '/admin';
$result = $mail->send();
unset($mail);
$sent[$userId] = $catOwnerEmail;
}
}
$tpl->processTemplate('writeContent', array('msgNewContentHeader' => $PMF_LANG["msgNewContentHeader"], 'Message' => $isNew ? $PMF_LANG['msgNewContentThanks'] : $PMF_LANG['msgNewTranslationThanks']));
} else {
if (false === IPCheck($_SERVER['REMOTE_ADDR'])) {
$tpl->processTemplate('writeContent', array('msgNewContentHeader' => $PMF_LANG['msgNewContentHeader'], 'Message' => $PMF_LANG['err_bannedIP']));
} else {
if (is_null($faqid)) {
$faqsession->userTracking('error_save_entry', 0);
} else {
$faqsession->userTracking('error_save_translation_entry', 0);
}
示例10: PMF_Faq_Questions
// Initalizing static string wrapper
//
PMF_String::init($LANGCODE);
$faqQuestions = new PMF_Faq_Questions();
$rssData = $faqQuestions->fetchAll();
$num = count($rssData);
$rss = new XMLWriter();
$rss->openMemory();
$rss->setIndent(true);
$rss->startDocument('1.0', 'utf-8');
$rss->startElement('rss');
$rss->writeAttribute('version', '2.0');
$rss->startElement('channel');
$rss->writeElement('title', $faqconfig->get('main.titleFAQ') . ' - ' . $PMF_LANG['msgOpenQuestions']);
$rss->writeElement('description', html_entity_decode($faqconfig->get('main.metaDescription')));
$rss->writeElement('link', PMF_Link::getSystemUri('/feed/openquestions/rss.php'));
if ($num > 0) {
$counter = 0;
foreach ($rssData as $item) {
if ($counter < PMF_RSS_OPENQUESTIONS_MAX) {
$counter++;
$rss->startElement('item');
$rss->writeElement('title', PMF_Utils::makeShorterText(html_entity_decode($item->question), 8) . " (" . $item->username . ")");
$rss->startElement('description');
$rss->writeCdata($item->question);
$rss->endElement();
$rss->writeElement('link', (isset($_SERVER['HTTPS']) ? 's' : '') . "://" . $_SERVER["HTTP_HOST"] . str_replace("feed/openquestions/rss.php", "index.php", $_SERVER["PHP_SELF"]) . "?action=open#openq_" . $item->id);
$rss->writeElement('pubDate', PMF_Date::createRFC822Date($item->date, true));
$rss->endElement();
}
}
示例11: html_entity_decode
$rss->startDocument('1.0', 'utf-8');
$rss->startElement('rss');
$rss->writeAttribute('version', '2.0');
$rss->startElement('channel');
$rss->writeElement('title', $faqconfig->get('main.titleFAQ') . ' - ' . $PMF_LANG['msgTopTen']);
$rss->writeElement('description', html_entity_decode($faqconfig->get('main.metaDescription')));
$rss->writeElement('link', PMF_Link::getSystemUri('/feed/topten/rss.php'));
if ($num > 0) {
$i = 0;
foreach ($rssData as $item) {
$i++;
// Get the url
$link = str_replace($_SERVER['SCRIPT_NAME'], '/index.php', $item['url']);
if (PMF_RSS_USE_SEO) {
if (isset($item['thema'])) {
$oLink = new PMF_Link($link);
$oLink->itemTitle = html_entity_decode($item['thema'], ENT_COMPAT, 'UTF-8');
$link = html_entity_decode($oLink->toString(), ENT_COMPAT, 'UTF-8');
}
}
$rss->startElement('item');
$rss->writeElement('title', PMF_Utils::makeShorterText(html_entity_decode($item['thema'], ENT_COMPAT, 'UTF-8'), 8) . " (" . $item['visits'] . " " . $PMF_LANG['msgViews'] . ")");
$rss->startElement('description');
$rss->writeCdata("[" . $i . ".] " . $item['thema'] . " (" . $item['visits'] . " " . $PMF_LANG['msgViews'] . ")");
$rss->endElement();
$rss->writeElement('link', PMF_Link::getSystemUri('/feed/topten/rss.php') . $link);
$rss->writeElement('pubDate', PMF_Date::createRFC822Date($item['last_visit'], false));
$rss->endElement();
}
}
$rss->endElement();
示例12: array
$templateVars['renderUpdateUserScript'] = true;
$templateVars['updateUserId'] = PMF_Filter::filterInput(INPUT_GET, 'user_id', FILTER_VALIDATE_INT, 0);
}
$twig->loadTemplate('user/list.twig')->display($templateVars);
}
// show list of all users
if ($userAction == 'listallusers' && $user->perm->checkRight($user->getUserId(), 'edituser')) {
$templateVars = array('PMF_LANG' => $PMF_LANG, 'displayPagination' => false, 'message' => $message, 'users' => array());
$allUsers = $user->getAllUsers();
$numUsers = count($allUsers);
$page = PMF_Filter::filterInput(INPUT_GET, 'page', FILTER_VALIDATE_INT, 0);
$perPage = 10;
$numPages = ceil($numUsers / $perPage);
$lastPage = $page * $perPage;
$firstPage = $lastPage - $perPage;
$baseUrl = sprintf('%s?action=user&user_action=listallusers&page=%d', PMF_Link::getSystemRelativeUri(), $page);
if ($perPage < $numUsers) {
// Pagination options
$options = array('baseUrl' => $baseUrl, 'total' => $numUsers, 'perPage' => $perPage, 'pageParamName' => 'page');
$pagination = new PMF_Pagination($faqConfig, $options);
$templateVars['displayPagination'] = true;
$templateVars['pagination'] = $pagination->render();
}
$counter = $displayedCounter = 0;
foreach ($allUsers as $userId) {
$user->getUserById($userId);
if ($displayedCounter >= $perPage) {
continue;
}
$counter++;
if ($counter <= $firstPage) {
示例13: PMF_Glossary
// Get all data from the news record
$news = $oNews->getNewsEntry($news_id);
$content = $news['content'];
$header = $news['header'];
// Add Glossary entries
$oGlossary = new PMF_Glossary();
$content = $oGlossary->insertItemsIntoContent($content);
$header = $oGlossary->insertItemsIntoContent($header);
// Add information link if existing
if (strlen($news['link']) > 0) {
$content .= sprintf('</p><p>%s<a href="%s" target="%s">%s</a>', $PMF_LANG['msgInfo'], $news['link'], $news['target'], $news['linkTitle']);
}
// Show link to edit the news?
$editThisEntry = '';
if (isset($permission['editnews'])) {
$editThisEntry = sprintf('<a href="%sadmin/index.php?action=news&do=edit&id=%d">%s</a>', PMF_Link::getSystemRelativeUri('index.php'), $news_id, $PMF_LANG['ad_menu_news_edit']);
}
// Is the news item expired?
$expired = date('YmdHis') > $news['dateEnd'];
// Does the user have the right to add a comment?
if (!$news['active'] || !$news['allowComments'] || $expired) {
$commentMessage = $PMF_LANG['msgWriteNoComment'];
} else {
$oLink = new PMF_Link($_SERVER['SCRIPT_NAME'] . '?' . str_replace('&', '&', $_SERVER['QUERY_STRING']));
$oLink->itemTitle = $header;
$commentHref = $oLink->toString() . '#comment';
$commentMessage = sprintf('<a onclick="javascript:$(\'#comment\').show();" href="%s">%s</a>', $commentHref, $PMF_LANG['newsWriteComment']);
}
// Set the template variables
$tpl->processTemplate("writeContent", array('writeNewsHeader' => $writeNewsHeader, 'writeNewsRSS' => $writeNewsRSS, 'writeHeader' => $header, 'writeContent' => $content, 'writeDateMsg' => $news['active'] && !$expired ? $PMF_LANG['msgLastUpdateArticle'] . '<span id="newsLastUpd">' . $news['date'] . '</span>' : '', 'writeAuthor' => $news['active'] && !$expired ? $PMF_LANG['msgAuthor'] . ': ' . $news['authorName'] : '', 'editThisEntry' => $editThisEntry, 'writeCommentMsg' => $commentMessage, 'msgWriteComment' => $PMF_LANG['newsWriteComment'], 'writeSendAdress' => '?' . $sids . 'action=savecomment', 'newsId' => $news_id, 'newsLang' => $news['lang'], 'msgCommentHeader' => $PMF_LANG['msgCommentHeader'], 'msgNewContentName' => $PMF_LANG['msgNewContentName'], 'msgNewContentMail' => $PMF_LANG['msgNewContentMail'], 'defaultContentMail' => $user instanceof PMF_User_CurrentUser ? $user->getUserData('email') : '', 'defaultContentName' => $user instanceof PMF_User_CurrentUser ? $user->getUserData('display_name') : '', 'msgYourComment' => $PMF_LANG['msgYourComment'], 'msgNewContentSubmit' => $PMF_LANG['msgNewContentSubmit'], 'captchaFieldset' => PMF_Helper_Captcha::getInstance()->renderFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('writecomment')), 'writeComments' => $comment->getComments($news_id, PMF_Comment::COMMENT_TYPE_NEWS)));
$tpl->includeTemplate('writeContent', 'index');
示例14: getPdfLink
/**
* Returns the "Show FAQ as PDF" URL
*
* @return string
*/
public function getPdfLink()
{
return sprintf('%spdf.php?cat=%d&id=%d&artlang=%s', PMF_Link::getSystemRelativeUri('index.php'), $this->getCategoryId(), $this->getFaqId(), $this->getLanguage());
}
示例15: PMF_Search
$search = new PMF_Search($faqConfig);
if ('truncatesearchterms' === $action) {
if ($search->deleteAllSearchTerms()) {
printf('<p class="alert alert-success">%s</p>', $PMF_LANG["ad_searchterm_del_suc"]);
} else {
printf('<p class="alert alert-success">%s</p>', $PMF_LANG["ad_searchterm_del_err"]);
}
}
$searchesCount = $search->getSearchesCount();
$searchesList = $search->getMostPopularSearches($searchesCount + 1, true);
if (is_null($pages)) {
$pages = round((count($searchesList) + $perpage / 3) / $perpage, 0);
}
$start = ($page - 1) * $perpage;
$ende = $start + $perpage;
$baseUrl = sprintf('%s?action=searchstats&page=%d', PMF_Link::getSystemRelativeUri(), $page);
// Pagination options
$options = array('baseUrl' => $baseUrl, 'total' => count($searchesList), 'perPage' => $perpage, 'pageParamName' => 'page');
$pagination = new PMF_Pagination($faqConfig, $options);
?>
<div id="ajaxresponse"></div>
<table class="table table-striped">
<thead>
<tr>
<th><?php
echo $PMF_LANG['ad_searchstats_search_term'];
?>
</th>
<th><?php
echo $PMF_LANG['ad_searchstats_search_term_count'];
?>