本文整理汇总了PHP中NewsStory::expired方法的典型用法代码示例。如果您正苦于以下问题:PHP NewsStory::expired方法的具体用法?PHP NewsStory::expired怎么用?PHP NewsStory::expired使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NewsStory
的用法示例。
在下文中一共展示了NewsStory::expired方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
include_once '../../mainfile.php';
include_once XOOPS_ROOT_PATH . '/modules/news/class/class.newsstory.php';
include_once XOOPS_ROOT_PATH . '/modules/news/include/functions.php';
$storyid = isset($_GET['storyid']) ? intval($_GET['storyid']) : 0;
if (empty($storyid)) {
redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
}
// Verify that the article is published
$story = new NewsStory($storyid);
// Not yet published
if ($story->published() == 0 || $story->published() > time()) {
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 = '';
示例2: isset
$story->setTopicdisplay($_POST['topicdisplay']);
// Display Topic Image ? (Yes or No)
$story->setTopicalign($_POST['topicalign']);
// Topic Align, 'Right' or 'Left'
$story->setIhome($_POST['ihome']);
// Publish in home ? (Yes or No)
if (isset($_POST['bodytext'])) {
$story->setBodytext($_POST['bodytext']);
} else {
$story->setBodytext(' ');
}
$approve = isset($_POST['approve']) ? intval($_POST['approve']) : 0;
if (!$story->published() && $approve) {
$story->setPublished(time());
}
if (!$story->expired()) {
$story->setExpired(0);
}
if (!$approve) {
$story->setPublished(0);
}
} elseif ($xoopsModuleConfig['autoapprove'] == 1 && !$approveprivilege) {
if (empty($storyid)) {
$approve = 1;
} else {
$approve = isset($_POST['approve']) ? intval($_POST['approve']) : 0;
}
if ($approve) {
$story->setPublished(time());
} else {
$story->setPublished(0);
示例3: intval
$storyid = 0;
if (isset($_GET['storyid'])) {
$storyid = intval($_GET['storyid']);
} else {
if (isset($_POST['storyid'])) {
$storyid = intval($_POST['storyid']);
}
}
if (!empty($storyid)) {
$article = new NewsStory($storyid);
if ($article->published() == 0 || $article->published() > time()) {
redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
exit;
}
// Expired
if ($article->expired() != 0 && $article->expired() < time()) {
redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
exit;
}
} else {
redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
exit;
}
// 3) Does the user can see this news ? If he can't see it, he can't vote for
$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'))) {
示例4: lastStories
lastStories();
expStories();
echo "<br />";
echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
echo "<h4>" . _AM_POSTNEWARTICLE . "</h4>";
$type = "admin";
include "storyform.inc.php";
echo "</td></tr></table>";
break;
case "preview":
xoops_cp_header();
echo "<h4>" . _AM_CONFIG . "</h4>";
if (isset($storyid)) {
$story = new NewsStory($storyid);
$published = $story->published();
$expired = $story->expired();
} else {
$story = new NewsStory();
}
$story->setTitle($_POST['title']);
$story->setHomeText($_POST['hometext']);
$story->setBodyText($_POST['bodytext']);
if (isset($_POST['nohtml']) && ($_POST['nohtml'] == 0 || $_POST['nohtml'] == 1)) {
$story->setNohtml($_POST['nohtml']);
}
if (isset($_POST['nosmiley']) && ($_POST['nosmiley'] == 0 || $_POST['nosmiley'] == 1)) {
$story->setNosmiley($_POST['nosmiley']);
}
$xt = new XoopsTopic($xoopsDB->prefix("topics"));
$p_title = $story->title("Preview");
$p_hometext = $story->hometext("Preview");