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


PHP XoopsTree::getChildTreeArray方法代码示例

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


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

示例1: b_sitemap_oledrion

/**
 * oledrion
 *
 * @copyright   The XOOPS Project http://sourceforge.net/projects/xoops/
 * @license     http://www.fsf.org/copyleft/gpl.html GNU public license
 * @author      Hervé Thouzard (http://www.herve-thouzard.com/)
 * @version     $Id: oledrion.php 12290 2014-02-07 11:05:17Z beckmi $
 */
function b_sitemap_oledrion()
{
    require '../oledrion/header.php';
    global $sitemap_configs;
    $xoopsDB = XoopsDatabaseFactory::getDatabaseConnection();
    $table = $xoopsDB->prefix('oledrion_cat');
    $id_name = 'cat_cid';
    $pid_name = 'cat_pid';
    $title_name = 'cat_title';
    $url = 'category.php?cat_cid=';
    $order = 'cat_title';
    include_once XOOPS_ROOT_PATH . '/class/xoopstree.php';
    $mytree = new XoopsTree($table, $id_name, $pid_name);
    $xoopsDB = XoopsDatabaseFactory::getDatabaseConnection();
    $sitemap = array();
    $myts = MyTextSanitizer::getInstance();
    $i = 0;
    $sql = "SELECT `{$id_name}`,`{$title_name}` FROM `{$table}` WHERE `{$pid_name}`=0";
    if ($order != '') {
        $sql .= " ORDER BY `{$order}`";
    }
    $result = $xoopsDB->query($sql);
    while (list($catid, $name) = $xoopsDB->fetchRow($result)) {
        $sitemap['parent'][$i]['id'] = $catid;
        $sitemap['parent'][$i]['title'] = $myts->htmlSpecialChars($name);
        if (oledrion_utils::getModuleOption('urlrewriting') == 1) {
            // On utilise l'url rewriting
            $url = 'category' . '-' . intval($catid) . oledrion_utils::makeSeoUrl($name) . '.html';
        } else {
            // Pas d'utilisation de l'url rewriting
            $url = 'category.php?cat_cid=' . intval($catid);
        }
        $sitemap['parent'][$i]['url'] = $url;
        if (@$sitemap_configs["show_subcategoris"]) {
            $j = 0;
            $child_ary = $mytree->getChildTreeArray($catid, $order);
            foreach ($child_ary as $child) {
                $count = strlen($child['prefix']) + 1;
                $sitemap['parent'][$i]['child'][$j]['id'] = $child[$id_name];
                $sitemap['parent'][$i]['child'][$j]['title'] = $myts->htmlSpecialChars($child[$title_name]);
                $sitemap['parent'][$i]['child'][$j]['image'] = $count > 3 ? 4 : $count;
                if (oledrion_utils::getModuleOption('urlrewriting') == 1) {
                    // On utilise l'url rewriting
                    $url = 'category' . '-' . intval($child[$id_name]) . oledrion_utils::makeSeoUrl($child[$title_name]) . '.html';
                } else {
                    // Pas d'utilisation de l'url rewriting
                    $url = 'category.php?cat_cid=' . intval($child[$id_name]);
                }
                $sitemap['parent'][$i]['child'][$j]['url'] = $url;
                $j++;
            }
        }
        $i++;
    }
    return $sitemap;
}
开发者ID:osw17,项目名称:oledrion,代码行数:64,代码来源:oledrion.php

示例2: getChildTopicsTreeArray

 function getChildTopicsTreeArray()
 {
     $ret = array();
     $xt = new XoopsTree($this->table, "topic_id", "topic_pid");
     $topic_arr = $xt->getChildTreeArray($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

示例3: sprintf

}
echo "<h3 style='text-align:left;'>" . sprintf(_AM_H3_FMT_CATEGORIES, $xoopsModule->name()) . "</h3>\n";
if ($disp == "edit" && $cid > 0) {
    // Editing
    $sql = "SELECT cid,pid,title,imgurl FROM {$table_cat} WHERE cid='{$cid}'";
    $crs = $xoopsDB->query($sql);
    $cat_array = $xoopsDB->fetchArray($crs);
    display_edit_form($cat_array, _AM_CAT_MENU_EDIT, 'update');
} else {
    if ($disp == "new") {
        // New
        $cat_array = array('cid' => 0, 'pid' => $cid, 'title' => '', 'imgurl' => 'http://');
        display_edit_form($cat_array, _AM_CAT_MENU_NEW, 'insert');
    } else {
        // Listing
        $cat_tree_array = $cattree->getChildTreeArray(0, 'title');
        // Get ghost categories
        $live_cids = $cattree->getAllChildId(0);
        $whr_cid = "cid NOT IN (";
        foreach ($live_cids as $cid) {
            $whr_cid .= "{$cid},";
        }
        $whr_cid .= "0)";
        $rs = $xoopsDB->query("SELECT * FROM {$table_cat} WHERE {$whr_cid}");
        if ($xoopsDB->fetchArray($rs) != false) {
            $xoopsDB->queryF("UPDATE {$table_cat} SET pid='0' WHERE {$whr_cid}");
            redirect_header('index.php', 0, 'A Ghost Category found.');
            exit;
        }
        // Waiting Admission
        $ars = $xoopsDB->query("SELECT COUNT(*) FROM {$table_photos} WHERE status=0");
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:31,代码来源:index.php

示例4: nw_b_news_latestnews_edit

function nw_b_news_latestnews_edit($options) 
{
    global $xoopsDB;
    include_once NW_MODULE_PATH . '/include/functions.php';
    include_once NW_MODULE_PATH . '/class/class.newstopic.php';
    
    $tabletag1='<tr><td>';
    $tabletag2='</td><td>';

    $form = "<table border='0'>";
    $form .= $tabletag1._MB_NW_LATESTNEWS_DISPLAY.$tabletag2;
    $form .= "<input type='text' name='options[]' value='".$options[0]."' size='4'>&nbsp;"._MB_NW_LATESTNEWS."</td></tr>";
    $form .=  $tabletag1._MB_NW_LATESTNEWS_COLUMNS.$tabletag2;
    $form .= "<input type='text' name='options[]' value='".$options[1]."' size='4'>&nbsp;"._MB_NW_LATESTNEWS_COLUMN."</td></tr>";
    $form .=  $tabletag1._MB_NW_LATESTNEWS_TEXTLENGTH.$tabletag2;
    $form .= "<input type='text' name='options[]' value='".$options[2]."' size='4'>&nbsp;"._MB_NW_LATESTNEWS_LETTER."</td></tr>";
    $form .=  $tabletag1._MB_NW_LATESTNEWS_IMGWIDTH.$tabletag2;
    $form .= "<input type='text' name='options[]' value='".$options[3]."' size='4'>&nbsp;"._MB_NW_LATESTNEWS_PIXEL."</td></tr>";
    $form .=  $tabletag1._MB_NW_LATESTNEWS_IMGHEIGHT.$tabletag2;
    $form .= "<input type='text' name='options[]' value='".$options[4]."' size='4'>&nbsp;"._MB_NW_LATESTNEWS_PIXEL."</td></tr>";
    $form .=  $tabletag1._MB_NW_LATESTNEWS_BORDER.$tabletag2;
    $form .= "<input type='text' name='options[]' value='".$options[5]."' size='4'>&nbsp;"._MB_NW_LATESTNEWS_PIXEL."</td></tr>";
    $form .=  $tabletag1._MB_NW_LATESTNEWS_BORDERCOLOR.$tabletag2;
    $form .= "<input type='text' name='options[]' value='".$options[6]."' size='8'></td></tr>";
    $form .=  $tabletag1._MB_NW_LATESTNEWS_SELECTEDSTORIES.$tabletag2;
    $form .= "<input type='text' name='options[]' value='".$options[7]."' size='16'></td></tr>";
    $form .= $tabletag1._MB_NW_LATESTNEWS_IMGPOSITION.$tabletag2;
    $form .= nw_latestnews_mk_select($options,8);
    $form .= $tabletag1._MB_NW_LATESTNEWS_TOPICLINK.$tabletag2;
    $form .= nw_latestnews_mk_chkbox($options,9);
    $form .= $tabletag1._MB_NW_LATESTNEWS_ARCHIVELINK.$tabletag2;
    $form .= nw_latestnews_mk_chkbox($options,10);
    $form .= $tabletag1._MB_NW_LATESTNEWS_SUBMITLINK.$tabletag2;
    $form .= nw_latestnews_mk_chkbox($options,11);
    $form .= $tabletag1._MB_NW_LATESTNEWS_POSTEDBY.$tabletag2;
    $form .= nw_latestnews_mk_chkbox($options,12);
    $form .= $tabletag1._MB_NW_LATESTNEWS_POSTTIME.$tabletag2;
    $form .= nw_latestnews_mk_chkbox($options,13);
    $form .= $tabletag1._MB_NW_LATESTNEWS_TOPICIMAGE.$tabletag2;
    $form .= nw_latestnews_mk_chkbox($options,14);
    $form .= $tabletag1._MB_NW_LATESTNEWS_TOPICTITLE.$tabletag2;
    $form .= nw_latestnews_mk_chkbox($options,15);
    $form .= $tabletag1._MB_NW_LATESTNEWS_READ.$tabletag2;
    $form .= nw_latestnews_mk_chkbox($options,16);
    $form .= $tabletag1._MB_NW_LATESTNEWS_COMMENT.$tabletag2;
    $form .= nw_latestnews_mk_chkbox($options,17);
    $form .= $tabletag1._MB_NW_LATESTNEWS_PRINT.$tabletag2;
    $form .= nw_latestnews_mk_chkbox($options,18);
    $form .= $tabletag1._MB_NW_LATESTNEWS_PDF.$tabletag2;
    $form .= nw_latestnews_mk_chkbox($options,19);
    $form .= $tabletag1._MB_NW_LATESTNEWS_EMAIL.$tabletag2;
    $form .= nw_latestnews_mk_chkbox($options,20);
    $form .= $tabletag1._MB_NW_LATESTNEWS_MORELINK.$tabletag2;
    $form .= nw_latestnews_mk_chkbox($options,21);
    $form .= $tabletag1._MB_NW_LATESTNEWS_SCROLL.$tabletag2;
    $form .= nw_latestnews_mk_chkbox($options,22);
    $form .= $tabletag1._MB_NW_LATESTNEWS_SCROLLHEIGHT.$tabletag2;
    $form .= "<input type='text' name='options[]' value='".$options[23]."' size='4'></td></tr>";
    $form .= $tabletag1._MB_NW_LATESTNEWS_SCROLLSPEED.$tabletag2;
    $form .= "<input type='text' name='options[]' value='".$options[24]."' size='4'></td></tr>";

	//order
    $form .= $tabletag1._MB_NW_LATESTNEWS_ORDERBY.$tabletag2;
    $form .= "<select name='options[]'>";
    $form .= "<option value='published'";
    if ( $options[25] == 'published' ) {
        $form .= " selected='selected'";
    }
    $form .= '>'._MB_NW_LATESTNEWS_DATE."</option>\n";

    $form .= "<option value='counter'";
    if($options[25] == 'counter'){
        $form .= " selected='selected'";
    }
    $form .= '>'._MB_NW_LATESTNEWS_HITS.'</option>';
    $form .= "<option value='rating'";
    if ( $options[25] == 'rating' ) {
        $form .= " selected='selected'";
    }
    $form .= '>' . _MB_NW_LATESTNEWS_RATE . '</option>';
    $form .= "</select></td></tr>";
    //topics
    $form .= $tabletag1._MB_NW_LATESTNEWS_TOPICSDISPLAY.$tabletag2;
    $form .= "<select name='options[]' multiple='multiple'>";
    $topics_arr=array();
    $xt = new XoopsTree($xoopsDB->prefix('nw_topics'), 'topic_id', 'topic_pid');
    $topics_arr = $xt->getChildTreeArray(0,'topic_title');
    $size = count($options);
    foreach ($topics_arr as $onetopic) {
    	$sel = '';
		if($onetopic['topic_pid']!=0) {
			$onetopic['prefix'] = str_replace('.','-',$onetopic['prefix']) . '&nbsp;';
		} else {
			$onetopic['prefix'] = str_replace('.','',$onetopic['prefix']);
		}
        for ( $i = 26; $i < $size; $i++ ) {
            if ($options[$i] == $onetopic['topic_id']) {
                $sel = " selected='selected'";
            }
        }
//.........这里部分代码省略.........
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:101,代码来源:news_latestnews.php

示例5: XoopsTree

 function &getCommentTree()
 {
     $mytree = new XoopsTree($this->ctable, "comment_id", "pid");
     $ret = array();
     $tarray = $mytree->getChildTreeArray($this->getVar("comment_id"), "comment_id");
     foreach ($tarray as $ele) {
         $ret[] = new XoopsComments($this->ctable, $ele);
     }
     return $ret;
 }
开发者ID:amjadtbssm,项目名称:website,代码行数:10,代码来源:xoopscomments.php

示例6: getChildTreeArray

	function getChildTreeArray(){
		$ret = array();
		$xt = new XoopsTree($this->table, "id", "pid");
		$category_arr = $xt->getChildTreeArray($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

示例7: XoopsTree

$cattree = new XoopsTree($table_cat, "cid", "pid");
// Get variables
if (empty($_GET['target'])) {
    exit;
}
$num = empty($_GET['num']) ? 10 : intval($_GET['num']);
$cid = !isset($_GET['cid']) ? 0 : intval($_GET['cid']);
$xoopsTpl = new XoopsTpl();
$xoopsTpl->assign('lang_imgmanager', _IMGMANAGER);
$xoopsTpl->assign('sitename', $xoopsConfig['sitename']);
$target = htmlspecialchars($_GET['target'], ENT_QUOTES);
$xoopsTpl->assign('target', $target);
$xoopsTpl->assign('mod_url', $mod_url);
$xoopsTpl->assign('cid', $cid);
$xoopsTpl->assign('can_add', $global_perms & GPERM_INSERTABLE && $cid);
$cats = $cattree->getChildTreeArray(0, 'title');
$xoopsTpl->assign('makethumb', $myalbum_makethumb);
$xoopsTpl->assign('lang_imagesize', _ALBM_CAPTION_IMAGEXYT);
$xoopsTpl->assign('lang_align', _ALIGN);
$xoopsTpl->assign('lang_add', _ADD);
$xoopsTpl->assign('lang_close', _CLOSE);
$xoopsTpl->assign('lang_left', _LEFT);
$xoopsTpl->assign('lang_center', _CENTER);
$xoopsTpl->assign('lang_right', _RIGHT);
if (sizeof($cats) > 0) {
    $xoopsTpl->assign('lang_refresh', _ALBM_CAPTION_REFRESH);
    // WHERE clause for ext
    // $whr_ext = "ext IN ('" . implode( "','" , $myalbum_normal_exts ) . "')" ;
    $whr_ext = '1';
    $select_is_normal = "ext IN ('" . implode("','", $myalbum_normal_exts) . "')";
    // select box for category
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:imagemanager.php

示例8: array

	function xpress_get_categoires_map($blogs ,$disp_sub){
		global $sitemap_configs;
		
		$xoopsDB =& Database::getInstance();
		
		$sitemap = array();
		$myts =& MyTextSanitizer::getInstance();
		
		$blogs_count = count($blogs);
		$i = 0;
		$blog = array();
		for ($b_no = 0 ; $b_no < $blogs_count ; $b_no++){
			$blog = $blogs[$b_no];
			$terms = $blog['terms'];
			$term_taxonomy = $blog['term_taxonomy'];
			$blog_sub_url = $blog['blog_sub_url'];
			$cat_url = $blog['blog_sub_url'] . '?cat=';
			$blog_name = $blog['blog_name'];
			
			$sql  = "SELECT term_id , name FROM $terms";
			$result = $xoopsDB->query($sql);
			$cat_name = array();
			while (list($id, $name) = $xoopsDB->fetchRow($result)){
				$cat_name["'ID" . $id . "'"] = $name;
			}
			if ($blogs_count > 1){
					$sitemap['parent'][$i]['id'] = 0;
					$sitemap['parent'][$i]['title'] = $blog_name ;
					$sitemap['parent'][$i]['image'] = 1 ;
					$sitemap['parent'][$i]['url'] = $blog_sub_url;
					$blog_index = $i;
					$i++;
			}

			$mytree = new XoopsTree($term_taxonomy, 'term_id' , 'parent');
			$sql  = "SELECT term_id  FROM $term_taxonomy WHERE parent = 0 AND taxonomy = 'category'";
			$result = $xoopsDB->query($sql);
			while (list($catid) = $xoopsDB->fetchRow($result)){
				if ($blogs_count <= 1){
					$dipth = 1;
					$sitemap['parent'][$i]['id'] = $catid;
					$sitemap['parent'][$i]['title'] = $cat_name["'ID" . $catid . "'"] ; ;
					$sitemap['parent'][$i]['image'] = $dipth ;
					$sitemap['parent'][$i]['url'] = $cat_url.$catid;

					if($disp_sub){ 
						$j = 0;
						$child_ary = $mytree->getChildTreeArray($catid, '');
						foreach ($child_ary as $child)
						{
							$count = strlen($child['prefix']) + $dipth;
							$sitemap['parent'][$i]['child'][$j]['id'] = $child['term_id'];
							$sitemap['parent'][$i]['child'][$j]['title'] = $cat_name["'ID" .$child['term_id'] . "'"];
							$sitemap['parent'][$i]['child'][$j]['image'] = (($count > 3) ? 4 : $count);
							$sitemap['parent'][$i]['child'][$j]['url'] = $cat_url.$child['term_id'];
							$j++;
						}
					}
					$i++;
				} else {
					$dipth = 2;
					$sitemap['parent'][$blog_index]['child'][$i]['id'] = $catid;
					$sitemap['parent'][$blog_index]['child'][$i]['title'] = $cat_name["'ID" . $catid . "'"];
					$sitemap['parent'][$blog_index]['child'][$i]['image'] = $dipth;
					$sitemap['parent'][$blog_index]['child'][$i]['url'] = $cat_url.$catid;
					$i++;
					$parent_id = $blog_index;
					if($disp_sub){ 
						$child_ary = $mytree->getChildTreeArray($catid, '');
						foreach ($child_ary as $child)
						{
							$count = strlen($child['prefix']) + $dipth; 
							$sitemap['parent'][$blog_index]['child'][$i]['id'] = $child['term_id'];
							$sitemap['parent'][$blog_index]['child'][$i]['title'] = $cat_name["'ID" .$child['term_id'] . "'"];
							$sitemap['parent'][$blog_index]['child'][$i]['image'] = (($count > 3) ? 4 : $count);
							$sitemap['parent'][$blog_index]['child'][$i]['url'] = $cat_url.$child['term_id'];
							$i++;
						}
					}
				}
			$i++;
			}
		}
		return $sitemap;
	}
开发者ID:nunoluciano,项目名称:uxcl,代码行数:85,代码来源:sitemap.plugin.php

示例9: Dummy

         var $weight = 0;
         var $ismenuitem = 0;
         var $udtstamp = 0;
     }
     $cat = new Dummy();
     $cat->pid = $cid;
     $cat->udtstamp = time();
     display_edit_form($cat, _AM_MENU_CAT_NEW, 'insert');
 } else {
     echo "<h4>" . _AM_MENU_CATEGORIES . "</h4>\n";
     if (!empty($_GET['mes'])) {
         echo "<p><font color='blue'>" . htmlspecialchars($_GET['mes'], ENT_QUOTES) . "</font></p>";
     }
     echo "<p><a href='?disp=new&cid=0'>" . _AM_MB_MAKETOPCAT . "<img src='../images/cat_add.gif' width='18' height='15' alt='' /></a></p>\n";
     // カテゴリーデータ取得
     $cat_tree_array = $cattree->getChildTreeArray(0, 'weight ASC,cat_title');
     // TH Part
     echo "\n\t<form name='MainForm' action='' method='post' style='margin:10px;'>\n\t" . $xoopsGTicket->getTicketHtml(__LINE__) . "\n\t<input type='hidden' name='delcat' value='' />\n\t<table width='75%' class='outer' cellpadding='4' cellspacing='1'>\n\t  <tr valign='middle'>\n\t    <th>" . _AM_CAT_TH_TITLE . "</th>\n\t    <th>" . _AM_CAT_TH_OPERATION . "</th>\n\t    <th>" . _AM_CAT_TH_ENABLED . "</th>\n\t    <th>" . _AM_CAT_TH_WEIGHT . "</th>\n\t  </tr>\n\t";
     // リスト出力部
     $oddeven = 'odd';
     foreach ($cat_tree_array as $cat_node) {
         $oddeven = $oddeven == 'odd' ? 'even' : 'odd';
         extract($cat_node);
         $prefix = str_replace('.', '&nbsp;--', substr($prefix, 1));
         $enable_checked = $enabled ? "checked='checked'" : "";
         $cid = intval($cid);
         $cat_title = $myts->makeTBoxData4Show($cat_title);
         $del_confirm = 'confirm("' . sprintf(_AM_FMT_CATDELCONFIRM, $cat_title) . '")';
         echo "\n\t  <tr>\n\t    <td class='{$oddeven}' width='100%'><a href='?disp=edit&amp;cid={$cid}'>{$prefix}&nbsp;{$cat_title}</a></td>\n\t    <td class='{$oddeven}' align='center' nowrap='nowrap'>\n\t      <a href='{$mod_url}/index.php?action=Edit&amp;cid={$cid}' target='_blank'><img src='{$cal->images_url}/addevent.gif' border='0' width='14' height='12' /></a>\n\t      &nbsp;\n\t      <a href='?disp=edit&amp;cid={$cid}'><img src='../images/cat_edit.gif' width='18' height='15' alt='" . _AM_MENU_CAT_EDIT . "' title='" . _AM_MENU_CAT_EDIT . "' /></a>\n\t      &nbsp;\n\t      <a href='?disp=new&amp;cid={$cid}'><img src='../images/cat_add.gif' width='18' height='15' alt='" . _AM_MENU_CAT_NEW . "' title='" . _AM_MENU_CAT_NEW . "' /></a>\n\t      &nbsp;\n\t      <input type='button' value='" . _DELETE . "'  onclick='if({$del_confirm}){document.MainForm.delcat.value=\"{$cid}\"; submit();}' />\n\t    </td>\n\t    <td class='{$oddeven}' align='center'><input type='checkbox' name='enabled[{$cid}]' value='1' {$enable_checked} /></td>\n\t    <td class='{$oddeven}' align='right'><input type='text' name='weights[{$cid}]' size='4' maxlength='6' value='{$weight}' /></td>\n\t  </tr>\n";
     }
     // テーブルフッタ部
开发者ID:BackupTheBerlios,项目名称:peakxoops-svn,代码行数:31,代码来源:categories.php

示例10: topicsmanager

function topicsmanager()
{
    global $xoopsDB, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $myts;
    include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
    xoops_cp_header();
    adminmenu(0);
    $uploadfolder = sprintf(_AM_UPLOAD_WARNING, XOOPS_URL . "/modules/" . $xoopsModule->dirname() . '/images/topics');
    $uploadirectory = "/modules/" . $xoopsModule->dirname() . '/images/topics';
    $start = isset($_GET['start']) ? intval($_GET['start']) : 0;
    $xt = new XoopsTree($xoopsDB->prefix("topics"), "topic_id", "topic_pid");
    $topics_arr = $xt->getChildTreeArray(0, "topic_title");
    $totaltopics = count($topics_arr);
    $class = '';
    echo "<h4>" . _AM_CONFIG . "</h4>";
    news_collapsableBar('topicsmanager', 'toptopicsmanager');
    echo "<img onclick='toggle('toptable'); toggleIcon('toptableicon');' id='toptopicsmanager' name='toptopicsmanager' src=" . XOOPS_URL . "/modules/news/images/close12.gif alt='' /></a>&nbsp;" . _AM_TOPICSMNGR . ' (' . $totaltopics . ')' . "</h4>";
    echo "<div id='topicsmanager'>";
    echo "<br />";
    echo "<div style='text-align: center;'>";
    echo "<table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'><tr class='bg3'><td align='center'>" . _AM_TOPIC . "</td><td align='left'>" . _AM_TOPICNAME . "</td><td align='center'>" . _AM_PARENTTOPIC . "</td><td align='center'>" . _AM_SUB_MENU_YESNO . "</td><td align='center'>" . _AM_ACTION . "</td></tr>";
    if (is_array($topics_arr) && $totaltopics) {
        $cpt = 1;
        $tmpcpt = $start;
        $ok = true;
        $output = '';
        while ($ok) {
            if ($tmpcpt < $totaltopics) {
                $linkedit = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/admin/index.php?op=topicsmanager&amp;topic_id=' . $topics_arr[$tmpcpt]['topic_id'];
                $linkdelete = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/admin/index.php?op=delTopic&amp;topic_id=' . $topics_arr[$tmpcpt]['topic_id'];
                $action = sprintf("<a href='%s'>%s</a> - <a href='%s'>%s</a>", $linkedit, _AM_EDIT, $linkdelete, _AM_DELETE);
                $parent = '&nbsp;';
                if ($topics_arr[$tmpcpt]['topic_pid'] > 0) {
                    $xttmp = new XoopsTopic($xoopsDB->prefix("topics"), $topics_arr[$tmpcpt]['topic_pid']);
                    $parent = $xttmp->topic_title();
                    unset($xttmp);
                }
                if ($topics_arr[$tmpcpt]['topic_pid'] != 0) {
                    $topics_arr[$tmpcpt]['prefix'] = str_replace(".", "-", $topics_arr[$tmpcpt]['prefix']) . '&nbsp;';
                } else {
                    $topics_arr[$tmpcpt]['prefix'] = str_replace(".", "", $topics_arr[$tmpcpt]['prefix']);
                }
                $submenu = $topics_arr[$tmpcpt]['menu'] ? _YES : _NO;
                $class = $class == 'even' ? 'odd' : 'even';
                $output = $output . "<tr class='" . $class . "'><td>" . $topics_arr[$tmpcpt]['topic_id'] . "</td><td align='left'>" . $topics_arr[$tmpcpt]['prefix'] . $myts->displayTarea($topics_arr[$tmpcpt]['topic_title']) . "</td><td align='left'>" . $parent . "</td><td>" . $submenu . "</td><td>" . $action . "</td></tr>";
            } else {
                $ok = false;
            }
            if ($cpt >= $xoopsModuleConfig['storycountadmin']) {
                $ok = false;
            }
            $tmpcpt++;
            $cpt++;
        }
        echo $output;
    }
    $pagenav = new XoopsPageNav($totaltopics, $xoopsModuleConfig['storycountadmin'], $start, 'start', 'op=topicsmanager');
    echo "</table><div align='right'>" . $pagenav->renderNav() . '</div><br />';
    echo "</div></div><br />\n";
    $topic_id = isset($_GET['topic_id']) ? intval($_GET['topic_id']) : 0;
    if ($topic_id > 0) {
        $xtmod = new NewsTopic($topic_id);
        $topic_title = $xtmod->topic_title('E');
        $topic_description = $xtmod->topic_description('E');
        $topic_rssfeed = $xtmod->topic_rssurl('E');
        $op = 'modTopicS';
        if (xoops_trim($xtmod->topic_imgurl()) != '') {
            $topicimage = $xtmod->topic_imgurl();
        } else {
            $topicimage = "blank.png";
        }
        $btnlabel = _AM_MODIFY;
        $parent = $xtmod->topic_pid();
        $formlabel = _AM_MODIFYTOPIC;
        $submenu = $xtmod->menu();
        $topic_frontpage = $xtmod->topic_frontpage();
        $topic_color = $xtmod->topic_color();
        unset($xtmod);
    } else {
        $topic_title = '';
        $topic_frontpage = 1;
        $topic_description = '';
        $op = 'addTopic';
        $topicimage = 'xoops.gif';
        $btnlabel = _AM_ADD;
        $parent = -1;
        $submenu = 0;
        $topic_rssfeed = '';
        $formlabel = _AM_ADD_TOPIC;
        $topic_color = '000000';
    }
    $sform = new XoopsThemeForm($formlabel, "topicform", XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/index.php', 'post');
    $sform->setExtra('enctype="multipart/form-data"');
    $sform->addElement(new XoopsFormText(_AM_TOPICNAME, 'topic_title', 50, 255, $topic_title), true);
    $editor = news_getWysiwygForm(_AM_TOPIC_DESCR, 'topic_description', $topic_description, 15, 60, 'hometext_hidden');
    if ($editor) {
        $sform->addElement($editor, false);
    }
    $sform->addElement(new XoopsFormHidden('op', $op), false);
    $sform->addElement(new XoopsFormHidden('topic_id', $topic_id), false);
    include_once XOOPS_ROOT_PATH . "/modules/news/class/class.newstopic.php";
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:101,代码来源:index.php

示例11: current

 if (count($_GROUPS) == 1) {
     $sql .= " AND grp_access = '" . current($_GROUPS) . "' ";
 } else {
     $sql .= " AND grp_access IN (" . implode(',', array_values($_GROUPS)) . ") ";
 }
 $sql .= "ORDER BY cid";
 $query = DB_query($sql);
 while (list($cid, $title, $directUploadGroup) = DB_fetchArray($query)) {
     $categorySelectHTML .= '<option value="' . $cid . '">';
     if (!SEC_inGroup($directUploadGroup)) {
         $categorySelectHTML .= "{$title} *";
     } else {
         $categorySelectHTML .= "{$title}";
     }
     $categorySelectHTML .= "</option>\n";
     $arr = $mytree->getChildTreeArray($cid);
     foreach ($arr as $option) {
         $option['prefix'] = str_replace(".", "--", $option['prefix']);
         $catpath = $option['prefix'] . "&nbsp;" . $myts->makeTboxData4Show($option[2]);
         $categorySelectHTML .= '<option value="' . $option[$mytree->id] . '">';
         if (!SEC_inGroup($option[5])) {
             $categorySelectHTML .= "{$catpath} *";
         } else {
             $categorySelectHTML .= "{$catpath}";
         }
         $categorySelectHTML .= "</option>\n";
     }
 }
 $T->set_var(array('lang_submitnotice' => _MD_SUBMITONCE, 'lang_allpending' => _MD_ALLPENDING, 'lang_dontabuse' => _MD_DONTABUSE, 'lang_takedays' => _MD_TAKEDAYS, 'lang_required' => _MD_REQUIRED, 'lang_filetitle' => _MD_FILETITLE, 'lang_filename' => _MD_DLFILENAME, 'lang_category' => _MD_CATEGORY, 'lang_approve' => _MD_APPROVEREQ, 'lang_homepage' => _MD_HOMEPAGEC, 'lang_version' => _MD_VERSIONC, 'lang_desc' => _MD_DESCRIPTIONC, 'lang_screenshot' => _MD_SHOTIMAGE, 'lang_commentoption' => _MD_COMMENTOPTION, 'lang_no' => _MD_NO, 'lang_yes' => _MD_YES, 'lang_submit' => _MD_SUBMIT, 'lang_cancel' => _MD_CANCEL, 'token_name' => CSRF_TOKEN, 'security_token' => SEC_createToken(), 'cat_select_options' => $categorySelectHTML, 'uid' => $uid));
 $display .= FM_siteHeader();
 $display .= COM_startBlock("<b>" . _MD_UPLOADTITLE . "</b>");
开发者ID:spacequad,项目名称:glfusion,代码行数:31,代码来源:submit.php

示例12: XoopsTpl

}
// Display
$photo_for_tpl = myalbum_get_array_for_photo_assign($photo);
$tpl = new XoopsTpl();
include 'include/assign_globals.php';
$tpl->assign($myalbum_assign_globals);
$tpl->assign('photo', $photo_for_tpl);
echo "<table class='outer' style='width:100%;'>";
$tpl->display("db:{$mydirname}_photo_in_list.html");
echo "</table>\n";
// Show the form
$form = new XoopsThemeForm(_ALBM_PHOTOEDITUPLOAD, "uploadphoto", "editphoto.php?lid={$lid}");
$form->setExtra("enctype='multipart/form-data'");
$title_text = new XoopsFormText(_ALBM_PHOTOTITLE, "title", 50, 255, $myts->makeTboxData4Edit($photo['title']));
$cat_select = new XoopsFormSelect('', "cid", $photo['cid']);
$tree = $cattree->getChildTreeArray(0, "title");
foreach ($tree as $leaf) {
    $leaf['prefix'] = substr($leaf['prefix'], 0, -1);
    $leaf['prefix'] = str_replace(".", "--", $leaf['prefix']);
    $cat_select->addOption($leaf['cid'], $leaf['prefix'] . $leaf['title']);
}
$cat_link = new XoopsFormLabel("<a href='javascript:location.href=\"viewcat.php?cid=\"+document.uploadphoto.cid.value;'>" . _GO . "</a>");
$cat_tray = new XoopsFormElementTray(_ALBM_PHOTOCAT, '&nbsp;');
$cat_tray->addElement($cat_select);
$cat_tray->addElement($cat_link);
$desc_tarea = new XoopsFormDhtmlTextArea(_ALBM_PHOTODESC, "desc_text", $myts->makeTareaData4Edit($photo['description']), 10, 50);
$file_form = new XoopsFormFile(_ALBM_SELECTFILE, "photofile", $myalbum_fsize);
$file_form->setExtra("size='70'");
if ($myalbum_canrotate) {
    $rotate_radio = new XoopsFormRadio(_ALBM_RADIO_ROTATETITLE, 'rotate', 'rot0');
    $rotate_radio->addOption('rot0', _ALBM_RADIO_ROTATE0 . " &nbsp; ");
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:31,代码来源:editphoto.php

示例13: sitemap_get_categoires_map

function sitemap_get_categoires_map($table, $id_name, $pid_name, $title_name, $url, $order = "")
{
    global $sitemap_configs;
    $mytree = new XoopsTree($table, $id_name, $pid_name);
    $xoopsDB =& Database::getInstance();
    $sitemap = array();
    $myts =& MyTextSanitizer::getInstance();
    $i = 0;
    $sql = "SELECT `{$id_name}`,`{$title_name}` FROM `{$table}` WHERE `{$pid_name}`=0";
    if ($order != '') {
        $sql .= " ORDER BY `{$order}`";
    }
    $result = $xoopsDB->query($sql);
    while (list($catid, $name) = $xoopsDB->fetchRow($result)) {
        // 親の出力
        $sitemap['parent'][$i]['id'] = $catid;
        $sitemap['parent'][$i]['title'] = $myts->makeTboxData4Show($name);
        $sitemap['parent'][$i]['url'] = $url . $catid;
        if ($sitemap_configs['XMLsublastmodval'] == "Date/Time") {
            $sitemap['parent'][$i]['lastmod'] = gmdate('Y-m-d\\TH:i:s\\Z');
        } elseif ($sitemap_configs['XMLsublastmodval'] == "Date Only") {
            $sitemap['parent'][$i]['lastmod'] = gmdate('Y-m-d');
        } else {
            $sitemap['parent'][$i]['lastmod'] = '';
        }
        if ($sitemap_configs['XMLsubchangefreq'] != "OFF") {
            $sitemap['parent'][$i]['changefreq'] = $sitemap_configs['XMLsubchangefreq'];
        } else {
            $sitemap['parent'][$i]['changefreq'] = '';
        }
        if ($sitemap_configs['XMLsubpriorityvalue'] != "OFF") {
            $sitemap['parent'][$i]['priority'] = $sitemap_configs['XMLsubpriorityvalue'];
        } else {
            $sitemap['parent'][$i]['priority'] = '';
        }
        // 子の出力
        if (@$sitemap_configs["show_subcategoris"]) {
            // サブカテ表示のときのみ実行 by Ryuji
            $j = 0;
            $child_ary = $mytree->getChildTreeArray($catid, $order);
            foreach ($child_ary as $child) {
                $count = strlen($child['prefix']) + 1;
                // MEMO prefixの長さでサブカテの深さを判定してる
                $sitemap['parent'][$i]['child'][$j]['id'] = $child[$id_name];
                $sitemap['parent'][$i]['child'][$j]['title'] = $myts->makeTboxData4Show($child[$title_name]);
                $sitemap['parent'][$i]['child'][$j]['image'] = $count > 3 ? 4 : $count;
                $sitemap['parent'][$i]['child'][$j]['url'] = $url . $child[$id_name];
                if ($sitemap_configs['XMLsublastmodval'] == "Date/Time") {
                    $sitemap['parent'][$i]['child'][$j]['lastmod'] = gmdate('Y-m-d\\TH:i:s\\Z');
                } elseif ($sitemap_configs['XMLsublastmodval'] == "Date Only") {
                    $sitemap['parent'][$i]['child'][$j]['lastmod'] = gmdate('Y-m-d');
                } else {
                    $sitemap['parent'][$i]['child'][$j]['lastmod'] = '';
                }
                if ($sitemap_configs['XMLsubchangefreq'] != "OFF") {
                    $sitemap['parent'][$i]['child'][$j]['changefreq'] = $sitemap_configs['XMLsubchangefreq'];
                } else {
                    $sitemap['parent'][$i]['child'][$j]['changefreq'] = '';
                }
                if ($sitemap_configs['XMLsubpriorityvalue'] != "OFF") {
                    $sitemap['parent'][$i]['child'][$j]['priority'] = $sitemap_configs['XMLsubpriorityvalue'];
                } else {
                    $sitemap['parent'][$i]['child'][$j]['priority'] = '';
                }
                $j++;
            }
        }
        $i++;
    }
    return $sitemap;
}
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:71,代码来源:sitemap.php

示例14: getCommentTree

 /**
  * Get Comments Tree
  *
  * @return unknown
  */
 public function getCommentTree()
 {
     $mytree = new XoopsTree($this->ctable, 'comment_id', 'pid');
     $ret = array();
     $tarray = $mytree->getChildTreeArray($this->getVar('comment_id'), 'comment_id');
     foreach ($tarray as $ele) {
         $ret[] = new XoopsComments($this->ctable, $ele);
     }
     return $ret;
 }
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:15,代码来源:xoopscomments.php

示例15: XoopsTree

		$ams_articles	= $xoopsDB->prefix('ams_article');
		$ams_text		= $xoopsDB->prefix('ams_text');
		$ams_files		= $xoopsDB->prefix('ams_files');
		$ams_links		= $xoopsDB->prefix('ams_link');
		$ams_rating		= $xoopsDB->prefix('ams_rating');
		// Retreive News tables names
		$news_stories_votedata = $xoopsDB->prefix('nw_stories_votedata');
		// Misc
		$comment_handler =& xoops_gethandler('comment');
		$notification_handler =& xoops_gethandler('notification');
		$ams_news_topics=array();	// Key => AMS Id,  Value => News ID

        // The import by itself
        // Read topics by their order
        $mytree = new XoopsTree($ams_topics,'topic_id','topic_pid');
        $ams_topics = $mytree->getChildTreeArray(0,'weight');
		foreach($ams_topics as $one_amstopic) {
			// First we create the topic
			$topicpid=0;
			if($one_amstopic['topic_pid']!=0) { // Search for its the parent
				if(array_key_exists($one_amstopic['topic_pid'],$ams_news_topics)) {
					$topicpid=$ams_news_topics[$one_amstopic['topic_pid']];
				}
			}
			$news_topic = new nw_NewsTopic();
			$news_topic->setTopicPid($topicpid);
			$news_topic->setTopicTitle($one_amstopic['topic_title']);
			$news_topic->setTopicImgurl($one_amstopic['topic_imgurl']);
			$news_topic->setMenu(0);
			$news_topic->setTopicFrontpage(1);
			$news_topic->Settopic_rssurl('');
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:amsimport.php


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