本文整理汇总了PHP中NewsStory::topicid方法的典型用法代码示例。如果您正苦于以下问题:PHP NewsStory::topicid方法的具体用法?PHP NewsStory::topicid怎么用?PHP NewsStory::topicid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NewsStory
的用法示例。
在下文中一共展示了NewsStory::topicid方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
exit;
}
// Expired
if ($story->expired() != 0 && $story->expired() < time()) {
redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
exit;
}
// Verify permissions
$gperm_handler =& xoops_gethandler('groupperm');
if (is_object($xoopsUser)) {
$groups = $xoopsUser->getGroups();
} else {
$groups = XOOPS_GROUP_ANONYMOUS;
}
if (!$gperm_handler->checkRight('news_view', $story->topicid(), $groups, $xoopsModule->getVar('mid'))) {
redirect_header(XOOPS_URL . '/modules/news/index.php', 3, _NOPERM);
exit;
}
$xoops_meta_keywords = '';
$xoops_meta_description = '';
if (trim($story->keywords()) != '') {
$xoops_meta_keywords = $story->keywords();
} else {
$xoops_meta_keywords = news_createmeta_keywords($story->hometext() . ' ' . $story->bodytext());
}
if (trim($story->description()) != '') {
$xoops_meta_description = $story->description();
} else {
$xoops_meta_description = strip_tags($story->title());
}
示例2: b_news_top_show
/**
* Notes about the spotlight :
* If you have restricted topics on index page (in fact if the program must completly respect the permissions) and if
* the news you have selected to be viewed in the spotlight can't be viewed by someone then the spotlight is not visible !
* This is available in the classical and in the tabbed view.
* But if you have uncheck the option "Restrict topics on index page", then the news will be visible but users without
* permissions will be rejected when they will try to read news content.
*
* Also, if you have selected a tabbed view and wanted to use the Spotlight but did not choosed a story, then the block
* will switch to the "most recent news" mode (the visible news will be searched according to the permissions)
*/
function b_news_top_show($options)
{
global $xoopsConfig;
include_once XOOPS_ROOT_PATH . '/modules/news/include/functions.php';
$myts =& MyTextSanitizer::getInstance();
$block = array();
$displayname = news_getmoduleoption('displayname');
$tabskin = news_getmoduleoption('tabskin');
if (file_exists(XOOPS_ROOT_PATH . '/modules/news/language/' . $xoopsConfig['language'] . '/main.php')) {
include_once XOOPS_ROOT_PATH . '/modules/news/language/' . $xoopsConfig['language'] . '/main.php';
} else {
include_once XOOPS_ROOT_PATH . '/modules/news/language/english/main.php';
}
$block['displayview'] = $options[8];
$block['tabskin'] = $tabskin;
$block['imagesurl'] = XOOPS_URL . '/modules/news/images/';
$restricted = news_getmoduleoption('restrictindex');
$dateformat = news_getmoduleoption('dateformat');
$infotips = news_getmoduleoption('infotips');
$newsrating = news_getmoduleoption('ratenews');
if ($dateformat == '') {
$dateformat = 's';
}
$perm_verified = false;
$news_visible = true;
// Is the spotlight visible ?
if ($options[4] == 1 && $restricted && $options[5] == 0) {
$perm_verified = true;
$permittedtopics = news_MygetItemIds();
$permstory = new NewsStory($options[6]);
if (!in_array($permstory->topicid(), $permittedtopics)) {
$usespotlight = false;
$news_visible = false;
$topicstitles = array();
}
$options[4] == 0;
}
// Try to see what tabs are visibles (if we are in restricted view of course)
if ($options[8] == 2 && $restricted && $options[14] != 0) {
$topics2 = array();
$permittedtopics = news_MygetItemIds();
$topics = array_slice($options, 14);
foreach ($topics as $onetopic) {
if (in_array($onetopic, $permittedtopics)) {
$topics2[] = $onetopic;
}
}
$before = array_slice($options, 0, 14);
$options = array_merge($before, $topics2);
}
if ($options[8] == 2) {
// Tabbed view ********************************************************************************************
$defcolors[1] = array('#F90', '#FFFFFF', '#F90', '#C60', '#999');
// Bar Style
$defcolors[2] = array('#F90', '#FFFFFF', '#F90', '#AAA', '#666');
// Beveled
$defcolors[3] = array('#F90', '#FFFFFF', '', '#789', '#789');
// Classic
$defcolors[4] = array('#F90', '#FFFFFF', '', '', '');
// Folders
$defcolors[5] = array('#F90', '#FFFFFF', '#CCC', 'inherit', '#999');
// MacOs
$defcolors[6] = array('#F90', '#FFFFFF', '#FFF', '#DDD', '#999');
// Plain
$defcolors[7] = array('#F90', '#FFFFFF', '', '', '');
// Rounded
$defcolors[8] = array('#F90', '#FFFFFF', '#F90', '#930', '#C60');
// ZDnet
$myurl = $_SERVER['PHP_SELF'];
if (substr($myurl, strlen($myurl) - 1, 1) == '/') {
$myurl .= 'index.php';
}
$myurl .= '?';
foreach ($_GET as $key => $value) {
if ($key != 'NewsTab') {
$myurl .= $key . '=' . $value . '&';
}
}
$block['url'] = $myurl;
$tabscount = 0;
$usespotlight = false;
if (isset($_GET['NewsTab'])) {
$_SESSION['NewsTab'] = intval($_GET['NewsTab']);
$currenttab = intval($_GET['NewsTab']);
} elseif (isset($_SESSION['NewsTab'])) {
$currenttab = intval($_SESSION['NewsTab']);
} else {
$currenttab = 0;
}
//.........这里部分代码省略.........
示例3: isset
if ($article->published() == 0 || $article->published() > time()) {
redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOTYETSTORY);
exit;
}
// Expired
if ($article->expired() != 0 && $article->expired() < time()) {
redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
exit;
}
$gperm_handler =& xoops_gethandler('groupperm');
if (is_object($xoopsUser)) {
$groups = $xoopsUser->getGroups();
} else {
$groups = XOOPS_GROUP_ANONYMOUS;
}
if (!$gperm_handler->checkRight('news_view', $article->topicid(), $groups, $xoopsModule->getVar('mid'))) {
redirect_header(XOOPS_URL . '/modules/news/index.php', 3, _NOPERM);
exit;
}
$storypage = isset($_GET['page']) ? intval($_GET['page']) : 0;
$dateformat = news_getmoduleoption('dateformat');
$hcontent = '';
/**
* update counter only when viewing top page and when you are not the author or an admin
*/
if (empty($_GET['com_id']) && $storypage == 0) {
if (is_object($xoopsUser)) {
if ($xoopsUser->getVar('uid') == $article->uid() || news_is_admin_group()) {
// nothing ! ;-)
} else {
$article->updateCounter();
示例4: array
// Notification
// TODO: modifier afin qu'en cas de prépublication, la notification ne se fasse pas
$notification_handler =& xoops_gethandler('notification');
$tags = array();
$tags['STORY_NAME'] = $story->title();
$tags['STORY_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/article.php?storyid=' . $story->storyid();
// If notify checkbox is set, add subscription for approve
if ($notifypub && $approve) {
include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
$notification_handler->subscribe('story', $story->storyid(), 'approve', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE, $xoopsModule->getVar('mid'), $story->uid());
}
if ($approve == 1) {
$notification_handler->triggerEvent('global', 0, 'new_story', $tags);
$notification_handler->triggerEvent('story', $story->storyid(), 'approve', $tags);
// Added by Lankford on 2007/3/23
$notification_handler->triggerEvent('category', $story->topicid(), 'new_story', $tags);
} else {
$tags['WAITINGSTORIES_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/index.php?op=newarticle';
$notification_handler->triggerEvent('global', 0, 'story_submit', $tags);
}
}
if ($allowupload) {
// Manage upload(s)
if (isset($_POST['delupload']) && count($_POST['delupload']) > 0) {
foreach ($_POST['delupload'] as $onefile) {
$sfiles = new sFiles($onefile);
$sfiles->delete();
}
}
if (isset($_POST['xoops_upload_file'])) {
$fldname = $_FILES[$_POST['xoops_upload_file'][0]];
示例5: NewsStory
switch ($op) {
case "edit":
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_EDITARTICLE . "</h4>";
$story = new NewsStory($storyid);
$title = $story->title("Edit");
$hometext = $story->hometext("Edit");
$bodytext = $story->bodytext("Edit");
$nohtml = $story->nohtml();
$nosmiley = $story->nosmiley();
$ihome = $story->ihome();
$topicid = $story->topicid();
if ($story->published() != 0) {
$published = $story->published();
}
if ($story->expired() != 0) {
$expired = $story->expired();
}
// $notifypub = $story->notifypub();
$type = $story->type();
$topicdisplay = $story->topicdisplay();
$topicalign = $story->topicalign(false);
$isedit = 1;
include "storyform.inc.php";
echo "</td></tr></table>";
break;
case "newarticle":
示例6: NewsStory
if (empty($storyid)) {
redirect_header(XOOPS_URL . "/modules/news/index.php", 2, _NW_NOSTORY);
exit;
}
$article = new NewsStory($storyid);
if ($article->published() == 0 || $article->published() > time()) {
redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
exit;
}
$gperm_handler =& xoops_gethandler('groupperm');
if (is_object($xoopsUser)) {
$groups = $xoopsUser->getGroups();
} else {
$groups = XOOPS_GROUP_ANONYMOUS;
}
if (!$gperm_handler->checkRight("news_view", $article->topicid(), $groups, $xoopsModule->getVar('mid'))) {
redirect_header(XOOPS_URL . '/modules/news/index.php', 3, _NOPERM);
exit;
}
$dateformat = getmoduleoption('dateformat');
$article_data = $article->hometext() . $article->bodytext();
$forumdata['topic_title'] = news_html2text($myts->undoHtmlSpecialChars($article->title()));
$pdf_data['title'] = news_html2text($myts->undoHtmlSpecialChars($article->title()));
$pdf_data['subtitle'] = $myts->htmlSpecialChars($article->topic_title());
$pdf_data['subsubtitle'] = '';
$pdf_data['date'] = formatTimestamp($article->published(), $dateformat);
$pdf_data['filename'] = preg_replace("/[^0-9a-z\\-_\\.]/i", '', $myts->htmlSpecialChars($article->topic_title()) . ' - ' . $article->title());
$pdf_data['filename'] = 'test';
$content = $article->hometext() . '<br /><br />' . $article->bodytext();
$content = str_replace("[pagebreak]", "<br /><br />", $content);
$pdf_data['content'] = $content;
示例7: unset
} else {
unset($tmpstory);
redirect_header(XOOPS_URL . "/modules/news/index.php", 3, _NOPERM);
exit;
}
}
}
switch ($op) {
case 'edit':
if (!$approveprivilege) {
redirect_header(XOOPS_URL . '/modules/news/index.php', 0, _NOPERM);
exit;
break;
}
$story = new NewsStory($storyid);
if (!$gperm_handler->checkRight("news_view", $story->topicid(), $groups, $module_id)) {
redirect_header(XOOPS_URL . '/modules/news/index.php', 0, _NOPERM);
exit;
break;
}
echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
echo "<h4>" . _AM_EDITARTICLE . "</h4>";
$title = $story->title("Edit");
$hometext = $story->hometext("Edit");
$bodytext = $story->bodytext("Edit");
$nohtml = $story->nohtml();
$nosmiley = $story->nosmiley();
$description = $story->description();
$keywords = $story->keywords();
$ihome = $story->ihome();
$newsauthor = $story->uid();
示例8: sprintf
if ($story['poster']) {
$story['posterid'] = $article->uid();
$story['poster'] = '<a href="' . XOOPS_URL . '/userinfo.php?uid=' . $story['posterid'] . '">' . $story['poster'] . '</a>';
} else {
$story['poster'] = '';
$story['posterid'] = 0;
$story['poster'] = $xoopsConfig['anonymous'];
}
$story['morelink'] = '';
$story['adminlink'] = '';
unset($isadmin);
if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
$isadmin = true;
$story['adminlink'] = $article->adminlink();
}
$story['topicid'] = $article->topicid();
$story['imglink'] = '';
$story['align'] = '';
if ($article->topicdisplay()) {
$story['imglink'] = $article->imglink();
$story['align'] = $article->topicalign();
}
$story['hits'] = $article->counter();
$story['mail_link'] = 'mailto:?subject=' . sprintf(_NW_INTARTICLE, $xoopsConfig['sitename']) . '&body=' . sprintf(_NW_INTARTFOUND, $xoopsConfig['sitename']) . ': ' . XOOPS_URL . '/modules/news/article.php?storyid=' . $article->storyid();
$xoopsTpl->assign('story', $story);
$xoopsTpl->assign('lang_printerpage', _NW_PRINTERFRIENDLY);
$xoopsTpl->assign('lang_sendstory', _NW_SENDSTORY);
$xoopsTpl->assign('lang_on', _ON);
$xoopsTpl->assign('lang_postedby', _POSTEDBY);
$xoopsTpl->assign('lang_reads', _READS);
$xoopsTpl->assign('mail_link', 'mailto:?subject=' . sprintf(_NW_INTARTICLE, $xoopsConfig['sitename']) . '&body=' . sprintf(_NW_INTARTFOUND, $xoopsConfig['sitename']) . ': ' . XOOPS_URL . '/modules/news/article.php?storyid=' . $article->storyid());
示例9: mktime
$xoopsTpl->assign('currentyear', $fromyear);
$xoopsTpl->assign('lang_actions', _NW_ACTIONS);
$xoopsTpl->assign('lang_date', _NW_DATE);
$xoopsTpl->assign('lang_views', _NW_VIEWS);
// must adjust the selected time to server timestamp
$timeoffset = $useroffset - $xoopsConfig['server_TZ'];
$monthstart = mktime(0 - $timeoffset, 0, 0, $frommonth, 1, $fromyear);
$monthend = mktime(23 - $timeoffset, 59, 59, $frommonth + 1, 0, $fromyear);
$monthend = $monthend > time() ? time() : $monthend;
$sql = "SELECT * FROM " . $xoopsDB->prefix("stories") . " WHERE published > {$monthstart} and published < {$monthend} ORDER by published DESC";
$result = $xoopsDB->query($sql);
$count = 0;
while ($myrow = $xoopsDB->fetchArray($result)) {
$article = new NewsStory($myrow);
$story = array();
$story['title'] = "<a href='index.php?storytopic=" . $article->topicid() . "'>" . $article->topic_title() . "</a>: <a href='article.php?storyid=" . $article->storyid() . "'>" . $article->title() . "</a>";
$story['counter'] = $article->counter();
$story['date'] = formatTimestamp($article->published(), "m", $useroffset);
$story['print_link'] = 'print.php?storyid=' . $article->storyid();
$story['mail_link'] = 'mailto:?subject=' . sprintf(_NW_INTARTICLE, $xoopsConfig['sitename']) . '&body=' . sprintf(_NW_INTARTFOUND, $xoopsConfig['sitename']) . ': ' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/article.php?storyid=' . $article->storyid();
$xoopsTpl->append('stories', $story);
$count++;
}
$xoopsTpl->assign('lang_printer', _NW_PRINTERFRIENDLY);
$xoopsTpl->assign('lang_sendstory', _NW_SENDSTORY);
$xoopsTpl->assign('lang_storytotal', sprintf(_NW_THEREAREINTOTAL, $count));
} else {
$xoopsTpl->assign('show_articles', false);
}
$xoopsTpl->assign('lang_newsarchives', _NW_NEWSARCHIVES);
include XOOPS_ROOT_PATH . "/footer.php";