View Full Version : Display ALexa Thumbshot for Featured only
bobby9101
05-18-2006, 09:56 PM
I wrote this for 2.0 but it should work in 3+ with a little modding
PUT:
Content visible to registered users only. in your link.tpl BEFORE
Content visible to registered users only.
bobby9101
05-20-2006, 06:27 PM
I editted the code so it should work now :)
lebefa
05-20-2006, 11:29 PM
I tried the code on my version 3.O.5, using the pagerank mod.
But I can't see any thumbshots in featured links.
I am maybe missing something ?
here is my link.tpl code :
{strip}
<table width="100%" align="center" cellpadding="0" cellspacing="0" class="linkarea">
<tbody>
<tr valign="top">
{* show page rank *}
{if $smarty.const.SHOW_PAGERANK}
<td width="40">{include file="pagerank.tpl" pr=$link.PAGERANK}</td>
{/if}
<td>
<span align="left" class="linktitle"> {if $link.TYPE eq 4}<td>
<a href="{$link.URL}" id="{$link.ID}" rel="nofollow"><img src="http://pthumbnails.alexa.com/image_server.cgi?id=mysiteurl&size=small&url={$lin k.URL}" width="111" height="87"></a>
</td>{/if}<a id="id_{$link.ID}" href="{$link.URL|escape}" title="{$link.TITLE|escape}"
{* nofollow *}
{if $link.NOFOLLOW or ($link.RECPR_VALID eq 0 and ($smarty.const.RECPR_NOFOLLOW eq 2 or ($smarty.const.RECPR_NOFOLLOW eq 1 and $link.RECPR_REQUIRED eq 1)))} rel="nofollow"{/if}
{if $smarty.const.ENABLE_BLANK} target="_blank"{/if}>
{$link.TITLE|escape}</a></span><br />
<span class="linkshortdesc">{$link.DESCRIPTION|escape}</span>
<br />
<span class="linkurl">{$link.URL|escape} [ <a href="{if !$smarty.const.ENABLE_REWRITE}{$smarty.const.DOC_R OOT}/detail.php?id={$link.ID}
{else}
{$smarty.const.DOC_ROOT}/detail/link-{$link.ID}.html{/if}" title="{l}Read more about{/l}: {$link.TITLE|escape}">{l}Detail{/l}</a>
{if $smarty.const.REQUIRE_REGISTERED_USER == 1 and !empty($regular_user_details) and ($regular_user_details.ID == $link.OWNER_ID)}, <a href="{$smarty.const.DOC_ROOT}/submit.php?linkid={$link.ID}" title="{l}Edit or Remove your link{/l}">{l}Review{/l}</a>
{/if} ]</span>
</td>
</tr>
</tbody>
</table>
{/strip}
Neticus
05-21-2006, 01:38 AM
@Lebefa
Try this
Where you currently have the following code in link.tpl wrap the following in bold around it:
Content visible to registered users only.
Also I advise you copy and paste the whole code above (alexa code included) for some reason I tried the code you've used above and didn't recieve any images in thumbshots. Dunno maybe its just me.
Oh and the code above is supposed to entirely replace the code in the first post.
that worked for me Neticus
lebefa
05-21-2006, 06:20 PM
ok, I gonna try and tell you if it works. Thanks for your time!
lebefa
05-21-2006, 06:41 PM
still don't have any images. Here is my code now ? am I right ?
Or maybe it's because I am working on a subdomain ?
Thanks
{strip}
<table width="100%" align="center" cellpadding="0" cellspacing="0" class="linkarea">
<tbody>
<tr valign="top">
{* show page rank *}
{if $smarty.const.SHOW_PAGERANK}
<td width="40">{include file="pagerank.tpl" pr=$link.PAGERANK}</td>
{/if}
<td>
<span align="left" class="linktitle"> {if $link.FEATURED}<td> <a href="{$link.URL}" id="{$link.ID}" rel="nofollow" "{if $smarty.const.ENABLE_BLANK}" target="_BLANK"{/if}><img border="0" width="80" height="85" src="http://pthumbnails.alexa.com/image_server.cgi?site=mysite.com&size=small&url={$link.URL}" alt="{$link.TITLE}"></a></td> {/if}<a id="id_{$link.ID}" href="{$link.URL|escape}" title="{$link.TITLE|escape}"
{* nofollow *}
{if $link.NOFOLLOW or ($link.RECPR_VALID eq 0 and ($smarty.const.RECPR_NOFOLLOW eq 2 or ($smarty.const.RECPR_NOFOLLOW eq 1 and $link.RECPR_REQUIRED eq 1)))} rel="nofollow"{/if}
{if $smarty.const.ENABLE_BLANK} target="_blank"{/if}>
{$link.TITLE|escape}</a></span><br />
<span class="linkshortdesc">{$link.DESCRIPTION|escape}</span>
<br />
<span class="linkurl">{$link.URL|escape} [ <a href="{if !$smarty.const.ENABLE_REWRITE}{$smarty.const.DOC_R OOT}/detail.php?id={$link.ID}
{else}
{$smarty.const.DOC_ROOT}/detail/link-{$link.ID}.html{/if}" title="{l}Read more about{/l}: {$link.TITLE|escape}">{l}Detail{/l}</a>
{if $smarty.const.REQUIRE_REGISTERED_USER == 1 and !empty($regular_user_details) and ($regular_user_details.ID == $link.OWNER_ID)}, <a href="{$smarty.const.DOC_ROOT}/submit.php?linkid={$link.ID}" title="{l}Edit or Remove your link{/l}">{l}Review{/l}</a>
{/if} ]</span>
</td>
</tr>
</tbody>
</table>
{/strip}
Neticus
05-21-2006, 07:08 PM
I'm not sure why you're not getting any images, I've just tried it on a 3.05 and seem to show up fine. I don't think it should matter whether your directory is in a subdomain or not as I've just tested it on 3.05 in a subdomain. So the images don't show up at all? Or you get an error message?
lebefa
05-21-2006, 07:21 PM
OK I found out. Thanks.
the reason was that I was working on the sprinbreak template which uses the file featured.link.tpl
So I just pasted the code there and it works fine.
lebefa
05-21-2006, 08:43 PM
by the way, do you know if there is a way to display another image than the standard alexa one ("Picture coming soon") when the thumbshot is not available yet?
Thanks for your help.
deepimpact71
05-21-2006, 09:07 PM
Hi
Finally this worked for me:
{if $link.FEATURED}<td>
<a href="{$link.URL}" id="{$link.ID}" rel="nofollow" "{if $smarty.const.ENABLE_BLANK}" target="_BLANK"{/if}><img border="0" width="80" height="85" src="http://pthumbnails.alexa.com/image_server.cgi?site=[yoursite.com]&size=small&url={$link.URL}" alt="{$link.TITLE}"></a></td>
{/if}
I made sure that I changed [yoursite.com] in my code :-)
BTW for those who don't know, I took the abovecode from where the original mod is posted.
Thank you all for your time! It makes it so much more fun that you guys are willing to help one out with PHP Link Directory stuff.
Deepimpact
Neticus
05-21-2006, 10:05 PM
@lebefa
I haven't seen a post or mod on this yet but i'm sure someone competent enough in coding could do this.:)
@deepimpact
Glad it worked out for ya ;)
ewwharhar
05-24-2006, 02:23 AM
Works perfectly :D
Thanks
Domie
05-27-2006, 05:20 AM
So where does
Content visible to registered users only.
Go?
[/B]
bobby9101
05-27-2006, 05:26 AM
post your link.tpl and i'll show ya ;)
Domie
05-27-2006, 05:31 AM
/index.php?c=22
I still get that PR: 0
And if you look at the other regular links, there is still a box next to it. Hopw can i fix this?
bobby9101
05-27-2006, 05:37 AM
could you please PM/Post your link.tpl file
Domie
05-27-2006, 05:38 AM
Content visible to registered users only.
bobby9101
05-27-2006, 05:43 AM
do you not want the PR: 0 to show?
Domie
05-27-2006, 05:46 AM
Yes i dont want the PR: 0 and the N/A Boxes for NON-feature links.
bobby9101
05-27-2006, 05:49 AM
try this: Content visible to registered users only.
Domie
05-27-2006, 05:57 AM
Works, thank you so much bob. :)
Isabel
06-01-2006, 11:18 AM
Hello.
I have version 2 and peppermint template with this code.
The pagerank not work. Show N/A
Thank you.
Isabel.
<div class="pr">
<a href="{$link.URL}" id="{$link.ID}" rel="nofollow">
<a href="{$link.URL}" id="{$link.ID}" rel="nofollow" "{if $smarty.const.ENABLE_BLANK}" target="_BLANK"{/if}><img border="0" width="90" height="80" src="http://pthumbnails.alexa.com/image_server.cgi?site=[www.directorio-de-alimentacion.com]&size=small&url={$link.URL} " alt="{$link.TITLE}"></a>
{if $pr gt -1}
PR: {$pr}
{else}
N/A
{/if}
<div class="prg">
<div class="prb" style="width: {if $pr gt -1}{math equation="x*4" x=$pr}{else}0{/if}px"></div>
</div>
</div>
bobby9101
06-01-2006, 08:01 PM
was it showing before this mod?
if not then PM david about the pagerank update tool
jaffa
06-03-2006, 02:51 PM
Content visible to registered users only.
Thank you Neticus that one worked for me on version 3.05 using template RealBlue
Steven Myers
06-06-2006, 03:45 AM
Here's a *Bump* for this. I need to know if there is a way to get it to NOT show the thumbnails in the Top Sites and Latest Links pages?
bobby9101
06-06-2006, 01:31 PM
{if not $qu and not $list}
your code
{/if}
should do the trick for 3+
Steven Myers
06-06-2006, 01:33 PM
YES!, thank you bobby, that worked like a charm :D
bobby9101
06-06-2006, 01:35 PM
anytime man
i am starting to learn 3+ and dont even have it ;)
Neticus
06-06-2006, 01:56 PM
Just for reference.
To show for featured link only, however not on the latest and top hits pages, this seems to work:
{if $link.FEATURED and not $list}
code
{/if}
v3.05
laters.
Steven Myers
06-06-2006, 04:38 PM
This did help as well Neticus, because a few links that were displayed in the main categories, were being displayed with the thumbnail.
Thanks :)
arindra
06-20-2006, 11:42 AM
i have managed to make a modification that will make the thumbs show only for Featured link on a category and NOT on top hits or latest link .
To this , i copied the link.tpl and made another file called flink.tpl . In this file i inserted the code as mentioned here (http://www.phplinkdirectory.com/forum/showpost.php?p=22840&postcount=69) and went back to my main.tpl and scrolled down to where it says Content visible to registered users only. and just beklow that made a small change to call my " flink.tpl " instead of " link.tpl " like this
Content visible to registered users only.
maybe some of the more learned ppl can say if this is ok or not :)
bobby9101
06-20-2006, 03:07 PM
arindra that is a good job i think most of us have done that and it is safe and effective
arindra
06-20-2006, 03:32 PM
thx for the confirmation :)
have also found a way to get the top links also show thumbnails optionally :D
shutzu
06-21-2006, 03:44 AM
how can i place the alexa thumbs for ISEDN links? any idea? those are displayed as featured on my site
Artbrio
08-11-2006, 01:02 AM
Which file do you add the code in?
Steven Myers
08-11-2006, 01:36 AM
@Michael Wong: in your link.tpl file located in your templates/YourTemplate
It didn't work for me. I tested all the examples but the thumbnail never shown.
I'm using another code for the thumbnails, not the Alexa ones and it works perfect now :) . I have only replaced the URL:
Content visible to registered users only.
gmschmitz
01-16-2007, 06:35 PM
Riks,
Thanks I couldn't get the Alexa thumb nails to show for some reason. This MSN url works just fine. you can see them here California Real Estate (www.us-realestatedirectory.com/California/)
Content visible to registered users only.
Nice it worked for you
:)
objectcreator
01-20-2007, 02:59 PM
It didn't work for me either. Perhaps the alexa-code doesn't function any more. The msn-code worked at once.
eddie43302
01-20-2007, 06:14 PM
I think alexa has stopped people from being able to display thumbnails using there code.
I wonder why the rel="nofollow" ?
If these are featured links....
I have deleted by now.
gmschmitz
01-22-2007, 04:07 AM
The no follow is just for the thumbnail image, there is no "rel= no follow" on the link itself.
proprod
01-22-2007, 04:13 AM
Content visible to registered users only.
Alexa went to a pay per impression system... no longer free. You can still get them, you just need to sign up and pay for them now. The price is actually not too bad if you prefer the Alexa images over the Girafa ones.
amatas
02-06-2007, 02:46 AM
I am using the following script from flink.php however causes everything to go astray. What confines the table width of the featured link text?
{strip}
<table width="100%" cellpadding="10" cellspacing="0" class="featured">
<tr>
<td width="100%" align="left" valign="top">
<table width="100%" cellpadding="0" cellspacing="0"><tr>
{* show page rank *}
{if $smarty.const.SHOW_PAGERANK}
<td style="padding-right:10px; width:120px;">
{include file="pagerank.tpl" pr=$link.PAGERANK}
</td>
{/if}
{if $link.FEATURED}<td>
<a href="{$link.URL}" id="{$link.ID}" rel="nofollow" "{if $smarty.const.ENABLE_BLANK}" target="_BLANK"{/if}><img
border="0" width="80" height="85" src="htxp://msnsearch.srv.girafa.com/srv/i?s=MSNSEARCH&r={$link.URL}"
alt="{$link.TITLE}"></a></td>
{/if}
<td>
<a id="id_{$link.ID}" href="{$link.URL|escape|trim}" title="{$link.TITLE|escape|trim}"
{* nofollow *}
{if $link.NOFOLLOW or ($link.RECPR_VALID eq 0 and ($smarty.const.RECPR_NOFOLLOW eq 2 or ($smarty.const.RECPR_NOFOLLOW
eq 1 and $link.RECPR_REQUIRED eq 1)))} rel="nofollow"{/if}
{if $smarty.const.ENABLE_BLANK} target="_blank"{/if}>
<strong>{$link.TITLE|escape|trim}</strong></a>
{if !empty ($search) or !empty ($uid)}
<p>{l}Category{/l}: <a href="{$smarty.const.DOC_ROOT}/{$link.CATEGORY_URL|escape|trim}"
title="{$link.CATEGORY_TITLE|escape|trim}"><strong>{$link.CATEGORY_TITLE|escape|trim}</strong></a></p>
{/if}
<p>
{$link.DESCRIPTION|escape|trim} - <a href="{if !$smarty.const.ENABLE_REWRITE}
{$smarty.const.DOC_ROOT}/detail.php?id={$link.ID}
{else}
{$smarty.const.DOC_ROOT}/detail/link-{$link.ID}.html{/if}" title="{l}Read
more about{/l}: {$link.TITLE|escape|trim}">Read more</a>
</p>
<div style="margin:0px;">
<table cellpadding="0" cellspacing="0" align="left">
<tr>
<td><span class="url">{$link.URL|escape|trim}</span></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
{/strip}
Robert Allen
02-06-2007, 09:23 PM
In case alexa doesn't work, try this;
Content visible to registered users only.
Rob
gmschmitz
02-07-2007, 12:52 AM
The MSN option on page 2 of this thread works as well, you can see it used at the 1st link in my signature.
MissDanni
02-21-2007, 01:20 PM
Arindra,
I followed your example but I'm scratching my head - I have featured links with thumbs in FF but no thumbs in IE :confused:
flink.tpl
Content visible to registered users only.
main.tpl (Snippet):
Content visible to registered users only.
Uploaded flink.tpl to my current templates folder.
Example Link: http://www.phobi.net/computers_and_internet/
I know I must be forgetting something, could someone with fresh eyes take a peek here for me and let me know if you can see what I've missed?
Thanks Lots :)
Content visible to registered users only.
MissDanni
02-21-2007, 11:51 PM
I managed to fix up the code a little bit and now I have thumbs for featured links in both FF & IE YAY!
Just in case anyone else is having the same trouble I was, maybe the below will fix it for you.
FIRST: You should always make a back up of a file before you mess with it just in case. Accidents can happen and sometime they are not very pretty. So please be sure you keep a backup or copy of the original file before editing or adding to the code.
Copy and Paste the following into note pad and save as flink.tpl
Content visible to registered users only.Upload to your phpld root/templates/your current templates folder
Example: public_html/templates/default
In the Admin/System/Template Manager click on the button that says "Edit current templates files".
Edit the file named main.tpl
About half way down find this:
Content visible to registered users only.Change to this:
Content visible to registered users only.Save and thats it, you're all done :)
The above should give you nice thumbnails for featured listings only.
websub
03-01-2007, 01:14 PM
Thanks Miss Danny,
That is a great way of doing and explaining it.
If you still want the Read More link next to your featured listing, remember to add
Content visible to registered users only.
immediately after Content visible to registered users only.
in the flink.tpl file
Anni
jminscoe
03-02-2007, 07:55 PM
where would I put this code
Content visible to registered users only.
{strip}
<table width="100%" align="center" cellpadding="0" cellspacing="0" class="linkarea">
<tbody>
<tr valign="top">
{* show page rank *}
{if $smarty.const.SHOW_PAGERANK}
<td width="40">{include file="pagerank.tpl" pr=$link.PAGERANK}</td>
{/if}
<td>
{if $link.FEATURED}<td>
<a href="{$link.URL}" id="{$link.ID}" rel="nofollow" "{if $smarty.const.ENABLE_BLANK}" target="_BLANK"{/if}><img border="0" width="80" height="85" src="http://msnsearch.srv.girafa.com/srv/i?s=MSNSEARCH&r={$link.URL}
alt="{$link.TITLE}"></a></td>
{/if}
<td>
<a id="id_{$link.ID}" href="{$link.URL|escape|trim}" title="{$link.TITLE|escape|trim}"
{* nofollow *}
{if $link.NOFOLLOW or ($link.RECPR_VALID eq 0 and ($smarty.const.RECPR_NOFOLLOW eq 2 or ($smarty.const.RECPR_NOFOLLOW eq 1 and $link.RECPR_REQUIRED eq 1)))} rel="nofollow"{/if}
{if $smarty.const.ENABLE_BLANK} target="_blank"{/if}>
{$link.TITLE|escape|trim}</a> <span class="url">- {$link.URL|escape|trim}</span>
{if !empty ($search) or !empty ($uid)}
<p>{l}Category{/l}: <a href="{$smarty.const.DOC_ROOT}/{$link.CATEGORY_URL|escape|trim}" title="{$link.CATEGORY_TITLE|escape|trim}">{$link.CATEGORY_TITLE|escape|trim}</a></p>
{/if}
<p>
{$link.DESCRIPTION|escape|trim} - [<a href="{if !$smarty.const.ENABLE_REWRITE}
{$smarty.const.DOC_ROOT}/detail.php?id={$link.ID}
{else}
{$smarty.const.DOC_ROOT}/detail/link-{$link.ID}.html{/if}" title="{l}Read more about{/l}: {$link.TITLE|escape|trim}">{l}Read more{/l}</a>
{if $smarty.const.REQUIRE_REGISTERED_USER == 1 and !empty ($regular_user_details) and ($regular_user_details.ID == $link.OWNER_ID)}
, <a href="{$smarty.const.DOC_ROOT}/submit.php?linkid={$link.ID}" title="{l}Edit or Remove your link{/l}">{l}Review{/l}</a>
{/if}
]
</p>
</td>
</tr>
</table>
{/strip}
markn26
03-16-2007, 05:12 PM
this thread really got confusing :(
is there a modern and up-to-date (not 2006) thread explaining how to do this, exactly, and step by step?
ewhitaker
04-09-2007, 09:45 PM
I tried to insert the code and had problems with it, so I restored the original link.tpl file and re-uploaded it. Now anytime I go to any category I am getting the following error:
Fatal error: Smarty error: [in link.tpl line 13]: syntax error: unbalanced parenthesis in if statement (Smarty_Compiler.class.php, line 1268) in /home/virtual/site29/fst/var/www/html/directory/libs/smarty/Smarty.class.php on line 1095
I understand its telling me there is a syntax error, but I restored the original to be on the safe side. What to do now?:confused:
bilzone
04-11-2007, 05:39 PM
Great mod...It work fine...Thx for this !
ewhitaker
04-11-2007, 06:53 PM
Content visible to registered users only.
Ignore - working now.
vBulletin® v3.8.0, Copyright ©2000-2012, Jelsoft Enterprises Ltd.