PHP Based Test of Getting Website Thumbnails Dynamically
To learn the most from these 6 test pages, first test each of the test scripts below, and then read the Info on each of these tests.
- test1.php: getting website info dynamically
- test2.php: getting website thumbnails dynamically
- test3.php: getting website info and thumbnails dynamically using one link per URL
- test4.php: getting website info and thumbnails dynamically using separate links per URL
- test5.php: getting website info dynamically using Ajax
- test6.php: getting website info and thumbnails dynamically using separate links per URL and Ajax
- INFO on test1.php: getting website info dynamically
- INFO on test2.php: getting website thumbnails dynamically
- INFO on test3.php: getting website info and thumbnails dynamically using one link per URL
- INFO on test4.php: getting website info and thumbnails dynamically using separate links per URL
- INFO on test5.php: getting website info dynamically using Ajax
- INFO on test6.php: getting website info and thumbnails dynamically using separate links per URL and Ajax
Note the websnapr.js JavaScript script and websnapr.css CSS stying files loaded in before the action starts. These are Websnapr's files to support their pop-up thumbnail scripts. Note also the attribution giving credit where credit is due—THEY created the automatic pop-up thumbnails scripts, not us. Their approach is to have people who sign up with them (free, but there are paid versions too) get to use their thumbnail creation, storage, and pop-up protocols. Our approach might have been to develop algorithms simulating the PrintScreen key and image reduction and trimming needed to pull off this stuff on the fly, except there's the teeny issue that we are CSS, HTML, JavaScript, Ajax, DHTML and PHP programmers, not C programmers, and C or a minimum of Visual Basic is required for the job. The languages we know just won't do it. So we went with THEIR approach. If there are any free services that will do the job of simulating the PrintScreen key and image reduction and trimming on the fly and without storing thumbnail images, we didn't find them. The Websnapr people (once you sign up) queue the websites when you first click a link with the class "websnapr" in your web pages. It takes a while—they're running the web pages through their thumbnail creation process. Then the next time you click on them, the thumbnails come up pretty quickly. Thumbnail storage may just be the only viable way to get a quick response, judging from the time it takes to resample a page and trim it to size in ImageForge or Irfanview.
Note that the code below is simple: load in the 2 external files from Websnapr and include the class "websnappr" in your links. And that's all she wrote. This test shows the viability of the Websnapr system to give thumbnail pop-ups.
Note that the final HTML code below is the displaying of the links themselves. This test page worked to prove that getting website thumbnails dynamically—on the fly—is viable. If this was a regular website directory, it would of course be using MySQL databases and other elements of the CMS configuration protocol, not a few sample links. It would of course be faster to store your own thumbnails rather than relying on a service. But free is free!
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="imagetoolbar" content="no">
<style type="text/css" media="screen">
BODY {margin-left:0; margin-right:0; margin-top:0;text-align:left}
p, li {font:13px Verdana; color:black;text-align:left;margin-top:0.2em;margin-bottom:0}
h1 {font:bold 28px Verdana; color:black;text-align:center}
h2 {font:bold 24px Verdana;text-align:center}
.d {position:absolute; left:700px; width:300px; margin:0; padding:10px; background-color:#ddd; border:1px solid #000; font: 11px Verdana;}
.e {position:absolute; left:700px; width:300px; margin:0; padding:10px; background-color:transparent; border:none; font: 11px Verdana;}
.f {position:absolute; left:330px; width:350px; top:70px; padding:10px; background-color:#eee; border:1px solid black; font: 13px Verdana;}
.b {font:bold 13px Verdana;}
</style>
<style type="text/css" media="screen">@import "websnapr.css";</style>
<script type="text/javascript" src="websnapr.js"></script>
</style>
</head>
<body>
<!--
link-preview v1.4 by frequency-decoder.com is used in this page
Released under a creative commons Attribution-ShareAlike 2.5 license (http://creativecommons.org/licenses/by-sa/2.5/)
Please credit frequency-decoder in any derivative work - like this page is.
You are free:
* to copy, distribute, display, and perform the work
* to make derivative works
* to make commercial use of the work
Under the following conditions:
by Attribution.
--------------
You must attribute the work in the manner specified by the author or licensor.
sa
--
Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one.
* For any reuse or distribution, you must make clear to others the license terms of this work.
* Any of these conditions can be waived if you get permission from the copyright holder.
References:
Wesnapr: http://www.websnapr.com
Dustan Diaz: http://www.dustindiaz.com/sweet-titles-finalized
Arc90: http://lab.arc90.com/2006/07/link_thumbnail.php
-->
</div>
<div class='f'>
<a HREF="http://www.theliquidateher.com/" target="_blank" class="websnapr">http://www.theliquidateher.com</a>
<BR><BR><a HREF="http://www.css-resources.com/" target="_blank" class="websnapr">http://www.css-resources.com</a>
<BR><BR><a HREF="http://www.mcsii.biz/" target="_blank" class="websnapr">http://www.mcsii.biz</a>
<BR><BR><a HREF="http://www.aglasshalffull.org/" target="_blank" class="websnapr">http://www.aglasshalffull.org</a>
<BR><BR><a HREF="http://www.bicycleclothing.com/" target="_blank" class="websnapr">http://www.bicycleclothing.com</a>
<BR><BR><a HREF="http://fireprotection.name/" target="_blank" class="websnapr">http://fireprotection.name</a>
<BR><BR><a HREF="http://www.criegergoodwin.com/" target="_blank" class="websnapr">http://www.criegergoodwin.com</a>
<BR><BR><a HREF="http://4homedesign.wordpress.com/" target="_blank" class="websnapr">http://4homedesign.wordpress.com</a>
<BR><BR><a HREF="http://www.aglasshalffull.org/webhatchers/webhatchers.html" target="_blank" class="websnapr">http://www.aglasshalffull.org/webhatchers/webhatchers.html</a>
<BR><BR><a HREF="http://theliquidateher.com/squirrel-valley/squirrel-valley-railroad-demo.htm" target="_blank" class="websnapr">http://theliquidateher.com/squirrel-valley/squirrel-valley-railroad-demo.htm</a>
</div>
</body>
</html>