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


PHP content::getCategoryTree方法代码示例

本文整理汇总了PHP中content::getCategoryTree方法的典型用法代码示例。如果您正苦于以下问题:PHP content::getCategoryTree方法的具体用法?PHP content::getCategoryTree怎么用?PHP content::getCategoryTree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在content的用法示例。


在下文中一共展示了content::getCategoryTree方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_rss

function get_rss()
{
    global $aa;
    require_once e_PLUGIN . "content/handlers/content_class.php";
    $aa = new content();
    $rss = array();
    $array = $aa->getCategoryTree('', '', FALSE);
    foreach ($array as $k => $v) {
        $name = '';
        for ($i = 0; $i < count($array[$k]); $i++) {
            $name .= $array[$k][$i + 1] . " > ";
            $i++;
        }
        $name = substr($name, 0, -3);
        $feed['name'] = $name;
        $feed['url'] = 'content';
        //the identifier for the rss feed url
        $feed['topic_id'] = $k;
        //the topic_id, empty on default (to select a certain category)
        $feed['path'] = 'content';
        //this is the plugin path location
        $feed['text'] = 'this is the rss feed for content category : ' . $name;
        $feed['class'] = '0';
        $feed['limit'] = '9';
        $rss[] = $feed;
    }
    return $rss;
}
开发者ID:Jimmi08,项目名称:content,代码行数:28,代码来源:e_rss.php

示例2: status

 function status()
 {
     $sql = e107::getDb();
     $aa = new content();
     if ($maincat = $sql->retrieve("pcontent", "content_id, content_heading", " WHERE  content_parent  = '0' ORDER BY content_heading", true)) {
         $i = 0;
         foreach ($maincat as $row) {
             $count = 0;
             $array = $aa->getCategoryTree("", $row['content_id'], TRUE);
             $validparent = implode(",", array_keys($array));
             $qrycat = " content_parent REGEXP '" . $aa->CONTENTREGEXP($validparent) . "' ";
             $count = $sql->count("pcontent", "(*)", "WHERE " . $qrycat . "  AND content_refer != 'sa' ");
             $var[$i]['icon'] = "<img src='" . e_PLUGIN_ABS . "content/images/content_16.png' style='width: 16px; height: 16px; vertical-align: bottom' alt='' /> ";
             $var[$i]['title'] = $row['content_heading'];
             $var[$i]['url'] = e_PLUGIN . "content/admin_content_config.php?content." . $row['content_id'];
             $var[$i]['total'] = $count;
             $i = $i + 1;
         }
     }
     return $var;
 }
开发者ID:Jimmi08,项目名称:content,代码行数:21,代码来源:e_dashboard.php

示例3: implode

while ($rowm = $sqlm->db_Fetch()) {
    $ICON = "";
    $HEADING = "";
    $AUTHOR = "";
    $CATEGORY = "";
    $DATE = "";
    $INFO = "";
    $LIST_CAPTION = $rowm['content_heading'];
    //global var for this main parent
    $mainparent = $rowm['content_id'];
    //get path variables
    $content_recent_pref = $aa->getContentPref($mainparent);
    $content_recent_pref["content_icon_path"] = $content_recent_pref["content_icon_path"] ? $content_recent_pref["content_icon_path"] : "{e_PLUGIN_ABS}content/images/icon/";
    $content_icon_path = $tp->replaceConstants($content_recent_pref["content_icon_path"]);
    //prepare query string
    $array = $aa->getCategoryTree("", $mainparent, TRUE);
    $validparent = implode(",", array_keys($array));
    $qry = " content_refer !='sa' AND content_parent REGEXP '" . $aa->CONTENTREGEXP($validparent) . "' AND content_class REGEXP '" . e_CLASS_REGEXP . "' ";
    //check so only the preferences from the correct content_type (article, content, review etc) are used and rendered
    if (substr($contentmode, 8) == $rowm['content_id']) {
        if ($mode == "new_page" || $mode == "new_menu") {
            $lvisit = $this->getlvisit();
            $qry = $qry . " AND content_datestamp>" . $lvisit;
        } else {
            $qry = $qry . " " . $datequery;
        }
        $qry .= " ORDER BY content_datestamp DESC LIMIT 0," . intval($arr[7]);
        //get recent content for each main parent
        $sqli = new db();
        if (!($resultitem = $sqli->db_Select("pcontent", "*", $qry))) {
            $LIST_DATA = CONTENT_MENU_LAN_5 . " " . $rowm['content_heading'];
开发者ID:Jimmi08,项目名称:content,代码行数:31,代码来源:e_list.php

示例4: intval

            $content_pref = e107::unserialize($row['content_pref']);
            //$content_pref					= $eArrayStorage->ReadxxxArray($row['content_pref']);
            $content_pref["content_cat_icon_path_large"] = $content_pref["content_cat_icon_path_large"] ? $content_pref["content_cat_icon_path_large"] : "{e_PLUGIN}content/images/cat/48/";
            $content_pref["content_cat_icon_path_small"] = $content_pref["content_cat_icon_path_small"] ? $content_pref["content_cat_icon_path_small"] : "{e_PLUGIN}content/images/cat/16/";
            $content_cat_icon_path_large = $tp->replaceConstants($content_pref["content_cat_icon_path_large"]);
            $content_cat_icon_path_small = $tp->replaceConstants($content_pref["content_cat_icon_path_small"]);
            $content_icon_path = $tp->replaceConstants($content_pref["content_icon_path"]);
            if ($content_pref["content_submit"] && check_class($content_pref["content_submit_class"])) {
                $content_submit_type_table_string .= $tp->parseTemplate($CONTENT_SUBMIT_TYPE_TABLE, FALSE, $newcontent_shortcodes);
                $count = $count + 1;
            }
        }
        if ($count == "0") {
            $text .= "<div style='text-align:center;'>" . CONTENT_ADMIN_SUBMIT_LAN_0 . "</div>";
        } else {
            $text = $CONTENT_SUBMIT_TYPE_TABLE_START . $content_submit_type_table_string . $CONTENT_SUBMIT_TYPE_TABLE_END;
        }
    }
    $caption = CONTENT_ADMIN_SUBMIT_LAN_1;
    $ns->tablerender($caption, $text);
}
if (isset($qs[0]) && $qs[0] == "content" && $qs[1] == "submit" && is_numeric($qs[2]) && !isset($qs[3])) {
    //check if valid categories exist for this main parent
    $array = $aa->getCategoryTree("", intval($qs[2]), TRUE);
    $validparent = implode(",", array_keys($array));
    $qry = " content_parent REGEXP '" . $aa->CONTENTREGEXP($validparent) . "' ";
    $sql2 = new db();
    //$contenttotal	= $sql2 -> db_Count($plugintable, "(*)", "WHERE ".$qry." ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' " );
    $aform->show_create_content("submit");
}
require_once FOOTERF;
开发者ID:Jimmi08,项目名称:content,代码行数:31,代码来源:content_submit.php

示例5: list

$fl = new e_file();
global $tp;
$deltest = array_flip($_POST);
// check query
if (isset($_POST['delete'])) {
    $tmp = array_pop(array_flip($_POST['delete']));
    list($delete, $del_id) = explode("_", $tmp);
}
$sql = e107::getDb();
// ##### DB ---------------------------------------------------------------------------------------
if (isset($delete) && $delete == 'cat') {
    $record = $sql->retrieve($plugintable, 'content_id,content_heading,content_parent', "content_id = '{$del_id}' ");
    $content_id = $record['content_id'];
    $content_heading = $record['content_heading'];
    $content_parent = $record['content_parent'];
    $checkarray = $aa->getCategoryTree("", $content_id, TRUE);
    unset($agc);
    //unset the globalised getCategoryTree array
    $checkvalidparent = implode(",", array_keys($checkarray));
    $checkqry = " content_parent REGEXP '" . $aa->CONTENTREGEXP($checkvalidparent) . "' ";
    //check if subcats present
    if (count($array) > 1) {
        //subcategories found don't delete
        $checkermsg .= CONTENT_ADMIN_CAT_LAN_36 . "<br />";
        $checksubcat = TRUE;
    } else {
        $checkermsg .= CONTENT_ADMIN_CAT_LAN_39 . "<br />";
        $checksubcat = FALSE;
    }
    //check if items present
    if ($sql->count($plugintable, "(*)", "WHERE " . $checkqry . " ")) {
开发者ID:Jimmi08,项目名称:content,代码行数:31,代码来源:admin_content_config.php


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