<?php
/************************
6/2009
Author: Shengjiang Lu
************************/
class Photo{
	var $fields = array('memberID','photo0','pDate','uDate','title','des','tag','orderNum','active');
    var $table = "";
	var $ID,$row;
	function Photo(){
		$this->table = C_tpre."Photo";
	}
	function setID($ID){
		$this->ID = $ID;
		$t = mysql_query("select * from $this->table where ID='$ID'");
		if($row=mysql_fetch_array($t)){
			$this->row = $row;
		}
	}
	function getMaxID($memberID){
		$t = mysql_query("select * from $this->table where memberID='{$memberID}' order by ID desc limit 0,1");
		if($row=mysql_fetch_array($t)){
			$this->row = $row;
			return $row["ID"];
		}	
		return "";	
	}
	function getURL(){//after setID() or getMaxID()
		global $_site;
		$re = "{$_site}/".NEWS_PATH."photo/images/".path($this->row["pDate"])."/".$this->row["photo0"];
		return $re;
	}
}
?>