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


PHP PMF_Category::getPath方法代码示例

本文整理汇总了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>
开发者ID:noon,项目名称:phpMyFAQ,代码行数:31,代码来源:record.save.php

示例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;
 }
开发者ID:noon,项目名称:phpMyFAQ,代码行数:55,代码来源:Export.php


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