case 'modTopic': $template = 'bulletin_modtopic.html'; $BTopic = new BulletinTopic($mydirname, $_GET['topic_id']); $topics_array = XoopsLists::getImgListAsArray($xoopsModuleConfig['topicon_path']); xoops_cp_header(); include dirname(__FILE__) . '/mymenu.php'; $images = array(); foreach ($topics_array as $v) { $images[] = array('image' => htmlspecialchars($v), 'option' => $BTopic->topic_imgurl() ? 'selected="selected"' : ''); } //ob_start(); //$BTopic->makeTopicSelBox( 1, $BTopic->topic_pid(), 'topic_pid' ); //$topicselbox = ob_get_contents(); //ob_end_clean(); $topicselbox = $BTopic->makeTopicSelBox(true, $BTopic->topic_pid(), 'topic_pid'); $asssigns = array('gticket_hidden' => $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'bulletin_admin'), 'images' => $images, 'topic_id' => $BTopic->topic_id(), 'topic_pid' => $BTopic->topic_pid(), 'topic_title' => $BTopic->topic_title('E'), 'topic_imgurl' => $BTopic->topic_imgurl(), 'topic_imgdir' => str_replace(XOOPS_ROOT_PATH, XOOPS_URL, $xoopsModuleConfig['topicon_path']), 'topicselbox' => $topicselbox); break; case 'addTopic': //ver3.0 if (!$xoopsGTicket->check(true, 'bulletin_admin')) { redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors()); } $BTopic = new BulletinTopic($mydirname); $BTopic->setTopicPid($_POST['topic_pid']); if (empty($_POST['topic_title'])) { redirect_header("index.php?op=topicsmanager", 2, _AM_ERRORTOPICNAME); } $BTopic->setTopicTitle($_POST['topic_title']); if (isset($_POST['topic_imgurl']) && $_POST['topic_imgurl'] != "") { $BTopic->setTopicImgurl($_POST['topic_imgurl']); }
foreach($topics_array as $v){ $images[] = array('image' => htmlspecialchars($v), 'option' => $BTopic->topic_imgurl() ? 'selected="selected"' : ''); } //ob_start(); //$BTopic->makeTopicSelBox( 1, $BTopic->topic_pid(), 'topic_pid' ); //$topicselbox = ob_get_contents(); //ob_end_clean(); $topicselbox = $BTopic->makeTopicSelBox( true , $BTopic->topic_pid() , 'topic_pid' ) ; $asssigns = array( 'gticket_hidden' => $xoopsGTicket->getTicketHtml( __LINE__ , 1800 , 'bulletin_admin') , 'images' => $images, 'topic_id' => $BTopic->topic_id(), 'topic_pid' => $BTopic->topic_pid(), 'topic_title' => $BTopic->topic_title('E'), 'topic_imgurl' => $BTopic->topic_imgurl(), 'topic_imgdir' => str_replace(XOOPS_ROOT_PATH,XOOPS_URL,$xoopsModuleConfig['topicon_path']), 'topicselbox' => $topicselbox ); break; case 'addTopic': //ver3.0 if ( ! $xoopsGTicket->check( true , 'bulletin_admin' ) ) { redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors()); } $BTopic = new BulletinTopic( $mydirname ); $BTopic->setTopicPid( $_POST['topic_pid'] );
die(_MD_NO_TOPICS); exit; } } // In case of No Topic $BTopic = new BulletinTopic( $mydirname, $topicid ); $topicid = $BTopic->getTopicIdByPermissionCheck($topicid); if( $topicid ){ $story->setVar('topicid', $topicid); } if( !$BTopic->topicExists() ){ die(_MD_NO_TOPICS); exit; } $xoopsTpl->assign('topic_title', $BTopic->topic_title()); // Chanege the WSYWIG editor if( ! empty( $_REQUEST['using_fck'] ) ) { $_POST['text'] = $_POST['text_fck'] ; } $str_arr = array('title','text'); $int_arr = array('topicid','type','topicimg','published','expired'); $bai_arr = array('html','smiley','br','xcode','autodate','autoexpdate','notifypub','block','ihome','approve'); foreach( $str_arr as $k ){ if( isset($_POST[$k]) ){ $story->setVar($k, $_POST[$k]); } } foreach( $int_arr as $k ){
case 'modTopic': $template = 'bulletin_modtopic.html'; $BTopic = new BulletinTopic($mydirname, $_GET['topic_id']); $topics_array = XoopsLists::getImgListAsArray($xoopsModuleConfig['topicon_path']); xoops_cp_header(); include dirname(__FILE__) . '/mymenu.php'; $images = array(); foreach ($topics_array as $v) { $images[] = array('image' => htmlspecialchars($v), 'option' => $BTopic->topic_imgurl() ? 'selected="selected"' : ''); } //ob_start(); //$BTopic->makeTopicSelBox( 1, $BTopic->topic_pid(), 'topic_pid' ); //$topicselbox = ob_get_contents(); //ob_end_clean(); $topicselbox = $BTopic->makeTopicSelBox(true, $BTopic->topic_pid(), 'topic_pid'); $asssigns = array('images' => $images, 'topic_id' => $BTopic->topic_id(), 'topic_pid' => $BTopic->topic_pid(), 'topic_title' => $BTopic->topic_title('E'), 'topic_imgurl' => $BTopic->topic_imgurl(), 'topic_imgdir' => str_replace(XOOPS_ROOT_PATH, XOOPS_URL, $xoopsModuleConfig['topicon_path']), 'topicselbox' => $topicselbox); break; case 'addTopic': $BTopic = new BulletinTopic($mydirname); $BTopic->setTopicPid($_POST['topic_pid']); if (empty($_POST['topic_title'])) { redirect_header("index.php?op=topicsmanager", 2, _AM_ERRORTOPICNAME); } $BTopic->setTopicTitle($_POST['topic_title']); if (isset($_POST['topic_imgurl']) && $_POST['topic_imgurl'] != "") { $BTopic->setTopicImgurl($_POST['topic_imgurl']); } $BTopic->store(); $notification_handler =& xoops_gethandler('notification'); $tags = array(); $tags['TOPIC_NAME'] = $_POST['topic_title'];