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


PHP XoopsTree::getFirstChild方法代码示例

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


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

示例1: XoopsTree

// MyTextSanitizer object
include_once XOOPS_ROOT_PATH . "/class/xoopstree.php";
$mytree = new XoopsTree($xoopsDB->prefix("mylinks_cat"), "cid", "pid");
$xoopsOption['template_main'] = 'mylinks_index.html';
include XOOPS_ROOT_PATH . "/header.php";
$result = $xoopsDB->query("SELECT cid, title, imgurl FROM " . $xoopsDB->prefix("mylinks_cat") . " WHERE pid = 0 ORDER BY title") or exit("Error");
$count = 1;
while ($myrow = $xoopsDB->fetchArray($result)) {
    $imgurl = '';
    if ($myrow['imgurl'] && $myrow['imgurl'] != "http://") {
        $imgurl = $myts->makeTboxData4Edit($myrow['imgurl']);
    }
    $totallink = getTotalItems($myrow['cid'], 1);
    // get child category objects
    $arr = array();
    $arr = $mytree->getFirstChild($myrow['cid'], "title");
    $space = 0;
    $chcount = 0;
    $subcategories = '';
    foreach ($arr as $ele) {
        $chtitle = $myts->makeTboxData4Show($ele['title']);
        if ($chcount > 5) {
            $subcategories .= "...";
            break;
        }
        if ($space > 0) {
            $subcategories .= ", ";
        }
        $subcategories .= "<a href=\"" . XOOPS_URL . "/modules/mylinks/viewcat.php?cid=" . $ele['cid'] . "\">" . $chtitle . "</a>";
        $space++;
        $chcount++;
开发者ID:amjadtbssm,项目名称:website,代码行数:31,代码来源:index.php

示例2: getTotalItems

     $category_image_link = '<a href="' . $_CONF[site_url] . '/filemgmt/viewcat.php?cid=' . $myrow['cid'] . '">' . '<img src="' . $filemgmt_SnapCatURL . $imgurl . '" width="' . $mydownloads_shotwidth . '" style="border:none;" alt=""' . XHTML . '></a>';
     $p->set_var('category_link', $category_image_link);
 } else {
     $p->set_var('category_link', '');
 }
 $downloadsWaitingSubmission = getTotalItems($myrow['cid'], 0);
 $p->set_var('num_files', getTotalItems($myrow['cid'], 1));
 if ($downloadsWaitingSubmission > 0) {
     $p->set_var('files_waiting_submission', '(' . getTotalItems($myrow['cid'], 0) . ')');
 } else {
     $p->set_var('files_waiting_submission', '');
 }
 // get child category objects
 $subcategories = '';
 $arr = array();
 $arr = $mytree->getFirstChild($myrow['cid'], 'title');
 $space = 0;
 $chcount = 0;
 foreach ($arr as $ele) {
     $chtitle = $myts->makeTboxData4Show($ele['title']);
     if ($chcount >= $numSubCategories2Show) {
         $subcategories .= "...";
         break;
     }
     if ($space > 0) {
         $subcategories .= ", ";
     }
     $subcategories .= "<a href=\"{$_CONF[site_url]}/filemgmt/viewcat.php?cid={$ele['cid']}\">{$chtitle}</a>";
     $space++;
     $chcount++;
 }
开发者ID:milk54,项目名称:geeklog-japan,代码行数:31,代码来源:index.php

示例3: getFirstChildTopics

 function getFirstChildTopics()
 {
     $ret = array();
     $xt = new XoopsTree($this->table, "topic_id", "topic_pid");
     $topic_arr = $xt->getFirstChild($this->topic_id, "topic_title");
     if (is_array($topic_arr) && count($topic_arr)) {
         foreach ($topic_arr as $topic) {
             $ret[] = new XoopsTopic($this->table, $topic);
         }
     }
     return $ret;
 }
开发者ID:koki-h,项目名称:xoops_utf8,代码行数:12,代码来源:xoopstopic.php

示例4: getFirstChild

	function getFirstChild(){
		$ret = array();
		$xt = new XoopsTree($this->table, "id", "pid");
		$category_arr = $xt->getFirstChild($this->id, 'orders');
		if ( is_array($category_arr) && count($category_arr) ) {
			foreach($category_arr as $category){
				$ret[] = new WfsCategory($category);
			}
		}
		return $ret;
	}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:11,代码来源:wfscategory.php

示例5: convertorderbyin

$show = $mydownloads_perpage;
$offset = ($page - 1) * $show;
$orderby = '';
if (isset($_GET['orderby'])) {
    $orderby = COM_applyFilter($_GET['orderby']);
}
$orderby = convertorderbyin($orderby);
$pathstring = '<a href="index.php">' . _MD_MAIN . '</a>&nbsp;:&nbsp;';
$nicepath = $mytree->getNicePathFromId($cid, "title", "{$_CONF['site_url']}/filemgmt/viewcat.php");
$pathstring .= $nicepath;
$p->set_var('category_path_link', $pathstring);
$p->set_var('cid', $cid);
// get child category objects
$subcategories = '';
$arr = array();
$arr = $mytree->getFirstChild($cid, 'title');
if (count($arr) > 0) {
    $count = 1;
    foreach ($arr as $ele) {
        $totalfiles = 0;
        $chtitle = $myts->makeTboxData4Show($ele['title']);
        $totalfiles = $totalfiles + getTotalItems($ele['cid'], 1);
        $subcategories = '<a href="' . $_CONF[site_url] . '/filemgmt/viewcat.php?cid=' . $ele['cid'] . '">' . $chtitle . '</a>&nbsp;(' . $totalfiles . ')&nbsp;&nbsp;';
        $p->set_var('subcategories', $subcategories);
        $p->set_var('new_table_row', $count == 1 ? '<tr>' : '');
        $p->set_var('end_of_row', $count == $numCategoriesPerRow ? '</tr>' : '');
        $count = $count == $numCategoriesPerRow ? 1 : $count + 1;
        $p->parse('category_records', 'category', true);
    }
} else {
    $p->set_var('subcategories', '');
开发者ID:milk54,项目名称:geeklog-japan,代码行数:31,代码来源:viewcat.php

示例6: getTotalItems

    echo $heading;
}
echo "<br /><br />";
echo "<table width=80% cellspacing=4 cellpadding=0 border=0 valign=top><tr>";
while ($myrow = $xoopsDB->fetchArray($result)) {
    $cname = $myts->makeTboxData4Show($myrow['cname']);
    $cdesc = $myts->makeTboxData4Show($myrow['cdesc']);
    $cimg = $myts->makeTboxData4Show($myrow['cimg']);
    $number = getTotalItems($myrow['cid'], 1, 3);
    if ($category_visdefault == 1) {
        $show = $category_visualize;
    } else {
        $show = $category_default;
    }
    $arr = array();
    $arr = $mytree->getFirstChild($myrow['cid'], "cname");
    $space = 0;
    $chcount = 0;
    $subcats = "";
    foreach ($arr as $ele) {
        $chtitle = $myts->makeTboxData4Show($ele['cname']);
        if ($chcount > $maxsubcatshow) {
            $subcats .= "...";
            break;
        }
        if ($space > 0) {
            $subcats .= ", ";
        }
        $subcats .= "<a href=\"" . XOOPS_URL . "/modules/tutorials/listtutorials.php?cid=" . $ele['cid'] . "\">" . $chtitle . "</a>";
        $space++;
        $chcount++;
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:31,代码来源:index.php

示例7: isset

$min = isset($HTTP_GET_VARS['min']) ? intval($HTTP_GET_VARS['min']) : 0;
if (!isset($max)) {
    $max = $min + $show;
}
if (isset($HTTP_GET_VARS['orderby'])) {
    $orderby = convertorderbyin($HTTP_GET_VARS['orderby']);
} else {
    $orderby = "title ASC";
}
$pathstring = "<a href='index.php'>" . _MD_MAIN . "</a>&nbsp;:&nbsp;";
$pathstring .= $mytree->getNicePathFromId($cid, "title", "viewcat.php?op=");
$xoopsTpl->assign('category_path', $pathstring);
$xoopsTpl->assign('category_id', $cid);
// get child category objects
$arr = array();
$arr = $mytree->getFirstChild($cid, "title");
if (count($arr) > 0) {
    $scount = 1;
    foreach ($arr as $ele) {
        $sub_arr = array();
        $sub_arr = $mytree->getFirstChild($ele['cid'], "title");
        $space = 0;
        $chcount = 0;
        $infercategories = "";
        foreach ($sub_arr as $sub_ele) {
            $chtitle = $myts->makeTboxData4Show($sub_ele['title']);
            if ($chcount > 5) {
                $infercategories .= "...";
                break;
            }
            if ($space > 0) {
开发者ID:amjadtbssm,项目名称:website,代码行数:31,代码来源:viewcat.php

示例8: array

    echo "<table width=100% cellspacing=4 cellpadding=0 border=0 valign=top><tr>";
}
$subcats = $db->num_rows($result);
while (list($cid, $cname, $cdesc, $cimg) = $db->fetch_row($result)) {
    $cname = $myts->makeTboxData4Show($cname);
    $cdesc = $myts->makeTboxData4Show($cdesc);
    $cimg = $myts->makeTboxData4Show($cimg);
    $result2 = $db->query("select tid from " . $db->prefix(tutorials) . " where cid={$cid} and status=1 or status=3");
    $number = $db->num_rows($result2);
    if ($category_visdefault == 1) {
        $show = $category_visualize;
    } else {
        $show = $category_default;
    }
    $arr = array();
    $arr = $mytree->getFirstChild($cid, "cname");
    $space = 0;
    $chcount = 0;
    $subcat = "";
    foreach ($arr as $ele) {
        $chtitle = $myts->makeTboxData4Show($ele['cname']);
        if ($chcount > $maxsubcatshow) {
            $subcat .= "...";
            break;
        }
        if ($space > 0) {
            $subcat .= ", ";
        }
        $subcat .= "<a href=\"" . XOOPS_URL . "/modules/tutorials/listtutorials.php?cid=" . $ele['cid'] . "\">" . $chtitle . "</a>";
        $space++;
        $chcount++;
开发者ID:amjadtbssm,项目名称:website,代码行数:31,代码来源:listtutorials.php


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