About using Thumbshots

Core code customizations and Smarty markup and Template design help in regards to ADP.

Moderator: pgolovko

About using Thumbshots

Postby xprt007 » 03/06/2007 7:00 am

Hi,

Has anyone got any experience using Thumbshots from http://www.thumbshots.org/ ? Any good or bad experiences?

I have seen some directories using them and want to give it a try,. but have been held up by limited programming skills.

These are the instructions for using them:
Step 1. Insert Thumbshots code

Copy and paste the following code beside each link. This code will automatically generate thumbshots beside the link.

Code: Select all

<img src="http://open.thumbshots.org/image.pxf?url=[LINK]" border="0" onload="if (this.width>50) this.border=1; this.alt='Thumbnails by Thumbshots.org';">


Replace the [LINK] tag by the URL of the link. This link should be encoded to avoid mangling the querystring.

Step 2. Add the required thumbshots attribution

Please click here to add the thumbshots attribution as required by our licence. Failure to add the thumbshots attribution may result in losing your rights to use thumbshots permanently. We work so hard to help you. We only ask that you acknowledge our work by placing our small attribution.


That seems to presume one has only a couple of links.
How about dynamically produced links like those in the adp directory?

I suppose one has to somehow integrate that code on the body.html page.

The question is where does one do that?

Just in case this does not work, I may try www.snap.com preview solution, though I hope the code fits in without causing any conflicts. The only bad experience from another site I have with snap, is that at times, it holds up loading the page fast enough. A good number of times, it is the very last connection to load.

Thanks
xprt007
 
Posts: 92
Joined: 02/12/2007 4:39 am


Postby xprt007 » 03/06/2007 8:55 am

Hi,
Funny enough, I came up with a solution after playing around with code in body.html as I suspected, on that line... added that part immediately after the <li> tag.

Code: Select all
<td><font size=2><li><img src="http://open.thumbshots.org/image.pxf?url={$item.url}" border="0" onload="if (this.width>50) this.border=1; this.alt='Thumbnails by Thumbshots.org';">&nbsp;<a href="{$item.url}">{$item.title}</a> <a target="_blank" href="{$item.url}"><img border=0 src="/adp/images/nw2.gif"></a>{if $item.recip == "1"} <img src="images/recip.gif">{/if}<br />
xprt007
 
Posts: 92
Joined: 02/12/2007 4:39 am

Same code for search results

Postby editor » 01/21/2009 2:51 pm

Thanks xprt. Heres a mode to add thumbshots to Search Results:

file name: /admin/templates/search.html
change
Code: Select all
{foreach from=$results item=item key=key}
<font size=2><li><a href="{$item.url}">{$item.title}</a>  <a target="_blank" href="{$item.url}"><img border=0 src="/images/nw2.gif"></a>{if $item.recip == "1"} <img src="/images/recip.gif">{/if}<br>{$item.description}<br /><font size=1><font color=green>{$item.url}</font><br />Relevance: {$item.Relevance}, Date: {$item.date}, Google PR: {$item.gpr},{if $item.size} Size: {$item.size} bytes,{/if} Recip: {if $item.recip == "1"} Yes{else} No{/if}<p></font>
{/foreach}


to

Code: Select all
<div align="left">
  <table border="0">
    <tr>
      <td valign="top"><img src="http://open.thumbshots.org/image.pxf?url=<?php echo $this->_tpl_vars['item']['url']; ?>
" border="1" align="top" style="margin-right: 10px;"></td>
      <td valign="top"><font size=2><li><a href="<?php echo $this->_tpl_vars['item']['url']; ?>
"><?php echo $this->_tpl_vars['item']['title']; ?>
</a>  <a target="_blank" href="<?php echo $this->_tpl_vars['item']['url']; ?>
"><img border=0 src="/images/nw2.gif"></a><?php if ($this->_tpl_vars['item']['recip'] == '1'): ?> <img src="/images/recip.gif"><?php endif; ?><br><?php echo $this->_tpl_vars['item']['description']; ?>
<br /><font size=1><font color=green><?php echo $this->_tpl_vars['item']['url']; ?>
</font><br />Relevance: <?php echo $this->_tpl_vars['item']['Relevance']; ?>
, Date: <?php echo $this->_tpl_vars['item']['date']; ?>
, Google PR: <?php echo $this->_tpl_vars['item']['gpr']; ?>
,<?php if ($this->_tpl_vars['item']['size']): ?> Size: <?php echo $this->_tpl_vars['item']['size']; ?>
bytes,<?php endif; ?> Recip: <?php if ($this->_tpl_vars['item']['recip'] == '1'): ?> Yes<?php else: ?> No<?php endif; ?></font></td>
    </tr>
  </table>
</div>
<br>


Notice I had to put this in a table. Without the table IE looked fine - netscape browsers looked bad. In table both looked good

Cheers
editor
 
Posts: 3
Joined: 01/07/2009 10:19 am


Return to Customization & Templates

Who is online

Users browsing this forum: No registered users and 0 guests

cron