Exemplo n.º 1
0
 public function actionLibrary($globalid, $field, $image = '')
 {
     if (empty($image)) {
         //zotop::redirect('zotop/image/upload',array('globalid'=>$globalid, 'field'=>$field, 'image'=>url::encode($image)));
     }
     $file = zotop::model('zotop.image');
     $images = $file->db()->where('type', '=', 'image')->where('globalid', '=', $globalid)->orderby('createtime', 'desc')->getPage();
     $pagination = new pagination();
     $pagination->page = $images['page'];
     $pagination->pagesize = $images['pagesize'];
     $pagination->total = $images['total'];
     $p = $pagination->render();
     $page = new dialog();
     $page->set('title', '图片库');
     $page->set('globalid', $globalid);
     $page->set('field', $field);
     $page->set('navbar', $this->navbar($globalid, $field, $image));
     $page->set('image', $image);
     $page->set('page', $images['page']);
     $page->set('pagesize', $images['pagesize']);
     $page->set('total', $images['total']);
     $page->set('images', $images['data']);
     $page->set('pagination', $p);
     $page->display();
 }
Exemplo n.º 2
0
 public function actionIndex($categoryid = 0, $status = null)
 {
     $where = array();
     if (!empty($categoryid)) {
         $where[] = 'AND';
         $where[] = array('categoryid', '=', $categoryid);
     }
     if (isset($status)) {
         $where[] = 'AND';
         $where[] = array('status', '=', $status);
     }
     $where = array_slice($where, 1);
     $blog = zotop::model('blog.blog');
     $blogs = $blog->db()->where($where)->orderby('order', 'desc')->orderby('updatetime', 'desc')->getPage();
     $blogstatus = $blog->status();
     $category = zotop::model('blog.category');
     $categorys = $category->getAll();
     $categorys = arr::hashmap($categorys, 'id');
     $pagination = new pagination();
     $pagination->page = $blogs['page'];
     $pagination->pagesize = $blogs['pagesize'];
     $pagination->total = $blogs['total'];
     $p = $pagination->render();
     $page = new page();
     $page->set('title', '日志管理');
     $page->set('navbar', $this->navbar($categoryid));
     $page->set('blogs', $blogs);
     $page->set('status', $status);
     $page->set('blogstatus', $blogstatus);
     $page->set('pagination', $p);
     $page->set('categoryid', $categoryid);
     $page->set('categorys', $categorys);
     $page->display();
 }
Exemplo n.º 3
0
 public function actionIndex($type = '')
 {
     $file = zotop::model('zotop.file');
     if (!empty($type)) {
         $where = array('type', '=', $type);
     }
     $files = $file->db()->where($where)->orderby('createtime', 'desc')->getPage();
     $pagination = new pagination();
     $pagination->page = $files['page'];
     $pagination->pagesize = $files['pagesize'];
     $pagination->total = $files['total'];
     $p = $pagination->render();
     $totalsize = $file->totalsize();
     $totalcount = $file->count();
     $page = new page();
     $page->set('title', zotop::t('文件管理'));
     $page->set('navbar', $this->navbar());
     $page->set('page', $files['page']);
     $page->set('pagesize', $files['pagesize']);
     $page->set('total', $files['total']);
     $page->set('files', $files['data']);
     $page->set('totalsize', $totalsize);
     $page->set('totalcount', $totalcount);
     $page->set('pagination', $p);
     $page->display();
 }
Exemplo n.º 4
0
 public static function output($total, $page = 0, $pagesize = 0, $url = '')
 {
     if (is_array($total)) {
         $page = $total['page'];
         $pagesize = $total['pagesize'];
         $url = $total['url'];
         $total = $total['total'];
     }
     $pagination = new pagination();
     $pagination->total = $total;
     $pagination->page = $page;
     $pagination->pagesize = $pagesize;
     $pagination->url = $url;
     $p = $pagination->render();
     return $p;
 }
Exemplo n.º 5
0
 public function actionIndex($type = 'all', $folderid = 0)
 {
     $file = zotop::model('system.file');
     $folder = zotop::model('system.folder');
     if (!empty($type) && $type != 'all') {
         $where = array('file.type', '=', $type);
     }
     $files = $file->db()->select('file.*', 'user.name as user_name', 'user.username as user_username')->join('user', 'user.id', 'file.userid')->where($where)->orderby('file.createtime', 'desc')->getPage();
     //zotop::dump($file->db()->Sql());
     $types = $file->types();
     $pagination = new pagination();
     $pagination->page = $files['page'];
     $pagination->pagesize = $files['pagesize'];
     $pagination->total = $files['total'];
     $p = $pagination->render();
     $totalsize = $file->totalsize($where);
     $totalcount = $file->count();
     $folders = $folder->getAll();
     $tree = new tree($folders, 0);
     $position = $tree->getPosition($folderid);
     foreach ($position as $p) {
         $pos[zotop::url('system/file/index/' . $type . '/' . $p['id'])] = $p['title'];
     }
     $page = new page();
     $page->set('title', zotop::t('文件管理'));
     $page->set('position', array(zotop::url('system/file') => zotop::t('文件管理'), zotop::url('system/file/' . $type . '/0') => zotop::t('全部文件')) + (array) $pos + array('列表'));
     $page->set('navbar', $this->navbar());
     $page->set('page', $files['page']);
     $page->set('pagesize', $files['pagesize']);
     $page->set('total', $files['total']);
     $page->set('files', $files['data']);
     $page->set('totalsize', $totalsize);
     $page->set('totalcount', $totalcount);
     $page->set('pagination', $p);
     $page->set('types', $types);
     $page->set('type', $type);
     $page->set('folderid', $folderid);
     $page->display();
 }
Exemplo n.º 6
0
 public function actionIndex($categoryid = 0, $status = null)
 {
     $blog = zotop::model('blog.blog');
     $blogs = $blog->getPage($categoryid, $status);
     $blogstatus = $blog->status();
     $category = zotop::model('blog.category');
     $categorys = $category->getAll();
     $pagination = new pagination();
     $pagination->page = $blogs['page'];
     $pagination->pagesize = $blogs['pagesize'];
     $pagination->total = $blogs['total'];
     $p = $pagination->render();
     $page = new page();
     $page->set('title', '日志管理');
     $page->set('navbar', $this->navbar($categoryid));
     $page->set('blogs', $blogs);
     $page->set('status', $status);
     $page->set('blogstatus', $blogstatus);
     $page->set('pagination', $p);
     $page->set('categoryid', $categoryid);
     $page->set('categorys', $categorys);
     $page->display();
 }
Exemplo n.º 7
0
 public function actionBrowser($folderid = 0)
 {
     $file = zotop::model('system.file');
     if ($folderid == 0) {
         $images = $file->db()->where('type', '=', 'image')->orderby('createtime', 'desc')->getPage();
     } else {
         $images = $file->db()->where('type', '=', 'image')->where('folderid', '=', $folderid)->orderby('createtime', 'desc')->getPage();
     }
     $pagination = new pagination();
     $pagination->page = $images['page'];
     $pagination->pagesize = $images['pagesize'];
     $pagination->total = $images['total'];
     $p = $pagination->render();
     $page = new page();
     $page->set('title', '图片库');
     $page->set('image', $image);
     $page->set('page', $images['page']);
     $page->set('pagesize', $images['pagesize']);
     $page->set('total', $images['total']);
     $page->set('images', $images['data']);
     $page->set('pagination', $p);
     $page->display();
 }
Exemplo n.º 8
0
.html" id="link">
<p  class="titactp"><?php 
        echo $row->titre;
        ?>
 </p>
<p id="datact" class="datact"><?php 
        echo $row->dat;
        ?>
</p>
<P class="contact"><?php 
        echo limitmot($row->content, 25) . '.....' . '<span class="suit">' . lg('SUIT') . '</span>';
        ?>
</P>
</a>

</div><!--End act-->
            <?php 
    }
    ?>

 </div>       

        <?php 
    // render the pagination links
    $pagination->render();
} else {
    header('location:./');
}
?>

Exemplo n.º 9
0
function controller_news_index()
{
    $NewsPage = new pagination();
    return "<ul class=\"pagination pagination-sm\">" . $NewsPage->render() . "</ul>";
}
Exemplo n.º 10
0
 public function actionIndex($categoryid = 0, $status = null)
 {
     $content = zotop::model('content.content');
     //获取模型信息
     $model = zotop::model('content.model');
     $models = $model->cache();
     //获取栏目信息
     $category = zotop::model('content.category');
     $categories = $category->cache();
     $db = $content->db()->select('content.*,user.username,user.name,user.email')->join('user', 'user.id', 'content.userid', 'left')->orderby('content.order', 'desc')->orderby('content.updatetime', 'desc');
     if ($categoryid) {
         if (isset($categories[$categoryid])) {
             $childids = explode(',', $categories[$categoryid]['childids']);
             if (is_array($childids)) {
                 $db->where('content.categoryid', 'in', $childids);
             }
         }
     }
     if (is_numeric($status)) {
         $db->where('content.status', '=', $status);
     } else {
         //默认不显示回收站的内容
         $db->where('content.status', '>=', -50);
     }
     if ($keywords = zotop::get('keywords')) {
         $db->where(array(array('content.title', 'like', $keywords), 'or', array('content.keywords', 'like', $keywords), 'or', array('user.name', 'like', $keywords), 'or', array('user.username', 'like', $keywords)));
     }
     $contents = $db->getPage();
     $position = array(zotop::url('content') => zotop::t('内容管理'), zotop::url('content/content') => zotop::t('内容库'));
     if ($categoryid) {
         $pos = $category->getPosition($categoryid);
         foreach ($pos as $p) {
             $position[zotop::url('content/content/index/' . $p['id'])] = $p['title'];
         }
     }
     if ($keywords) {
         $position[] = zotop::t('搜索结果');
     } else {
         $position[] = zotop::t('内容列表');
     }
     $pagination = new pagination();
     $pagination->page = $contents['page'];
     $pagination->pagesize = $contents['pagesize'];
     $pagination->total = $contents['total'];
     $p = $pagination->render();
     $statuses = $content->status();
     $page = new page();
     $page->set('title', zotop::t('内容管理'));
     $page->set('position', $position);
     $page->set('navbar', $this->navbar($categoryid));
     $page->set('categoryid', $categoryid);
     $page->set('contents', $contents['data']);
     $page->set('pagesize', $contents['pagesize']);
     $page->set('total', $contents['total']);
     $page->set('page', $contents['page']);
     $page->set('pagination', $p);
     $page->set('categories', $categories);
     $page->set('models', $models);
     $page->set('statuses', $statuses);
     $page->display();
 }