Thanks, it works now, but i fixed the code:Originally Posted by Infizi
"<a target='_blank' href='$images_dir/".$row[2]."'><img src='".$images_dir."/tb_".$row[2]."' border='0' alt='".$row[1]."' /><br />".$row[1]."</a>";
| SitePoint Sponsor |
Thanks, it works now, but i fixed the code:Originally Posted by Infizi
"<a target='_blank' href='$images_dir/".$row[2]."'><img src='".$images_dir."/tb_".$row[2]."' border='0' alt='".$row[1]."' /><br />".$row[1]."</a>";



remember to remove /tb_ from both sides
PHP Code:echo "<a target='_blank' href='$images_dir/".$row[2]."'><img src='".$images_dir."/".$row[2]."' border='0' alt='".$row[1]."' /><br />".$row[1]."</a>";
Originally Posted by duris
is there a way to make the filenames generated to be non-repeating non-sequential? (using numeric and alpha characters)
I want to upload an entire folder in 1 time, is that also possible?



hmm, youd have to use a readir() and fopen() loop. Not sure it is possible but hope this pointer helpsOriginally Posted by tweetie
![]()



i useOriginally Posted by nickthibert
PHP Code:$filename = md5(md5($photo['tmp_name'].time()).time());
$filename = substr($filename, 0, 10).".".$known_photo_types[$photo['type']];

Warning: getimagesize: Unable to open 'rsname/125.jpg' for reading. on line 98
line 98 is
rsname is name of directory where previously moved images are placed referenced by $images_dir = 'rsname/';PHP Code:$size = GetImageSize('rsname/' . $filename);
block of code
trying to get resized image to display asPHP Code:$resultthumb=mysql_query("select filename from resale1 where id ='$id'");
$fileresult=mysql_fetch_array($resultthumb);
$filename=$fileresult['filename'];
$size = GetImageSize('rsname/' . $filename);
if($size[0] > $size[1]){
$new_width = 100;
$new_height = (int)(100 * $size[1]/$size[0]);
}
else{
$new_width = (int)(100 * $size[0]/$size[1]);
$new_height = 100;
}
exec("$imagemagickPath/convert -geometry " . "{$new_width}x{$new_height} " . "$images_dir/$filename $images_dir/tb_$filename");
<?php $img = "<td align center><img src=rsname/tb_$filename></td>/n"


My host does not support copy functions as there is a restriction on open_basedir, does anyone know how I can change this code to use the move uploaded files function rather that the code below.
The above code is making the script spit out errorsPHP Code:copy($photos_uploaded['tmp_name'][$counter], $images_dir."/".$filename);



your images dir will need to be a full path, ie /home/user/pathOriginally Posted by arano
hello
i have tried the script as it is from the original files,
i have changed my config file with correct details
when i submit a photo,
error comes up
Fatal error: Call to undefined function ImageCreateFromJPEG() in /web/kahmad/ftpaccess/pub/upload.php on line 73
the server has got GD installed so what can it be?
i cant think of anything what could it be?
please help!
well I just had some other errors when I uploaded, but making a directory called "photos" in the gallery folder seemed to solve the problem.
Now I am trying to find out how to manage the categories from the browser...any tips?
Knud



try this:
1 - give a fully qualified path "/home/user/public_html/rsname/"
2 - make the current path relative "/rsname/"
if they both fail then check that GDLib is installed properly.
Originally Posted by soart
What does this error mean...no I did not upload more than 8 mb of photos
Knudo



Hi Knudo,
I dont quite understand what you want, but i can see that originally you didnt have the folder there, so it could not copy the files to a folder that dosent exist.
Please tell us the error and we can help!!!!!!!
Originally Posted by knudo



Youll need to create a PHP front end for the database backend!!! Its very simple, if you cant do it then show me your website and current scripts and i will make something for you to get you going!!!
Have a great new year everyone!!!
Originally Posted by Knudo
I am having a problem with uploading files because the copy function (and others) are trying to write to /tmp
Here is one of the errors I am getting:
Warning: copy(): open_basedir restriction in effect. File(/tmp/php1Va9tH) is not within the allowed path(s): (/home/fatpigeonuk/public_html) in /home/fatpigeonuk/public_html/gallery/upload.php on line 51
How can I fix this?
Thanks,
Ludders




Hey people,
This has been great reading .. Thumbs up to you all ..
Drew .. Yer the man .. I tired your DrewsVersionOfMayanksPhotoGallery.zip .. works great ..
Couple of thoughts I have ..
I cant find the max file upload size .. It seems it set to 2097152 Bytes ..
Maybe a few addons ..
A signup form for public photo submissions .. with intergrated sessions so only admin can delete / rename photos & catagories etc .. public can only upload images and create catagories .. Also rights so when they first signup they are given say 1 .. So they cant actually upload untill admin gives them 2 ..?
and ..
allow sub catagories to be added .. would be a great option to have
Also ..
Allow an admin option to have the large images opened in new window .. using javascript so browser resizes to image size ..
and maybe ..
Another method on the index page so the way the images are displayed in tables/borders etc can easliy edited by noobies .. ?
Anyway .. great job guys .. This is exactly what I am after .. the Coppermine Photo Gallery etc are to tedius and have very bad admin panel in the rsepect of u cant turn off latest editions .. top 10 .. bla bla .. I like simple like you guys have created ..
Great Job!
Last edited by _matrix_; Jan 4, 2005 at 23:03.


use move_uploaded_files instead of using copy and use the full pathname to your directory like this:Originally Posted by ludders
That is roughly it but ive changed my script a little so not exactly the same.PHP Code:move_uploaded_file($photos_uploaded['tmp_name'][$counter], "/home/fatpigeonuk/public_html/gallery".$filename);
Aaron
Cheers! That worked. Also, is there any way I can make the image dir one outside of the same site. I have loads of space on my ntlworld account and would like to upload the images there instead of on my site (i am running out of space).
Thanks,
Ludders



I finnaly got round to looking at Drews Gallery Version.
I have done quite a lot more with the gallery including making a user area so users can manage photos to, private gallerys only available to registered users, public gallerys available to all etc etc etc, plus standard admin stuff, and sub categorys, user login expration, etc etc etc.
Plus its fully customisable via a clever template system
Is anyone wanting this more advanced version? If people do i can get it all working properly. I have some spare time, so if people want other stuff added in too then let me know, please PM with subject "Wanted Features" and just list your ideas. Credits will be given to anyone who helps/inputs good ideas that are used of course too!!!


I am getting a memory error when I am uploading photos.
The filesize of the image is only 800kb and my php.ini setting on my web host states that the memory_limit is 8388608, how can my script be throwing errors when the allowed memory limit is 9 times the size of the image. The max upload size is 6097152 so its not that either. Anybody got an idea what is going on?
edit- I read somewhere that this might be due to image resolution problems rather than filesize as the image is converted to bitmap on upload and hence a bigger res image makes a bigger file size in bmp format- can anyone confirm this??
Aaron
Last edited by arano; Jan 6, 2005 at 06:38.




Hi Infizi,
I am very interested in getting more advanced features into this gallery ..
The only ideas I have at the moment are the ones posted a few posts up .. Also an installer could be good as well .. This script with the features you spoke about would be perfect!
I have Drews Gallery Version working like a charm in themed sites ..
Great job guys


In regards to my earlier post I have changed a few settings to make it work, it anyone is interested. I read that it is down to imagecreatefromjpeg using up all the memory it can, but i used ini_set() to double the memory in my php.ini file and the upload worked.
The function memory_get_usage() showed that the memory used to create the file was nearly at the new limit set which it a lot !!
Temporarly setting the memory should be fine, as its only when the image is uploaded then it will be reset.
Aaron



All those ideas will be taken into thought when making my version, also the installer package seems a good idea!!!!!Originally Posted by _matrix_
I will start work tonight, get a simple site up and post updates on it etc,![]()
Well you should post your code here to the forum in a zip file like I did with ALL the advanced features. The PM method does not make it very easy to attain the code. My code was posted so long ago that it's not even funny any more. Remember the code that I posted was a collaboration effort by lots of people including myself.
I am glad someone finally took this to another level. This was the idea right from the start. Now hopefully others will post their code here too. This tutorial was supposed to be a learning process and a starting point for something bigger and better so lets see your products people!
Originally Posted by Infizi
Drew
"The town where I grew up has a zip code of E-I-E-I-O."
Bookmarks