<?php
/**
 *类  名：Url
 *文件名：class_url.php
 *编写人：http://Www.HuCart.Com
*/
class Mobile
{
 
	function Mobile()
	{
 
	}
	
	function index()
	{
 		
		//查询分类
		$getartsort = $this -> helper -> get_artsort('archiver');
		$this -> view -> assign('getartsort',$getartsort);
		
		$getprosort = $this -> helper -> get_prosort('archiver');
 
		$this -> view -> assign('getprosort',$getprosort);
		
		$getpicsort = $this -> helper -> get_picsort('archiver');
		$this -> view -> assign('getpicsort',$getpicsort);
		
		$getvidsort = $this -> helper -> get_vidsort( 'archiver' );
		$this -> view -> assign('getvidsort',$getvidsort);
		
		$this -> view -> assign('webtitle',$webtitle);
		$this -> view -> display('index_tpl.html',$cache_id);
	}
	
	
	function get_art( $id = '', $page = '' )
	{
 	
		if($page==''){ $page = 1;}
		

		$now_address = '您的位置：<a href="'.BASE_WEBURL.'/mobile/">首页</a> > <a href="'.BASE_WEBURL.'/mobile/?artlist.html">新闻资讯</a>';


		if( $id > 0 )
		{
			$sqlQuery 		= " SELECT a.* ,s.ars_name  FROM  ".$this -> db -> prefix."article as a ,".$this -> db -> prefix."artsort  as s  WHERE a.ars_id = s.ars_id and a.art_enabled = 1  and a.art_id = ".$id." ORDER BY a.`art_id`  ";
			$infodetail 	= $this -> db -> selectOne($sqlQuery);
			$reinfodetail 	= $this -> getcontent( $infodetail["art_detail"], $page = $page);
			$infodetail["art_detail"] = $this -> helper -> restrval( $reinfodetail["reInfo"]) ;
			
			$webtitle  		= $infodetail["art_title"];
			if($infodetail["ars_name"]!='')
			{
				$now_address = $now_address. ' > <a href="'.BASE_WEBURL.'/mobile/?artlist-'.$infodetail["ars_id"].'.html">'.$infodetail["ars_name"].'</a> ';
			}
			
			if( $GLOBALS["WebConfig"]["webhtml"] == 1 )
			{
				$url = BASE_WEBURL.'/art-'.$id.'.html';
			}else{
				$url = BASE_WEBURL.'/?load=art&act=detail&id='.$id;
			}
			
			
			$page_str 	= $GLOBALS['Page'] -> buildpage_str( $url , $page = $page , $page_size = 1 , $result_count = $reinfodetail["pageCount"]);
			
			//浏览量 + 1
			$sqlup = " UPDATE ".$this -> db -> prefix."article set art_count = art_count +1 WHERE art_id = ".$id ; 
			$this -> db -> querySql($sqlup);
			

			
			$cache_id = $id.'art'.$page;
			$this -> view -> assign('arturl',$url);
			$this -> view -> assign('webtitle',$webtitle);
			$this -> view -> assign('infodetail',$infodetail);
			$this -> view -> assign('page_str',$page_str);	//分页
			$this -> view -> assign('now_address',$now_address);
			$this -> view -> display('art_tpl.html',$cache_id);
			
		}else{
			$this -> error('404');
		}
	}
	
		//分页程序
		function getcontent($content, $page=1)
		{  
			$page = $page ? intval($page) : 1;
			
			$reArticle = array(  'reInfo' => array(), 'pageCount' => 1 );
			
			if(!empty($content))
			{  
				$pattern = "/<div style=\"page-break-after: always;?\">\s*<span style=\"display: none;?\">&nbsp;<\/span>\s*<\/div>/";
				$contents = preg_split($pattern, $content);  
				$reArticle['pageCount'] = count($contents); 
				($page > $reArticle['pageCount']) && $page = $reArticle['pageCount'];  
				$reArticle['reInfo'] = $contents[$page - 1];
				
			}else{
				return false;
			}
			
			return $reArticle;  
		}
	
	function get_artlist( $sid = '', $page_num = 1 , $num = '1')
	{
		$page_size = 50 ;
		
		if( $page_num  > 1 )
		{
			$limit_num = ceil( ( $page_num -1 ) * $page_size );
		}else{
			$page_num  = 1;
			$limit_num = 0 ;
		}
		
		$webtitle = '最新新闻';
		
		$now_address = '您的位置：<a href="'.BASE_WEBURL.'/mobile/">首页</a> > <a href="'.BASE_WEBURL.'/mobile/?artlist.html">新闻资讯</a> ';
		if( $sid != '' )
		{
			$seletsort = " SELECT ars_id,ars_name  FROM ".$this -> db -> prefix."artsort WHERE ars_id = ".$sid." or  ars_parentid = ".$sid ;
			$sortInfo  = $this -> db ->  select_info($seletsort);
			
			$sinid 	   = $sid;

				foreach((array)$sortInfo as $skey => $sval )
				{
					if( $sval["ars_id"]== $sid )
					{
						$sortval = $sval["ars_name"];
					}
 						$sinid .= ','.$sval["ars_id"];
				}
			
			 $sqlQuery 		= " SELECT art_id, art_title , art_count   FROM  ".$this -> db -> prefix."article   WHERE art_sysfile ='' and  art_enabled = 1 and  ars_id in ( ".$sinid." ) ".$whereadd."  GROUP BY  art_id ORDER BY art_uptime DESC, `art_id` LIMIT   $limit_num , $page_size ";
			 $sqlQuerycount 	= " SELECT count(1) as CNUM  FROM  ".$this -> db -> prefix."article  WHERE art_sysfile ='' and  art_enabled = 1  and   ars_id in ( ".$sinid." ) ".$whereadd." ORDER BY `art_id`  ";

		}else{
			$sqlQuery 		= " SELECT art_id, art_title , art_count   FROM  ".$this -> db -> prefix."article   WHERE art_sysfile ='' and  art_enabled = 1  GROUP BY  art_id ORDER BY art_uptime DESC,  `art_id` LIMIT   $limit_num , $page_size ";
			$sqlQuerycount 	= " SELECT count(1) as CNUM  FROM  ".$this -> db -> prefix."article  WHERE art_sysfile ='' and  art_enabled = 1  ".$whereadd." ORDER BY `art_id`  ";
			
		}
		
		$info = $this -> db -> select_info($sqlQuery);
		$infocount 	= $this -> db -> selectOne($sqlQuerycount);
		
		$url = BASE_WEBURL.'/mobile/?ars-'.$sid.".html";
		
		$page_str    = $GLOBALS['Page']   -> buildpage_str( $url , $page_num  , $page_size  , $result_count = $infocount["CNUM"] );


		$cache_id = $sid.'artlist'.$page_num;
		$this -> view -> assign('arturl',$url);
		$this -> view -> assign('webtitle',$webtitle);
		$this -> view -> assign('info',$info);
		$this -> view -> assign('page_str',$page_str);	//分页
		$this -> view -> assign('now_address',$now_address);
		
		$this -> view -> display('artlist_tpl.html',$cache_id);
		
	}
	
	function get_prolist( $sid = '', $page_num = 1 , $num = '1')
	{
		$page_size = 50 ;
		
		if( $page_num  > 1 )
		{
			$limit_num = ceil( ( $page_num -1 ) * $page_size );
		}else{
			$page_num  = 1;
			$limit_num = 0 ;
		}
		
		$webtitle = '最新商品';
		
		$now_address = '您的位置：<a href="'.BASE_WEBURL.'/mobile/">首页</a> > <a href="'.BASE_WEBURL.'/mobile/?prolist.html">最新商品</a> ';
		if( $sid != '' )
		{
			$seletsort = " SELECT prs_id,prs_name  FROM ".$this -> db -> prefix."prosort WHERE prs_id = ".$sid." or  prs_parentid = ".$sid ;
			$sortInfo  = $this -> db ->  select_info($seletsort);
			$sinid 	   = $sid;

				foreach((array)$sortInfo as $skey => $sval )
				{
					if( $sval["prs_id"]== $sid )
					{
						$sortval = $sval["prs_name"];
					}
 						$sinid .= ','.$sval["prs_id"];
				}
			
			 $sqlQuery 		= " SELECT pro_id, pro_name , pro_count   FROM  ".$this -> db -> prefix."product   WHERE   pro_enabled = 1 and  prs_id in ( ".$sinid." )   GROUP BY  pro_id ORDER BY pro_up_time DESC, `pro_id` LIMIT   $limit_num , $page_size ";
			 $sqlQuerycount 	= " SELECT count(1) as CNUM  FROM  ".$this -> db -> prefix."product  WHERE    pro_enabled = 1  and   prs_id in ( ".$sinid." )  ORDER BY `pro_id`  ";

		}else{
			$sqlQuery 		= " SELECT pro_id, pro_title , pro_count   FROM  ".$this -> db -> prefix."product   WHERE   pro_enabled = 1  GROUP BY  pro_id ORDER BY pro_up_time DESC,  `pro_id` LIMIT   $limit_num , $page_size ";
			$sqlQuerycount 	= " SELECT count(1) as CNUM  FROM  ".$this -> db -> prefix."product  WHERE   pro_enabled = 1  ORDER BY `pro_id`  ";
			
		}
		
		$info = $this -> db -> select_info($sqlQuery);
		$infocount 	= $this -> db -> selectOne($sqlQuerycount);
		
		$url = BASE_WEBURL.'/mobile/?prs-'.$sid.".html";
		
		$page_str    = $GLOBALS['Page']   -> buildpage_str( $url , $page_num  , $page_size  , $result_count = $infocount["CNUM"] );

		$cache_id = $sid.'prolist'.$page_num;
		
		$this -> view -> assign('arturl',$url);
		$this -> view -> assign('webtitle',$webtitle);
		$this -> view -> assign('info',$info);
		$this -> view -> assign('page_str',$page_str);	//分页
		$this -> view -> assign('now_address',$now_address);
		
		$this -> view -> display('prolist_tpl.html',$cache_id);
		
	}

	function get_piclist( $sid = '', $page_num = 1 , $num = '1')
	{
		$page_size = 50 ;
		
		if( $page_num  > 1 )
		{
			$limit_num = ceil( ( $page_num -1 ) * $page_size );
		}else{
			$page_num  = 1;
			$limit_num = 0 ;
		}
		
		$webtitle = '最新图库';
		
		$now_address = '您的位置：<a href="'.BASE_WEBURL.'/mobile/">首页</a> > <a href="'.BASE_WEBURL.'/mobile/?piclist.html">最新图库</a> ';
		if( $sid != '' )
		{
			$seletsort = " SELECT pis_id,sort_name  FROM ".$this -> db -> prefix."picsort WHERE pis_id = ".$sid." or  pis_parentid = ".$sid ;
			$sortInfo  = $this -> db ->  select_info($seletsort);
			$sinid 	   = $sid;

				foreach((array)$sortInfo as $skey => $sval )
				{
					if( $sval["pis_id"]== $sid )
					{
						$sortval = $sval["sort_name"];
					}
 						$sinid .= ','.$sval["pis_id"];
				}
			
			 $sqlQuery 		= " SELECT pic_id, pic_title , pic_view   FROM  ".$this -> db -> prefix."picture   WHERE   pic_enabled = 1 and  pis_id in ( ".$sinid." )   GROUP BY  pic_id ORDER BY pic_uptime DESC, `pic_id` LIMIT   $limit_num , $page_size ";
			 $sqlQuerycount 	= " SELECT count(1) as CNUM  FROM  ".$this -> db -> prefix."picture  WHERE    pic_enabled = 1  and   pis_id in ( ".$sinid." )   ORDER BY `pic_id`  ";

		}else{
			$sqlQuery 		= " SELECT pic_id, pic_title , pic_view   FROM  ".$this -> db -> prefix."picture   WHERE   pic_enabled = 1  GROUP BY  pic_id ORDER BY pic_uptime DESC,  `pic_id` LIMIT   $limit_num , $page_size ";
			$sqlQuerycount 	= " SELECT count(1) as CNUM  FROM  ".$this -> db -> prefix."picture  WHERE   pic_enabled = 1   ORDER BY `pic_id`  ";
			
		}
		
		$info 		= $this -> db -> select_info($sqlQuery);
		$infocount 	= $this -> db -> selectOne($sqlQuerycount);
		
		$url 		= BASE_WEBURL.'/mobile/?pis-'.$sid.".html";
		
		$page_str    = $GLOBALS['Page']   -> buildpage_str( $url , $page_num  , $page_size  , $result_count = $infocount["CNUM"] );

		$cache_id = $sid.'piclist'.$page_num;
		
		$this -> view -> assign('arturl',$url);
		$this -> view -> assign('webtitle',$webtitle);
		$this -> view -> assign('info',$info);
		$this -> view -> assign('page_str',$page_str);	//分页
		$this -> view -> assign('now_address',$now_address);
		
		$this -> view -> display('piclist_tpl.html',$cache_id);
		
	}
	
	function get_vidlist( $sid = '', $page_num = 1 , $num = '1')
	{
		$page_size = 50 ;
		
		if( $page_num  > 1 )
		{
			$limit_num = ceil( ( $page_num -1 ) * $page_size );
		}else{
			$page_num  = 1;
			$limit_num = 0 ;
		}
		
		$webtitle = '最新视频';
		$now_address = '您的位置：<a href="'.BASE_WEBURL.'/mobile/">首页</a> > <a href="'.BASE_WEBURL.'/mobile/?vidlist.html">最新视频</a> ';
		
		if( $sid != '' )
		{
			$seletsort = " SELECT vis_id,vis_name  FROM ".$this -> db -> prefix."vidsort WHERE vis_id = ".$sid." or  vis_parentid = ".$sid ;
			$sortInfo  = $this -> db ->  select_info($seletsort);
			$sinid 	   = $sid;

				foreach((array)$sortInfo as $skey => $sval )
				{
					if( $sval["vis_id"]== $sid )
					{
						$sortval = $sval["vis_name"];
					}
 						$sinid .= ','.$sval["vis_id"];
				}
			
			 $sqlQuery 		= " SELECT vid_id, vid_title , vid_count   FROM  ".$this -> db -> prefix."video   WHERE   vid_enabled = 1 and  vis_id in ( ".$sinid." )   GROUP BY  vid_id ORDER BY vid_uptime DESC, `vid_id` LIMIT   $limit_num , $page_size ";
			 $sqlQuerycount = " SELECT count(1) as CNUM  FROM  ".$this -> db -> prefix."video  WHERE    vid_enabled = 1  and   vis_id in ( ".$sinid." )   ORDER BY `vid_id`  ";

		}else{
			$sqlQuery 		= " SELECT vid_id, vid_title , vid_count   FROM  ".$this -> db -> prefix."video   WHERE   vid_enabled = 1  GROUP BY  vid_id ORDER BY vid_uptime DESC,  `vid_id` LIMIT   $limit_num , $page_size ";
			$sqlQuerycount 	= " SELECT count(1) as CNUM  FROM  ".$this -> db -> prefix."video  WHERE   vid_enabled = 1   ORDER BY `vid_id`  ";
			
		}

		$info 		= $this -> db -> select_info($sqlQuery);
		$infocount 	= $this -> db -> selectOne($sqlQuerycount);
		
		$url 		= BASE_WEBURL.'/mobile/?vis-'.$sid.".html";
		
		$page_str    = $GLOBALS['Page']   -> buildpage_str( $url , $page_num  , $page_size  , $result_count = $infocount["CNUM"] );

		$cache_id = $sid.'vidlist'.$page_num;
		
		$this -> view -> assign('arturl',$url);
		$this -> view -> assign('webtitle',$webtitle);
		$this -> view -> assign('info',$info);
		$this -> view -> assign('page_str',$page_str);	//分页
		$this -> view -> assign('now_address',$now_address);
		
		$this -> view -> display('vidlist_tpl.html',$cache_id);
		
	}

	
	function get_pro( $id = '', $num = '8')
	{
		$now_address = '您的位置：<a href="'.BASE_WEBURL.'/mobile/">首页</a> > <a href="'.BASE_WEBURL.'/mobile/?prolist.html">最新商品</a>';
		
		if( $id > 0 )
		{
			$sqlQuery 		= " SELECT a.* ,s.prs_name  FROM  ".$this -> db -> prefix."product as a ,".$this -> db -> prefix."prosort  as s  WHERE a.prs_id = s.prs_id and a.pro_enabled = 1  and a.pro_id = ".$id." ORDER BY a.`pro_id`  ";
			$infodetail 	= $this -> db -> selectOne($sqlQuery);
			
			$webtitle  		= $infodetail["pro_name"];
			
			if($infodetail["vis_name"]!='')
			{
				$now_address = $now_address. ' > <a href="'.BASE_WEBURL.'/mobile/?prs-'.$infodetail["prs_id"].'.html">'.$infodetail["prs_name"].'</a> ';
			}
			
			if( $GLOBALS["WebConfig"]["webhtml"] == 1 )
			{
				$url = BASE_WEBURL.'/pro-'.$id.".html";
			}else{
				$url = BASE_WEBURL.'/?load=pro&act=detail&id='.$id;
			}
			
				//查询图片资料
				$sqlQuery 	= " SELECT *   FROM  ".$this -> db -> prefix."proimg    WHERE  pro_id  = ".$infodetail["pro_id"]." ORDER BY  `pri_id`  ";
				
				$infoimg 	= $this -> db ->  select_info($sqlQuery);
				
				//var_dump($infoimg);
				$infoimgArray[0]["big_img"] = $infodetail["pro_img"];
				$infoimgArray[0]["pro_img"] =  $this -> helper -> build_img( $infodetail["pro_img"] );
				
				foreach($infoimg as $ikey => $ival )
				{
					$infoimgArray[$ikey+1]["big_img"] = $ival["pri_url"];
					$infoimgArray[$ikey+1]["pro_img"] = $this -> helper -> build_img( $ival["pri_url"]);
				}
				
			
			
			//浏览量 + 1
			$sqlup = " UPDATE ".$this -> db -> prefix."product set pro_count = pro_count +1 WHERE pro_id = ".$id ;
			$this -> db -> querySql( $sqlup );
			

			
			$cache_id = $id.'pro';
			$this -> view -> assign('arturl',$url);
			$this -> view -> assign('webtitle',$webtitle);
			$this -> view -> assign('infoimgArray',$infoimgArray);
			$this -> view -> assign('infodetail',$infodetail);
			$this -> view -> assign('page_str',$page_str);	//分页
			$this -> view -> assign('now_address',$now_address);
			$this -> view -> display('pro_tpl.html',$cache_id);
			
		}else{
			$this -> error('404');
		}
		
	}
	
	
	//图片中心
	function get_pic( $id = '', $num = '8')
	{
		
		$now_address = '您的位置：<a href="'.BASE_WEBURL.'/mobile/">首页</a> > <a href="'.BASE_WEBURL.'/mobile/?piclist.html">最新图库</a>';
 
		if( $id > 0 )
		{
			$sqlQuery 		= " SELECT a.* ,s.sort_name  FROM  ".$this -> db -> prefix."picture as a ,".$this -> db -> prefix."picsort  as s  WHERE a.pis_id = s.pis_id and a.pic_enabled = 1  and a.pic_id = ".$id." ORDER BY a.`pic_id`  ";
			$infodetail 	= $this -> db -> selectOne($sqlQuery);
			
			$webtitle  		= $infodetail["pic_title"];

			$infoItemval[0]["pii_url"] = $this -> helper -> build_img( $infodetail["pic_url"] ) ;
			$infoItemval[0]["piibig_url"] = $infodetail["pic_url"]  ;
			$infoItemval[0]["pii_desc"]  =  strip_tags($infodetail["pic_content"]);

					
			//查询其他图片信息
			$sqlQueryitem 	= " SELECT  pii_id, pic_id , pii_desc, pii_url    FROM  ".$this -> db -> prefix."picitem    WHERE  pii_enabled = 1  and  pic_id = ".$id."  ORDER BY  `pii_id`  LIMIT 0,200";
			$infoItem 	= $this -> db ->  select_info( $sqlQueryitem );
			
			$picnum = count($infoItem);
			

			foreach((array)$infoItem as $itemkey => $itemval )
			{
						
					$infoItemval[$itemval["pii_id"]]["pii_url"] 	= $this -> helper -> build_img( $itemval["pii_url"] ) ;
					$infoItemval[$itemval["pii_id"]]["piibig_url"] 	= $itemval["pii_url"]  ;
					$infoItemval[$itemval["pii_id"]]["pii_desc"] =  strip_tags($itemval["pii_desc"]);
			}


			if($infodetail["sort_name"]!='')
			{
				$now_address = $now_address. ' > <a href="'.BASE_WEBURL.'/mobile/?pis-'.$infodetail["pis_id"].'.html">'.$infodetail["sort_name"].'</a> ';
			}

			
			if( $GLOBALS["WebConfig"]["webhtml"] == 1 )
			{
				$url = BASE_WEBURL.'/pic-'.$id.".html";
			}else{
				$url = BASE_WEBURL.'/?load=pic&act=detail&id='.$id;
			}

			
			
			//浏览量 + 1
			$sqlup = " UPDATE ".$this -> db -> prefix."picture set pic_view = pic_view +1 WHERE pic_id = ".$id ;
			$this -> db -> querySql( $sqlup );
			

			
			$cache_id = $id.'pic';
			$this -> view -> assign('arturl',$url);
			$this -> view -> assign('webtitle',$webtitle);
			$this -> view -> assign('infoItemval',$infoItemval);
			$this -> view -> assign('infodetail',$infodetail);
			$this -> view -> assign('page_str',$page_str);	//分页
			$this -> view -> assign('now_address',$now_address);
			$this -> view -> display('pic_tpl.html',$cache_id);
			
		}else{
			$this -> error('404');
		}

	}
	
	function get_vid( $id = '')
	{

		$now_address = '您的位置：<a href="'.BASE_WEBURL.'/mobile/">首页</a> > <a href="'.BASE_WEBURL.'/mobile/?vidlist.html">最新视频</a>';
		
		if( $id > 0 )
		{
			$sqlQuery 		= " SELECT a.* ,s.vis_name  FROM  ".$this -> db -> prefix."video as a ,".$this -> db -> prefix."vidsort  as s  WHERE a.vis_id = s.vis_id and a.vid_enabled = 1  and a.vid_id = ".$id." ORDER BY a.`vid_id`  ";
			$infodetail 	= $this -> db -> selectOne($sqlQuery);
			
			$webtitle  		= $infodetail["vid_title"];
			
			if($infodetail["vis_name"]!='')
			{
				$now_address = $now_address. ' > <a href="'.BASE_WEBURL.'/mobile/?vis-'.$infodetail["vis_id"].'.html">'.$infodetail["vis_name"].'</a> ';
			}
			
			if( $GLOBALS["WebConfig"]["webhtml"] == 1 )
			{
				$url = BASE_WEBURL.'/vid-'.$id.".html";
			}else{
				$url = BASE_WEBURL.'/?load=vid&act=detail&id='.$id;
			}
			//浏览量 + 1
			$sqlup = " UPDATE ".$this -> db -> prefix."video set vid_count = vid_count +1 WHERE vid_id = ".$id ;
			$this -> db -> querySql( $sqlup );
			

			
			$cache_id = $id.'vid';
			$this -> view -> assign('arturl',$url);
			$this -> view -> assign('webtitle',$webtitle);
			$this -> view -> assign('infodetail',$infodetail);
			$this -> view -> assign('page_str',$page_str);	//分页
			$this -> view -> assign('now_address',$now_address);
			$this -> view -> display('vid_tpl.html',$cache_id);
			
		}else{
			$this -> error('404');
		}

		
	}
	
	function get_inv( $sid = '', $num = '8')
	{
		
		$addsql = '';
		
 		$info["title"] 	= '招聘信息';
		
		$sqlQuery 	= " SELECT inv_id, inv_position ,  inv_addtime   FROM  ".$this -> db -> prefix."invite   WHERE inv_enabled = 1 $addsql  GROUP BY  inv_id ORDER BY  `inv_id` LIMIT  0 , $num ";
 
		$info["invinfo"] 	= $this -> db ->  select_info( $sqlQuery );
		

		foreach((array)$info["invinfo"] as $pkey => $pval )
		{
			 $info["invinfo"][$pkey]["get_url"]	= $this -> helper  -> build_url( $valid = $pval["inv_id"],'inv');
		}

		return $info;
		
	}
	
	function get_vot( $sid = '', $num = '8')
	{
		
		$addsql = '';
		
 		$info["title"] 	= '推荐投票';

		$sqlQuery 	= " SELECT vot_id, vot_title , vot_endtime  FROM  ".$this -> db -> prefix."vote   WHERE 1 $addsql  GROUP BY  vot_id ORDER BY  `vot_id` LIMIT  0 , $num ";
 
		$info["votinfo"] 	= $this -> db ->  select_info( $sqlQuery );
		
		

		foreach((array)$info["votinfo"] as $pkey => $pval )
		{
			 $info["votinfo"][$pkey]["get_url"]	= $this -> helper  -> build_url( $valid = $pval["vot_id"],'vot');
		}

		return $info;
		
	}
	
	function get_dow( $sid = '', $num = '8')
	{
		
		$addsql = '';
		
 		$info["title"] 	= '最新下载';

		$sqlQuery 	= " SELECT dow_id, dow_name , dow_uptime   FROM  ".$this -> db -> prefix."download   WHERE dow_enabled = 1 $addsql  GROUP BY  dow_id ORDER BY  dow_uptime DESC , `dow_id` DESC  LIMIT  0 , $num ";
 
		$info["dowinfo"] 	= $this -> db ->  select_info( $sqlQuery );

		foreach((array)$info["dowinfo"] as $pkey => $pval )
		{
			 $info["dowinfo"][$pkey]["get_url"]	= $this -> helper  -> build_url( $valid = $pval["dow_id"],'dow');
		}

		return $info;
		
	}


}

$Mobil = new Mobile();


?>