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


PHP News::gI方法代码示例

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


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

示例1: menu

 function menu($count = 1, $type = 'news')
 {
     global $sets;
     if ($sets['view_news_premium']) {
         $this->refresh_antics();
     }
     if (!Site::gI()->check_is_main() && $sets['news_only_main']) {
         return false;
     }
     $show_title = 0;
     $width = 135;
     //максимальная длина превью новости
     News::gI()->update_type($type);
     $this->pref_link = $type;
     $date_str_t = '';
     $news = $this->db->get_rows("SELECT * FROM " . $this->table . " WHERE type=" . quote_smart($type) . " && antic != 1 ORDER BY date DESC, id DESC LIMIT " . $count . "");
     $news_antic = $this->db->get_rows("SELECT * FROM " . $this->table . " WHERE type=" . quote_smart($type) . " && antic = 1 ORDER BY date DESC, id DESC LIMIT " . $count . "");
     $news_menu = '';
     //Вроде вывод новостей
     if (count($news) > 0) {
         $news_title = $show_title ? $this->the_title[$this->type] : '';
         foreach ($news as $id => $res) {
             $news_href = !empty($res['vlink']) ? SITE_URL . htmlspecialchars($res['vlink']) : SITE_URL . $this->pref_link . '/' . $res['id'];
             //$news_href = SITE_URL.$this->pref_link
             $news_menu .= '<div class="news news_block_' . $id . '">';
             $news_menu .= '<div class="news_datetitle">';
             $news_menu .= '<div class="news_title"><a href="' . $news_href . '">' . htmlspecialchars(str_replace('&nbsp;', ' ', $res['t'])) . '</a></div>';
             /*datetitle*/
             if ($this->show_date) {
                 $news_menu .= '</div>';
             }
             $minheight = $this->show_photo() && is_file($res['photo']) ? ' style="min-height: 84px;" ' : '';
             $news_menu .= '<div class="news_text"' . $minheight . '>';
             if ($this->show_photo() && is_file($res['photo'])) {
                 $news_menu .= '<img class="news_image" src="' . SITE_URL . 'imgtmp/80_80/' . $res['photo'] . '" width="80" height="80" title="' . $res['t'] . '">';
             }
             $news_menu .= substr2(Strip_Tags(Trim(str_replace('&nbsp;', ' ', $res['txt']))), $width) . '</div>';
             /*news_text*/
             $news_menu .= '</div>';
             /*news_block_id*/
         }
         $news_menu .= '<div class="news_all"><div><a href="' . $this->pref_link . '/page/1">' . lg($this->all_title[$this->type]) . '</a></div>';
         if (count($news_antic) > 0) {
             $news_menu .= '<div><a href="' . $this->pref_link . '/antic/1">Архив</a></div>';
         }
         $news_menu .= '</div>';
     }
     return $news_menu;
 }
开发者ID:Vladimir25,项目名称:marykay,代码行数:49,代码来源:news.php

示例2: array

    ?>
						</div>
					</div>
					<?php 
}
?>
					<?php 
include 'anketa.php';
?>
				</div>
			</div>

			<div style="clear: both;"></div>
			<?php 
if ($_SERVER['REQUEST_URI'] == '/') {
    echo $site->view('module', array('title' => '', 'content' => News::gI()->menu($sets['count_news'], 'news')));
}
?>
		</main>
		<div style="clear: both;"></div>
		<footer>
			 <div class="newsgetter">
				<div class="recall_inner">
					<div class="call_forma">
						<form>
							<input type="text" placeholder="Введите Ваш e-mail адрес..." />
						</form>
						<?php 
//echo $site->view('module', array('title' => 'Рассылка новостей', 'content' => Podpiska::gI()->form())) // Рассылка новостей
?>
						<!-- Модуль подписки но он не работает -->
开发者ID:Vladimir25,项目名称:marykay,代码行数:31,代码来源:i.php

示例3: array

<?php

$news_modules = array('news', 'spec_offer');
foreach ($news_modules as $id => $val) {
    if (!empty($_GET['module']) && $_GET['module'] == $val) {
        if ($sets['view_news_premium']) {
            News::gI()->refresh_antics($val);
        }
        News::gI()->update_type($val);
        if (!empty($_GET['type']) && $_GET['type'] == 'page') {
            $content = News::gI()->news_list($_GET['id'], $val);
        } elseif (!empty($_GET['type']) && $_GET['type'] == 'antic') {
            $content = News::gI()->news_antic_list($_GET['id'], $val);
        } else {
            $content = News::gI()->get_news($_GET['id'], $val);
        }
    }
}
开发者ID:Vladimir25,项目名称:marykay,代码行数:18,代码来源:i.php


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