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


PHP NewsStory::textlink方法代码示例

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


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

示例1: formatTimestamp

    if (is_object($xoopsUser)) {
        if ($xoopsUser->getVar('uid') == $article->uid() || news_is_admin_group()) {
            // nothing ! ;-)
        } else {
            $article->updateCounter();
        }
    } else {
        $article->updateCounter();
    }
}
$xoopsOption['template_main'] = 'news_article.html';
include_once XOOPS_ROOT_PATH . '/header.php';
$story['id'] = $storyid;
$story['posttime'] = formatTimestamp($article->published(), $dateformat);
$story['news_title'] = $article->title();
$story['title'] = $article->textlink() . ' : ' . $article->title();
$story['topic_title'] = $article->textlink();
$story['text'] = $article->hometext();
$bodytext = $article->bodytext();
if (xoops_trim($bodytext) != '') {
    $articletext = array();
    if (news_getmoduleoption('enhanced_pagenav')) {
        $articletext = preg_split('/(\\[pagebreak:|\\[pagebreak)(.*)(\\])/iU', $bodytext);
        $arr_titles = array();
        $auto_summary = $article->auto_summary($bodytext, $arr_titles);
        $bodytext = str_replace('[summary]', $auto_summary, $bodytext);
        $articletext[$storypage] = str_replace('[summary]', $auto_summary, $articletext[$storypage]);
        $story['text'] = str_replace('[summary]', $auto_summary, $story['text']);
    } else {
        $articletext = explode('[pagebreak]', $bodytext);
    }
开发者ID:trabisdementia,项目名称:xuups,代码行数:31,代码来源:article.php

示例2: NewsStory

include_once XOOPS_ROOT_PATH . '/header.php';
$myts =& MyTextSanitizer::getInstance();
// set comment mode if not set
$article = new NewsStory($storyid);
if ($article->published() == 0 || $article->published() > time()) {
    redirect_header('index.php', 2, _NW_NOSTORY);
    exit;
}
$storypage = isset($_GET['page']) ? intval($_GET['page']) : 0;
// update counter only when viewing top page
if (empty($_GET['com_id']) && $storypage == 0) {
    $article->updateCounter();
}
$story['id'] = $storyid;
$story['posttime'] = formatTimestamp($article->published());
$story['title'] = $article->textlink() . " : " . $article->title();
$story['text'] = $article->hometext();
$bodytext = $article->bodytext();
if (trim($bodytext) != '') {
    $articletext = explode("[pagebreak]", $bodytext);
    $story_pages = count($articletext);
    if ($story_pages > 1) {
        include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
        $pagenav = new XoopsPageNav($story_pages, 1, $storypage, 'page', 'storyid=' . $storyid);
        $xoopsTpl->assign('pagenav', $pagenav->renderNav());
        //$xoopsTpl->assign('pagenav', $pagenav->renderImageNav());
        if ($storypage == 0) {
            $story['text'] = $story['text'] . '<br /><br />' . $articletext[$storypage];
        } else {
            $story['text'] = $articletext[$storypage];
        }
开发者ID:koki-h,项目名称:xoops_utf8,代码行数:31,代码来源:article.php


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