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


PHP NewsStory::topic_title方法代码示例

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


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


//.........这里部分代码省略.........
            }
            $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);
                $stories = $tmpstory->getAllPublished($options[1], 0, $restricted, $topics, 1, true, $options[0]);
            }
            if (count($stories) > 0) {
                foreach ($stories as $key => $story) {
                    $news = array();
                    $title = $story->title();
                    if (strlen($title) > $options[2]) {
                        $title = xoops_substr($title, 0, $options[2] + 3);
                    }
                    $news['title'] = $title;
                    $news['id'] = $story->storyid();
                    $news['date'] = formatTimestamp($story->published(), $dateformat);
                    $news['hits'] = $story->counter();
                    $news['rating'] = number_format($story->rating(), 2);
开发者ID:trabisdementia,项目名称:xuups,代码行数:67,代码来源:news_top.php

示例3: formatTimestamp

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);
$pdf_data['content'] = $content;
$pdf_data['author'] = $article->uname();
//Other stuff
$puff = '<br />';
$puffer = '<br /><br /><br />';
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:31,代码来源:makepdf.php

示例4: count

$filescount = count($filesarr);
$xoopsTpl->assign('attached_files_count', $filescount);
if ($filescount > 0) {
    foreach ($filesarr as $onefile) {
        $newsfiles[] = array('file_id' => $onefile->getFileid(), 'visitlink' => XOOPS_URL . '/modules/news/visit.php?fileid=' . $onefile->getFileid(), 'file_realname' => $onefile->getFileRealName(), 'file_attacheddate' => formatTimestamp($onefile->getDate(), $dateformat), 'file_mimetype' => $onefile->getMimetype(), 'file_downloadname' => XOOPS_UPLOAD_URL . '/' . $onefile->getDownloadname());
    }
    $xoopsTpl->assign('attached_files', $newsfiles);
}
/**
 * Create page's title
 */
$complement = '';
if (news_getmoduleoption('enhanced_pagenav') && (isset($arr_titles) && is_array($arr_titles) && isset($arr_titles, $storypage) && $storypage > 0)) {
    $complement = ' - ' . $arr_titles[$storypage];
}
$xoopsTpl->assign('xoops_pagetitle', $article->title() . $complement . ' - ' . $article->topic_title() . ' - ' . $xoopsModule->name('s'));
if (news_getmoduleoption('newsbythisauthor')) {
    $xoopsTpl->assign('news_by_the_same_author_link', sprintf("<a href='%s?uid=%d'>%s</a>", XOOPS_URL . '/modules/news/newsbythisauthor.php', $article->uid(), _NW_NEWSSAMEAUTHORLINK));
}
/**
 * Create a clickable path from the root to the current topic (if we are viewing a topic)
 * Actually this is not used in the default's templates but you can use it as you want
 * Uncomment the code to be able to use it
 */
if ($cfg['create_clickable_path']) {
    $mytree = new XoopsTree($xoopsDB->prefix('topics'), 'topic_id', 'topic_pid');
    $topicpath = $mytree->getNicePathFromId($article->topicid(), 'topic_title', 'index.php?op=1');
    $xoopsTpl->assign('topic_path', $topicpath);
    unset($mytree);
}
/**
开发者ID:trabisdementia,项目名称:xuups,代码行数:31,代码来源:article.php

示例5: sFiles

$sfiles = new sFiles();
$filesarr = array();
$newsfiles = array();
$filesarr = $sfiles->getAllbyStory($storyid);
$filescount = count($filesarr);
$xoopsTpl->assign('attached_files_count', $filescount);
if ($filescount > 0) {
    foreach ($filesarr as $onefile) {
        $newsfiles[] = array('file_id' => $onefile->getFileid(), 'visitlink' => XOOPS_URL . '/modules/news/visit.php?fileid=' . $onefile->getFileid(), 'file_realname' => $onefile->getFileRealName(), 'file_attacheddate' => formatTimestamp($onefile->getDate(), $dateformat), 'file_mimetype' => $onefile->getMimetype(), 'file_downloadname' => XOOPS_UPLOAD_URL . '/' . $onefile->getDownloadname());
    }
    $xoopsTpl->assign('attached_files', $newsfiles);
}
/**
 * Create page's title
*/
$xoopsTpl->assign('xoops_pagetitle', $article->title() . ' - ' . $article->topic_title() . ' - ' . $myts->htmlSpecialChars($xoopsModule->name()));
if (getmoduleoption('newsbythisauthor')) {
    $xoopsTpl->assign('news_by_the_same_author_link', sprintf("<a href='%s?uid=%d'>%s</a>", XOOPS_URL . '/modules/news/newsbythisauthor.php', $article->uid(), _NW_NEWSSAMEAUTHORLINK));
}
/**
 * Create a clickable path from the root to the current topic (if we are viewing a topic)
 * Actually this is not used in the default's templates but you can use it as you want
 * Uncomment the code to be able to use it
 */
$mytree = new XoopsTree($xoopsDB->prefix("topics"), "topic_id", "topic_pid");
$topicpath = $mytree->getNicePathFromId($article->topicid(), "topic_title", "index.php?op=1");
$xoopsTpl->assign('topic_path', $topicpath);
unset($mytree);
/**
 * Summary table
 *
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:31,代码来源:article.php

示例6: 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

示例7: formatTimestamp

require_once XOOPS_ROOT_PATH . '/modules/news/pdf/tcpdf.php';
$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);
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:pdf.php


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