|
|
|||||||
| Register | FAQ | Calendar | Radio and TV | NP Shop | Search | Today's Posts | Mark Forums Read |
| Tutorials Tutorials and helpful articles made by ponders for ponders |
![]() |
![]() |
![]() |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
WARNING! May ask stupid questions...
|
Simple open thumbnail in themed window PHP tutorial.
Here is a nice little bit of PHP for people who want to show their ‘larger’ images on a background instead of just a plain white background.
It is fairly simple to implement, and shows the larger image in the context of the web site/page, and allows you to display the banners or affiliated links around the image as well as on the site. So by your surfer looking at the same ‘page’ with the large image on it, only increases the chance of them clicking on your sponsor’s banner and making you some money, instead of just grabbing the big picture and may be not going any further. To start with, you need to create a template for your page. Load it with your usual sponsor banners, links, or whatever you choose to put in there. This is just to insure that your pages look in the same context the whole way through of the page/site. From your template save two files, for the purpose of this tutorial, I will say ‘gallery.php or HTML’ and ‘image.php’ (keeping the extensions the same is more professional looking in my opinion!) First off we need to set up an image folder on the server structure. Keep it in the root, so you can find it easier, and it makes the little bit of coding later on a lot simpler to write. 1. Gather your images that you are going to use for the gallery. 2. Number the images 01 XX, where XX is the highest number of the amount of images you are going to use. 3. Create a copy of these images, and rename them with the prefix of L, so your image title would look L01.jpg, for example. 4. Now rename the images that you have previously numbered with the prefix of S… REMEMBER TO KEEP THE IMAGES MATCHING WITH THE ‘L’ PREFIXED ONES!!! 5. Cut the images with the prefix of S in to your standard thumbnail size for what you use. 6. Move both the S and L prefixed images in to the same folder, which could be a subfolder of /images/ for example. Here we add the codes on to the gallery images, to open them up on the larger side, within site context. 1. Create your thumbnail gallery as normal, and instead of placing an direct link to image.jpg, use instead the link of: PHP Code:
2. Go through all of the thumbs and add them to your page, but making sure that the ‘L’ number matches the ‘S’ number on them all. 3. Save this page and then that is that for this gallery. Bringing the images up on the page, in context. Now we are here, you need to open the ‘image.php’ file that you created earlier. 1. Position one of the large images in the area to be able to get the dimensions and positioning correct on the image. 2. Once you have got the positioning correct on the page, with your maximum width set (control by width, and leave out the height, because if not, you may end up with some squashed images later on!) 3. Flip over to the code view, and find the link to where the image is… It should look like PHP Code:
PHP Code:
4. You can put your own link on this image as well, using the standard <a href> command. 5. Save the image.php file to the root of your site. I know this is probably very basic, and probably old, for most experienced webmasters, but it is a very good looking trick, which when set up is only a couple of minutes more work in putting a gallery together, and it puts your affiliate banners under the eyes of the surfer, again, instead of just letting them have the bigger image for nothing. If you get one extra sell out of it, then it is worth the time to set it up To use banners or targeted texts directly to the sponsor whose images you are using, then create copies of the image.php, with a naming convention of your choice, and then put in the relevant banners to that version of image.php (prefix with the site initials, works well), and then in the gallery, instead of just using image.php in the link, you use the prefixed version. You may have to change the location '/' on the image folders and the PHP script to get this working right, depending on how your site is structured. __________________
I would change the world, but they would not give me the source code. |
|
|
|
|
|
#2 (permalink) |
|
...babe bloggin'...
Join Date: Mar 2005
Location: ...around...
Posts: 4,264
Points: 612
|
Very nice dude - bookmarked this and will have a bash over the weekend
![]() __________________
![]() Twisty's Babes|Watch 4 Beauty|Neon Dollars|Amour Angels Submit Your Blogs - Porn Planet | Fresh Porn |
|
|
|
|
|
#3 (permalink) |
|
I see you baby.. shakin that Ass!
|
coolness!
gotta love da Pay-Hache-Pay ![]() i'm going to sift through my little hacks and see if they are cool for tutorials, ya inspired me man! gracias __________________
- Reading can help your $$$ statusVanity Email Service - "Be different.. Express Your Vanity!" Daily Political News - "Coffee and Politics... Yum!" -
|
|
|
|
|
|
#5 (permalink) | |
|
WARNING! May ask stupid questions...
|
Quote:
I've just read through the tutorial again, and where I was looking at it, I realised that I should have used something else to represent the image (possibly 'p' for photo). The reason I used the 'f' was when I was building it, I was building a site in Spanish, and 'f' is the inital for fotografía where as it could be confused in English as folder... Sorry for the confusion. I have extended this script a bit, as to give the impression that you are updating your thumbnail page every day, where in fact you could only be doing it on a monthly basis... If anyone wants that posting up here, then let me know, and I'll sort it out. __________________
I would change the world, but they would not give me the source code. |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
![]() |
![]() |