Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Image Rate!!

Quote Reply
Image Rate!!
Hi All,

Can anyone help me designing a plug-in for the image rate mod for links V2?

Regards

MDJ1
http://www.isee-multimedia.co.uk
Quote Reply
Re: Image Rate!! In reply to
Shouldn't this be discussed in the Plugins Discussion?

Robert Blackstone
Webmaster of Scato Search
http://www.scato.com
Quote Reply
Re: Image Rate!! In reply to
No, as discussed in the Pluggins Forum, It should not be used for requests for plugins, but for the release of plugins! Correct me if im wrong?



Regards

MDJ1
http://www.isee-multimedia.co.uk
Quote Reply
Re: Image Rate!! In reply to
Your right, I'm wrong. Smile

I found this post, might help in the developing of this plugin:
http://gossamer-threads.com/...pl?ubb=003069:Forum3

If I have some time later this week, I may just start working on this plugin. Smile

Robert Blackstone
Webmaster of Scato Search
http://www.scato.com
Quote Reply
Re: Image Rate!! In reply to
Hi:

I wrote a mod- not as a plug in, but as a global- back when LINKS NG was in beta. It STILL works, and is posted in THIS forum, as well as the Pugdogs FAQ!

dave

Quote Reply
Re: Image Rate!! In reply to
Hi:

I looked, and was not able to find the mod in Pugdog's FAQ, or this forum.... maybe I was not looking right... anyway, here is the mod:

create a global called rate_img (or whatever you want...)

define it like this:

In Reply To:
sub {
my ($rec) = @_;
if ($rec->{'Rating'} eq '10.00') {'40'; }
elsif ($rec->{'Rating'} eq '0.00') {'00'; }
elsif ($rec->{'Rating'} eq '') {'00'; }
elsif ($rec->{'Rating'} le '0.25') {'01'; }
elsif ($rec->{'Rating'} le '0.50') {'02'; }
elsif ($rec->{'Rating'} le '0.75') {'03'; }
elsif ($rec->{'Rating'} le '1.00') {'04'; }
elsif ($rec->{'Rating'} le '1.25') {'05'; }
elsif ($rec->{'Rating'} le '1.50') {'06'; }
elsif ($rec->{'Rating'} le '1.75') {'07'; }
elsif ($rec->{'Rating'} le '2.00') {'08'; }
elsif ($rec->{'Rating'} le '2.25') {'09'; }
elsif ($rec->{'Rating'} le '2.50') {'10'; }
elsif ($rec->{'Rating'} le '2.75') {'11'; }
elsif ($rec->{'Rating'} le '3.00') {'12'; }
elsif ($rec->{'Rating'} le '3.25') {'13'; }
elsif ($rec->{'Rating'} le '3.50') {'14'; }
elsif ($rec->{'Rating'} le '3.75') {'15'; }
elsif ($rec->{'Rating'} le '4.00') {'16'; }
elsif ($rec->{'Rating'} le '4.25') {'17'; }
elsif ($rec->{'Rating'} le '4.50') {'18'; }
elsif ($rec->{'Rating'} le '4.75') {'19'; }
elsif ($rec->{'Rating'} le '5.00') {'20'; }
elsif ($rec->{'Rating'} le '5.25') {'21'; }
elsif ($rec->{'Rating'} le '5.50') {'22'; }
elsif ($rec->{'Rating'} le '5.75') {'23'; }
elsif ($rec->{'Rating'} le '6.00') {'24'; }
elsif ($rec->{'Rating'} le '6.25') {'25'; }
elsif ($rec->{'Rating'} le '6.50') {'26'; }
elsif ($rec->{'Rating'} le '6.75') {'27'; }
elsif ($rec->{'Rating'} le '7.00') {'28'; }
elsif ($rec->{'Rating'} le '7.25') {'29'; }
elsif ($rec->{'Rating'} le '7.50') {'30'; }
elsif ($rec->{'Rating'} le '7.75') {'31'; }
elsif ($rec->{'Rating'} le '8.00') {'32'; }
elsif ($rec->{'Rating'} le '8.25') {'33'; }
elsif ($rec->{'Rating'} le '8.50') {'34'; }
elsif ($rec->{'Rating'} le '8.75') {'35'; }
elsif ($rec->{'Rating'} le '9.00') {'36'; }
elsif ($rec->{'Rating'} le '9.25') {'37'; }
elsif ($rec->{'Rating'} le '9.50') {'38'; }
elsif ($rec->{'Rating'} le '9.75') {'39'; }
else {'40'; }

}
You can adjust for the number of images you want... and then just use somethink like this to get the image:

<IMG SRC="http://path.to/images/rate<%rate_img%>.gif" WIDTH=115 HEIGHT=10 BORDER=0 ALT="<%Rating%> of 10 Points"></A>

EASY!

dave

Quote Reply
Re: Image Rate!! In reply to
That should work. Smile

Robert Blackstone
Webmaster of Scato Search
http://www.scato.com
Quote Reply
Re: Image Rate!! In reply to
Or you could do:

sub {
my $tags = shift;
return int ($tags->{Rating} * 4);
}

which will give you an integer between 0 and 40.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Image Rate!! In reply to
Where should this go, and alex how would i go about making this into a simple plug in, maybe elaborate and create an upload section for the images.



Regards

MDJ1
http://www.isee-multimedia.co.uk
Quote Reply
Re: Image Rate!! In reply to
mdj:

It does not need to be a plug in- it is a global variable. Just enter it in the admin/build section... in Template Globals!

good luck!

dave