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


PHP category::gethtmlrule方法代码示例

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


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

示例1: url

    static function url($info,$page=null,$relative=false) {
        if ($info['linkto']) return $info['linkto'];
        
        if(front::$get['t'] == 'wap'){
        	if (config::get('wap_html_prefix')){
        		$html_prefix='/'.trim(config::get('wap_html_prefix'),'/');
        	}
        	if(front::$rewrite){
        		if (!$page){
        			return config::get('site_url').'show_wap_'.$info['aid'].'.htm';
        		}else{
        			return config::get('site_url').'show_wap_'.$info['aid'].'_'.$page.'.htm';
        		}
        	}
        	$type=category::getInstance();
        	if($info['iswaphtml'] == 2){
        		return url::create('archive/show/t/wap/aid/'.$info['aid']);
        	}
        	
        	if (!category::getarciswaphtml($info)){
        		if ($page){
        			return url::create('archive/show/t/wap/aid/'.$info['aid'].'/page/'.$page);
	        	}else{
	        		return url::create('archive/show/t/wap/aid/'.$info['aid']);
	        	}
        	}else {
        		if ($info['htmlrule']){
        			$rule=$info['htmlrule'];
        		}else{
        			$rule=category::gethtmlrule($info['catid'],'showhtmlrule');
        		}
        		$rule=str_replace('{$caturl}',$type->htmlpath($info['catid']),$rule);
        		$rule=str_replace('{$dir}',$type->category[$info['catid']]['htmldir'],$rule);
        		$rule=str_replace('{$catid}',$info['catid'],$rule);
        		$rule=str_replace('{$aid}',$info['aid'],$rule);
        		if ($page){
        			$rule=str_replace('{$page}',$page,$rule);
        		}else{
        			$rule=preg_replace('/\(.*?\)/','',$rule);
        			$rule=str_replace('_{$page}','',$rule);
        		}
        		$rule=preg_replace('/[\(\)]/','',$rule);
        		$rule=preg_replace('%[\\/]index\.htm1%','',$rule);
        		$rule=rtrim($rule,'/');
        		$rule=trim($rule,'\\');
        		if ($relative) return $html_prefix.'/'.$rule;
        		return config::get('base_url').$html_prefix.'/'.$rule;
        	}
        }
        
        if (config::get('html_prefix')) $html_prefix='/'.trim(config::get('html_prefix'),'/');
        $type=category::getInstance();
        if($info['ishtml'] == 2){
        	return url::create('archive/show/aid/'.$info['aid']);
        }
        if (!category::getarcishtml($info) ||front::$rewrite) if ($page) return url::create('archive/show/aid/'.$info['aid'].'/page/'.$page);
            else return url::create('archive/show/aid/'.$info['aid']);
        else {
            if ($info['htmlrule']) $rule=$info['htmlrule'];
            else $rule=category::gethtmlrule($info['catid'],'showhtmlrule');
            $rule=str_replace('{$caturl}',$type->htmlpath($info['catid']),$rule);
            $rule=str_replace('{$dir}',$type->category[$info['catid']]['htmldir'],$rule);
            $rule=str_replace('{$catid}',$info['catid'],$rule);
            $rule=str_replace('{$aid}',$info['aid'],$rule);
            if ($page){
                $rule=str_replace('{$page}',$page,$rule);
            }else{
                $rule=preg_replace('/\(.*?\)/','',$rule);
                $rule=str_replace('_{$page}','',$rule);
            }
            $rule=preg_replace('/[\(\)]/','',$rule);
            $rule=preg_replace('%[\\/]index\.htm1%','',$rule);
            $rule=rtrim($rule,'/');
            $rule=trim($rule,'\\');
            if ($relative) return $html_prefix.'/'.$rule;
            return config::get('base_url').$html_prefix.'/'.$rule;
        }
    }
开发者ID:jiangsuei8,项目名称:public_php_shl,代码行数:78,代码来源:archive.php

示例2: url

 static function url($catid,$page=null,$relative=false) {
     //var_dump(front::$get);
     $category=self::getInstance();
     if (@$category->category[$catid]['linkto']) return $category->category[$catid]['linkto'];
     
     if(front::get('t')=='wap'){
     	if (config::get('wap_html_prefix')){
     		$wap_html_prefix='/'.trim(config::get('wap_html_prefix'),'/');
     	}
     	if(front::$rewrite){
     		if (!$page){
     			return config::get('site_url').'list_wap_'.$catid.'.htm';
     		}else{
     			return config::get('site_url').'list_wap_'.$catid.'_'.$page.'.htm';
     		}
     	}
     	if (!category::getiswaphtml($catid)) {
     		if (!$page){
     			return url::create('archive/list/t/wap/catid/'.$catid);
     		}else{
     			return url::create('archive/list/t/wap/catid/'.$catid.'/page/'.$page);
     		}
     	}else{
     		$rule=category::gethtmlrule($catid,'listhtmlrule');
     		$rule=str_replace('{$caturl}',$category->htmlpath($catid),$rule);
     		$rule=str_replace('{$dir}',$category->category[$catid]['htmldir'],$rule);
     		$rule=str_replace('{$catid}',$catid,$rule);
     		if ($category->category[$catid]['ispages'] &&!$page) $page=1;
     		if ($page) $rule=str_replace('{$page}',$page,$rule);
     		else $rule=preg_replace('/\(.*?\)/','',$rule);
     		$rule=preg_replace('%/\.html$%','/index.html',$rule);
     		$rule=preg_replace('/[\(\)]/','',$rule);
     		$rule=preg_replace('%[\\/]index\.htm(l)?%','',$rule);
     		$rule=rtrim($rule,'/');
     		$rule=trim($rule,'\\');
     		if ($relative) return $wap_html_prefix.'/'.$rule;
     		$rule=str_replace('/1.html','',$rule);
     		$path = config::get('base_url').$wap_html_prefix.'/'.$rule;
     		//echo $path;
     		return $path;
     	}
     }
     
     if (config::get('html_prefix')) $html_prefix='/'.trim(config::get('html_prefix'),'/');
     if (!category::getishtml($catid) ||front::$rewrite) {
         if (!$page) return url::create('archive/list/catid/'.$catid);
         else return url::create('archive/list/catid/'.$catid.'/page/'.$page);
     }
     else {
         $rule=category::gethtmlrule($catid,'listhtmlrule');
         $rule=str_replace('{$caturl}',$category->htmlpath($catid),$rule);
         $rule=str_replace('{$dir}',$category->category[$catid]['htmldir'],$rule);
         $rule=str_replace('{$catid}',$catid,$rule);
         if ($category->category[$catid]['ispages'] &&!$page) $page=1;
         if ($page) $rule=str_replace('{$page}',$page,$rule);
         else $rule=preg_replace('/\(.*?\)/','',$rule);
         $rule=preg_replace('%/\.html$%','/index.html',$rule);
         $rule=preg_replace('/[\(\)]/','',$rule);
         $rule=preg_replace('%[\\/]index\.htm(l)?%','',$rule);
         $rule=rtrim($rule,'/');
         $rule=trim($rule,'\\');
         if ($relative) return $html_prefix.'/'.$rule;
         $rule=str_replace('/1.html','',$rule);
         return config::get('base_url').$html_prefix.'/'.$rule;
     }
 }
开发者ID:jiangsuei8,项目名称:public_php_shl,代码行数:66,代码来源:category.php


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