Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function create($tag,$increment=true,$status=-1)
- {
- $ret=false; $incCond=""; $statusCond="";
- $tag=$this->prepare($tag);
- if(strlen($tag)>0)
- {
- //does the tag already exist?
- $existsData=$this->get($tag,true); //by tag title
- if($existsData==false OR !isset($existsData["tid"]))
- {
- $status=intval($status);
- if($status>-1 AND $status<4) $status2=$status;
- else $status2=1;
- $sql="INSERT INTO tags (tid,uid,title,status) VALUES('','".$this->uid."','$tag','$status2')";
- $result=$this->db->query($sql);
- if($result==false) return false;
- else return intval($this->db->lastInsertID());
- }
Add Comment
Please, Sign In to add comment