Exemplo n.º 1
0
function commonNewsLoop($paged)
{
    $newstypes = array('album' => gettext('album'), 'image' => gettext('image'), 'video' => gettext('video'), 'news' => gettext('news'));
    while (next_news()) {
        $newstype = getNewsType();
        $newstypedisplay = $newstypes[$newstype];
        if (stickyNews()) {
            $newstypedisplay .= ' <small><em>' . gettext('sticky') . '</em></small>';
        }
        ?>
		<div class="newsarticle<?php 
        if (stickyNews()) {
            echo ' sticky';
        }
        ?>
">
			<h3><?php 
        printNewsTitleLink();
        echo " <span class='newstype'>[" . $newstypedisplay . "]</span>";
        ?>
</h3>
			<div class="newsarticlecredit">
				<span class="newsarticlecredit-left">
					<?php 
        $count = getCommentCount();
        $cat = getNewsCategories();
        printNewsDate();
        if ($count > 0) {
            echo ' | ';
            printf(gettext("Comments: %d"), $count);
        }
        ?>
				</span>
				<?php 
        if (is_GalleryNewsType()) {
            echo ' | ' . gettext("Album:") . " <a href='" . getNewsAlbumURL() . "' title='" . getBareNewsAlbumTitle() . "'>" . getNewsAlbumTitle() . "</a>";
        } else {
            if (!empty($cat) && !in_context(ZP_ZENPAGE_NEWS_CATEGORY)) {
                echo ' | ';
                printNewsCategories(", ", gettext("Categories: "), "newscategories");
            }
        }
        ?>
			</div> <!-- newsarticlecredit -->
			<br clear="all" />
			<?php 
        printCodeblock(1);
        ?>
			<?php 
        printNewsContent();
        ?>
			<?php 
        printCodeblock(2);
        ?>
			<br clear="all" />
			</div>
	<?php 
    }
    if ($paged) {
        printNewsPageListWithNav(gettext('next &raquo;'), gettext('&laquo; prev'), true, 'pagelist', true);
    }
}
/**
 * Returns the text for the read more link for news articles or gallery items if in CombiNews mode
 *
 * @return string
 */
function getNewsReadMore()
{
    global $_zp_current_zenpage_news;
    $type = getNewsType();
    switch ($type) {
        case "news":
            $readmore = get_language_string(ZP_READ_MORE);
            break;
        case "image":
        case "video":
        case "album":
            $readmore = get_language_string(getOption("zenpage_combinews_readmore"));
            break;
    }
    return $readmore;
}
Exemplo n.º 3
0
		<br style="clear: both" />
		<?php 
    printPageListWithNav("&laquo; " . gettext("prev"), gettext("next") . " &raquo;");
    ?>

	<?php 
} else {
    // news article loop
    printNewsPageListWithNav(gettext('next &raquo;'), gettext('&laquo; prev'), true, 'pagelist', true);
    echo "<hr />";
    while (next_news()) {
        ?>
 <div class="newsarticle">
		<h3><?php 
        printNewsTitleLink();
        echo " <span class='newstype'>[" . getNewsType() . "]</span>";
        ?>
</h3>
				<div class="newsarticlecredit"><span class="newsarticlecredit-left"><?php 
        printNewsDate();
        ?>
 | <?php 
        echo gettext("Comments:");
        ?>
 <?php 
        echo getCommentCount();
        ?>
</span>
<?php 
        if (is_GalleryNewsType()) {
            if (!is_NewsType("album")) {
Exemplo n.º 4
0
 function edit()
 {
     //新建
     //$t=getgpc("t");
     $id = intval(getgpc("id"));
     $catres = getNewsType("news");
     foreach ($catres as $row) {
         $cat[$row['catid']] = $row['name'];
     }
     $data['cat'] = $cat;
     //面包屑导航
     $headpagemenu = array(0 => array('name' => '后台', 'link' => "admin.php"), 1 => array('name' => '新闻管理', 'link' => "?mod=news"));
     $headpagemenu[3] = array('name' => '修改新闻', 'link' => "");
     $data['headpagemenu'] = $headpagemenu;
     $res = fetch_one_array("select * from " . dbtable("news") . " where id='" . $id . "' and status >0");
     $data['headpagetitle'] = $cat[$res['catid']] . "管理";
     //左侧菜单
     $data['menumod'] = "news";
     $data['id'] = $id;
     $data["res"] = $res;
     if (!$res) {
         alert("错误,找不到该新闻", "");
     } else {
         $this->load->view('news_edit', $data);
     }
 }