Kigger på siden her:
Adding a watermarkEr dog blot forvirret over hvordan jeg får det proppet ind i dette:
- <?
- if(isset($_FILES['files'])){
- $res = upload_multiple_file($_FILES['files'],"fotoalbumsbilleder/");
- echo $res;
- }
- function upload_multiple_file($file,$file_dir="fotoalbumsbilleder/") {
- $overwrite = 0;
- $allowed_file_type = array("jpg","jpeg","JPG","JPEG","png","x-png","PNG","X-PNG","gif","GIF");
- $max_file_size = 2097152;
- foreach($_FILES['files']['name'] as $fkey=> $fname){
- $ext = pathinfo($fname, PATHINFO_EXTENSION);
- if (!in_array($ext, $allowed_file_type)) {
- return "Kunne ikke oploade en eller flere af filerne.<br />Tilladte typer: jpg, gif, png";
- break;
- }
- }
- foreach($_FILES['files']['tmp_name'] as $key => $tmp_name ){
- $file_name = $_FILES['files']['name'][$key];
- $file_size =$_FILES['files']['size'][$key];
- $file_tmp_name =$_FILES['files']['tmp_name'][$key];
- $file_type=$_FILES['files']['type'][$key];
- if($max_file_size_check >0) {
- if($file_size > $max_file_size){
- $fsize=$max_file_size/1048576;
- return 'File size must be less than '.$fsize.' MB';
- break;
- }
- }
- if(is_dir($file_dir)==false){
- $status = mkdir("$file_dir", 0700);
- if($status < 1){
- return "unable to create diractory $file_dir ";
- }
- }
- $codelenght = 20;
- while(strlen($billedeid) < $codelenght) {
- $part = rand(1,3);
- if($part==1){$a=48;$b=57;}
- if($part==2){$a=65;$b=90;}
- if($part==3){$a=97;$b=122;}
- $billedeid .= chr(rand($a,$b));
- }
- $randto = rand(1,90000000);
- if(is_dir($file_dir)){
- if($overwrite < 1){
- move_uploaded_file($file_tmp_name,"$file_dir/".$billedeid."_".$randto."_".$file_name);
- }
- }
- $ip = htmlspecialchars($_SERVER["REMOTE_ADDR"]);
- $dato = date("d/m/Y H:i:s");
- $file_upload_query="INSERT into tp_fotoalbums (`brugernavn`,`file_name`,`file_size`,`file_type`,`dato`,`ipa`) VALUES('dsfdsf','".$billedeid."_".$randto."_".$file_name."','".$file_size."','".$file_type."','".$dato."','".$ip."'); ";
- mysql_query($file_upload_query);
- echo ("<a href='fotoalbumsbilleder/".$billedeid."_".$randto."_".$file_name."' class='swipebox' title='Er klar til visning'><img src='../fotoalbumsbilleder/".$billedeid."_".$randto."_".$file_name."' width='50' heigt='50' border='0'></a>");
- }
- return "<hr />Billedet kan ses i stort ved at klikke på det.<br />";
- }
- ?>
Dog et krav på det bliver nr 3. jeg vil have lavet i mit.
3 - Adding some opacity to the watermark
Vil godt betale for hjælpen hvis det er problemet
Indlæg senest redigeret d. 26.09.2013 12:11 af Bruger #17554