function fetchSummary($external_link_id) { $db =& Database::getInstance(); $myts =& MyTextsanitizer::getInstance(); $module_handler =& xoops_gethandler('module'); $module =& $module_handler->getByDirname($this->mydirname); $storyid = intval($external_link_id); $mydirname = $this->mydirname; if (preg_match('/[^0-9a-zA-Z_-]/', $mydirname)) { die('Invalid mydirname'); } $mytrustdirpath = dirname(dirname(__FILE__)); require_once dirname(dirname(__FILE__)) . '/class/bulletin.php'; if (Bulletin::isPublishedExists($mydirname, $storyid)) { $article = new Bulletin($mydirname, $storyid); $subject4assign = $article->getVar('title'); $summary = $article->getVar('hometext'); if (function_exists('easiestml')) { $summary = easiestml($summary); } $summary4assign = htmlspecialchars(xoops_substr($this->unhtmlspecialchars(strip_tags($summary)), 0, 255), ENT_QUOTES); } else { $subject4assign = ''; $summary4assign = ''; } return array('dirname' => $mydirname, 'module_name' => $module->getVar('name'), 'subject' => $subject4assign, 'uri' => XOOPS_URL . '/modules/' . $mydirname . '/index.php?page=article&storyid=' . $storyid, 'summary' => $summary4assign); }
<?php $storyid = isset($_GET['storyid']) ? intval($_GET['storyid']) : 0; $storypage = isset($_GET['storypage']) ? intval($_GET['storypage']) : 0; // If there are no articles if (empty($storyid) || !Bulletin::isPublishedExists($mydirname, $storyid)) { redirect_header($mydirurl . '/index.php', 2, _MD_NOSTORY); exit; } //Template $xoopsOption['template_main'] = "{$mydirname}_article.html"; require_once XOOPS_ROOT_PATH . '/header.php'; $article = new Bulletin($mydirname, $storyid); $gperm =& BulletinGP::getInstance($mydirname); if (!$gperm->proceed4topic('can_read', $article->getVar('topicid'))) { redirect_header($mydirurl . '/index.php', 2, _NOPERM); exit; } $story['id'] = $storyid; $story['posttime'] = formatTimestamp($article->getVar('published'), $bulletin_date_format); $story['topicid'] = $article->getVar('topicid'); $story['topic'] = $article->topic_title(); $story['title'] = $article->getVar('title'); $story['text'] = $article->getVar('hometext'); $story['hits'] = $article->getVar('counter') + 1; // To disp real view $bodytext = $article->getVar('bodytext'); if ($bodytext != '') { $articletext = explode('[pagebreak]', $bodytext); $story_pages = count($articletext); $storypage = $story_pages - 1 >= $storypage ? $storypage : 0;
$new_story->setVar('expired', $story['expired']); $new_story->setVar('hostname', $story['hostname']); $new_story->setVar('html', $html); $new_story->setVar('br', 1); $new_story->setVar('smiley', $smiley); $new_story->setVar('xcode', 1); $new_story->setVar('hometext', $story['hometext']); $new_story->setVar('bodytext', $story['bodytext']); $new_story->setVar('counter', $story['counter']); $new_story->setVar('topicid', $story['topicid']); $new_story->setVar('ihome', $ihome); $new_story->setVar('type', $type); $new_story->setVar('topicimg', $topicimg); $new_story->setVar('comments', $story['comments']); if ($new_story->store()) { echo '<br />Story "' . htmlspecialchars($story['title']) . '" was successfully converted : ' . $new_story->getVar('storyid'); } else { echo '<br /><b>Failed to convert : ' . htmlspecialchars($story['title']) . '</b>'; } } echo '<br /><a href="index.php">' . _BACK . '</a>'; } break; } $credit = _AM_CREDIT; $translater = _AM_TRANSLATER; $assing_global = array('ADMENU7' => constant($constpref . '_ADMENU7'), 'ADMENU2' => constant($constpref . '_ADMENU2'), 'ADMENU4' => constant($constpref . '_ADMENU4'), 'ADMENU5' => constant($constpref . '_ADMENU5'), 'imagelocation' => sprintf(_AM_IMGNAEXLOC, str_replace(XOOPS_ROOT_PATH, XOOPS_URL, $xoopsModuleConfig['topicon_path'])), 'imagebase' => basename(str_replace(XOOPS_ROOT_PATH, XOOPS_URL, $xoopsModuleConfig['topicon_path'])), 'imagedirname' => dirname(str_replace(XOOPS_ROOT_PATH, XOOPS_URL, $xoopsModuleConfig['topicon_path'])), 'credit' => $myts->previewTarea($credit, 0, 1, 0, 0, 0), 'translater' => $myts->previewTarea($translater, 0, 1, 0, 0, 0), 'admin_title' => sprintf(_AM_CONFIG, $xoopsModule->name()), 'xoops_url' => XOOPS_URL, 'template_path' => $mytrustdirpath . "/admin/templates", 'mydirurl' => $mydirurl); $tpl->assign($assing_global); if (!empty($asssigns)) { $tpl->assign($asssigns); }
<?php $storyid = isset($_GET['storyid']) ? intval($_GET['storyid']) : 0; // If there are no articles if (!Bulletin::isPublishedExists($mydirname, $storyid)) { redirect_header($mydirurl . '/index.php', 2, _MD_NOSTORY); exit; } require_once XOOPS_ROOT_PATH . '/class/template.php'; $article = new Bulletin($mydirname, $storyid); $gperm =& BulletinGP::getInstance($mydirname); if (!$gperm->proceed4topic('can_read', $article->getVar('topicid'))) { // redirect_header($mydirurl.'/index.php',2,_NOPERM); exit; } $datetime = formatTimestamp($article->getVar('published'), $bulletin_date_format); $tpl = new XoopsTpl(); $tpl->xoops_setTemplateDir(XOOPS_ROOT_PATH . '/themes'); $tpl->xoops_setCaching(2); $tpl->xoops_setCacheTime(0); $tpl->assign('charset', _CHARSET); $tpl->assign('sitename', htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)); $tpl->assign('sitename', htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)); $tpl->assign('slogan', htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)); $tpl->assign('xoops_version', htmlspecialchars(XOOPS_VERSION, ENT_QUOTES)); $tpl->assign('site_image', htmlspecialchars($bulletin_imgurl_on_print, ENT_QUOTES)); $tpl->assign('story_title', $article->getVar('title')); $tpl->assign('story_date', $datetime); $tpl->assign('story_topic', $article->topic_title()); $tpl->assign('story_hometext', $article->getVar('hometext')); $tpl->assign('story_id', $storyid);
$storyid = isset( $_POST['storyid'] ) ? intval( $_POST['storyid'] ) : 0 ; if ( empty($storyid) ){ die( _MD_EMPTYNODELETE ); exit(); } $story = new Bulletin( $mydirname , $storyid ); if (!$story){ die( _MD_EMPTYNODELETE ); exit(); } // Remove the related articles $story->relation->queryUnlinkById($storyid); $story->relation->queryDelete(1); $story -> delete(); xoops_comment_delete( $xoopsModule->getVar('mid'), $storyid ); xoops_notification_deletebyitem( $xoopsModule->getVar('mid'), 'story', $storyid ); if( $return == 1){ redirect_header( $mydirurl.'/index.php?mode=admin&op=list', 1, _MD_DBPUDATED ); }else{ redirect_header( $mydirurl.'/index.php', 1, _MD_DBPUDATED ); } exit(); }else{ require_once XOOPS_ROOT_PATH.'/header.php'; xoops_confirm( array( 'op' => 'delete', 'storyid' => $storyid, 'ok' => 1, 'return' => $return, 'XOOPS_G_TICKET'=>$xoopsGTicket->issue( __LINE__ ) ), 'index.php?page=submit', $story->getVar('title').'<br/><br/>'._MD_RUSUREDEL ); require_once XOOPS_ROOT_PATH.'/footer.php'; } } ?>
<?php $com_itemid = isset($_GET['com_itemid']) ? intval($_GET['com_itemid']) : 0 ; // If there are no articles if( !Bulletin::isPublishedExists( $mydirname , $com_itemid) ){ redirect_header($mydirurl.'/index.php',2,_MD_NOSTORY); exit(); } $article = new Bulletin( $mydirname , $com_itemid); $gperm =& BulletinGP::getInstance($mydirname) ; if( ! $gperm->proceed4topic('can_read',$article->getVar('topicid')) ){ redirect_header($mydirurl.'/index.php',2,_NOPERM); exit(); } $com_replytext = _POSTEDBY.' <b>'.$article->getUname().'</b> '._DATE.' <b>'.formatTimestamp($article->getvar('published')).'</b><br /><br />'.$article->getVar('hometext'); $bodytext = $article->getDividedBodytext(); if ($bodytext != '') { $com_replytext .= '<br /><br />'.$bodytext.''; } $com_replytitle = $article->getVar('title'); $_GET['page'] = 'article'; require XOOPS_ROOT_PATH.'/include/comment_new.php'; ?>
$auto['min'] = isset($_POST['auto']['min']) ? intval($_POST['auto']['min']) : formatTimestamp($time, 'i'); $auto['sec'] = isset($_POST['auto']['sec']) ? intval($_POST['auto']['sec']) : date('s'); $autoexp['year'] = isset($_POST['autoexp']['year']) ? intval($_POST['autoexp']['year']) : formatTimestamp($time, 'Y'); $autoexp['month'] = isset($_POST['autoexp']['month']) ? intval($_POST['autoexp']['month']) : formatTimestamp($time, 'n'); $autoexp['day'] = isset($_POST['autoexp']['day']) ? intval($_POST['autoexp']['day']) : formatTimestamp($time, 'd'); $autoexp['hour'] = isset($_POST['autoexp']['hour']) ? intval($_POST['autoexp']['hour']) : formatTimestamp($time, 'H'); $autoexp['min'] = isset($_POST['autoexp']['min']) ? intval($_POST['autoexp']['min']) : formatTimestamp($time, 'i'); $autoexp['sec'] = isset($_POST['autoexp']['sec']) ? intval($_POST['autoexp']['sec']) : date('s'); // new post if (empty($storyid)) { $story->setVar('hostname', xoops_getenv('REMOTE_ADDR')); $story->setVar('uid', $my_uid); $story->devideHomeTextAndBodyText(); // 自動承認かどうか if ($gperm->group_perm(2)) { $story->setVar('type', $story->getVar('approve')); // GIJ } else { $story->setVar('type', 0); } // 掲載予定日設定のルーチン if ($story->getVar('autodate') == 1 && $gperm->group_perm(3)) { $pubdate = mktime($auto['hour'], $auto['min'], $auto['sec'], $auto['month'], $auto['day'], $auto['year']); $offset = $xoopsUser->timezone() - $xoopsConfig['server_TZ']; $pubdate = $pubdate - $offset * 3600; $story->setVar('published', $pubdate); } else { $story->setVar('published', time()); } // 掲載終了日設定のルーティン if ($story->getVar('autoexpdate') == 1 && $gperm->group_perm(3)) {
<?php $com_itemid = isset($_GET['com_itemid']) ? intval($_GET['com_itemid']) : 0; // 記事が無い場合 if (!Bulletin::isPublishedExists($mydirname, $com_itemid)) { redirect_header($mydirurl . '/index.php', 2, _MD_NOSTORY); exit; } $article = new Bulletin($mydirname, $com_itemid); $com_replytext = _POSTEDBY . ' <b>' . $article->getUname() . '</b> ' . _DATE . ' <b>' . formatTimestamp($article->getvar('published')) . '</b><br /><br />' . $article->getVar('hometext'); $bodytext = $article->getDividedBodytext(); if ($bodytext != '') { $com_replytext .= '<br /><br />' . $bodytext . ''; } $com_replytitle = $article->getVar('title'); $_GET['page'] = 'article'; require XOOPS_ROOT_PATH . '/include/comment_new.php';
<?php $storyid = isset($_GET['storyid']) ? intval($_GET['storyid']) : 0; $storypage = isset($_GET['storypage']) ? intval($_GET['storypage']) : 0; // 記事が存在しない場合 if (!Bulletin::isPublishedExists($mydirname, $storyid)) { redirect_header($mydirurl . '/index.php', 2, _MD_NOSTORY); exit; } //テンプレート $xoopsOption['template_main'] = "{$mydirname}_article.html"; require_once XOOPS_ROOT_PATH . '/header.php'; $article = new Bulletin($mydirname, $storyid); $story['id'] = $storyid; $story['posttime'] = formatTimestamp($article->getVar('published'), $bulletin_date_format); $story['topicid'] = $article->getVar('topicid'); $story['topic'] = $article->topic_title(); $story['title'] = $article->getVar('title'); $story['text'] = $article->getVar('hometext'); $story['hits'] = $article->getVar('counter') + 1; // To disp real view $bodytext = $article->getVar('bodytext'); if ($bodytext != '') { $articletext = explode('[pagebreak]', $bodytext); $story_pages = count($articletext); $storypage = $story_pages - 1 >= $storypage ? $storypage : 0; // [pagebreak]で複数ページのコンテンツが構成されている場合 if ($story_pages > 1) { require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; $pagenav = new XoopsPageNav($story_pages, 1, $storypage, 'storypage', 'page=article&storyid=' . $storyid); $xoopsTpl->assign('pagenav', $pagenav->renderNav());
<?php $storyid = isset($_GET['storyid']) ? intval($_GET['storyid']) : 0; // 記事が存在しない場合 if (!Bulletin::isPublishedExists($mydirname, $storyid)) { redirect_header($mydirurl . '/index.php', 2, _MD_NOSTORY); exit; } require_once XOOPS_ROOT_PATH . '/class/template.php'; $article = new Bulletin($mydirname, $storyid); $datetime = formatTimestamp($article->getVar('published'), $bulletin_date_format); $tpl = new XoopsTpl(); $tpl->xoops_setTemplateDir(XOOPS_ROOT_PATH . '/themes'); $tpl->xoops_setCaching(2); $tpl->xoops_setCacheTime(0); $tpl->assign('charset', _CHARSET); $tpl->assign('sitename', htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)); $tpl->assign('sitename', htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)); $tpl->assign('slogan', htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)); $tpl->assign('xoops_version', htmlspecialchars(XOOPS_VERSION, ENT_QUOTES)); $tpl->assign('site_image', htmlspecialchars($bulletin_imgurl_on_print, ENT_QUOTES)); $tpl->assign('story_title', $article->getVar('title')); $tpl->assign('story_date', $datetime); $tpl->assign('story_topic', $article->topic_title()); $tpl->assign('story_hometext', $article->getVar('hometext')); $tpl->assign('story_id', $storyid); $tpl->assign('story_bodytext', $article->getDividedBodytext()); $tpl->assign('this_comes_from', sprintf(_MD_THISCOMESFROM, htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES))); $tpl->assign($assing_array); $tpl->display("db:{$mydirname}_print.html");