本文整理汇总了PHP中PMF_Category::getPath方法的典型用法代码示例。如果您正苦于以下问题:PHP PMF_Category::getPath方法的具体用法?PHP PMF_Category::getPath怎么用?PHP PMF_Category::getPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMF_Category
的用法示例。
在下文中一共展示了PMF_Category::getPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
$record_id = PMF_Filter::filterInput(INPUT_POST, 'record_id', FILTER_VALIDATE_INT);
$solution_id = PMF_Filter::filterInput(INPUT_POST, 'solution_id', FILTER_VALIDATE_INT);
$revision = PMF_Filter::filterInput(INPUT_POST, 'revision', FILTER_SANITIZE_STRING);
$revision_id = PMF_Filter::filterInput(INPUT_POST, 'revision_id', FILTER_VALIDATE_INT);
$changed = PMF_Filter::filterInput(INPUT_POST, 'changed', FILTER_SANITIZE_STRING);
// Permissions
$user_permission = PMF_Filter::filterInput(INPUT_POST, 'userpermission', FILTER_SANITIZE_STRING);
$restricted_users = 'all' == $user_permission ? -1 : PMF_Filter::filterInput(INPUT_POST, 'restricted_users', FILTER_VALIDATE_INT);
$group_permission = PMF_Filter::filterInput(INPUT_POST, 'grouppermission', FILTER_SANITIZE_STRING);
$restricted_groups = 'all' == $group_permission ? -1 : PMF_Filter::filterInput(INPUT_POST, 'restricted_groups', FILTER_VALIDATE_INT);
if (isset($submit['submit'][2]) && !is_null($question) && !is_null($categories)) {
// Preview
$category->transform(0);
$categorylist = '';
foreach ($categories['rubrik'] as $_categories) {
$categorylist .= $category->getPath($_categories) . '<br />';
}
?>
<h2><?php
print $PMF_LANG["ad_entry_preview"];
?>
</h2>
<h3><strong><em><?php
print $categorylist;
?>
</em>
<?php
print $question;
?>
</strong></h3>
示例2: getXMLExport
/**
* Returns the XML export
*
* @param integer $nCatid Number of categories
* @param boolean $bDownwards Downwards
* @param string $lang Language
*
* @return string
*/
public static function getXMLExport($nCatid = 0, $bDownwards = true, $lang = "")
{
global $db, $LANGCODE, $PMF_LANG, $PMF_CONF;
$tree = new PMF_Category();
$tree->transform(0);
$my_xml_output = "<?xml version=\"1.0\" encoding=\"" . $PMF_LANG["metaCharset"] . "\" standalone=\"yes\" ?>\n";
$my_xml_output .= "<!-- XML-Output by phpMyFAQ " . $PMF_CONF['main.currentVersion'] . " | Date: " . PMF_Date::createIsoDate(date("YmdHis")) . " -->\n";
$my_xml_output .= "<phpmyfaq xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:NamespaceSchemaLocation=\"http://www.phpmyfaq.de/xml/faqschema.xsd\">\n";
// Get Faq Data
$oFaq = new PMF_Faq();
$faqs = $oFaq->get(FAQ_QUERY_TYPE_EXPORT_XML, $nCatid, $bDownwards, $lang);
// Start composing XML
if (count($faqs) > 0) {
foreach ($faqs as $faq) {
// Get faq properties
$xml_content = $faq['content'];
$xml_rubrik = $tree->getPath($faq['category_id'], " >> ");
$xml_thema = $faq['topic'];
$xml_keywords = $faq['keywords'];
// Take care of XML entities
$xml_content = strip_tags(PMF_String::htmlspecialchars($xml_content, ENT_QUOTES, $PMF_LANG['metaCharset']));
$xml_rubrik = PMF_htmlentities(strip_tags($xml_rubrik), ENT_QUOTES, $PMF_LANG['metaCharset']);
$xml_thema = strip_tags($xml_thema);
// Build the <article/> node
$my_xml_output .= "\t<article id=\"" . $faq['id'] . "\">\n";
$my_xml_output .= "\t<language>" . $faq['lang'] . "</language>\n";
$my_xml_output .= "\t<category>" . $xml_rubrik . "</category>\n";
if (!empty($xml_keywords)) {
$my_xml_output .= "\t<keywords>" . $xml_keywords . "</keywords>\n";
} else {
$my_xml_output .= "\t<keywords />\n";
}
$my_xml_output .= "\t<theme>" . $xml_thema . "</theme>\n";
$my_xml_output .= "\t<content xmlns=\"http://www.w3.org/TR/REC-html40\">" . $xml_content . "</content>\n";
if (!empty($faq['author_name'])) {
$my_xml_output .= "\t<author>" . $faq['author_name'] . "</author>\n";
} else {
$my_xml_output .= "\t<author />\n";
}
$my_xml_output .= "\t<date>" . PMF_Date::createIsoDate($faq['lastmodified']) . "</date>\n";
$my_xml_output .= "\t</article>\n";
}
}
$my_xml_output .= "</phpmyfaq>";
return $my_xml_output;
}