function HookElastic_searchAllAftersaveresourcedata(){ global $baseurl,$ref,$collection, $pagename; if($pagename != "edit2"){ if($collection !=""){ $query = sql_query("SELECT resource FROM collection_resource WHERE collection = $collection"); foreach($query as $colk => $colv){ savetoelastic($colv['resource']); } }else{ savetoelastic($ref); } } }
$data['error']=false; $data['textStatus']= $file . " - Successfully Added"; $data['ref']=$ref; }else{ $data['error']=true; $data['textStatus']="could not move file to tmp"; } if($resource_type==2){ extract_text($ref,$file_extension); } if($resource_type != 2 && $resource_type != 3 && $resource_type != 4){ //create preview files in that directory create_previews_using_im($ref,false,$file_extension); $nothumb = false; }else{ $nothumb = true; sql_query("UPDATE resource SET is_transcoding = 1 WHERE ref = $ref"); //Process previews in the backgrond and continue $attempts = 1; $command = "/usr/bin/php -q -f /var/www/plugins/mia_upload/pages/background_previews.php $resource_type $ref $file_extension $attempts"; exec("$command > /dev/null &", $arrOutput); } savetoelastic($ref); echo(json_encode($data)); ob_flush(); flush(); }else{ echo('Please Add a File'); }; ?>