/** * 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; }
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; }
} 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");
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'> "._MB_NW_LATESTNEWS."</td></tr>"; $form .= $tabletag1._MB_NW_LATESTNEWS_COLUMNS.$tabletag2; $form .= "<input type='text' name='options[]' value='".$options[1]."' size='4'> "._MB_NW_LATESTNEWS_COLUMN."</td></tr>"; $form .= $tabletag1._MB_NW_LATESTNEWS_TEXTLENGTH.$tabletag2; $form .= "<input type='text' name='options[]' value='".$options[2]."' size='4'> "._MB_NW_LATESTNEWS_LETTER."</td></tr>"; $form .= $tabletag1._MB_NW_LATESTNEWS_IMGWIDTH.$tabletag2; $form .= "<input type='text' name='options[]' value='".$options[3]."' size='4'> "._MB_NW_LATESTNEWS_PIXEL."</td></tr>"; $form .= $tabletag1._MB_NW_LATESTNEWS_IMGHEIGHT.$tabletag2; $form .= "<input type='text' name='options[]' value='".$options[4]."' size='4'> "._MB_NW_LATESTNEWS_PIXEL."</td></tr>"; $form .= $tabletag1._MB_NW_LATESTNEWS_BORDER.$tabletag2; $form .= "<input type='text' name='options[]' value='".$options[5]."' size='4'> "._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']) . ' '; } else { $onetopic['prefix'] = str_replace('.','',$onetopic['prefix']); } for ( $i = 26; $i < $size; $i++ ) { if ($options[$i] == $onetopic['topic_id']) { $sel = " selected='selected'"; } } $form .= "<option value='".$onetopic['topic_id']."'$sel>".$onetopic['prefix'].$onetopic['topic_title'].'</option>'; } $form .= '</select></td></tr>'; $form .= "</table>"; return $form; }
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; }
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; }
$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
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; }
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('.', ' --', 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&cid={$cid}'>{$prefix} {$cat_title}</a></td>\n\t <td class='{$oddeven}' align='center' nowrap='nowrap'>\n\t <a href='{$mod_url}/index.php?action=Edit&cid={$cid}' target='_blank'><img src='{$cal->images_url}/addevent.gif' border='0' width='14' height='12' /></a>\n\t \n\t <a href='?disp=edit&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 \n\t <a href='?disp=new&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 \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"; } // テーブルフッタ部
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> " . _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&topic_id=' . $topics_arr[$tmpcpt]['topic_id']; $linkdelete = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/admin/index.php?op=delTopic&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 = ' '; 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']) . ' '; } 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"; $xt = new NewsTopic(); $sform->addElement(new XoopsFormLabel(_AM_PARENTTOPIC, $xt->MakeMyTopicSelBox(1, $parent, 'topic_pid', '', false))); // Topic's color // Code stolen to Zoullou, thank you Zoullou ;-) $select_color = "\n<select name='topic_color' onchange='xoopsGetElementById(\"NewsColorSelect\").style.backgroundColor = \"#\" + this.options[this.selectedIndex].value;'>\n<option value='000000'>" . _AM_NEWS_COLOR . "</option>\n"; $color_values = array('000000', '000033', '000066', '000099', '0000CC', '0000FF', '003300', '003333', '003366', '0033CC', '0033FF', '006600', '006633', '006666', '006699', '0066CC', '0066FF', '009900', '009933', '009966', '009999', '0099CC', '0099FF', '00CC00', '00CC33', '00CC66', '00CC99', '00CCCC', '00CCFF', '00FF00', '00FF33', '00FF66', '00FF99', '00FFCC', '00FFFF', '330000', '330033', '330066', '330099', '3300CC', '3300FF', '333300', '333333', '333366', '333399', '3333CC', '3333FF', '336600', '336633', '336666', '336699', '3366CC', '3366FF', '339900', '339933', '339966', '339999', '3399CC', '3399FF', '33CC00', '33CC33', '33CC66', '33CC99', '33CCCC', '33CCFF', '33FF00', '33FF33', '33FF66', '33FF99', '33FFCC', '33FFFF', '660000', '660033', '660066', '660099', '6600CC', '6600FF', '663300', '663333', '663366', '663399', '6633CC', '6633FF', '666600', '666633', '666666', '666699', '6666CC', '6666FF', '669900', '669933', '669966', '669999', '6699CC', '6699FF', '66CC00', '66CC33', '66CC66', '66CC99', '66CCCC', '66CCFF', '66FF00', '66FF33', '66FF66', '66FF99', '66FFCC', '66FFFF', '990000', '990033', '990066', '990099', '9900CC', '9900FF', '993300', '993333', '993366', '993399', '9933CC', '9933FF', '996600', '996633', '996666', '996699', '9966CC', '9966FF', '999900', '999933', '999966', '999999', '9999CC', '9999FF', '99CC00', '99CC33', '99CC66', '99CC99', '99CCCC', '99CCFF', '99FF00', '99FF33', '99FF66', '99FF99', '99FFCC', '99FFFF', 'CC0000', 'CC0033', 'CC0066', 'CC0099', 'CC00CC', 'CC00FF', 'CC3300', 'CC3333', 'CC3366', 'CC3399', 'CC33CC', 'CC33FF', 'CC6600', 'CC6633', 'CC6666', 'CC6699', 'CC66CC', 'CC66FF', 'CC9900', 'CC9933', 'CC9966', 'CC9999', 'CC99CC', 'CC99FF', 'CCCC00', 'CCCC33', 'CCCC66', 'CCCC99', 'CCCCCC', 'CCCCFF', 'CCFF00', 'CCFF33', 'CCFF66', 'CCFF99', 'CCFFCC', 'CCFFFF', 'FF0000', 'FF0033', 'FF0066', 'FF0099', 'FF00CC', 'FF00FF', 'FF3300', 'FF3333', 'FF3366', 'FF3399', 'FF33CC', 'FF33FF', 'FF6600', 'FF6633', 'FF6666', 'FF6699', 'FF66CC', 'FF66FF', 'FF9900', 'FF9933', 'FF9966', 'FF9999', 'FF99CC', 'FF99FF', 'FFCC00', 'FFCC33', 'FFCC66', 'FFCC99', 'FFCCCC', 'FFCCFF', 'FFFF00', 'FFFF33', 'FFFF66', 'FFFF99', 'FFFFCC', 'FFFFFF'); foreach ($color_values as $color_value) { if ($topic_color == $color_value) { $selected = " selected='selected'"; } else { $selected = ""; } $select_color .= "<option" . $selected . " value='" . $color_value . "' style='background-color:#" . $color_value . ";color:#" . $color_value . ";'>#" . $color_value . "</option>\n"; } $select_color .= "</select> \n<span id='NewsColorSelect'> </span>"; $sform->addElement(new XoopsFormLabel(_AM_NEWS_TOPIC_COLOR, $select_color)); // Sub menu ? $sform->addElement(new XoopsFormRadioYN(_AM_SUB_MENU, 'submenu', $submenu, _YES, _NO)); $sform->addElement(new XoopsFormRadioYN(_AM_PUBLISH_FRONTPAGE, 'topic_frontpage', $topic_frontpage, _YES, _NO)); // Unused for this moment... sorry //$sform->addElement(new XoopsFormText(_AM_NEWS_RSS_URL, 'topic_rssfeed', 50, 255, $topic_rssfeed), false); // ********** Picture $imgtray = new XoopsFormElementTray(_AM_TOPICIMG, '<br />'); $imgpath = sprintf(_AM_IMGNAEXLOC, "modules/" . $xoopsModule->dirname() . "/images/topics/"); $imageselect = new XoopsFormSelect($imgpath, 'topic_imgurl', $topicimage); $topics_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/modules/news/images/topics/"); foreach ($topics_array as $image) { $imageselect->addOption("{$image}", $image); } $imageselect->setExtra("onchange='showImgSelected(\"image3\", \"topic_imgurl\", \"" . $uploadirectory . "\", \"\", \"" . XOOPS_URL . "\")'"); $imgtray->addElement($imageselect, false); $imgtray->addElement(new XoopsFormLabel('', "<br /><img src='" . XOOPS_URL . "/" . $uploadirectory . "/" . $topicimage . "' name='image3' id='image3' alt='' />")); $uploadfolder = sprintf(_AM_UPLOAD_WARNING, XOOPS_URL . "/modules/" . $xoopsModule->dirname() . '/images/topics'); $fileseltray = new XoopsFormElementTray('', '<br />'); $fileseltray->addElement(new XoopsFormFile(_AM_TOPIC_PICTURE, 'attachedfile', $xoopsModuleConfig['maxuploadsize']), false); $fileseltray->addElement(new XoopsFormLabel($uploadfolder), false); $imgtray->addElement($fileseltray); $sform->addElement($imgtray); // Submit buttons $button_tray = new XoopsFormElementTray('', ''); $submit_btn = new XoopsFormButton('', 'post', $btnlabel, 'submit'); $button_tray->addElement($submit_btn); $sform->addElement($button_tray); $sform->display(); echo "<script type='text/javascript'>\n"; echo 'xoopsGetElementById("NewsColorSelect").style.backgroundColor = "#' . $topic_color . '";'; echo "</script>\n"; }
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'] . " " . $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>");
} // 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, ' '); $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 . " ");
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; }
/** * 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; }
$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('');
if ($filecount <= 1) { echo "<p>{$dir4edit} : " . _MD_A_GNAV_MES_BATCHNONE . "</p>"; } else { printf("<p>" . _MD_A_GNAV_MES_BATCHDONE . "</p>", $filecount - 1); } $result_str = ob_get_contents(); ob_end_clean(); } // Make form objects $form = new XoopsThemeForm(_MD_A_GNAV_PHOTOBATCHUPLOAD, "batchupload", "index.php?page=batch"); $title_text = new XoopsFormText("", "title", 50, 255, $title4edit); $title_tray = new XoopsFormElementTray(_MD_A_GNAVI_TH_TITLE, '<br /><br />'); $title_tray->addElement($title_text); $title_tray->addElement(new XoopsFormLabel("", _MD_A_GNAV_BATCHBLANK)); $cat = new XoopsFormSelect(_MD_A_GNAVI_TH_CATEGORIES, "cid", $cid); $tree = $cattree->getChildTreeArray(0, 'weight,title'); foreach ($tree as $leaf) { $leaf['prefix'] = substr($leaf['prefix'], 0, -1); $leaf['prefix'] = str_replace(".", "--", $leaf['prefix']); $cat->addOption($leaf['cid'], $leaf['prefix'] . $leaf['title']); } $submitter_select = new XoopsFormSelectUser(_MD_A_GNAVI_TH_SUBMITTER, 'submitter', false, $submitter); $date_text = new XoopsFormText(_MD_A_GNAVI_TH_DATE, 'post_date', 20, 20, formatTimestamp(time(), _MD_GNAV_DTFMT_YMDHI)); $dir_tray = new XoopsFormElementTray(_MD_A_GNAV_TEXT_DIRECTORY, '<br /><br />'); $dir_text = new XoopsFormText(_MD_A_GNAV_PHOTOPATH, "dir", 50, 255, $dir4edit); $dir_tray->addElement($dir_text); $dir_tray->addElement(new XoopsFormLabel(_MD_A_GNAV_DESC_PHOTOPATH)); $desc_tarea = new XoopsFormDhtmlTextarea(_MD_A_GNAVI_TH_DESCRIPTION, 'desc', $desc4edit, 10, 50); $submit_button = new XoopsFormButton('', "submit", _SUBMIT, 'submit'); // Render forms xoops_cp_header();
/** * Function used to edit the block */ function b_news_top_edit($options) { global $xoopsDB; $tmpstory = new NewsStory(); $form = _MB_NEWS_ORDER . " <select name='options[]'>"; $form .= "<option value='published'"; if ($options[0] == 'published') { $form .= " selected='selected'"; } $form .= '>' . _MB_NEWS_DATE . "</option>\n"; $form .= "<option value='counter'"; if ($options[0] == 'counter') { $form .= " selected='selected'"; } $form .= '>' . _MB_NEWS_HITS . '</option>'; $form .= "<option value='rating'"; if ($options[0] == 'rating') { $form .= " selected='selected'"; } $form .= '>' . _MB_NEWS_RATE . '</option>'; $form .= "</select>\n"; $form .= ' ' . _MB_NEWS_DISP . " <input type='text' name='options[]' value='" . $options[1] . "'/> " . _MB_NEWS_ARTCLS; $form .= " <br /><br />" . _MB_NEWS_CHARS . " <input type='text' name='options[]' value='" . $options[2] . "'/> " . _MB_NEWS_LENGTH . '<br /><br />'; $form .= _MB_NEWS_TEASER . " <input type='text' name='options[]' value='" . $options[3] . "' />" . _MB_NEWS_LENGTH; $form .= '<br /><br />'; $form .= _MB_NEWS_SPOTLIGHT . " <input type='radio' name='options[]' value='1'"; if ($options[4] == 1) { $form .= " checked='checked'"; } $form .= ' />' . _YES; $form .= "<input type='radio' name='options[]' value='0'"; if ($options[4] == 0) { $form .= " checked='checked'"; } $form .= ' />' . _NO . '<br /><br />'; $form .= _MB_NEWS_WHAT_PUBLISH . " <select name='options[]'><option value='1'"; if ($options[5] == 1) { $form .= ' selected'; } $form .= ' />' . _MB_NEWS_RECENT_NEWS; $form .= "</option><option value='0'"; if ($options[5] == 0) { $form .= ' selected'; } $form .= ' />' . _MB_NEWS_RECENT_SPECIFIC . '</option></select>'; $form .= '<br /><br />' . _MB_NEWS_SPOTLIGHT_ARTICLE . '<br />'; $articles = $tmpstory->getAllPublished(200, 0, false, 0, 0, false); // I have limited the listbox to the last 200 articles $form .= "<select name ='options[]'>"; $form .= "<option value='0'>" . _MB_NEWS_FIRST . '</option>'; foreach ($articles as $storyid => $storytitle) { $sel = ''; if ($options[6] == $storyid) { $sel = " selected='selected'"; } $form .= "<option value='{$storyid}'{$sel}>" . $storytitle . '</option>'; } $form .= '</select><br /><br />'; $form .= _MB_NEWS_IMAGE . " <input type='text' id='spotlightimage' name='options[]' value='" . $options[7] . "' size='50'/>"; $form .= " <img align='middle' onmouseover='style.cursor=\"hand\"' onclick='javascript:openWithSelfMain(\"" . XOOPS_URL . "/imagemanager.php?target=spotlightimage\",\"imgmanager\",400,430);' src='" . XOOPS_URL . "/images/image.gif' alt='image' title='image' />"; $form .= '<br /><br />' . _MB_NEWS_DISP . " <select name='options[]'><option value='1' "; if ($options[8] == 1) { $form .= 'selected'; } $form .= '>' . _MB_NEWS_VIEW_TYPE1 . "</option><option value='2' "; if ($options[8] == 2) { $form .= 'selected'; } $form .= '>' . _MB_NEWS_VIEW_TYPE2 . '</option></select><br /><br />'; $form .= "<table border=0>\n"; $form .= "<tr><td colspan='2' align='center'><u>" . _MB_NEWS_DEFAULT_COLORS . "</u></td></tr>"; $form .= "<tr><td>" . _MB_NEWS_TAB_COLOR1 . "</td><td><input type='text' name='options[]' value='" . $options[9] . "' size=7></td></tr>"; $form .= "<tr><td>" . _MB_NEWS_TAB_COLOR2 . "</td><td><input type='text' name='options[]' value='" . $options[10] . "' size=7></td></tr>"; $form .= "<tr><td>" . _MB_NEWS_TAB_COLOR3 . "</td><td><input type='text' name='options[]' value='" . $options[11] . "' size=7></td></tr>"; $form .= "<tr><td>" . _MB_NEWS_TAB_COLOR4 . "</td><td><input type='text' name='options[]' value='" . $options[12] . "' size=7></td></tr>"; $form .= "<tr><td>" . _MB_NEWS_TAB_COLOR5 . "</td><td><input type='text' name='options[]' value='" . $options[13] . "' size=7></td></tr>"; $form .= "</table>\n"; $form .= '<br /><br />' . _MB_SPOTLIGHT_TOPIC . "<br /><select name='options[]' multiple='multiple'>"; include_once XOOPS_ROOT_PATH . '/modules/news/class/class.newstopic.php'; $topics_arr = array(); include_once XOOPS_ROOT_PATH . '/class/xoopstree.php'; $xt = new XoopsTree($xoopsDB->prefix('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']) . ' '; } else { $onetopic['prefix'] = str_replace('.', '', $onetopic['prefix']); } for ($i = 14; $i < $size; $i++) { if ($options[$i] == $onetopic['topic_id']) { $sel = " selected='selected'"; } } $form .= "<option value='" . $onetopic['topic_id'] . "'{$sel}>" . $onetopic['prefix'] . $onetopic['topic_title'] . '</option>'; } $form .= '</select><br />'; return $form; }
$poster_name_text = new XoopsFormHidden("poster_name", $myts->makeTboxData4Edit($photo['poster_name'])); } //category $cat_select = new XoopsFormSelect(_MD_GNAV_ITM_CATMAIN, "cid", $photo['cid']); if ($mode == G_INSERT) { $cat_select->addOption('', '----'); } $cat_select1 = new XoopsFormSelect(_MD_GNAV_ITM_CAT1, "cid1", $photo['cid1']); $cat_select1->addOption('', '----'); $cat_select2 = new XoopsFormSelect(_MD_GNAV_ITM_CAT2, "cid2", $photo['cid2']); $cat_select2->addOption('', '----'); $cat_select3 = new XoopsFormSelect(_MD_GNAV_ITM_CAT3, "cid3", $photo['cid3']); $cat_select3->addOption('', '----'); $cat_select4 = new XoopsFormSelect(_MD_GNAV_ITM_CAT4, "cid4", $photo['cid4']); $cat_select4->addOption('', '----'); $tree = $cattree->getChildTreeArray(0, "weight,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_select1->addOption($leaf['cid'], $leaf['prefix'] . $leaf['title']); $cat_select2->addOption($leaf['cid'], $leaf['prefix'] . $leaf['title']); $cat_select3->addOption($leaf['cid'], $leaf['prefix'] . $leaf['title']); $cat_select4->addOption($leaf['cid'], $leaf['prefix'] . $leaf['title']); } //fileform if ($photo['ext']) { $photoview = new XoopsFormLabel(_MD_GNAV_ITM_FILE1, "<img src='" . $photo['imgsrc_photo'] . "' width='150' />"); $file_form = new XoopsFormFile(_MD_GNAV_ITM_EDIT_FILE1, "photofile", $gnavi_fsize); $del_box = new XoopsFormCheckBox(" ", "del_photo", array(0)); $del_box->addOption('1', _MD_GNAV_ITM_DEL_FILE1);