本文整理汇总了PHP中category::url方法的典型用法代码示例。如果您正苦于以下问题:PHP category::url方法的具体用法?PHP category::url怎么用?PHP category::url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类category
的用法示例。
在下文中一共展示了category::url方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_action
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;
}
}
示例2: list_action
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();
}
示例3: show_action
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();
}
示例4: categoryinfo
static function categoryinfo($id) {
if ($id == 0) {
$category = category::getInstance ();
if (is_array ( $id ))
$id = $id ['catid'];
$categories = $category->son ( $id );
$cats = array ();
foreach ( $categories as $catid ) {
$_category = $category->category [$catid];
if ($stype && ! preg_match ( '/-/', $stype ) && $_category ['stype'] != $stype)
continue;
if ($stype && preg_match ( '/-/', $stype ) && '-' . $_category ['stype'] == $stype)
continue;
$_category ['url'] = category::url ( $_category ['catid'] );
$cats [] = $_category;
}
return $cats;
}
$category = category::getInstance ();
$catinfo [] = $category->category [$id];
$catinfo [0] ['url'] = category::url ( $id );
return $catinfo;
}
示例5: caturl
function caturl($catid,$page=null) {
return category::url($catid,$page);
}
示例6: asearch_action
function asearch_action() {
if (front::get('keyword') && !front::post('keyword'))
front::$post['keyword'] = front::get('keyword');
front::check_type(front::post('keyword'), 'safe');
if (front::post('keyword')) {
$this->view->keyword = trim(front::post('keyword'));
session::set('keyword', $this->view->keyword);
} elseif (session::get('keyword')) {
$this->view->keyword = trim(session::get('keyword'));
session::set('keyword', $this->view->keyword);
} else {
session::set('keyword', null);
$this->view->keyword = session::get('keyword');
}
$limit = (($this->view->page - 1) * $this->pagesize) . ',' . $this->pagesize;
$articles = $this->archive->getrows("title like '%" . $this->view->keyword . "%'", $limit);
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']);
}
$this->view->articles = $articles;
$this->view->archives = $articles;
$this->view->record_count = $this->archive->record_count;
}
示例7: header
function header($title)
{
$tit = "fitness shop";
if ($title) {
$tit = $title . " - " . $tit;
}
?>
<!DOCTYPE html>
<html lang="cs">
<head>
<title><?php
echo $tit;
?>
</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="robots" content="index,follow" />
<meta name="description" content="<?php
echo $this->description;
?>
" />
<meta name="author" content="SGS@alpaka.cz" />
<link rel="shortcut icon" href="grafika/favicon.ico" />
<link rel="stylesheet" href="css/styles.css" type="text/css" />
<link rel="stylesheet" href="css/layout.css" type="text/css" />
<link rel="stylesheet" href="css/components.css" type="text/css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript" src="ajax/main.js"></script>
<?php
//kanonicky odkaz
if ($this->canonical) {
echo "\t<link rel=\"canonical\" href=\"" . config::$web_url . "/" . $this->canonical . "\" />\n";
}
//css
for ($i = 0; $i < count($this->css); $i++) {
echo "\t<link rel=\"stylesheet\" href=\"css/" . $this->css[$i] . ".css\" type=\"text/css\" />\n";
}
//ajaxove scripty
for ($i = 0; $i < count($this->scripts); $i++) {
echo "\t<script type=\"text/javascript\" src=\"ajax/" . $this->scripts[$i] . ".js\"></script>\n";
}
if ($this->tinymce == 1) {
?>
<script language="javascript" type="text/javascript" src="external_modul/tiny_mce/tinymce.min.js"></script>
<script language="javascript" type="text/javascript">
tinymce.init({
selector: ".tinymce",
entity_encoding : "raw",
plugins: [
"advlist autolink lists link image charmap print preview hr anchor pagebreak",
"searchreplace wordcount visualblocks visualchars code fullscreen",
"insertdatetime media nonbreaking save table contextmenu directionality",
"emoticons template paste textcolor"
],
toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
toolbar2: "print preview media | forecolor backcolor emoticons",
image_advtab: true, autosave_ask_before_unload: false
});
</script>
<?php
}
if ($this->tinymce == 2) {
?>
<script language="javascript" type="text/javascript" src="external_modul/tiny_mce/tinymce.min.js"></script>
<script language="javascript" type="text/javascript">
tinymce.init({
selector: ".tinymce",
entity_encoding : "raw",
plugins: [
"advlist autolink lists link image charmap print preview hr anchor pagebreak",
"searchreplace wordcount visualblocks visualchars code fullscreen",
"insertdatetime media nonbreaking save table contextmenu directionality",
"emoticons template paste textcolor"
],
toolbar1: "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent",
image_advtab: false, autosave_ask_before_unload: false,
menubar: false
});
</script>
<?php
}
/*
?>
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-10847402-1', 'auto');
ga('send', 'pageview');
</script>
<?php
*/
?>
</head>
<body>
//.........这里部分代码省略.........
示例8: make_list_action
function make_list_action() {
$servip = gethostbyname($_SERVER['SERVER_NAME']);
if($servip==front::ip()&&front::get('ishtml')==1){
}else{
chkpw('cache_category');
}
header('Cache-control: private, must-revalidate');
@set_time_limit(0);
if (!front::post('submit'))
return;
$case = 'archive';
$act = 'list';
$_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';
$totalpage = 100;
$time_start = time::getTime();
$category = category::getInstance();
$categories = $category->sons(front::post('catid'));
$categories[] = front::post('catid');
$cpage = 0;
$archive_all = new archive();
foreach ($categories as $key => $catid) {
$new_categories = $category->sons($catid);
$new_categories[] = $catid;
$archive_num[$catid] = $archive_all->rec_count('catid in(' . implode(',', $new_categories) . ') and checked=1 and `state`=1');
}
$i = 0;
foreach ($categories as $catid) {
if ($catid == 0)
continue;
if (!category::getishtml($catid))
continue;
front::$get['catid'] = $catid;
$case->view->categories = category::getpositionlink2($catid);
$_categories = $category->sons($catid);
$_categories[] = $catid;
$case->view->ifson = category::hasson($catid);
for (front::$get['page'] = 1;; front::$get['page']++) {
$view = $case->view;
$_catpage = category::categorypages($catid);
if ($_catpage) {
$pagesize = $_catpage;
} else {
$pagesize = config::get('list_pagesize');
}
$limit = ((front::$get['page'] - 1) * $pagesize) . ',' . $pagesize;
$archive = new archive();
$tops = array();
$tops = $archive->getrows("checked=1 AND state=1 AND toppost!=0",0,'toppost DESC,listorder=0,listorder ASC,aid DESC');
if (@$category->category[$catid]['includecatarchives']) {
$case->view->archives = $archive->getrows('catid in(' . implode(',', $_categories) . ') and checked=1 and `state`=1', $limit, 'listorder=0,`listorder` asc,`adddate` DESC');
} else {
$case->view->archives = $archive->getrows("catid=$catid and checked=1 and `state`=1", $limit, 'listorder=0,`listorder` asc,`adddate` DESC');
}
$case->view->page = front::$get['page'];
if(is_array($tops) && !empty($tops)){
foreach($tops as $order => $arc){
if($arc['toppost'] == 3){
$tops[$order]['title'] = "[全站置顶]".$arc['title'];
}
if($arc['toppost'] == 2){
$subcatids = $category->sons($arc['catid']);
if($arc['catid'] != front::get('catid') && !in_array(front::get('catid'), $subcatids)){
unset($tops[$order]);
}else{
$tops[$order]['title'] = "[栏目置顶]".$arc['title'];
}
}
}
$case->view->archives = array_merge($tops , $case->view->archives);
}
foreach ($case->view->archives as $order => $arc) {
$articles = $arc;
if (!$arc['introduce'])
$arc['introduce'] = cut($arc['content'], 200);
$articles['url'] = archive::url($arc);
$articles['catname'] = category::name($arc['catid']);
$articles['caturl'] = category::url($arc['catid']);
$articles['image'] = @strstr($arc['image'], "http://") ? $arc['image'] : config::get('base_url') . '/' . $arc['image'];
$articles['strgrade'] = archive::getgrade($arc['grade']);
$articles['adddate'] = sdate($arc['adddate']);
$articles['buyurl'] = url('archive/orders/aid/' . $arc['aid']);
$articles['stitle'] = strip_tags($arc['title']);
if(strtolower(substr($arc['thumb'],0,7)) == 'http://'){
$articles['sthumb'] = $arc['thumb'];
}else{
$articles['sthumb'] = config::get('base_url').'/'.$arc['thumb'];
//.........这里部分代码省略.........
示例9: search_action
function search_action() {
if(front::get('keyword') &&!front::post('keyword'))
front::$post['keyword']=front::get('keyword');
front::check_type(front::post('keyword'),'safe');
if(front::post('keyword')) {
$this->view->keyword=trim(front::post('keyword'));
session::set('keyword',$this->view->keyword);
}
else {
session::set('keyword',null);
$this->view->keyword=session::get('keyword');
}
$type = $this->view->type;
$condition = "";
if(front::post('catid')) {
$condition .= "catid = '".front::post('catid')."' AND ";
}
$condition .= "(title like '%".$this->view->keyword."%'";
$sets=settings::getInstance()->getrow(array('tag'=>'table-fieldset'));
$arr = unserialize($sets['value']);
if(is_array($arr['archive']) &&!empty($arr['archive'])) {
foreach ($arr['archive'] as $v) {
if($v['issearch'] == '1') {
$condition .= " OR {$v['name']} like '%{$this->view->keyword}%'";
}
}
}
$condition .= ")";
$order = "`listorder` desc,1 DESC";
$limit=(($this->view->page-1)*$this->pagesize).','.$this->pagesize;
$articles=$this->archive->getrows($condition,$limit,$order);
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']);
}
$this->view->articles=$articles;
$this->view->archives=$articles;
$this->view->record_count=$this->archive->record_count;
}
示例10: pages
<?php
} else {
?>
<a href="<?php
echo category::url($catid, $p);
?>
"><?php
echo $p;
?>
</a>
<?php
}
?>
<?php
}
?>
<?php
if (pages('down')) {
?>
<a href="<?php
echo category::url($catid, pages('down'));
?>
"><?php
echo lang(downpage);
?>
</a>
<?php
}
?>
</div>
示例11: listdata
static function listdata($parentid=0,$limit=10,$order='catid asc',$where=null,$includeson=true) {
$category=new category();
$where='parentid='.($parentid?$parentid:'0').($where ?' and '.$where : '');
$categories=$category->getrows($where,$limit,$order);
foreach ($categories as $order=>$category) {
$categories[$order]['url']=category::url($category['catid']);
}
return $categories;
}
示例12: 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;
}