当前位置: 首页>>代码示例>>PHP>>正文


PHP NewsStory::published方法代码示例

本文整理汇总了PHP中NewsStory::published方法的典型用法代码示例。如果您正苦于以下问题:PHP NewsStory::published方法的具体用法?PHP NewsStory::published怎么用?PHP NewsStory::published使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NewsStory的用法示例。


在下文中一共展示了NewsStory::published方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PrintPage

function PrintPage($storyid)
{
    global $xoopsConfig, $xoopsModule;
    $story = new NewsStory($storyid);
    $datetime = formatTimestamp($story->published());
    echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">';
    echo '<html><head>';
    echo '<meta http-equiv="Content-Type" content="text/html; charset=' . _CHARSET . '" />';
    echo '<title>' . $xoopsConfig['sitename'] . '</title>';
    echo '<meta name="AUTHOR" content="' . $xoopsConfig['sitename'] . '" />';
    echo '<meta name="COPYRIGHT" content="Copyright (c) 2001 by ' . $xoopsConfig['sitename'] . '" />';
    echo '<meta name="DESCRIPTION" content="' . $xoopsConfig['slogan'] . '" />';
    echo '<meta name="GENERATOR" content="' . XOOPS_VERSION . '" />';
    echo '<body bgcolor="#ffffff" text="#000000" onload="window.print()">
    	<table border="0"><tr><td align="center">
    	<table border="0" width="640" cellpadding="0" cellspacing="1" bgcolor="#000000"><tr><td>
    	<table border="0" width="640" cellpadding="20" cellspacing="1" bgcolor="#ffffff"><tr><td align="center">
    	<img src="' . XOOPS_URL . '/images/logo.gif" border="0" alt="" /><br /><br />
    	<h3>' . $story->title() . '</h3>
    	<small><b>' . _NW_DATE . '</b>&nbsp;' . $datetime . ' | <b>' . _NW_TOPICC . '</b>&nbsp;' . $story->topic_title() . '</small><br /><br /></td></tr>';
    echo '<tr valign="top" style="font:12px;"><td>' . $story->hometext() . '<br />';
    $bodytext = $story->bodytext();
    $bodytext = str_replace("[pagebreak]", "<br style=\"page-break-after:always;\">", $bodytext);
    if ($bodytext != '') {
        echo $bodytext . '<br /><br />';
    }
    echo '</td></tr></table></td></tr></table>
	<br /><br />';
    printf(_NW_THISCOMESFROM, $xoopsConfig['sitename']);
    echo '<br /><a href="' . XOOPS_URL . '/">' . XOOPS_URL . '</a><br /><br />
    	' . _NW_URLFORSTORY . ' <!-- Tag below can be used to display Permalink image --><!--img src="' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/images/x.gif" /--><br />
    	<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/article.php?storyid=' . $story->storyid() . '">' . XOOPS_URL . '/article.php?storyid=' . $story->storyid() . '</a>
    	</td></tr></table>
    	</body>
    	</html>
    	';
}
开发者ID:amjadtbssm,项目名称:website,代码行数:37,代码来源:print.php

示例2: XoopsXmlRpcFault

 function &getPost($respond = true)
 {
     if (!$this->_checkUser($this->params[1], $this->params[2])) {
         $this->response->add(new XoopsXmlRpcFault(104));
     } else {
         // will be removed... don't worry if this looks bad
         include_once XOOPS_ROOT_PATH . '/modules/news/class/class.newsstory.php';
         $story = new NewsStory($this->params[0]);
         $ret = array('uid' => $story->uid(), 'published' => $story->published(), 'storyid' => $story->storyId(), 'title' => $story->title('Edit'), 'hometext' => $story->hometext('Edit'), 'moretext' => $story->bodytext('Edit'));
         if (!$respond) {
             return $ret;
         } else {
             if (!$ret) {
                 $this->response->add(new XoopsXmlRpcFault(106));
             } else {
                 $struct = new XoopsXmlRpcStruct();
                 $content = '';
                 foreach ($ret as $key => $value) {
                     switch ($key) {
                         case 'uid':
                             $struct->add('userid', new XoopsXmlRpcString($value));
                             break;
                         case 'published':
                             $struct->add('dateCreated', new XoopsXmlRpcDatetime($value));
                             break;
                         case 'storyid':
                             $struct->add('postid', new XoopsXmlRpcString($value));
                             $struct->add('link', new XoopsXmlRpcString(XOOPS_URL . '/modules/news/article.php?item_id=' . $value));
                             $struct->add('permaLink', new XoopsXmlRpcString(XOOPS_URL . '/modules/news/article.php?item_id=' . $value));
                             break;
                         case 'title':
                             $struct->add('title', new XoopsXmlRpcString($value));
                             break;
                         default:
                             $content .= '<' . $key . '>' . trim($value) . '</' . $key . '>';
                             break;
                     }
                 }
                 $struct->add('description', new XoopsXmlRpcString($content));
                 $this->response->add($struct);
             }
         }
     }
 }
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:44,代码来源:xoopsapi.php

示例3: b_news_top_show


//.........这里部分代码省略.........
            }
            if ($options[5] == 0) {
                // Use a specific news
                if (!isset($permstory)) {
                    $tmpstory->NewsStory($options[6]);
                } else {
                    $tmpstory = $permstory;
                }
            } else {
                // Use the most recent news
                $stories = array();
                $stories = $tmpstory->getAllPublished(1, 0, $restricted, 0, 1, true, $options[0]);
                if (count($stories) > 0) {
                    $firststory = $stories[0];
                    $tmpstory->NewsStory($firststory->storyid());
                } else {
                    $block['use_spotlight'] = false;
                }
            }
            $spotlight = array();
            $spotlight['title'] = $tmpstory->title();
            if ($options[7] != '') {
                $spotlight['image'] = sprintf("<a href='%s'>%s</a>", XOOPS_URL . '/modules/news/article.php?storyid=' . $tmpstory->storyid(), $myts->displayTarea($options[7], $tmpstory->nohtml));
            }
            $spotlight['text'] = $tmpstory->hometext();
            // Added 16 february 2007 *****************************************
            $story_user = null;
            $story_user = new XoopsUser($tmpstory->uid());
            if (is_object($story_user)) {
                $spotlight['avatar'] = XOOPS_UPLOAD_URL . '/' . $story_user->getVar('user_avatar');
            }
            // ****************************************************************
            $spotlight['id'] = $tmpstory->storyid();
            $spotlight['date'] = formatTimestamp($tmpstory->published(), $dateformat);
            $spotlight['hits'] = $tmpstory->counter();
            $spotlight['rating'] = number_format($tmpstory->rating(), 2);
            $spotlight['votes'] = $tmpstory->votes();
            if (strlen(xoops_trim($tmpstory->bodytext())) > 0) {
                $spotlight['read_more'] = true;
            } else {
                $spotlight['read_more'] = false;
            }
            $spotlight['readmore'] = sprintf("<a href='%s'>%s</a>", XOOPS_URL . '/modules/news/article.php?storyid=' . $tmpstory->storyid(), _MB_READMORE);
            $spotlight['title_with_link'] = sprintf("<a href='%s'>%s</a>", XOOPS_URL . '/modules/news/article.php?storyid=' . $tmpstory->storyid(), $tmpstory->title());
            if ($tmpstory->votes() == 1) {
                $spotlight['number_votes'] = _NW_ONEVOTE;
            } else {
                $spotlight['number_votes'] = sprintf(_NW_NUMVOTES, $tmpstory->votes());
            }
            $spotlight['votes_with_text'] = sprintf(_NW_NUMVOTES, $tmpstory->votes());
            $spotlight['topicid'] = $tmpstory->topicid();
            $spotlight['topic_title'] = $tmpstory->topic_title();
            // Added, topic's image and description
            $spotlight['topic_image'] = XOOPS_URL . '/modules/news/images/topics/' . $tmpstory->topic_imgurl();
            $spotlight['topic_description'] = $myts->displayTarea($tmpstory->topic_description, 1);
            if ($displayname != 3) {
                $spotlight['author'] = sprintf("%s %s", _POSTEDBY, $tmpstory->uname());
                $spotlight['author_with_link'] = sprintf("%s <a href='%s'>%s</a>", _POSTEDBY, XOOPS_URL . '/userinfo.php?uid=' . $tmpstory->uid(), $tmpstory->uname());
            } else {
                $spotlight['author'] = '';
                $spotlight['author_with_link'] = '';
            }
            $spotlight['author_id'] = $tmpstory->uid();
            // Create the summary table under the spotlight text
            if (isset($options[14]) && $options[14] == 0) {
                // Use all topics
开发者ID:trabisdementia,项目名称:xuups,代码行数:67,代码来源:news_top.php

示例4: formatTimestamp

        $tpl->assign('channel_desc', xoops_utf8_encode(htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)));
        $tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss'));
        $tpl->assign('channel_webmaster', checkEmail($xoopsConfig['adminmail'], true));
        // Fed up with spam
        $tpl->assign('channel_editor', checkEmail($xoopsConfig['adminmail'], true));
        // Fed up with spam
        $tpl->assign('channel_category', 'News');
        $tpl->assign('channel_generator', 'XOOPS');
        $tpl->assign('channel_language', _LANGCODE);
        $tpl->assign('image_url', XOOPS_URL . '/images/logo.gif');
        $dimention = getimagesize(XOOPS_ROOT_PATH . '/images/logo.gif');
        if (empty($dimention[0])) {
            $width = 88;
        } else {
            $width = $dimention[0] > 144 ? 144 : $dimention[0];
        }
        if (empty($dimention[1])) {
            $height = 31;
        } else {
            $height = $dimention[1] > 400 ? 400 : $dimention[1];
        }
        $tpl->assign('image_width', $width);
        $tpl->assign('image_height', $height);
        $count = $sarray;
        foreach ($sarray as $story) {
            //$tpl->append('items', array('title' => xoops_utf8_encode(htmlspecialchars($story->title(), ENT_QUOTES)), 'link' => XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(), 'guid' => XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(), 'pubdate' => formatTimestamp($story->published(), 'rss'), 'description' => xoops_utf8_encode($myts->undoHtmlSpecialChars($story->hometext(), ENT_QUOTES))));
            $tpl->append('items', array('title' => xoops_utf8_encode(htmlspecialchars($story->title(), ENT_QUOTES)), 'link' => XOOPS_URL . '/modules/news/article.php?storyid=' . $story->storyid(), 'guid' => XOOPS_URL . '/modules/news/article.php?storyid=' . $story->storyid(), 'pubdate' => formatTimestamp($story->published(), 'rss'), 'description' => xoops_utf8_encode(htmlspecialchars($story->hometext(), ENT_QUOTES))));
        }
    }
}
$tpl->display('db:system_rss.html');
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:31,代码来源:backendt.php

示例5: isset

 * @page_title			Story's title - Printer Friendly Page - Topic's title - Site's name
 *
 * @template_name		This page does not use any template
 *
 */
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;
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:31,代码来源:print.php

示例6: intval

        redirect_header(XOOPS_URL . '/modules/news/index.php', 3, _NOPERM);
        exit;
    }
}
// 2) Is the story published ?
$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)) {
开发者ID:trabisdementia,项目名称:xuups,代码行数:31,代码来源:ratenews.php

示例7: 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';
// We verify that the user can post comments **********************************
if (!isset($xoopsModuleConfig)) {
    die;
}
if ($xoopsModuleConfig['com_rule'] == 0) {
    // Comments are deactivate
    die;
}
if ($xoopsModuleConfig['com_anonpost'] == 0 && !is_object($xoopsUser)) {
    // Anonymous users can't post
    die;
}
// ****************************************************************************
$com_itemid = isset($_GET['com_itemid']) ? intval($_GET['com_itemid']) : 0;
if ($com_itemid > 0) {
    $article = new NewsStory($com_itemid);
    if ($article->storyid > 0) {
        $com_replytext = _POSTEDBY . '&nbsp;<b>' . $article->uname() . '</b>&nbsp;' . _DATE . '&nbsp;<b>' . formatTimestamp($article->published(), news_getmoduleoption('dateformat')) . '</b><br /><br />' . $article->hometext();
        $bodytext = $article->bodytext();
        if ($bodytext != '') {
            $com_replytext .= '<br /><br />' . $bodytext . '';
        }
        $com_replytitle = $article->title();
        include_once XOOPS_ROOT_PATH . '/include/comment_new.php';
    } else {
        exit;
    }
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:31,代码来源:comment_new.php

示例8: isset

         $story->Setdescription($_POST['description']);
         $story->Setkeywords($_POST['keywords']);
     }
     $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) {
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:31,代码来源:submit.php

示例9: isset

// Project: The XOOPS Project                                                //
// ------------------------------------------------------------------------- //
error_reporting(0);
include_once 'header.php';
$myts =& MyTextSanitizer::getInstance();
include_once XOOPS_ROOT_PATH . '/modules/news/class/class.newsstory.php';
require_once XOOPS_ROOT_PATH . '/modules/news/fpdf/fpdf.inc.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);
    exit;
}
$article = new NewsStory($storyid);
// Not yet published
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;
}
$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'))) {
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:31,代码来源:makepdf.php

示例10: formatTimestamp

        $tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss'));
        $tpl->assign('channel_webmaster', checkEmail($xoopsConfig['adminmail'], true));
        // Fed up with spam
        $tpl->assign('channel_editor', checkEmail($xoopsConfig['adminmail'], true));
        // Fed up with spam
        $tpl->assign('channel_category', htmlspecialchars($xt->topic_title(), ENT_QUOTES));
        $tpl->assign('channel_generator', 'XOOPS');
        $tpl->assign('channel_language', _LANGCODE);
        $tpl->assign('image_url', XOOPS_URL . '/images/logo.gif');
        $dimention = getimagesize(XOOPS_ROOT_PATH . '/images/logo.gif');
        if (empty($dimention[0])) {
            $width = 88;
        } else {
            $width = $dimention[0] > 144 ? 144 : $dimention[0];
        }
        if (empty($dimention[1])) {
            $height = 31;
        } else {
            $height = $dimention[1] > 400 ? 400 : $dimention[1];
        }
        $tpl->assign('image_width', $width);
        $tpl->assign('image_height', $height);
        $count = $sarray;
        foreach ($sarray as $story) {
            $storytitle = htmlspecialchars($story->title(), ENT_QUOTES);
            $description = htmlspecialchars($story->hometext(), ENT_QUOTES);
            $tpl->append('items', array('title' => xoops_utf8_encode($storytitle), 'link' => XOOPS_URL . '/modules/news/article.php?storyid=' . $story->storyid(), 'guid' => XOOPS_URL . '/modules/news/article.php?storyid=' . $story->storyid(), 'pubdate' => formatTimestamp($story->published(), 'rss'), 'description' => xoops_utf8_encode($description)));
        }
    }
}
$tpl->display('db:news_rss.html', $topicid);
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:backendt.php

示例11: isset

include_once XOOPS_ROOT_PATH . '/modules/news/class/class.newsstory.php';
include_once XOOPS_ROOT_PATH . '/modules/news/class/class.sfiles.php';
include_once XOOPS_ROOT_PATH . '/class/xoopstree.php';
include_once XOOPS_ROOT_PATH . '/modules/news/include/functions.php';
include_once XOOPS_ROOT_PATH . '/modules/news/class/class.newstopic.php';
include_once XOOPS_ROOT_PATH . '/modules/news/class/keyhighlighter.class.php';
include_once XOOPS_ROOT_PATH . '/modules/news/config.php';
$storyid = isset($_GET['storyid']) ? intval($_GET['storyid']) : 0;
if (empty($storyid)) {
    redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
    exit;
}
$myts =& MyTextSanitizer::getInstance();
// Not yet published
$article = new NewsStory($storyid);
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'))) {
开发者ID:trabisdementia,项目名称:xuups,代码行数:31,代码来源:article.php

示例12: NewsStory

         $story->setExpired($expdate);
     } else {
         $story->setExpired(0);
     }
     $story->setType($_POST['type']);
     $story->setHostname(getenv("REMOTE_ADDR"));
     // $story->setNotifyPub($notifypub);
 } else {
     $story = new NewsStory($storyid);
     if (!empty($_POST['autodate'])) {
         $pubdate = mktime($_POST['autohour'], $_POST['automin'], 0, $_POST['automonth'], $_POST['autoday'], $_POST['autoyear']);
         $offset = $xoopsUser->timezone();
         $offset = $offset - $xoopsConfig['server_TZ'];
         $pubdate = $pubdate - $offset * 3600;
         $story->setPublished($pubdate);
     } elseif ($story->published() == 0 && !empty($_POST['approve'])) {
         $story->setPublished(time());
         $isnew = 1;
     } else {
         if (!empty($_POST['movetotop'])) {
             $story->setPublished(time());
         }
     }
     if (!empty($_POST['autoexpdate'])) {
         $expdate = mktime($_POST['autoexphour'], $_POST['autoexpmin'], 0, $_POST['autoexpmonth'], $_POST['autoexpday'], $_POST['autoexpyear']);
         if (!empty($autoexpdate)) {
             $offset = $xoopsUser->timezone() - $xoopsConfig['server_TZ'];
         }
         $expdate = $expdate - $offset * 3600;
         $story->setExpired($expdate);
     }
开发者ID:koki-h,项目名称:xoops_utf8,代码行数:31,代码来源:index.php

示例13: NewsStory

         $story->setExpired($expdate);
     } else {
         $story->setExpired(0);
     }
     $story->setType($type);
     $story->setHostname(getenv("REMOTE_ADDR"));
     //			$story->setNotifyPub($notifypub);
 } else {
     $story = new NewsStory($storyid);
     if (!empty($autodate)) {
         $pubdate = mktime($autohour, $automin, 0, $automonth, $autoday, $autoyear);
         $offset = $xoopsUser->timezone();
         $offset = $offset - $xoopsConfig['server_TZ'];
         $pubdate = $pubdate - $offset * 3600;
         $story->setPublished($pubdate);
     } elseif ($story->published() == 0 && $approve) {
         $story->setPublished(time());
         $isnew = 1;
     } else {
         if (!empty($movetotop)) {
             $story->setPublished(time());
         }
     }
     if (!empty($autoexpdate)) {
         $expdate = mktime($autoexphour, $autoexpmin, 0, $autoexpmonth, $autoexpday, $autoexpyear);
         $offset = $xoopsUser->timezone() - $xoopsConfig['server_TZ'];
         $expdate = $expdate - $offset * 3600;
         $story->setExpired($expdate);
     }
 }
 $story->setApproved($approve);
开发者ID:amjadtbssm,项目名称:website,代码行数:31,代码来源:index.php

示例14: 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']) . '&amp;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";
开发者ID:amjadtbssm,项目名称:website,代码行数:31,代码来源:archive.php

示例15: isset

//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
include '../../mainfile.php';
include_once XOOPS_ROOT_PATH . '/modules/news/class/class.newsstory.php';
$com_itemid = isset($HTTP_GET_VARS['com_itemid']) ? intval($HTTP_GET_VARS['com_itemid']) : 0;
if ($com_itemid > 0) {
    $article = new NewsStory($com_itemid);
    $com_replytext = _POSTEDBY . '&nbsp;<b>' . $article->uname() . '</b>&nbsp;' . _DATE . '&nbsp;<b>' . formatTimestamp($article->published()) . '</b><br /><br />' . $article->hometext();
    $bodytext = $article->bodytext();
    if ($bodytext != '') {
        $com_replytext .= '<br /><br />' . $bodytext . '';
    }
    $com_replytitle = $article->title();
    include XOOPS_ROOT_PATH . '/include/comment_new.php';
}
开发者ID:amjadtbssm,项目名称:website,代码行数:31,代码来源:comment_new.php


注:本文中的NewsStory::published方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。