本文整理汇总了PHP中PMF_Init类的典型用法代码示例。如果您正苦于以下问题:PHP PMF_Init类的具体用法?PHP PMF_Init怎么用?PHP PMF_Init使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PMF_Init类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: trim
}
if (!isset($changeFreq)) {
$changeFreq = PMF_SITEMAP_GOOGLE_CHANGEFREQ_DAILY;
}
$node = '<url>' . '<loc>' . PMF_String::htmlspecialchars($location) . '</loc>' . '<lastmod>' . $lastmod . '</lastmod>' . '<changefreq>' . $changeFreq . '</changefreq>' . (isset($priority) ? '<priority>' . $priority . '</priority>' : '') . '</url>';
return $node;
}
//
// Future improvements
// WHEN a User PMF Sitemap will be:
// a. bigger than 10MB (!)
// b. w/ more than 50K URLs (!)
// we'll manage this issue using a Sitemap Index Files produced by this PHP code
// including Sitemap URLs always produced by this same PHP code (see PMF_SITEMAP_GOOGLE_GET_INDEX)
//
PMF_Init::cleanRequest();
session_name(PMF_COOKIE_NAME_AUTH . trim($faqconfig->get('main.phpMyFAQToken')));
session_start();
$oFaq = new PMF_Faq();
// Load the faq
$items = $oFaq->getTopTenData(PMF_SITEMAP_GOOGLE_MAX_URLS - 1);
$visitsMax = 0;
$visitMin = 0;
if (count($items) > 0) {
$visitsMax = $items[0]['visits'];
$visitMin = $items[count($items) - 1]['visits'];
}
// 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);
示例2: urlencode
$_SERVER['HTTP_USER_AGENT'] = urlencode($_SERVER['HTTP_USER_AGENT']);
define('PMF_ROOT_DIR', dirname(dirname(__FILE__)));
/* read configuration */
require_once PMF_ROOT_DIR . "/inc/data.php";
require_once PMF_ROOT_DIR . "/inc/config.php";
require_once PMF_ROOT_DIR . "/inc/constants.php";
/* include classes and functions */
require_once PMF_ROOT_DIR . "/inc/db.php";
define("SQLPREFIX", $DB["prefix"]);
$db = db::db_select($DB["type"]);
$db->connect($DB["server"], $DB["user"], $DB["password"], $DB["db"]);
require_once PMF_ROOT_DIR . "/inc/category.php";
require_once PMF_ROOT_DIR . "/inc/idna_convert.class.php";
$IDN = new idna_convert();
// get language (default: english)
$pmf = new PMF_Init();
$LANGCODE = $pmf->setLanguage(isset($PMF_CONF['detection']) ? true : false, $PMF_CONF['language']);
if (isset($LANGCODE) && isset($languageCodes[strtoupper($LANGCODE)])) {
require_once "../lang/language_" . $LANGCODE . ".php";
} else {
$LANGCODE = "en";
require_once "../lang/language_en.php";
}
/* header of the admin page */
require_once "header.php";
?>
</div>
<div id="bodyText">
<?php
if (isset($_GET["action"]) && $_GET["action"] == "newpassword") {
} elseif (isset($_GET["action"]) && $_GET["action"] == "savenewpassword") {
示例3: define
*/
require_once '../inc/functions.php';
require_once '../inc/init.php';
define('IS_VALID_PHPMYFAQ', null);
PMF_Init::cleanRequest();
require_once '../inc/constants.php';
require_once '../inc/config.php';
require_once '../inc/data.php';
require_once '../inc/db.php';
define('SQLPREFIX', $DB['prefix']);
$db = db::db_select($DB['type']);
$db->connect($DB['server'], $DB['user'], $DB['password'], $DB['db']);
require_once '../lang/language_en.php';
$auth_user = null;
$auth_pass = null;
if (isset($_GET['lang']) && PMF_Init::isASupportedLanguage($_GET['lang'])) {
require_once '../lang/language_' . $_GET['lang'] . '.php';
}
if (isset($_GET['hash']) && $_GET['hash'] != '') {
$pmf_hash = $db->escape_string($_GET['hash']);
$auth_user_pass = explode(',', base64_decode($pmf_hash));
if (is_array($auth_user_pass)) {
$auth_user = $auth_user_pass[0];
$auth_pass = $auth_user_pass[1];
}
} else {
header('Location: http://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME']));
exit;
}
if (isset($_GET['uin']) && preg_match('/^(\\w{32})$/i', substr($_GET['uin'], 0, 32)) && !is_null($auth_user) && !is_null($auth_pass)) {
$uin = $db->escape_string($_GET['uin']);
示例4: removeXSSGPC
/**
* removeXSSGPC
*
* Removes xss from an array
*
* @param array $data
* @return array
* @acces private
* @author Thorsten Rinne <thorsten@phpmyfaq.de>
* @author Johann-Peter Hartmann <hartmann@mayflower.de>
*/
function removeXSSGPC($data)
{
$cleanData = array();
foreach ($data as $key => $val) {
$key = PMF_Init::basicXSSClean($key);
if (is_array($val)) {
$cleanData[$key] = PMF_Init::removeXSSGPC($val);
} else {
$cleanData[$key] = PMF_Init::basicXSSClean($val);
}
}
return $cleanData;
}
示例5: generateNewestData
/**
* This function generates an array with a specified number of most recent published records
*
* @param string, int
* @return array
* @access public
* @author Robin Wood <robin@digininja.org>
* @since 2005-03-06
*/
function generateNewestData($language = '', $count = PMF_NUMBER_RECORDS_LATEST)
{
global $db, $sids, $PMF_LANG, $PMF_CONF;
$query = 'SELECT DISTINCT ' . SQLPREFIX . 'faqdata.id AS id, ' . SQLPREFIX . 'faqdata.lang AS lang, ' . SQLPREFIX . 'faqcategoryrelations.category_id AS category_id, ' . SQLPREFIX . 'faqdata.thema AS thema, ' . SQLPREFIX . 'faqdata.datum AS datum, ' . SQLPREFIX . 'faqvisits.visits AS visits FROM ' . SQLPREFIX . 'faqvisits, ' . SQLPREFIX . 'faqdata LEFT JOIN ' . SQLPREFIX . 'faqcategoryrelations ON ' . SQLPREFIX . 'faqdata.id = ' . SQLPREFIX . 'faqcategoryrelations.record_id AND ' . SQLPREFIX . 'faqdata.lang = ' . SQLPREFIX . 'faqcategoryrelations.record_lang WHERE ';
if (isset($language) && PMF_Init::isASupportedLanguage($language)) {
$query .= SQLPREFIX . 'faqdata.lang = \'' . $language . '\' AND ';
}
$query .= SQLPREFIX . 'faqdata.id = ' . SQLPREFIX . 'faqvisits.id AND ' . SQLPREFIX . 'faqdata.lang = ' . SQLPREFIX . 'faqvisits.lang AND ' . SQLPREFIX . 'faqdata.active = \'yes\' ORDER BY ' . SQLPREFIX . 'faqdata.datum DESC';
$result = $db->query($query);
$newestArray = array();
$data = array();
$i = 0;
$oldId = 0;
while (($row = $db->fetch_object($result)) && $i < $count) {
if ($oldId != $row->id) {
$data['datum'] = $row->datum;
$data['thema'] = $row->thema;
$data['visits'] = $row->visits;
if (isset($PMF_CONF["mod_rewrite"]) && $PMF_CONF["mod_rewrite"] == "TRUE") {
$data['url'] = $row->category_id . "_" . $row->id . "_" . $row->lang . ".html";
} else {
$data['url'] = $_SERVER["PHP_SELF"] . "?" . $sids . "action=artikel&cat=" . $row->category_id . "&id=" . $row->id . "&artlang=" . $row->lang;
}
$newestArray[] = $data;
$i++;
}
$oldId = $row->id;
}
return $newestArray;
}
示例6: header
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*/
if (!defined('IS_VALID_PHPMYFAQ')) {
header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
exit;
}
$captcha = new PMF_Captcha($sids);
if (!is_null($showCaptcha)) {
$captcha->showCaptchaImg();
exit;
}
$translationLanguage = PMF_Filter::filterInput(INPUT_POST, 'translation', FILTER_SANITIZE_STRING, $LANGCODE);
$faqSource['id'] = 'writeSourceFaqId';
$faqSource['lang'] = $translationLanguage;
$faqSource['title'] = 'writeSourceTitle';
$faqSource['content'] = 'writeSourceContent';
$faqSource['keywords'] = 'writeSourceKeywords';
$faqsession->userTracking('new_translation_entry', 0);
$id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$srclang = PMF_Filter::filterInput(INPUT_GET, 'srclang', FILTER_SANITIZE_STRING);
if (!is_null($id) && !is_null($srclang) && PMF_Language::isASupportedLanguage($srclang)) {
$oFaq = new PMF_Faq();
$oFaq->getRecord($id);
$faqSource = $oFaq->faqRecord;
}
$tpl->processTemplate('writeContent', array('writeSourceFaqId' => $faqSource['id'], 'writeSourceTitle' => $faqSource['title'], 'writeSourceContent' => $faqSource['content'], 'writeSourceKeywords' => $faqSource['keywords'], 'msgNewTranslationHeader' => $PMF_LANG['msgNewTranslationHeader'], 'msgNewTranslationAddon' => $PMF_LANG['msgNewTranslationAddon'], 'msgNewTransSourcePane' => $PMF_LANG['msgNewTransSourcePane'], 'msgNewTranslationPane' => $PMF_LANG['msgNewTranslationPane'], 'writeSendAdress' => '?' . $sids . 'action=save', 'defaultContentName' => $user ? $user->getUserData('display_name') : '', 'defaultContentMail' => $user ? $user->getUserData('email') : '', 'msgNewTranslationName' => $PMF_LANG['msgNewTranslationName'], 'msgNewTranslationMail' => $PMF_LANG['msgNewTranslationMail'], 'msgNewTranslationKeywords' => $PMF_LANG['msgNewTranslationKeywords'], 'writeTransFaqLanguage' => $translationLanguage, 'captchaFieldset' => printCaptchaFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('translate'), $captcha->caplength), 'msgNewTranslationSubmit' => $PMF_LANG['msgNewTranslationSubmit'], 'tinyMCELanguage' => PMF_Init::isASupportedTinyMCELanguage($LANGCODE) ? $LANGCODE : 'en'));
$tpl->includeTemplate('writeContent', 'index');