Just Puttzn' Around
Dynamic Images in Geocache Listing [Updated]
I’m not a builder. I don’t have the “handy” gene that most of the men in my family have. Instead, I have the nerd gene. The gene that makes me look at something online and wonder how it is done. How I would have done it differently or better. With that being said I realized I’m probably not going to be the person to build an awesome cache container, so I need to find a way to stand out doing what I do. Being a nerd. That has led me to hacking around with the cache listing page and different ideas for technology caches. I’ve found some interesting tricks lately including a way to change the image in your cache listing when the user clicks a certain link.
While this may not seem like much, it’s a neat little concept that doesn’t really take too much work at all. You’ll just need access to a server where you can write some code, PHP in my case, store some images, and a URL shortener like bit.ly.
The first thing you’ll need to do is create a directory on your web host where you will put your code and images. Once you have the directory created put all of the images you may need in there or a sub directory, or somewhere. I don’t really care where they are.
Step 1 – Create the PHP Controller
Next you’ll need to create your “controller” page that will contain all of the logic. In my case this was done using PHP. The backend code for controller looks something like this:
<br /> header('content-type: image/gif');<br /> header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate');<br /> header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past<br /> header('Pragma: no-cache');</p><p>if (strstr($_SERVER['REQUEST_URI'], "&test=2") != null || (strstr($_SERVER['HTTP_REFERER'], "&test=2") != null)) {<br /> $im = file_get_contents('./2.png');<br /> echo $im;<br /> } else if (strstr($_SERVER['REQUEST_URI'], "&test=3") != null || (strstr($_SERVER['HTTP_REFERER'], "&test=3") != null)) {<br /> $im = file_get_contents('./3.png');<br /> echo $im;<br /> } else if (($_SERVER['HTTP_REFERER'] == null) || ($_SERVER['HTTP_REFERER'] == "") || (strstr($_SERVER['HTTP_REFERER'], "&") == null )) {<br /> $im = file_get_contents('./1.png');<br /> echo $im;<br /> }</p><p>
What you should note of is that there are three distinct IF statements. Each one checks the URL, and URI, of the referrer. Depending on the parameters that are passed in it returns a different image. Pretty easy on the back end, eh?
Step 2 – Create the cache listing page
I’m not going to go into how to create a geocache listing page, hopefully you already know that. Instead I’m going to start at the step where you include your image.
Whenever you have your formatting complete and you are ready to add your image just do something like:
<br /> <img src="yourdomain.com/imageswitcher/controller.php" alt="" /><br />
Assuming your backend controller.php is similar to the one I posted above you should see whatever image you place in the final else of your conditions.
Step 3 – Test the Controller
The easiest way to test this is to append a new parameter at the end of the current URL. The URL of the cache listing probably looks something like the following:
http://www.geocaching.com/seek/cache_details.aspx?guid=2ff64e4e-3eb1-43d6-a896-aecad20fc339
Test your image switcher by putting the parameters on the end of that URL. In the case of our PHP example above we want to add the parameter “”test” and the value of either 2 or 3.
http://www.geocaching.com/seek/cache_details.aspx?guid=2ff64e4e-3eb1-43d6-a896-aecad20fc339&test=2
If everything worked you should see a different image on your cache listing page.
Step 4 – Make the page “functional”
The last step may be the most tedious, but it is sadly necessary. Since geocaching.com strips certain characters out of links, “&” being one of those characters, you’ll need to find a way around that limitation. That is where a good URL shortnener like bit.ly comes in handy.
Copy the URL you used above for testing, assuming they worked, and enter them into bit.ly and you’ll have links to the caching page with parameters on the querystring. At this point, feel free to customize the random URL bit.ly create for you. Maybe something like bit.ly/GCCODELINK1
Step 5 – Add links to listing page
The final step should be pretty apparent. Add the URL’s to your listing page. The traditional <A>nchor tags can be wrapped around text or an image. (Or an imagemap!!! – but that is my little secret for now. Shhhhh)
I’m not sure exactly how this would be useful, but it is kinf of neat.
Caveats
There is a lot of talk about how some browsers, websites, users dont send header information needed for this to work. Not everything will have the request parameters that are necessary, so use this cautiously, and be prepared for it to not work for some users.
Uses
Like I said above I’m not exactly sure how this can and will be used but one use has already been though of by FailedApparatus. He has included a link on the page for a *hint*. While it may be confusing to the user clicking the link will reload the page with a different / easier puzzle image that contains a hint.
[UPDATE 1/17/12]
FailedApparatus has implemented this in his “FA01 : Forest For the Trees” cache. If you click the hint link underneath the picture it will reload that page and swap out the image with an “easier” version of the puzzle.
Print article | This entry was posted by puttzy on January 10, 2012 at 7:41 pm, and is filed under Development, Personal, Web. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
- home depot chainsaw
- best snow blowers 2019
- try here
- sport italia canale
- Solar Generator for The home
- Ps4 Console In Stock
- Top Rated omelet pans
- Cheap voip phones
- Hard Skills For Business Office Manager
- Audio Technica Antenna Distribution System
- computer portatili
- abbigliamento sportivo freddy
- light up flying toys
- 2 cycle garden tiller
- mac laptop computers
- fat bike cargo hich carrier racks
- quick way to make an omelet in cupcake pans
- wireless video surveillance equipment
- walk behind gas leaf blowers
- marshmallow ingredients
- target baby dolls accessories
- who is Mkf collection
- artshesays.com noted
- mac ebook reader
- televisori nordmende 32 pollici
- best 3d printer controller
- do Blaupunkt car audio system suck?
- milwaukee 18 volt string trimmer
- dereal chainsaws
- portable light kit for video
- carpet cleaner vacuum
- earthquake auger carburetor
- baby monitor babies r us
- soft leather hobo bags
- coach crossbody bag sale
- cuccio sicilian nail whitening paste
- Small Bikini Trimmers
- pumps for small water fountains
- Woaitxt writes
- m&p sport 15 optics for shooting 100 yards
- used manual model:sb2135w studebaker cd-rw/cd-r boombox am/fm radio m radio
- under counter clock radios
- eninhome.com published a blog post
- hd Dvd Players interface
- mouse click the up coming post
- arranger workstation keyboard
- american bass hd 12 d2
- gingerbread plates tableware
- Topographic Maps Google Earth
- dry skin on newborn
- chip shop Curry sauce
- nest baby monitor
- whats in braunschweiger
- Generac Generators Lowes
- musica classica gravidanza
- riding lawn mowers at lowe’s
- Piante ikea vere
- rockstar energy drink side effects
- Solar in my dreams mamamoo album
- best leaf blowers cordless
- Click on Carpsclub Sakuraweb
- argos washing machines sale
- powersmart 22 inch snow blower
- king-knight generators
- ps4 console only for sale
- pantaloncini uomo moschino
- do aviation hand held gps units have raim
- mother care baby products
- click the up coming webpage
- camera photo logo
- modern mantel clock
- click through the up coming webpage
- discontinued rockstar flavors
- pc gaming mice costume
- america’s best reviews
- denon audio video receiver
- pandora fermi
- tv metz 32mtc6000
- visit miamiwomenmag.xyz here >>
- william best tools reviews
- men’s latin dance costumes
- s-video cables dithering blending
- best leather tote
- pineapple clothing for girls
- travel Size purell hand sanitizer
- dell computers laptop
- top rated lawn mowers
- types of wood drill bits
- stihl leaf blowers review
- Outdoor televisions
- Our Site
- womens urban clothing
- usb voip telephone
- abbigliamento sportivo bologna
- his response
- Biscuit Pancake mix
- Walk Behind Leaf Blowers
- masonry drill bits
- dragon touch 4k action camera
- best adult fitness trampolines
- hatsan vectis
- men’s costumes for halloween
- america’s test kitchen essential cookware
- Amazon Computer printers
- horror tv shows
- italian salad dressing recipe
- best plug and play video games
- powersmart 22 in. 2-stage electric start gas snow blower
- prodotti artego
- Davina Mccall Workout Video
- davina mccall full body workout
- leather tote brown
- macys Handbags
- husqvarna chainsaw 550xp
- Get More
- visit www.ziyousheji.com`s official website
- cheap luggage sets
- chanel mini top handle bag
- paper bag with handle
- ego string trimmer replacement head
- men’s sex toys
- Travel Tote bags
- betsey johnson clutch wallet
- tobacco Smoking pipes for sale
- helpful resources
- women’s sailing clothing
- betsey Johnson wallets
- tobacco pipes kits
- tobacco pipes starter kits
- benchtop metal milling machine
- generac 2700 psi pressure washer
- Used Benchtop Milling Machine For Sale Near Me
- outside caliper digital
- large leather tote bags
- leather handbags
- womens crossbody bags
- pump for generac pressure washer
- makita angle grinder accessories
- travel Tote for women
- stay puft marshmallows
- manhattan medium contrast-trim leather satchel
- 4 inch digital caliper
- how to make marshmallows
- dior women’s clothing
- building logs toys
- crossbody bags
- women’s leather tote bag
about 4 years ago
Hi there everybody, here every one is sharing such knowledge, so it’s good to read this
web site, and I used to pay a quick visit this
website daily.