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


PHP news::getNewsArray方法代码示例

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


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

示例1: displayNews

/**
 * @package pragyan
 * @copyright (c) 2008 Pragyan Team
 * @license http://www.gnu.org/licenses/ GNU Public License
 * For more details, see README
 */
function displayNews()
{
    $news = <<<NEWS
\t\t<style type="text/css">
\t\ta.tickl{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;line-height:12px;text-decoration:none;color:#fff;font-weight:bold;}
\t\t.tickls{color:#666;}
\t\t</style>
\t\t<div id="newsbox" style="font-size:0.9em;position:absolute;right:45px;width:375px;top:80px;color:#fff;z-index:2;">
\t\t<div class="ticki" >
\t\t<a class="tickl" href="/08/home/news/"><span class="tickls">UPDATES</span></a>
\t\t<a id="tickerAnchor" class="tickl" target="_top" href=""></a>
\t\t</div>
\t\t</div>
\t\t<script type="text/javascript" language="JavaScript">
\t\t <!--
\t\t var theCharacterTimeout = 50;
\t\t var theStoryTimeout = 5000;
\t\t var theWidgetOne = "_";
\t\t var theWidgetTwo = "-";
\t\t var theWidgetNone = "";
\t\t var theLeadString = ":&nbsp;";
\t\t var theSummaries = new Array();
\t\t var theSiteLinks = new Array();
NEWS;
    global $sourceFolder;
    global $moduleFolder;
    global $urlRequestRoot;
    global $pageIdArray;
    require_once "{$sourceFolder}/{$moduleFolder}/news.lib.php";
    $tmpNewsObj = new news();
    $pageFullPath = "/news/";
    ///<Replace with path of news page
    $pageId = parseUrlReal($pageFullPath, $pageIdArray);
    $pageInfo = getPageInfo($pageId);
    $newsArray = $tmpNewsObj->getNewsArray($pageInfo['page_modulecomponentid']);
    $news .= "var theItemCount =" . sizeof($newsArray) . ";";
    for ($i = 0; $i < sizeof($newsArray); $i++) {
        $newsFeed = $newsArray[$i]['news_title'];
        $newsFeed .= " - " . $newsArray[$i]['news_feed'];
        $newsLink = $newsArray[$i]['news_link'];
        //		displayerror()
        if (strlen($newsFeed) >= 48) {
            $newsFeed = substr($newsFeed, 0, 48);
            $newsFeed = substr($newsFeed, 0, strrpos($newsFeed, " "));
            $newsFeed .= "...";
        }
        $news .= "theSummaries[{$i}] = \"{$newsFeed}\";";
        if ($newsLink == "") {
            $newsLink = $urlRequestRoot . $pageFullPath . "&id=" . $newsArray[$i]['news_id'];
        }
        $news .= "theSiteLinks[{$i}] = \"{$newsLink}\";";
    }
    $news .= <<<NEWS
\t\t startTicker();
\t\t //-->
\t\t</script>
NEWS;
    return $news;
}
开发者ID:ksb1712,项目名称:pragyan,代码行数:65,代码来源:news.php

示例2: displayNew

function displayNew()
{
    global $sourceFolder;
    global $moduleFolder;
    global $urlRequestRoot;
    global $pageIdArray;
    require_once "{$sourceFolder}/{$moduleFolder}/news.lib.php";
    $tmpNewsObj = new news();
    $pageFullPath = "/whatsnew/";
    ///<Replace with path of news page
    $pageId = parseUrlReal($pageFullPath, $pageIdArray);
    $pageInfo = getPageInfo($pageId);
    $newsArray = $tmpNewsObj->getNewsArray($pageInfo['page_modulecomponentid']);
    $newsFeed = '';
    for ($i = 0; $i < sizeof($newsArray); $i++) {
        $newsTitle = str_replace("'", "&#39;", $newsArray[$i]['news_title']);
        $newsBody = str_replace("'", "&#39;", $newsArray[$i]['news_feed']);
        $newsTitle = rtrim($newsTitle);
        $newsBody = rtrim($newsBody);
        $days = 20;
        //		if(time()<(strtotime($newsArray[$i]['news_date'])+($days*24*60*60))) {
        //			$newsBody .= '<font color="#f9dc72"><strong> NEW!</strong></font>';
        //		}
        if ($newsArray[$i]['news_link'] == '') {
            $newsFeed .= '\'<a href=/09/home/whatsnew>' . $newsTitle . ' ' . $newsBody . '</a>\',';
        } else {
            $newsFeed .= '\'<a href=' . $newsArray[$i]['news_link'] . '>' . $newsTitle . ' ' . $newsBody . '</a>\',';
        }
    }
    $newsFeed = rtrim($newsFeed, ',');
    /**
    		if (strlen($newsFeed) >= 48) {
    			$newsFeed = substr($newsFeed, 0, 48);
    			$newsFeed = substr($newsFeed, 0, strrpos($newsFeed, " "));
    			$newsFeed .= "...";
    		}
    */
    $news = <<<NEWS
<script>
var pausecontent2=new Array({$newsFeed})
</script>
NEWS;
    return $news;
}
开发者ID:ksb1712,项目名称:pragyan,代码行数:44,代码来源:news.kid.php

示例3: displayNews2

/**
 * @package pragyan
 * @copyright (c) 2008 Pragyan Team
 * @license http://www.gnu.org/licenses/ GNU Public License
 * For more details, see README
 */
function displayNews2()
{
    global $sourceFolder;
    global $moduleFolder;
    global $urlRequestRoot;
    global $pageIdArray;
    require_once "{$sourceFolder}/{$moduleFolder}/news.lib.php";
    $tmpNewsObj = new news();
    $pageFullPath = "/news/";
    ///<Replace with path of news page
    $pageId = parseUrlReal($pageFullPath, $pageIdArray);
    $pageInfo = getPageInfo($pageId);
    $newsArray = $tmpNewsObj->getNewsArray(0);
    for ($i = 0; $i < sizeof($newsArray); $i++) {
        $divopen = "<div class=\"news_style\" rel=\"{$newsArray[$i]}[news_title]\" id=\"news{$i}\">";
        $heading = "<h4>{$newsArray[$i]}[news_title]</h4>";
        $content = "{$newsArray[$i]}[news_feed]";
        $divclose = "</div>";
        $fulldiv = $divopen . $heading . $content . $divclose;
        echo $fulldiv;
    }
    return 1;
}
开发者ID:ksb1712,项目名称:pragyan,代码行数:29,代码来源:news.kulz.php

示例4: news

 * @copyright (c) 2010 Pragyan Team
 * @license http://www.gnu.org/licenses/ GNU Public License
 * For more details, see README
 */
$newsItems = "<div style=\"display: none;\" id=\"newscontainer\">";
global $sourceFolder;
global $moduleFolder;
global $urlRequestRoot;
global $pageIdArray;
require_once "{$sourceFolder}/{$moduleFolder}/news.lib.php";
$tmpNewsObj = new news();
$pageFullPath = "/news/";
///<Replace with path of news page
$pageId = parseUrlReal($pageFullPath, $pageIdArray);
$pageInfo = getPageInfo($pageId);
$newsArray = $tmpNewsObj->getNewsArray(0);
for ($i = 0; $i < count($newsArray); $i++) {
    $newstitle = $newsArray[$i]['news_title'];
    $newsfeed = $newsArray[$i]['news_feed'];
    $newslink = $newsArray[$i]['news_link'];
    $divopen = "<div class=\"news_style\" rel=\"{$newstitle}\" id=\"news{$i}\">";
    $heading = "<h4><a href='" . $newslink . "'>" . $newstitle . "</a></h4>";
    $content = "{$newsfeed}";
    $divclose = "</div>";
    $fulldiv = $divopen . $heading . $content . $divclose;
    $newsItems .= $fulldiv;
}
$newsItems .= "</div>";
/*
$newsItems = <<<NEWSITEMS
	<div style="display: none;" id="newscontainer">
开发者ID:ksb1712,项目名称:pragyan,代码行数:31,代码来源:updates.php


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