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


PHP Blog::view方法代码示例

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


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

示例1: main

 public static function main()
 {
     if (isset($_REQUEST['blog_id'])) {
         $blog = new Blog((int) $_REQUEST['blog_id']);
     } elseif (isset($_REQUEST['id'])) {
         $blog = new Blog((int) $_REQUEST['id']);
     } else {
         $blog = new Blog();
     }
     if (!isset($_REQUEST['action'])) {
         if ($blog->id) {
             $action = 'view_comments';
         } else {
             $action = 'view';
         }
     } else {
         $action = $_REQUEST['action'];
     }
     switch ($action) {
         case 'view_comments':
             Layout::addStyle('blog');
             Layout::addPageTitle($blog->title);
             if (Current_User::allow('blog', 'edit_blog')) {
                 Blog_User::miniAdminList();
             }
             if ($blog->publish_date > time() && !Current_User::allow('blog')) {
                 PHPWS_Core::errorPage('404');
             } else {
                 $content = $blog->view(true, false);
             }
             break;
         case 'view':
             if (isset($_GET['y'])) {
                 $day = 1;
                 $month = 1;
                 $year = $_GET['y'];
                 if (isset($_GET['m'])) {
                     $month = $_GET['m'];
                     if (isset($_GET['d'])) {
                         $day = $_GET['d'];
                         $start_date = mktime(0, 0, 0, $month, $day, $year);
                         $end_date = mktime(23, 59, 59, $month, $day, $year);
                     } else {
                         $start_day = 1;
                         $end_day = (int) date('t', mktime(0, 0, 0, $month, 1, $year));
                         $start_date = mktime(0, 0, 0, $month, 1, $year);
                         $end_date = mktime(0, 0, 0, $month, $end_day, $year);
                     }
                 } else {
                     $start_date = mktime(0, 0, 0, 1, 1, $year);
                     $end_date = mktime(0, 0, 0, 12, 31, $year);
                 }
             } else {
                 $start_date = null;
                 $end_date = null;
             }
             $content = Blog_User::show($start_date, $end_date);
             Layout::add($content, 'blog', 'view', true);
             return;
             break;
         case 'submit':
             if (Current_User::allow('blog', 'edit_blog')) {
                 PHPWS_Core::reroute(PHPWS_Text::linkAddress('blog', array('action' => 'admin', 'tab' => 'new'), 1));
             } else {
                 PHPWS_Core::errorPage(403);
             }
             break;
         default:
             PHPWS_Core::errorPage(404);
             break;
     }
     Layout::add($content);
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:73,代码来源:Blog_User.php

示例2: User

    $site['enviroment'] = 'LIVE';
}
$site['media']['photos']['front-page'] = $config->getPhotoAds($site['creator'], 'front');
// LOAD USER DATA
$user = new User();
if (isset($_SESSION) or isset($_COOKIE['fl-user-name'])) {
    $site['user'] = $user->init($_SESSION, $_COOKIE);
    $user_logged_in = new UserDashboard($site['user']['name']);
    $site['user']['profile-photo'] = $profile_photo = $user_logged_in->getProfilePhoto($site['user']['name']);
    $site['user']['media'] = $user_data = $user_logged_in->getUserMedia($site['user']['name'], 'all');
}
$front_page_photos = $config->getPhotoAds($site['creator'], 'front');
shuffle($front_page_photos);
if ($page_title == '') {
    $page_title = $site['title'];
}
if ($meta_tag_photo == '') {
    $meta_tag_photo = "http://freelabel.net/images/fllogo.png";
} else {
    //$meta_tag_photo = "http://freelabel.net/images/fllogo.png";
}
$site_url = 'http://' . $_SERVER['SERVER_NAME'] . '/';
if (EVN == 'DEVELOPMENT' or $_GET['dev']) {
    echo EVN . '<pre>';
    print_r($site);
    echo '</pre>';
    exit;
}
$config->view('head.php', $site);
$config->view('ui.php', $site);
$config->view('footer.php', $site);
开发者ID:mayoalexander,项目名称:fl-two,代码行数:31,代码来源:ui.php

示例3: Blog

}
/*
 * Blog Controller File
 */
class Blog extends Page
{
    function __construct()
    {
        parent::__construct();
        Page::header('baseMVC - Blog');
    }
}
$blog = new Blog();
$autId = isset($_GET['id']) ? " WHERE SiteUsers.id = {$_GET['id']}" : '';
$data = $blog->callSelectSP('SELECT * FROM (BlogContent left outer join SiteUsers on authorId = SiteUsers.id)' . $autId . ' ORDER BY date DESC');
$blog->view('blog_view', $data);
/*
 * @todo: Module paths and locations (pages on which they should be viewed) should be stored in a db
 */
?>
	
	<aside>
	
	<!-- navigation div with all authors, 10 latest posts, style chooser and RSS -->
	<!--div id="modules">
		<div class="navModule">
			<h3>Our Authors</h3>
			<ul-->
				
			<?php 
//			$get_authors = $blog->callSelectSP('SELECT * FROM BlogAuthors GROUP BY name');
开发者ID:rootkowski,项目名称:baseMVC,代码行数:31,代码来源:blog.php


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