function b_news_topics_show() { global $xoopsDB, $storytopic; $block = array(); include_once XOOPS_ROOT_PATH . "/class/xoopstopic.php"; $xt = new XoopsTopic($xoopsDB->prefix("topics")); $jump = XOOPS_URL . "/modules/news/index.php?storytopic="; $storytopic = !empty($storytopic) ? intval($storytopic) : 0; ob_start(); $xt->makeTopicSelBox(1, $storytopic, "storytopic", "location=\"" . $jump . "\"+this.options[this.selectedIndex].value"); $block['selectbox'] = ob_get_contents(); ob_end_clean(); return $block; }
<form action='<?php echo $submit_page; ?> ' method='post' name='coolsus'> <?php echo "<p><b>" . _AM_TITLE . "</b><br />"; echo "<input type='text' name='title' id='title' value='"; if (isset($title)) { echo $title; } echo "' size='70' maxlength='80' />"; echo "</p><p>"; echo "<b>" . _AM_TOPIC . "</b> "; $xt = new XoopsTopic($xoopsDB->prefix("topics")); if (isset($topicid)) { $xt->makeTopicSelBox(0, $topicid, "topicid"); } else { $xt->makeTopicSelBox(0, 0, "topicid"); } echo "<br /><b>" . _AM_TOPICDISPLAY . "</b> <input type='radio' name='topicdisplay' value='1'"; if (!isset($topicdisplay) || $topicdisplay == 1) { echo " checked='checked'"; } echo " />" . _AM_YES . " <input type='radio' name='topicdisplay' value='0'"; if (empty($topicdisplay)) { echo " checked='checked'"; } echo " />" . _AM_NO . " "; echo "<b>" . _AM_TOPICALIGN . "</b> <select name='topicalign'>\n"; if ("L" == $topicalign) { $sel = " selected='selected'";
if ($xoopsOption['storynum'] > 30) { $xoopsOption['storynum'] = $xoopsModuleConfig['storyhome']; } } else { $xoopsOption['storynum'] = $xoopsModuleConfig['storyhome']; } if (isset($HTTP_GET_VARS['start'])) { $start = intval($HTTP_GET_VARS['start']); } else { $start = 0; } if ($xoopsModuleConfig['displaynav'] == 1) { $xoopsTpl->assign('displaynav', true); $xt = new XoopsTopic($xoopsDB->prefix('topics')); ob_start(); $xt->makeTopicSelBox(1, $xoopsOption['storytopic'], 'storytopic'); $topic_select = ob_get_contents(); ob_end_clean(); $xoopsTpl->assign('topic_select', $topic_select); $storynum_options = ''; for ($i = 5; $i <= 30; $i = $i + 5) { $sel = ''; if ($i == $xoopsOption['storynum']) { $sel = ' selected="selected"'; } $storynum_options .= '<option value="' . $i . '"' . $sel . '>' . $i . '</option>'; } $xoopsTpl->assign('storynum_options', $storynum_options); } else { $xoopsTpl->assign('displaynav', false); }
function modTopic() { global $xoopsDB, $xoopsConfig; global $xoopsModule; $xt = new XoopsTopic($xoopsDB->prefix("topics"), $_POST['topic_id']); $topics_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/modules/news/images/topics/"); xoops_cp_header(); echo "<h4>" . _AM_CONFIG . "</h4>"; // $xoopsModule->printAdminMenu(); // echo "<br />"; echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">"; echo "<h4>" . _AM_MODIFYTOPIC . "</h4><br />"; if ($xt->topic_imgurl()) { echo "<div style='text-align: right;'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/topics/" . $xt->topic_imgurl() . "'></div>"; } echo "<form action='index.php' method='post'>"; echo "<b>" . _AM_TOPICNAME . "</b> " . _AM_MAX40CHAR . "<br /><input type='text' name='topic_title' size='20' maxlength='40' value='" . $xt->topic_title('E') . "' /><br />"; echo "<b>" . _AM_TOPICIMG . "</b> (" . sprintf(_AM_IMGNAEXLOC, "modules/" . $xoopsModule->dirname() . "/images/topics/") . ")<br />" . _AM_FEXAMPLE . "<br />"; // echo "<input type='text' name='topic_imgurl' size='20' maxlength='20' value='".$xt->topic_imgurl()."' /><br />\n"; echo "<select size='1' name='topic_imgurl'>"; echo "<option value=' '>------</option>"; foreach ($topics_array as $image) { if ($image == $xt->topic_imgurl()) { $opt_selected = "selected='selected'"; } else { $opt_selected = ""; } echo "<option value='" . $image . "' {$opt_selected}>" . $image . "</option>"; } echo "</select><br />"; echo "<b>" . _AM_PARENTTOPIC . "<b><br />\n"; $xt->makeTopicSelBox(1, $xt->topic_pid(), "topic_pid"); echo "\n<br /><br />"; echo "<input type='hidden' name='topic_id' value='" . $xt->topic_id() . "' />\n"; echo "<input type='hidden' name='op' value='modTopicS' />"; echo "<input type='submit' value='" . _AM_SAVECHANGE . "' /> <input type='button' value='" . _AM_DEL . "' onclick='location=\"index.php?topic_pid=" . $xt->topic_pid() . "&topic_id=" . $xt->topic_id() . "&op=delTopic\"' />\n"; echo " <input type='button' value='" . _AM_CANCEL . "' onclick='javascript:history.go(-1)' />\n"; echo "</form>"; echo "</td></tr></table>"; }