<?php

/**
 * Copyright (C) 2009 Wskm Inc.All rights reserved.  
 * [Gart] www.wskmphp.com 
 * $Id: class_util.php 127 2010-10-04 03:03:55Z ws99 $ 
 */

!defined('IN_ART') && exit('Access Denied');

class art_util
{
	static $db=null;
	
	static function getIndex(){
		$data=array();
		$classArticle=usingModel('article');
		$data['news']=$classArticle->getArticleNews(19);
		$data['bests']=$classArticle->getArticleBests(13);
		$data['hots']=$classArticle->getArticleHots(10);
		$data['weekhots']=$classArticle->getArticleHots(17,'week');
		$data['pics']=$classArticle->getArticlePics(8);
		$data['cycles']=$classArticle->getArticleCycles();
		return $data;
	}

	static function getRight(){
		$data=array();
		$classArticle=usingModel('article');		
		$data['news']=$classArticle->getArticleNews(10);
		$data['weekhots']=$classArticle->getArticleHots(15,'week');		
		
		$model=usingModel('tag');
		$tags=$model->getRandomTagName(20);
		$taglist=array();
		foreach ($tags as $key=>$tag){
			$taglist[$key]['name']=$tag;
			$taglist[$key]['classkey']=mt_rand(1,10);
			$taglist[$key]['mvcurl']=mvcUrl('',array('tag','show',array('name'=>$tag)));
		}
		$data['tags']=$taglist;
		
		return $data;
	}
	
}


?>