Go Back   PHP Link Directory Forum > PHP Link Directory (phpLD) > Mods and contribution Discussion

Mods and contribution Discussion This forum is only for discussion of modding phpLD. For specific mod releases, please see the appropriate forum.

Closed Thread
 
Thread Tools Display Modes
Old 09-25-2005   #1
VSDan
Supporter
Moderator
 
VSDan's Avatar
 
Join Date: Sep 2005
Location: Vancouver, BC, Canada
Posts: 1,180
Default [Image-Based Rating System] Mod

Not sure if this has been done, but this quick mod will allow you display rating images. For example, 10 stars if rated 10 and 1 star if rated 1.

Code:
{if $link.RATE eq '10.00'}<img src="/images/20.gif" border="0">
{elseif $link.RATE eq '0.00'}<img src="/images/0.gif" border="0">
{elseif $link.RATE eq ''}<img src="/images/0.gif" border="0">
{elseif $link.RATE le '0.50'}<img src="/images/1.gif" border="0">
{elseif $link.RATE le '1.00'}<img src="/images/2.gif" border="0">
{elseif $link.RATE le '1.50'}<img src="/images/3.gif" border="0">
{elseif $link.RATE le '2.00'}<img src="/images/4.gif" border="0">
{elseif $link.RATE le '2.50'}<img src="/images/5.gif" border="0">
{elseif $link.RATE le '3.00'}<img src="/images/6.gif" border="0">
{elseif $link.RATE le '3.50'}<img src="/images/7.gif" border="0">
{elseif $link.RATE le '4.00'}<img src="/images/8.gif" border="0">
{elseif $link.RATE le '4.50'}<img src="/images/9.gif" border="0">
{elseif $link.RATE le '5.00'}<img src="/images/10.gif" border="0">
{elseif $link.RATE le '5.50'}<img src="/images/11.gif" border="0">
{elseif $link.RATE le '6.00'}<img src="/images/12.gif" border="0">
{elseif $link.RATE le '6.50'}<img src="/images/13.gif" border="0">
{elseif $link.RATE le '7.00'}<img src="/images/14.gif" border="0">
{elseif $link.RATE le '7.50'}<img src="/images/15.gif" border="0">
{elseif $link.RATE le '8.00'}<img src="/images/16.gif" border="0">
{elseif $link.RATE le '8.50'}<img src="/images/17.gif" border="0">
{elseif $link.RATE le '9.00'}<img src="/images/18.gif" border="0">
{elseif $link.RATE le '9.50'}<img src="/images/19.gif" border="0">
{else}<img src="/images/20.gif" border="0">
{/if}
Note: change URL to images if the location differs on your server.

Sample images attached as stars.zip
(feel free to download for your use - you can easily change the colours using an application like PainShop or PhotoShop, to name a few)


Cheers.

Dan
Virtual Solutions
monster-submit.com
Attached Files
File Type: zip stars.zip (12.0 KB, 175 views)

Last edited by VSDan; 10-09-2006 at 07:51 PM.
VSDan is offline  
Old 09-26-2005   #2
yktan
 
Join Date: Jun 2005
Posts: 353
Default

Thank for sharing VSDan!
__________________
Greatest fear in a coder\'s world: A minute bug with correct syntax.
{link removed from sig as the account seemed to be suspended}
yktan is offline  
Old 10-12-2005   #3
angeljs
Supporter
 
Join Date: Oct 2005
Posts: 42
Default

Thank you for this, and for all the images!
angeljs is offline  
Old 10-20-2005   #4
Serge
 
Join Date: Oct 2005
Location: Moscow, Russia
Posts: 4
Send a message via ICQ to Serge
Default Re: Rating Images

Quote:
Originally Posted by VSDan
Not sure if this has been done, but this quick mod will allow you display rating images. For example, 10 stars if rated 10 and 1 star if rated 1.
I hope my code will work fine too

Code:
<img src={$link.RATE*2}.gif alt="Rated as {$link.RATE}" border=0>
Serge is offline  
Old 10-20-2005   #5
VSDan
Supporter
Moderator
 
VSDan's Avatar
 
Join Date: Sep 2005
Location: Vancouver, BC, Canada
Posts: 1,180
Default Re: Rating Images

Quote:
Originally Posted by Serge
Quote:
Originally Posted by VSDan
Not sure if this has been done, but this quick mod will allow you display rating images. For example, 10 stars if rated 10 and 1 star if rated 1.
I hope my code will work fine too

Code:
<img src={$link.RATE*2}.gif alt="Rated as {$link.RATE}" border=0>
Would not work in cases where rating was not a whole number or decimal as .5 - for example, 5.4 would equal 10.8. You need to round off to nearest whole number (round($link.RATE * 2)), which I believe requires {php}{/php} - something I was trying to avoid at the time.
__________________
Dan

Unlock the Vault Contest :: Over $350 Prizes!
phpLD Mods :: phpLD_Vault
Webmaster Resources Directory
phpLD_Vault Support

IMPORTANT NOTE:
phpLD_Vault Support not handled in this forum AND not via PM here. Click on link above for support. NO exceptions!
VSDan is offline  
Old 01-07-2006   #6
LinkReal
 
Join Date: Jan 2006
Location: NYC
Posts: 7
Default

VSDan- nice work
Sorry for being a newbie @ this but where would one put your code for it to work.

Thanks in advance.
LinkReal is offline  
Old 01-07-2006   #7
VSDan
Supporter
Moderator
 
VSDan's Avatar
 
Join Date: Sep 2005
Location: Vancouver, BC, Canada
Posts: 1,180
Default

Sorry about that, in the link.tpl template file =)
__________________
Dan

Unlock the Vault Contest :: Over $350 Prizes!
phpLD Mods :: phpLD_Vault
Webmaster Resources Directory
phpLD_Vault Support

IMPORTANT NOTE:
phpLD_Vault Support not handled in this forum AND not via PM here. Click on link above for support. NO exceptions!
VSDan is offline  
Old 01-08-2006   #8
LinkReal
 
Join Date: Jan 2006
Location: NYC
Posts: 7
Default

Quote:
Originally Posted by VSDan
Sorry about that, in the link.tpl template file =)
Just drop the code anywhere?

thanks in advance.
LinkReal is offline  
Old 01-08-2006   #9
VSDan
Supporter
Moderator
 
VSDan's Avatar
 
Join Date: Sep 2005
Location: Vancouver, BC, Canada
Posts: 1,180
Default

Pretty much, anywhere you want the images to display. Play around with it until you get it right.
__________________
Dan

Unlock the Vault Contest :: Over $350 Prizes!
phpLD Mods :: phpLD_Vault
Webmaster Resources Directory
phpLD_Vault Support

IMPORTANT NOTE:
phpLD_Vault Support not handled in this forum AND not via PM here. Click on link above for support. NO exceptions!
VSDan is offline  
Old 01-09-2006   #10
LinkReal
 
Join Date: Jan 2006
Location: NYC
Posts: 7
Default

thanks much...
guess i wont know if it works until i fully launch the site and start to get some traffic.

Thanks for all the help and nice mods VSDan
LinkReal is offline  
Old 01-09-2006   #11
VSDan
Supporter
Moderator
 
VSDan's Avatar
 
Join Date: Sep 2005
Location: Vancouver, BC, Canada
Posts: 1,180
Default

Thanks, and you're welcome =)
__________________
Dan

Unlock the Vault Contest :: Over $350 Prizes!
phpLD Mods :: phpLD_Vault
Webmaster Resources Directory
phpLD_Vault Support

IMPORTANT NOTE:
phpLD_Vault Support not handled in this forum AND not via PM here. Click on link above for support. NO exceptions!
VSDan is offline  
Old 01-11-2006   #12
gustotelmy
Supporter
 
Join Date: Nov 2005
Posts: 182
Default You are the best!

You are the best! thanks buddy for sharing,
all the best to you for the new year.
gustotelmy is offline  
Old 01-11-2006   #13
VSDan
Supporter
Moderator
 
VSDan's Avatar
 
Join Date: Sep 2005
Location: Vancouver, BC, Canada
Posts: 1,180
Default Re: You are the best!

Thanks, and the same back at ya!
__________________
Dan

Unlock the Vault Contest :: Over $350 Prizes!
phpLD Mods :: phpLD_Vault
Webmaster Resources Directory
phpLD_Vault Support

IMPORTANT NOTE:
phpLD_Vault Support not handled in this forum AND not via PM here. Click on link above for support. NO exceptions!
VSDan is offline  
Old 01-11-2006   #14
John D
 
Join Date: Nov 2005
Posts: 156
Default

Is this for if the rating mod is installed?
John D is offline  
Old 01-11-2006   #15
VSDan
Supporter
Moderator
 
VSDan's Avatar
 
Join Date: Sep 2005
Location: Vancouver, BC, Canada
Posts: 1,180
Default

Yes, you need to have the Rating mod installed.
__________________
Dan

Unlock the Vault Contest :: Over $350 Prizes!
phpLD Mods :: phpLD_Vault
Webmaster Resources Directory
phpLD_Vault Support

IMPORTANT NOTE:
phpLD_Vault Support not handled in this forum AND not via PM here. Click on link above for support. NO exceptions!
VSDan is offline  
Old 01-13-2006   #16
swapshop
 
Join Date: Jan 2006
Posts: 29
Default Rating Mod

Where is the rating mod?
__________________
Please check your signature link
swapshop is offline  
Old 01-13-2006   #17
VSDan
Supporter
Moderator
 
VSDan's Avatar
 
Join Date: Sep 2005
Location: Vancouver, BC, Canada
Posts: 1,180
Default

Here you go:

http://www.phplinkdirectory.com/foru...opic.php?t=194
__________________
Dan

Unlock the Vault Contest :: Over $350 Prizes!
phpLD Mods :: phpLD_Vault
Webmaster Resources Directory
phpLD_Vault Support

IMPORTANT NOTE:
phpLD_Vault Support not handled in this forum AND not via PM here. Click on link above for support. NO exceptions!
VSDan is offline  
Old 06-02-2006   #18
leefs
Supporter
 
leefs's Avatar
 
Join Date: Mar 2006
Posts: 15
Default

Link is broken. Where can I find the rate mod?
leefs is offline  
Old 06-14-2006   #19
Domie
 
Join Date: May 2006
Posts: 163
Send a message via MSN to Domie
Default

How do you install this mod?
Domie is offline  
Old 06-23-2006   #20
vignesh_natraj
 
vignesh_natraj's Avatar
 
Join Date: Feb 2006
Posts: 100
Default

i used this code so the image does not link to the site
Quote:
{if $link.FEATURED}<td>
<img src="http://pthumbnails.alexa.com/image_server.cgi?id=[www.centraldirectory.net]&amp;size=small&amp;url={$link.URL}" width="111" height="87">
</td>{/if}
you can find it Central Directory
__________________
Please check your sig links (they were parked)
vignesh_natraj is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:56 PM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.