 
                                
                    
                        Re: Thumbnails for websites
                        Posted by larchy on 
    Sat Sep 6th 2008 at 11:24am
                     
                    
                        
                        Posted 
    2008-09-06 11:24am
                     
                 
                
            
            
                
    
                    
                             larchy
                            larchy
            
                            fluffy teim
                super admin
     
            496 posts
        87 snarkmarks
        Registered: 
    Jan 14th 2008
                    Occupation: kitten fluffer
                            Location: UK
             
                
                        Um, depends.
I've never personally used imageshack, but I assume that when you hotlink to an image hosted there the webserver returns a thumbnail of the image you linked to.
If thats what happens then the thumbs will be generated on the fly most likely (or they get generated when you first upload the image etc). There are libraries that let you write scripts to handle that - the way I added the thumbnail generation for oversize images on these forums was by using the php GD libraries to check the size of the image and generate+output a hyperlinked thumbnail if the image was over certain dimensions. There are potential drawbacks to this approach, but it seems to be working ok for now.
All this is server-side stuff though. If you just want somewhere to host your images, and you want a thumbnail to link to, then yeah you'd have to create your own thumbs and do what you say.... hopefully the above explains what is going on with imageshack etc a bit better though.
AJAX is "asynchronous javascript and xml" and isn't anything to do with that. It lets you do change elements of a page & communicate with the server without refreshing the entire page... for example I have an early version of the snarkpit's map upload page where when you add a map or images to the file input fields they upload in the background (ie before you press the submit button) while you fill out the rest of the page. Sadly it proved that it would be too awkward to implement very well because while AJAX just needs javascript & xml and therefore prettymuch works on any browser without needing anything special, there are a few things needed server side - namely a 'framework' or library that lets you 'do stuff', such as tigermouse or sajax - which isn't present, and most need/work best on php5. You can get by and do stuff without them, but really its not a very good idea.
                                    
             
        
            
            
                                     
                                
                    
                        Re: Thumbnails for websites
                        Posted by larchy on 
    Sun Sep 7th 2008 at 12:24pm
                     
                    
                        
                        Posted 
    2008-09-07 12:24pm
                     
                 
                
            
            
                
    
                    
                             larchy
                            larchy
            
                            fluffy teim
                super admin
     
            496 posts
        87 snarkmarks
        Registered: 
    Jan 14th 2008
                    Occupation: kitten fluffer
                            Location: UK
             
                
                        The way you'd do it is to have a file upload form which will take an image, save it on the server and create a thumbnail (could be preset dimensions or add the dimension fields to the form to make them variable... the gd libraries will handle all that fine), then spit out a "upload successful, code is: [blah]" message.
It wouldn't actually be very difficult, although you'd need an edit/delete form too and presumably some sort of basic login system.
                                    
             
        
            
            
                                     
                                
                    
                        Re: Thumbnails for websites
                        Posted by larchy on 
    Mon Sep 8th 2008 at 10:41am
                     
                    
                        
                        Posted 
    2008-09-08 10:41am
                     
                 
                
            
            
                
    
                    
                             larchy
                            larchy
            
                            fluffy teim
                super admin
     
            496 posts
        87 snarkmarks
        Registered: 
    Jan 14th 2008
                    Occupation: kitten fluffer
                            Location: UK
             
                
                        Pff it'd hardly be much of a stretch m8 the amount of my time I spend helping ppl with all sorts of stuff. Feel free to gimme a buzz if you need a hand with anything.
The login stuff shouldn't be an issue as you can just do a simple one with hardcoded values and there are loads of tutorials out there for that. The upload form is pretty simple too, although handling saving the file on the server can be a bit confusing... I've got a few classes that you can just drop in to give you some functions to make all that easier, and a class that helps with manipulating images that would be really helpful for you.
Have a look at XAMPP or WAMPServer2 as platforms for local development - its much easier to be able to mess around locally than have to be constantly uploading to a remote server.