本文整理汇总了PHP中NewsStory::bodytext方法的典型用法代码示例。如果您正苦于以下问题:PHP NewsStory::bodytext方法的具体用法?PHP NewsStory::bodytext怎么用?PHP NewsStory::bodytext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NewsStory
的用法示例。
在下文中一共展示了NewsStory::bodytext方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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> ' . $datetime . ' | <b>' . _NW_TOPICC . '</b> ' . $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>
';
}
示例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);
}
}
}
}
示例3: b_news_top_show
//.........这里部分代码省略.........
$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
$stories = $tmpstory->getAllPublished($options[1], 0, $restricted, 0, 1, true, $options[0]);
} else {
// Use some topics
$topics = array_slice($options, 14);
示例4: PrintPage
$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());
}
function PrintPage()
{
global $xoopsConfig, $xoopsModule, $story, $xoops_meta_keywords, $xoops_meta_description;
$myts =& MyTextSanitizer::getInstance();
$datetime = formatTimestamp($story->published(), news_getmoduleoption('dateformat'));
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="<?php
示例5: 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 . ' <b>' . $article->uname() . '</b> ' . _DATE . ' <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;
}
}
示例6: formatTimestamp
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;
}
$dateformat = news_getmoduleoption('dateformat');
$article_data = $article->hometext() . $article->bodytext();
$article_title = $article->title();
$article_title = news_html2text($myts->undoHtmlSpecialChars($article_title));
$forumdata['topic_title'] = $article_title;
$pdf_data['title'] = $article->title();
$topic_title = $article->topic_title();
$topic_title = news_html2text($myts->undoHtmlSpecialChars($topic_title));
$pdf_data['subtitle'] = $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';
$hometext = $article->hometext();
$bodytext = $article->bodytext();
$content = $myts->undoHtmlSpecialChars($hometext) . '<br /><br />' . $myts->undoHtmlSpecialChars($bodytext);
$content = str_replace('[pagebreak]', '<br /><br />', $content);
示例7: isset
} else {
$nosmiley = 0;
}
if ($approveprivilege) {
$nohtml = isset($_POST['nohtml']) ? intval($_POST['nohtml']) : 0;
$story->setNohtml($nohtml);
if (!isset($_POST['approve'])) {
$approve = 0;
}
} else {
$story->setNohtml = 1;
}
$title = $story->title('InForm');
$hometext = $story->hometext('InForm');
if ($approveprivilege) {
$bodytext = $story->bodytext('InForm');
$ihome = $story->ihome();
$description = $story->description('E');
$keywords = $story->keywords('E');
}
//Display post preview
$newsauthor = $story->uid();
$p_title = $story->title('Preview');
$p_hometext = $story->hometext('Preview');
if ($approveprivilege) {
$p_bodytext = $story->bodytext('Preview');
$p_hometext .= '<br /><br />' . $p_bodytext;
}
$topicalign2 = isset($story->topicalign) ? 'align="' . $story->topicalign() . '"' : '';
$p_hometext = $xt->topic_imgurl() != '' && $topicdisplay ? '<img src="images/topics/' . $xt->topic_imgurl() . '" ' . $topicalign2 . ' alt="" />' . $p_hometext : $p_hometext;
themecenterposts($p_title, $p_hometext);
示例8: NewsStory
} 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");
$p_bodytext = $story->bodytext("Preview");
$title = $story->title("InForm");
$hometext = $story->hometext("InForm");
$bodytext = $story->bodytext("InForm");
echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
$timage = "";
$warning = "";
if ($_POST['topicdisplay']) {
if ($_POST['topicalign'] == "L") {
$align = "left";
} else {
$align = "right";
}
if (empty($_POST['topicid'])) {
$warning = "<div style='text-align: center;'><blink><b>" . _AR_SELECTTOPIC . "</b></blink></div>";
$timage = "";
示例9: getmoduleoption
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;
$pdf_data['author'] = $article->uname();
//Other stuff
$puff = '<br />';
$puffer = '<br /><br /><br />';
//create the A4-PDF...
示例10: formatTimestamp
$filename = XOOPS_ROOT_PATH . '/modules/news/language/' . $xoopsConfig['language'] . '/main.php';
if (file_exists($filename)) {
include_once $filename;
} else {
include_once XOOPS_ROOT_PATH . '/modules/news/language/english/main.php';
}
$filename = XOOPS_ROOT_PATH . '/modules/news/pdf/config/lang/' . _LANGCODE . '.php';
if (file_exists($filename)) {
include_once $filename;
} else {
include_once XOOPS_ROOT_PATH . '/modules/news/pdf/config/lang/en.php';
}
$dateformat = news_getmoduleoption('dateformat');
$content = '';
$content .= '<b><i><u>' . $myts->undoHtmlSpecialChars($article->title()) . '</u></i></b><br /><b>' . $myts->undoHtmlSpecialChars($article->topic_title()) . '</b><br />' . _POSTEDBY . ' : ' . $myts->undoHtmlSpecialChars($article->uname()) . '<br />' . _MD_POSTEDON . ' ' . formatTimestamp($article->published(), $dateformat) . '<br /><br /><br />';
$content .= $myts->undoHtmlSpecialChars($article->hometext()) . '<br />' . $myts->undoHtmlSpecialChars($article->bodytext());
$content = str_replace('[pagebreak]', '<br />', $content);
$content = news_unhtml($content);
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true);
$doc_title = $myts->undoHtmlSpecialChars($article->title());
$doc_keywords = 'XOOPS';
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor(PDF_AUTHOR);
$pdf->SetTitle($doc_title);
$pdf->SetSubject($doc_title);
$pdf->SetKeywords($doc_keywords);
$firstLine = news_unhtml($article->title());
$secondLine = news_unhtml(XOOPS_URL . '/modules/news/article.php?storyid=1' . $storyid);
$pdf->SetHeaderData('', '', $firstLine, $secondLine);
//set margins