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


PHP getNews函数代码示例

本文整理汇总了PHP中getNews函数的典型用法代码示例。如果您正苦于以下问题:PHP getNews函数的具体用法?PHP getNews怎么用?PHP getNews使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: process_main

function process_main($window, $id)
{
    global $label, $statusbar, $top_bar, $foot_bar, $news_str, $wb;
    static $pos, $top_pos, $foot_pos;
    $disks_str = "";
    $news_str = $wb->newscontent;
    //	if ((date("i")%3)==0)
    //	{
    //		$news_str="滚动新闻:".getNews ();
    //
    ////		$disks = explode(" ", wb_get_system_info("diskdrives"));
    ////		for ($index = 0; $index < sizeof($disks); $index++)
    ////		{
    ////			$disks_str .= getTotalDiskSpace ($disks[$index]);
    ////		}
    //
    //	}
    //	$news_str=$news_str?$news_str:"滚动新闻:".getNews ();
    switch ($id) {
        case ID_NEWS_TIMER:
            $wb->newscontent = getNews();
            break;
        case ID_APP_TIMER:
            // Show the current time in hours, minutes and seconds
            wb_set_text($label, getTimeShotFormat(date("h:i:s A")));
            // Truncate text
            $text = $news_str;
            //			$text = formatLocalDate (date("Y-m-d H:i:s")).$news_str;//.$news_str;//date(LONG_FMT);
            $len = strlen($text);
            wb_set_text($statusbar, mb_substr($text . $text, $pos, $len, "gb2312"));
            //substr($text . $text, $pos, $len) mb_substr($text . $text, $pos, $len,"gb2312")
            $pos = $pos < $len ? $pos + 2 : 0;
            $top_text = "....>........";
            if (ereg("11:4([0-9])", date("H:i"))) {
                $top_text = "吃中午饭时间";
            }
            if (ereg("12:([0-9]{2})", date("H:i"))) {
                $top_text = "中午休息时间";
            }
            if (ereg("17:([2-3][0-9])", date("H:i"))) {
                $top_text = "记得写每日工作报告";
            }
            $top_len = strlen($top_text);
            wb_set_text($top_bar, mb_substr($top_text . $top_text, $top_pos, $top_len, "gb2312"));
            //substr($text . $text, $pos, $len) mb_substr($text . $text, $pos, $len,"gb2312")
            $top_pos = $top_pos > 0 ? $top_pos - 1 : $top_len;
            //			$foot_len = strlen($disks_str);
            //			wb_set_text($foot_bar, mb_substr($disks_str . $disks_str, $foot_pos, $foot_len,"gb2312"));//substr($text . $text, $pos, $len) mb_substr($text . $text, $pos, $len,"gb2312")
            //			$foot_pos = $foot_pos < $foot_len  ? $foot_pos +1 : 0;
            break;
        case IDCLOSE:
            wb_destroy_window($window);
            break;
    }
}
开发者ID:BackupTheBerlios,项目名称:flushcms,代码行数:55,代码来源:digiclock.php

示例2: member_auth

* see license.txt file; if not, write to marketing@boonex.com
***************************************************************************/
require_once 'inc/header.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'design.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'news.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'profiles.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'utils.inc.php';
// --------------- page variables / login
$_page['name_index'] = 20;
$_page['css_name'] = 'news.css';
$logged['member'] = member_auth(0, false);
$_page['header'] = _t("_NEWS_H");
$_page['header_text'] = _t("_NEWS_H");
// --------------- page components
$_ni = $_page['name_index'];
$_page_cont[$_ni]['page_main_code'] = isset($_GET['ID']) || isset($_GET['newsUri']) ? getNews() : printNewsList();
// --------------- [END] page components
PageCode();
// --------------- page components functions
/**
 * Print news
 */
function printNewsList()
{
    global $news_limit_chars;
    global $short_date_format;
    global $tmpl;
    $bNewsFriendly = getParam('permalinks_news') == 'on' ? true : false;
    $res = getNewsList();
    ob_start();
    if (!mysql_num_rows($res)) {
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:31,代码来源:news.php

示例3: _Comment_delete

 function _Comment_delete()
 {
     if (!$this->userdata['rights']['news']) {
         $this->_header("index.php");
     }
     $data = $_SESSION['steps'];
     $nid = param_num("nid");
     $cid = param_num("cid");
     #information message, step 2
     if ($data['deletecom']) {
         #save step
         unset($data['deletecom']);
         $_SESSION['steps'] = $data;
         $this->forms['information']['url'] = $this->backtracking->backlink();
         $this->forms['information']['action'] = "comments";
         $this->forms['information']['title'] = "Kommentar löschen";
         $this->forms['information']['message'] = "Kommentar erfolgreich gelöscht";
         $this->forms['information']['style'] = "green";
         $this->show('message_information', "Kommentar löschen");
     }
     if (!$cid) {
         $this->_header($this->backtracking->backlink());
     }
     $return = getNewsComment($cid);
     if (!$return) {
         $this->_header($this->backtracking->backlink());
     }
     $newsdata = getNews($nid);
     if (!$newsdata) {
         $this->_header($this->backtracking->backlink());
     }
     #deletecom, send
     if ($_REQUEST['send']) {
         if ($_REQUEST['yes_x']) {
             addToLogfile("Kommentar bei <b>" . $newsdata['title'] . "</b> gelöscht", "News", $this->userdata['uid']);
             deleteNewsCom($return['cid']);
             #save step
             $data['deletecom'] = 1;
             $_SESSION['steps'] = $data;
             $this->_header("index.php?action=deletecom&nid=" . $nid . "&send");
         } else {
             $this->_header($this->backtracking->backlink());
         }
     } else {
         $this->forms['information']['url'] = "index.php?nid={$nid}&cid={$cid}";
         $this->forms['information']['action'] = "deletecom";
         $this->forms['information']['title'] = "Kommentar löschen";
         $this->forms['information']['message'] = "Kommentar löschen ? <br><br>" . formatTextData($return['content']);
         $this->forms['information']['style'] = "black";
         $this->show('message_question', "Kommentar löschen");
     }
 }
开发者ID:Bobsel,项目名称:gn-tic,代码行数:52,代码来源:index.class.php

示例4: getNews

}
?>
                
            </div>
		
		</div>
 
	</div>    <!-- content End -->

	<!-- Footer Include -->
    <div id="footer"><?php 
include_once 'footer.php';
?>
</div> <!-- wrraper End -->
<script type="text/javascript">
	
    $('.dispScrolled ul').cycle({
        fx: 'scrollUp'
    });
    
    $('#newsDisp div').cycle({
        fx: 'fade'
    });
</script>
<div id="newsDisp">
    <?php 
echo getNews();
?>
</div>
</body>
</html>
开发者ID:sangikumar,项目名称:IP,代码行数:31,代码来源:admin.php

示例5: loadTrendingThreads

</script>
	</div>
	
	</aside>
	<section id="main_section"><!-- meet of the website-->
		<article class="trendingThreads trending threads topics abc article">
			<header><p class="channelHeder">Popular on the ABC forum</p></header>
			<div class="div trendingThreads trending threads topics abc">
			<?php 
loadTrendingThreads();
?>
			</div>
		</article>
			<article><header><p class="newsHeader">News</p></header>
		<?php 
getNews();
?>
		</article>
	</section>
	<!-- twitter causes the center div not to move -->
	<aside id="trendingNow" class="sideRight side_news twitter feed trendingNow general"><!-- id was side_news-->
	     <div class="twitter"> 
	      <a class="twitter-timeline"  href="https://twitter.com/ABCNetwork" data-widget-id="570623846131052544">Tweets by @ABCNetwork</a>
          <script type="text/javascript">!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> 
	</div>
	<div class="ad" style="width:15%;">
		
	
	</div>
	</aside>
	</div> <!-- end new div-->
开发者ID:m2345,项目名称:tvstalkers,代码行数:31,代码来源:index.php

示例6: view

function view()
{
	$b=h1("News").getNews();

	return menuSystem($b);
}
开发者ID:BackupTheBerlios,项目名称:antargis-svn,代码行数:6,代码来源:view.inc.php

示例7: displayNews

    displayNews(getNews($news_id));
    displayComments(getNewsComments($news_id));
    return;
} else {
    if (defined('INDEX_MODULE')) {
        $news = getNews(null, $limit, $index);
        displayNews($news, true);
        OpenContent();
        ?>
		<div style="float:right;">
			<a href="?load=news">Read All</a>&nbsp;
		</div>

<?php 
    } else {
        $news = getNews(null, $limit, $index);
        OpenContent();
        if ($page_num > 0) {
            echo "&nbsp;<a href=\"?load=news&page={$page_num}\">More Recent News</a>";
        }
        if (count($news) == $limit) {
            ?>
			<div style="float:right;">
				<a href="?load=news&page=<?php 
            echo $page_num + 2;
            ?>
">Older News</a>&nbsp;
			</div>
			<div class="clear"></div>	
<?php 
        }
开发者ID:jhunkeler,项目名称:bayonetcms,代码行数:31,代码来源:index.php

示例8: getSplotch

<?php

$TITLE = "Main";
include "inc.head.php";
echo getSplotch("missionstatement");
echo getNews(0, 10);
include "inc.foot.php";
开发者ID:BackupTheBerlios,项目名称:atomicl,代码行数:7,代码来源:index.php

示例9: getNews

                            
                            <div class="alert alert-info">
                                <h1 >Haberler</h1>
                                <p>Haberleri düzenlemek ya da silmek için listenin sağ tarafındaki butonları kullanınız.</p>
                            </div>
                            
                            <table class="table table-bordered table-hover">
                                <tr>
                                    <th>Durum</th>
                                    <th>Başlık</th>
                                    <th>İçerik</th>
                                    <th>Tarih</th>
                                    <th>Düzenle</th>
                                </tr>
                                <?php 
$allNews = getNews();
?>
                                <?php 
while ($news = mysql_fetch_array($allNews)) {
    ?>
                                <tr>
                                    <td>
                                        <?php 
    if ($news[1] == 0) {
        echo "Taslak";
    } else {
        echo "Yayında";
    }
    ?>
                                    </td>
开发者ID:kaanburaksener,项目名称:bicycle-rent-app,代码行数:29,代码来源:news.php

示例10: foreach

										<input type="submit" name="submit" value="CONNEXION">
									</div>
								</form>
							</div>
						</div>
				</div>
			</div>
		<?php 
} else {
    ?>
			<div class="col-xs-12 col-sm-6">
				<div class="box">
					<div class="title">Nouveautés:</div>
					<div class="news">
						<?php 
    foreach (getNews() as $news) {
        echo '<div class="title">' . Utils::shorten($news['title'], 35) . '</div>';
        echo '<div class="news">' . Utils::shorten($news['news'], 127) . '</div>';
        echo "<hr/>";
    }
    ?>
					</div>
				</div>
			</div>
			<div class="col-xs-12 col-sm-6">
				<div class="box">
					<div class="title">Travaux:</div>
					<div class="news">
						<?php 
    foreach (getWorks() as $work) {
        echo '<div class="title">' . Utils::shorten($work['title'], 35) . '</div>';
开发者ID:erib1998,项目名称:McWebmin,代码行数:31,代码来源:v_home.php

示例11: explode

//POST
$news = 'Четыре новосибирские компании вошли в сотню лучших работодателей
Выставка университетов США: открой новые горизонты
Оценку «неудовлетворительно» по качеству получает каждая 5-я квартира в новостройке
Студент-изобретатель раскрыл запутанное преступление
Хоккей: «Сибирь» выстояла против «Ак Барса» в пятом матче плей-офф
Здоровое питание: вегетарианская кулинария
День святого Патрика: угощения, пивной теннис и уличные гуляния с огнем
«Красный факел» пустит публику на ночные экскурсии за кулисы и по закоулкам столетнего здания
Звезды телешоу «Голос» Наргиз Закирова и Гела Гуралиа споют в «Маяковском»';
$news = explode("\n", $news);
if (isset($_POST['id'])) {
    $id = $_POST['id'];
    if (is_numeric($id) && array_key_exists($id, $news)) {
        getNews($id);
    } else {
        echo "Новости с таким id не существует";
    }
} else {
    header("HTTP/1.0 404 Not Found");
    echo "Страница не найдена, воспользуйтесь формой поиска, введите от 0 до 9<br/>";
    ?>
    
    <form method="POST">
        <input type="text" name="id" id="">
        <input type="submit" value="Показать">
    </form>
    
    <?php 
    news();
开发者ID:LEXXiY,项目名称:devschool,代码行数:30,代码来源:dz5_2.php

示例12: getNews

//on souhaite 5 news par page, le nombre de page est égal au nombre de news total divisé par 5.
//dans la plupart des cas, on aura un réel. pas de possibilité d'avoir 2.6 pages, on rajoute une page au cas où ca ne tombe pas juste
$nbPages = (int) ($nbNews / $newsParPage) + 1;
//on vérifie qu'au cas où le résultat tombe juste, on affiche pas une page en plus qui serait vide
if ($nbNews % $newsParPage == 0) {
    $nbPages = $nbPages - 1;
}
if (!isset($_GET['page'])) {
    $_GET['page'] = '1';
}
// pas de pages --> page 1
//on transforme le numero de page en entier, si la variable page n'est pas un nombre, page sera égal à 0
if (isset($_GET['page'])) {
    $page = (int) $_GET['page'];
}
//on vérifie maintenant que le numero de page existe bien
if (isset($page) and $page <= $nbPages and $page > 0) {
    $newsArray = getNews(($page - 1) * $newsParPage, $newsParPage, 'dateOrder DESC');
    foreach ($newsArray as $n) {
        $nbCommentNews[$n['ID']] = nbComments($n['ID']);
    }
    include_once 'vue/news/index.php';
} else {
    $js = false;
    $redirect[0] = 'news.php?op=index';
    $redirect[1] = '1';
    $page = 'accueil';
    $titreErreur = 'news : erreur';
    $erreur = 'Aucune news ne se trouve sur cette page!';
    include_once 'vue/erreur.php';
}
开发者ID:Rbeuque74,项目名称:boutiqueMvc,代码行数:31,代码来源:index.php

示例13: getTopNews

function getTopNews()
{
	echo getNews(true);
}
开发者ID:BackupTheBerlios,项目名称:antargis-svn,代码行数:4,代码来源:view.inc.php

示例14: substr

		$str = substr($text,$pos + 5,$pos2 - $pos - 5);
		$str2 = "internal_".$str;
		$text = str_replace("[var:".$str."]", @$$str2, $text);
	}*/
//
// end
//
//
// load style
//
$page = str_replace("[title]", $title, $page);
$page = str_replace("[text]", $text, $page);
$page = str_replace("[menu]", generatemenu(@$internal_style, 1, $extern_page), $page);
$page = str_replace("[menu2]", generatemenu(@$internal_style, 2, $extern_page), $page);
include "news.php";
$page = str_replace("[news]", getNews(), $page);
$page = str_replace("[position]", position_to_root($page_data->page_id), $page);
if (strpos($page, "[gbook-")) {
    include "gbook.php";
    $page = str_replace("[gbook-input]", gbook_input(), $page);
    $page = str_replace("[gbook-pages]", gbook_pages(), $page);
    $page = str_replace("[gbook-content]", gbook_content(), $page);
}
if (strpos($page, "[contact]")) {
    include "contact.php";
    $page = str_replace("[contact]", contact_formular(), $page);
}
$inlinemenu = '';
if ($page_data->inlinemenu_html != null) {
    include './styles/' . $internal_style . '/menue.php';
    $inlinemenu = $menu_inline;
开发者ID:BackupTheBerlios,项目名称:comacms-svn,代码行数:31,代码来源:index.php

示例15: getNews



<html>
	
	<div id="main">

		<div id="headerimg"><img src="img/head/5_h.png"></div>

		<h1>nyheter</h1>

		<div id="nyhet">

		<?php 
if (isset($_GET['news'])) {
    $news_id = $_GET['news'];
    $nyhet = getNews($news_id);
    if ($nyhet['news_pic']) {
        print '<div class="news_img"><img src="img/news/' . $nyhet['news_pic'] . '"></div>';
    }
    print mb_strtolower('<h1>' . $nyhet['news_title'] . '</h1>', 'UTF-8');
    print '<p>' . $nyhet['news'] . '</p>';
    print '<div class="datum">' . convertDate($nyhet['news_date']) . '</div>';
    print '<div class="border"></div>';
}
print '</div>';
print '<div id="container">';
foreach ($news as $news) {
    print '<div class="item">';
    print '<div class="wrap pil hvr-grow">';
    if ($news['news_pic']) {
        print '<a href="news.php?news=' . $news['news_id'] . '"><img src="img/news/' . $news['news_pic'] . '"></a>';
开发者ID:nilvisa,项目名称:WaterWeave,代码行数:29,代码来源:news.php


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