public function index()
 {
     $post = array('alert' => '');
     Model::load('admincp/comments');
     if ($match = Uri::match('\\/comments\\/(\\w+)')) {
         if (method_exists("controlComments", $match[1])) {
             $method = $match[1];
             $this->{$method}();
             die;
         }
     }
     $curPage = 0;
     if ($match = Uri::match('\\/page\\/(\\d+)')) {
         $curPage = $match[1];
     }
     if (Request::has('btnAction')) {
         actionProcess();
     }
     if (Request::has('btnSearch')) {
         filterProcess();
     } else {
         $post['pages'] = Misc::genSmallPage('admincp/comments', $curPage);
         $filterPending = '';
         if (Uri::has('\\/status\\/pending')) {
             $filterPending = " AND c.status='0' ";
         }
         $post['theList'] = Comments::get(array('limitShow' => 20, 'limitPage' => $curPage, 'query' => "select c.*,p.title from " . Database::getPrefix() . "post p," . Database::getPrefix() . "comments c where c.postid=p.postid order by c.commentid desc", 'cacheTime' => 1));
     }
     System::setTitle('Comments list - ' . ADMINCP_TITLE);
     View::make('admincp/head');
     self::makeContents('commentsList', $post);
     View::make('admincp/footer');
 }
Ejemplo n.º 2
0
 public function index()
 {
     if ($match = Uri::match('\\/jsonCategory')) {
         $keyword = String::encode(Request::get('keyword', ''));
         $loadData = Categories::get(array('where' => "where title LIKE '%{$keyword}%'", 'orderby' => 'order by title asc'));
         $total = count($loadData);
         $li = '';
         for ($i = 0; $i < $total; $i++) {
             $li .= '<li><span data-method="category" data-id="' . $loadData[$i]['catid'] . '" >' . $loadData[$i]['title'] . '</span></li>';
         }
         echo $li;
         die;
     }
     $post = array('alert' => '');
     Model::load('admincp/post');
     if ($match = Uri::match('\\/post\\/(\\w+)')) {
         if (method_exists("controlPost", $match[1])) {
             $method = $match[1];
             $this->{$method}();
             die;
         }
     }
     $curPage = 0;
     if ($match = Uri::match('\\/page\\/(\\d+)')) {
         $curPage = $match[1];
     }
     if (Request::has('btnAction')) {
         actionProcess();
     }
     if (Request::has('btnSearch')) {
         filterProcess();
     } else {
         $post['pages'] = Misc::genSmallPage('admincp/post', $curPage);
         $filterPending = '';
         if (Uri::has('\\/status\\/pending')) {
             $filterPending = " WHERE p.status='0' ";
         }
         $post['theList'] = Post::get(array('limitShow' => 20, 'limitPage' => $curPage, 'query' => "select p.*,u.username,c.title as cattitle from " . Database::getPrefix() . "post p left join users u on p.userid=u.userid join " . Database::getPrefix() . "categories c on p.catid=c.catid {$filterPending} order by p.postid desc", 'cache' => 'no'));
     }
     System::setTitle('Post list - ' . ADMINCP_TITLE);
     View::make('admincp/head');
     self::makeContents('postList', $post);
     View::make('admincp/footer');
 }
    			</div>

				<div class="col-lg-12 text-right">
					<?php 
echo $pages;
?>
				</div>    			
    		</div>
    		<!-- row -->
    	</form>
    	</div>
    	<div class="col-lg-4">
        

        <?php 
if (!Uri::has('\\/edit\\/\\d+')) {
    ?>
    		<div class="divAddnew">
            <form action="" method="post" enctype="multipart/form-data"> 
            <?php 
    echo $alert;
    ?>
	     		<h4>Add new</h4>
	    		<p>
	    			<label><strong>Title</strong></label>
	    			<input type="text" class="form-control" name="send[title]" placeholder="Title" id="txtTitle" />
	    		</p>
                <p>
                    <label><strong>Thumbnail</strong></label>
                    <input type="file" class="form-control" name="image" />
                </p>     
Ejemplo n.º 4
0
<?php

if (!Uri::has('^page\\-\\d+\\-.*?\\.html')) {
    Redirect::to('404page');
}
$pageName = 'page';
$pageData = array();
$pageData['content_top'] = Render::content_top($pageName);
$pageData['content_left'] = Render::content_left($pageName);
$pageData['content_right'] = Render::content_right($pageName);
$pageData['content_bottom'] = Render::content_bottom($pageName);
$headData = GlobalCMS::$setting;
Theme::model('page');
$pageData['alert'] = '';
$pageData = pageProcess($pageData);
if (isset($pageData['keywords'])) {
    $headData['keywords'] = $pageData['keywords'];
}
$headData['title'] = $pageData['title'];
if ($pageData['page_type'] == 'fullwidth') {
    $pageName = 'pageFullWidth';
}
Theme::view('head', $headData);
Theme::view($pageName, $pageData);
Theme::view('footer');