daily pastebin goal
11%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public function grava_tags($tags,$uid)
  2.     {        
  3.         $pieces = explode(",", $tags);
  4.  
  5.        
  6.         foreach($pieces as $tag)
  7.         {
  8.             $find_tag = ORM::factory('tags')->where('tag','=',$tag)->find_all();
  9.            
  10.             if(count($find_tag)=0) //grava tag se for menor =0
  11.             {
  12.                 $find_tag->tag  = $_POST['tag'];
  13.                        
  14.                 $find_tag->save();
  15.             }
  16.  
  17.             $tag_id = $find_tag->id;
  18.  
  19.             $find_tag = ORM::factory('tags_to_content')->where('contentuid','=',$uid)->where('tagid','=',$tag_id)->find_all();
  20.            
  21.             $find_tag->save();
  22.        
  23.            
  24.            
  25.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top