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


PHP front::record_count方法代码示例

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


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

示例1: special

 function show_action() {
     $this->view->page=front::get('page')?front::get('page'):1;
     $this->pagesize=config::get('list_pagesize');
     $limit=(($this->view->page-1)*$this->pagesize).','.$this->pagesize;
     $special=new special();
     $this->view->special=$special->getrow('spid='.front::get('spid'));
     $this->view->archive['title'] =  $this->view->special['title'];
     $this->view->pages=true;
     $archive=new archive();
     $archives=$archive->getrows('spid='.front::get('spid'),$limit);
     foreach($archives as $order=>$arc) {
         $archives[$order]['url']=archive::url($arc);
         $archives[$order]['catname']=category::name($arc['catid']);
         $archives[$order]['caturl']=category::url($arc['catid']);
         $archives[$order]['adddate']= sdate($arc['adddate']);
         $archives[$order]['stitle']= strip_tags($arc['title']);
     }
     $this->view->archives=$archives;
     $this->view->record_count=$archive->rec_count('spid='.front::get('spid'));
     front::$record_count=$this->view->record_count;
     $this->view->spid=front::get('spid');
     if (front::get('t') == 'wap') {
     	$this->out('wap/special_show.html');
     	return;
     }
 }
开发者ID:jiangsuei8,项目名称:public_php_shl,代码行数:26,代码来源:special_act.php

示例2: comment

 function list_action() {
     front::check_type(front::get('aid'));
     $this->view->article=archive::getInstance()->getrow(front::get('aid'));
     $this->view->page=front::get('page')?front::get('page'):1;
     $this->pagesize=config::get('list_pagesize');
     $limit=(($this->view->page-1)*$this->pagesize).','.$this->pagesize;
     $comment=new comment();
     $this->view->comments=$comment->getrows('state=1 and aid='.front::get('aid'),$limit);
     $this->view->record_count=$comment->rec_count('state=1 and aid='.front::get('aid'));
     front::$record_count=$this->view->record_count;
     $this->view->aid=front::get('aid');
 }
开发者ID:jiangsuei8,项目名称:public_php_shl,代码行数:12,代码来源:comment_act.php

示例3: area

 function list_action() {
     $this->view->page=front::get('page') ?front::get('page') : 1;
     $this->pagesize=config::get('list_pagesize');
     $limit=(($this->view->page -1) * $this->pagesize).','.$this->pagesize;
     $area=new area();
     $where='1';
     if (front::get('province_id')) $where.=' and id='.front::get('province_id');
     if (front::get('city_id')) $where.=' and id='.front::get('city_id');
     if (front::get('section_id')) $where.=' and id='.front::get('section_id');
     if (front::get('id')) $where.=' and id='.front::get('id');
     $this->view->area=$area->getrow($where);
     $archive=new archive();
     $where='1';
     if (front::get('province_id')) $where.=' and province_id='.front::get('province_id');
     if (front::get('city_id')) $where.=' and city_id='.front::get('city_id');
     if (front::get('section_id')) $where.=' and section_id='.front::get('section_id');
     if (front::get('id')) $where.=' and section_id='.front::get('id').' or city_id='.front::get('id').' or province_id='.front::get('id');
     $archives=$archive->getrows($where,$limit,'listorder,aid desc');
     foreach ($archives as $order=>$arc) {
         $archives[$order]['url']=archive::url($arc);
         $archives[$order]['catname']=category::name($arc['catid']);
         $archives[$order]['caturl']=category::url($arc['catid']);
         $archives[$order]['adddate']=sdate($arc['adddate']);
         $archives[$order]['stitle']=strip_tags($arc['title']);
     }
     $this->view->pages=true;
     if(front::get('id')!='') {
         $this->view->areaid=front::get('id');
     }elseif(front::get('province_id')!='') {
         $this->view->areaid=front::get('province_id');
     }elseif(front::get('city_id')!='') {
         $this->view->areaid=front::get('city_id');
     }elseif(front::get('section_id')!='') {
         $this->view->areaid=front::get('section_id');
     }
     $this->view->archive['title'] = area::name($this->view->areaid);
     $this->view->archives=$archives;
     $this->view->record_count=$archive->rec_count($where);
     front::$record_count=$this->view->record_count;
     
     if (front::get('t') == 'wap') {
     	$this->out('wap/area_list.html');
     	return;
     }
     
     $this->render();
 }
开发者ID:jiangsuei8,项目名称:public_php_shl,代码行数:47,代码来源:area_act.php

示例4: tag

 function show_action() {
     $tagname=urldecode(front::get('tag'));
     if(preg_match('/union/i',$tagname) || preg_match('/"/i',$tagname) ||preg_match('/\'/i',$tagname)){
     	exit('非法参数');
     }
     $tag=new tag();
     $tag=$tag->getrow('tagname="'.$tagname.'"');
     $tagid=$tag['tagid'];
     $archives=array();
     if($tagid) {
         $arctag=new arctag();
         if(front::get('page')) $page=front::get('page');
         else $page=1;
         $this->view->page=$page;
         $this->view->pagesize=config::get('list_pagesize');
         $limit=(($this->view->page-1)*$this->view->pagesize).','.$this->view->pagesize;
         $this->view->record_count=$arctag->rec_count('tagid='.$tagid);
         if($this->view->record_count>$this->view->pagesize)
             $this->view->pages=true;
         front::$record_count=$this->view->record_count;
         $arctags=$arctag->getrows('tagid='.$tagid,$limit);
         $arcids=array();
         foreach($arctags as $arctag) {
             $arcids[]=$arctag['aid'];
         }
         $archive=new archive();
         $archives=$archive->getrows('aid in ('.implode(',',$arcids).')',null,'aid desc');
         foreach($archives as $order=>$arc) {
             $archives[$order]['url']=archive::url($arc);
             $archives[$order]['catname']=category::name($arc['catid']);
             $archives[$order]['caturl']=category::url($arc['catid']);
             $archives[$order]['adddate']= sdate($arc['adddate']);
             $archives[$order]['stitle']= strip_tags($arc['title']);
         }
     }
     else echo lang('标签信息不存在');
     $this->view->tag=$tagname;
     $this->view->archive['title'] = $tagname;
     $this->view->archives=$archives;
     if (front::get('t') == 'wap') {
     	echo $this->fetch('wap/tag_show.html');
     	return;
     }
     $this->render();
 }
开发者ID:jiangsuei8,项目名称:public_php_shl,代码行数:45,代码来源:tag_act.php

示例5: type

 function list_action() {
     $this->view->page=front::get('page') ?front::get('page') : 1;
     $this->pagesize=config::get('list_pagesize');
     $limit=(($this->view->page -1) * $this->pagesize).','.$this->pagesize;
     $type=new type();
     $types=array();
     $types=$type->sons(front::get('typeid'));
     $types[]=front::get('typeid');
     $where='typeid in ('.implode(',',$types).') AND checked=1 AND state=1';
     $this->view->type=$type->getrow('typeid='.front::get('typeid'));
     $this->view->pages=@$this->view->type['ispages'];
     $this->view->typeid=front::get('typeid');
     $archive=new archive();
     $archives=$archive->getrows($where,$limit,'listorder desc,aid desc');
     foreach ($archives as $order=>$arc) {
         $archives[$order]['url']=archive::url($arc);
         $archives[$order]['typename']=type::name($arc['typeid']);
         $archives[$order]['typeurl']=type::url($arc['typeid']);
         $archives[$order]['adddate']=sdate($arc['adddate']);
         $archives[$order]['stitle']=strip_tags($arc['title']);
         $archives[$order]['sthumb'] = @strstr($arc['thumb'], "http://") ? $arc['thumb'] : config::get('base_url') . '/' . $arc['thumb'];
     }
     $this->view->archives=$archives;
     $this->view->record_count=$archive->rec_count($where);
     front::$record_count=$this->view->record_count;
     $this->type=type::getInstance();
 	if (front::get('t') == 'wap') {
         $this->out('wap/type_list.html');
         return;
     }
     $template=$this->type->type[front::get('typeid')]['template'];
     if ($template&&file_exists(TEMPLATE.'/'.$this->view->_style.'/'.$template)) $this->out($template);
     else {
         $tpl=type::gettemplate($this->view->typeid);
         if (type::getishtml($this->view->typeid)) {
             $path=ROOT.type::url($this->view->typeid,@front::$get['page']>1 ?front::$get['page'] : null);
             if (!preg_match('/\.[a-zA-Z]+$/',$path)) $path=rtrim(rtrim($path,'/'),'\\').'/index.html';
             $this->cache_path=$path;
         }
         $this->out($tpl);
     }
 }
开发者ID:jiangsuei8,项目名称:public_php_shl,代码行数:42,代码来源:type_act.php

示例6: intval

<div class="archive_title"><div class="r_box_top"></div><div class="r_box"><h1><?php 
echo $category[$catid]['catname'];
?>
</h1></div><div class="r_box_bottom"></div></div>

<!-- 内容 -->
<?php 
$page = intval(front::$get['page']);
if ($page == 0) {
    $page = 1;
}
$content = $category[$catid][categorycontent];
$contents = preg_split('%<div style="page-break-after(.*?)</div>%si', $content);
if ($contents) {
    $pages = count($contents);
    front::$record_count = $pages * config::get('list_pagesize');
    $category[$catid][categorycontent] = $contents[$page - 1];
}
echo $category[$catid]['categorycontent'];
?>

<div class="blank30"></div>
<?php 
if ($pages > 1) {
    ?>
<!-- 内页分页 -->
<div class="blank10"></div>
<div class="pages">
<?php 
    echo category_pagination($catid);
    ?>
开发者ID:jiangsuei8,项目名称:public_php_shl,代码行数:31,代码来源:#list_page.php

示例7: trim

    function show_action() {
        if (!front::get('aid'))
            front::$get['aid'] = front::get('id');
        front::check_type(front::$get['aid']);
        $this->view->aid = trim(front::get('aid'));
        $this->view->archive = archive::getInstance()->getrow(front::get('aid'));
        $this->view->categorys = category::getpositionlink2($this->view->archive['catid']);
        if (!is_array($this->view->archive))
            $this->out('message/error.html');
        if ($this->view->archive['checked'] < 1)
            exit(lang('未审核!<a href="'.front::$from.'">返回</a>'));
        if (!rank::arcget(front::get('aid'), $this->view->usergroupid)) {
            $this->out('message/error.html');
        }
        $this->view->catid = $this->view->archive['catid'];
        $this->view->topid = category::gettopparent($this->view->catid);
        $this->view->parentid = $this->category->getparent($this->view->catid);
        if (!rank::catget($this->view->catid, $this->view->usergroupid))
            $this->out('message/error.html');
        if (!isset($this->category->category[$this->view->catid]) ||
                !isset($this->category->category[$this->view->topid])) {

        }
        $template = @$this->view->archive['template'];
        $linkword = new linkword();
        $linkwords = $linkword->getrows(null, 1000, 'linkorder desc');
        $content = $this->view->archive['content'];
        $contents = preg_split('%<div style="page-break-after(.*?)</div>%si', $content);
        if ($contents) {
            $this->view->pages = count($contents);
            front::$record_count = $this->view->pages * config::get('list_pagesize');
            $content = $contents[$this->view->page - 1];
        }

        //$content = preg_replace("/(<a(.*))(>)(.*)(<)(\/a>)/isU", '\\1-]-\\4-[-\\6', $content);

        foreach ($linkwords as $linkword) {
            $linkword['linktimes'] = (int) $linkword['linktimes'];
            if (trim($linkword['linkurl']) && !preg_match('%^http://$%', trim($linkword['linkurl']))) {
                $link = "<a href='$linkword[linkurl]' target='_blank'>$linkword[linkword]</a>";
            } else {
                $link = "<a href='" . url('archive/search/keyword/' . urlencode($linkword['linkword'])) . "' target='_blank'>$linkword[linkword]</a>";
            }
            $content = _keylinks($content,$linkword['linkword'],$link,$linkword['linktimes']);
        }

        $this->view->likenews = $this->getLike($this->view->archive['tag'], $this->view->archive['keyword']);

        $taghtml = '';
        $tag_table = new tag();
        foreach ($tag_table->urls($this->view->archive['tag']) as $tag => $url) {
            $taghtml.="<a href='$url' target='_blank'>$tag</a>&nbsp;&nbsp;";
        }
        $this->view->archive['tag'] = $taghtml;

        $this->view->archive['special'] = null;
        if ($this->view->archive['spid']) {
            $spurl = special::url($this->view->archive['spid'],special::getishtml($this->view->archive['spid']));
            $sptitle = special::gettitle($this->view->archive['spid']);
            $this->view->archive['special'] = "<a href='$spurl' target='_blank'>$sptitle</a>&nbsp;&nbsp;";
        }
        $this->view->archive['type'] = null;
        if ($this->view->archive['typeid']) {
            $typeurl = type::url($this->view->archive['typeid'],1);
            $typetitle = type::name($this->view->archive['typeid']);
            $this->view->archive['type'] = "<a href='$typeurl' target='_blank'>$typetitle</a>&nbsp;&nbsp;";
        }
        $this->view->archive['area'] = null;
        $this->view->archive['area'] = area::getpositonhtml($this->view->archive['province_id'], $this->view->archive['city_id'], $this->view->archive['section_id']);
        $this->view->archive['content'] = $content;
        $aid = front::$get['aid'];
        $catid = $this->view->catid;
        if(!$this->view->archive['showform']) {
            $this->getshowform($catid);
        }else if($this->view->archive['showform'] && $this->view->archive['showform'] == '1') {
            $this->showform = 1;
        }else {
            $this->showform = $this->view->archive['showform'];
        }
        if(preg_match('/^my_/is',$this->showform)) {
            $this->view->archive['showform'] = $this->showform;
            $o_table = new defind($this->showform);
            front::$get['form'] = $this->showform;
            $this->view->primary_key = $o_table->primary_key;
            $field = $o_table->getFields();
            $fieldlimit = $o_table->getcols('user_modify');
            helper::filterField($field,$fieldlimit);
            $this->view->field = $field;
        }else {
            $this->view->archive['showform'] = '';
        }
        
        $str = "";
        cb_data($this->view->archive);
        foreach( $this->view->archive as $key => $value){
        	if(!preg_match('/^my/',$key) || !$value)
        		continue;
        	$category = category::getInstance();
        	$sonids = $category->sons(setting::$var['archive'][$key]['catid']);
        	if(setting::$var['archive'][$key]['catid'] != $this->view->archive['catid'] && !in_array($this->view->archive['catid'],$sonids) && (setting::$var['archive'][$key]['catid'])){
//.........这里部分代码省略.........
开发者ID:jiangsuei8,项目名称:public_php_shl,代码行数:101,代码来源:archive_act.php

示例8: header

 function make_show_action() {
     header('Cache-control: private, must-revalidate');
     @set_time_limit(0);
     $submit = front::post('submit') ? front::post('submit') : front::get('submit');
     if (!$submit)
         return;
     chkpw('cache_content');
     //time::start();
     $post = front::$post + front::$get;
     unset($post['submit']);
     $c_url = preg_replace('#&make_page=(\d+)#', '', $_SERVER['QUERY_STRING']);
     $c_url = preg_replace('#&aid_start=(\d+)#', '', $c_url);
     $c_url = preg_replace('#&aid_end=(\d+)#', '', $c_url);
     $c_url = preg_replace('#&catid=(\d+)#', '', $c_url);
     $c_url = preg_replace('#&submit=(\d+)#', '', $c_url);
     $c_url = 'index.php?' . $c_url;
     $c_url.='&submit=1';
     
     $category = category::getInstance(); //实例化栏目类
     
     if ($post['aid_start']) {
         $aid_start = $post['aid_start'];
         $aid_end = $post['aid_end'];
         $where = "aid>=$aid_start and aid<=$aid_end AND checked=1 AND (ishtml IS NULL OR ishtml!=2)";
         $c_url.='&aid_start=' . $aid_start . '&aid_end=' . $aid_end;
     } elseif (isset($post['catid'])) {
         $catid = $post['catid'];
         $categories = $category->sons($catid);
         $categories[] = $catid;
         $categories = implode(',', $categories);
         $where = "catid in(" . $categories . ') and checked=1 AND (ishtml IS NULL OR ishtml!=2)';
         $c_url.='&catid=' . $catid;
     }else
         return;
     $case = 'archive';
     $act = 'show';
     $_GET = array('case' => $case, 'act' => $act);
     $front = new front();
     front::$admin = false;
     front::$html = true;
     front::$rewrite = false;
     $case = $case . '_act';
     $case = new $case();
     $case->init();
     $method = $act . '_action';
     //$time_start = time::getTime();
     
     $archive = new archive(); //实例化文章类
     
     if (config::get('group_on')) { //启用分组生成
         $make_page = $post['make_page'] == '' ? 1 : $post['make_page'];
         $archive->getrows($where);
         $archive_num = $archive->record_count;
         $group_count = config::get('group_count');
         $make_page_num = ceil($archive_num / $group_count);
         $totalpage = (($make_page - 1) * $group_count) . ',' . $group_count;
         $c_url.='&make_page=' . ($make_page + 1);
     } else {
         $totalpage = "";
     }
     
     $archives = $archive->getrows($where, $totalpage, '1'); //取到要生成的所有文章
     
     $cpage = 0;
     foreach ($archives as $arc) {
         if (!category::getarcishtml($arc))  //如果文章设置不生成则跳过
             continue;
         if($arc['linkto']){ //如果有跳转连接则跳过生成
         	continue;
         }
         $case->view->archive = $arc;
         front::$get['aid'] = $case->view->aid = $case->view->archive['aid'];
         $case->view->catid = $case->view->archive['catid'];
         
         $case->view->topid = category::gettopparent($case->view->catid);
         $case->view->parentid = $category->getparent($case->view->catid);
         
         $template = $case->view->archive['template'];
         $content = $case->view->archive['content'];
         
         $case->view->categories = category::getpositionlink2($case->view->catid);
         
         //关键字连接
         $linkword = new linkword();
         $linkwords = $linkword->getrows(null, 1000, 'linkorder desc');
         foreach ($linkwords as $linkword) {
             if (trim($linkword['linkurl']) && !preg_match('%^http://$%', trim($linkword['linkurl']))) {
                 $linkword['linktimes'] = (int) $linkword['linktimes'];
                 $link = "<a href='$linkword[linkurl]' target='_blank'>$linkword[linkword]</a>";
             } else {
                 $link = "<a href='" . url('archive/search/keyword/' . urlencode($linkword['linkword'])) . "' target='_blank'>$linkword[linkword]</a>";
             }
             if (isset($link)) {
                 $content = preg_replace("%(?!\"]*>)$linkword[linkword](?!\s*\")%i", "\\1$link\\2", $content, $linkword['linktimes']);
             }
             unset($link);
         }
         
         //相关文章
         $case->view->likenews = $case->getLike($case->view->archive['tag'], $case->view->archive['keyword']);
//.........这里部分代码省略.........
开发者ID:jiangsuei8,项目名称:public_php_shl,代码行数:101,代码来源:cache_admin.php

示例9: index_archive

function index_archive($catid) {
    $index_archive = new archive();
    $index_category = category::getInstance();
    $index_view_category = $index_category->category;
    if (front::get('page'))
        $page = front::get('page');
    else
        $page = 1;
    $index_view_page = $page;
    front::check_type($page);
    $_catpage = category::categorypages($catid);
    if ($_catpage) {
        $index_pagesize = $_catpage;
    } else {
        $index_pagesize = config::get('list_pagesize');
    }
    front::check_type($index_pagesize);
    $index_view_categorys = category::getpositionlink2($catid);
    $topid = category::gettopparent($catid);
    if (!isset($index_category->category[$catid]) ||
            !isset($index_category->category[$topid])) {
        $this->out('message/error.html');
    }
    $limit = (($index_view_page - 1) * $index_pagesize) . ',' . $index_pagesize;
    $categories = array();
    if (@$index_category->category[$catid]['ispages'])
        $categories = $index_category->sons($catid);
    $categories[] = $catid;
    $index_view_pages = @$index_category->category[$catid]['ispages'];
    if (!rank::catget($catid, $index_view_usergroupid))
        $this->out('message/error.html');
    $order = "`listorder` asc,`adddate` DESC";
    if (@$index_category->category[$catid]['includecatarchives'])
        $articles = $index_archive->getrows('catid in (' . implode(',', $categories) . ') and checked=1', $limit, $order);
    else
        $articles = $index_archive->getrows('catid=' . $catid . ' and checked=1', $limit, $order);
    if (!is_array($articles)) {
        $this->out('message/error.html');
    }
    foreach ($articles as $order => $arc) {
        $articles[$order]['url'] = archive::url($arc);
        $articles[$order]['catname'] = category::name($arc['catid']);
        $articles[$order]['caturl'] = category::url($arc['catid']);
        $articles[$order]['adddate'] = sdate($arc['adddate']);
        $articles[$order]['stitle'] = strip_tags($arc['title']);
        $articles[$order]['strgrade'] = archive::getgrade($arc['grade']);
    }
    $index_view_archives = $articles;
    if (@$index_category->category[$catid]['includecatarchives'])
        $index_view_record_count = $index_archive->rec_count('catid in(' . implode(',', $categories) . ')');
    else
        $index_view_record_count = $index_archive->rec_count('catid=' . $catid);
    front::$record_count = $index_view_record_count;
    return $index_view_archives;
}
开发者ID:jiangsuei8,项目名称:public_php_shl,代码行数:55,代码来源:userfunction.php


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