PDA

View Full Version : Screenshot Processor Usage Tip


bruleo
07-05-2008, 06:29 PM
Ok, if you're like me, you don't want thousands and thousands of thumbnail images in the same folder on your server. What I wanted to do was to split my thumbs into groups of no more than a thousand.

Here is what I have done and it makes my life a while lot easier :) ..... There are probably other ways of doing it, but this works and it was simple!

Step 1:
First I created a group of new folders on the server for each size of image...

For example:
/images/thumbs/200x150/000000
/images/thumbs/200x150/001000
/images/thumbs/200x150/002000
......... (continue for as many as you like, increasing by 1000 each time.

Step 2:
In your templates where you display your images add:-
Content visible to registered users only.
The above code is for detail.tpl. If using in your link.tpl, then change all instances of '$ID' to '$link.ID'.

Step 3:
When you run the processor, create new jobs for each group of a thousand and save with the correct upload file path in Step 1. Not only does it help keeping things tidy on your server, it also makes updating the thumbs easier. Instead of 1 huge processing job, you can create smaller jobs and run them periodically. Not only that, it make the automatic scraping of all your thumbs, just a little bit harder for anyone that sets up an automated process to do it, as the file path of the images change depending upon the link ID.

Additional, but not required..
I have also added preview images of the thumbs into my Admin, by doing the following. This is an example only and is a direct copy of what I have in my u-Hits Admin for TWO different image size. Both images render in Admin the same size, but is a quick and easy way to see if the image actually exists for the link ID. You will need to change the image sizes and paths to whatever you have set.

In dir_links.tpl (in your Core admin templates folder), find:

Content visible to registered users only.

Add after:-
Content visible to registered users only.

I have all of the above installed and working on ALL of my directories with no problems at all. Please note the lower case '$id' in the admin as apposed to uppercase elsewhere. I found that uppercase in admin doesn't work!

Also, keep in mind, that if you add the other tip I submitted regarding displaying a default image if none exists, then it may slow your admin down considerably if you have a lot of images that are missing. I rarely have more than a couple missing, so it's not an issue for me, but I removed it from this tip, to keep the two seperate.

Hope this helps someone.

If you find it useful, a link back to one of my sites is always appreciated! :)

Bruce.

MikeK
08-24-2008, 08:14 PM
Hi Bruce,
good idea. With this I can start several instances parallel. ;)

Ciao,
Mike