<?php

/*
 * Copyright (C) xgcms.com
 */

class ads extends base_model {
	function __construct(&$conf) {
		parent::__construct($conf);
		$this->table = 'ads';
		$this->primarykey = array('adsid');
		$this->maxcol = 'adsid';
	}
		// 
	public function get_ads_list() {
		$ads=array();
		$list = $this->index_fetch(array(), array('adsid'=>1), 0, 100);
		foreach($list as $v){
			$ads[$v['adsname']]=$v['adscontent'];
		}
		return $ads;
	}
	public function get_ads_all(){
		$list = $this->index_fetch(array(), array('adsid'=>1), 0, 100);
		return $list;
	}
	
	public function get_by_adsname($name){
		$list = $this->index_fetch(array('adsname'=>$name), array(), 0, 1);
		return $list;
	}
	public function _delete($blogid) {
		$return = $this->delete($blogid);
		if($return) {
			$this->count('-1');
		}
		return $return;
	}
	
}

?>