Gossamer Forum
Home : Products : Links 2.0 : Customization :

Mod to disable ratings for some sites.

Quote Reply
Mod to disable ratings for some sites.
Is that a mod to disable rating for some sites? This option can be set directly by the adminstrator and need not to processed by a form like add.cgi or modify.cgi.


Quote Reply
Re: [missguy] Mod to disable ratings for some sites. In reply to
All you really need to do is add another field in link.def, maybe something like is_rating. Then in link.html you could put something like;

Code:
<%if is_rating%>
rating results and stuff to show if ratings are allowed.
<%endif%>

<%ifnot is_rating%>
stuff to show is no ratable
<%endif%>

It is best to set the field in links.def as a drop down, with say 'Yes' or 'No' options, that way there is less chance of confusion.

Hope that helps Wink

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [AndyNewby] Mod to disable ratings for some sites. In reply to
ooo i never think of that. :) thanks
Quote Reply
Re: [missguy] Mod to disable ratings for some sites. In reply to
Hmmm I am using image for the ratings... and if i want to display the image that says the site rating system is not disabled... how do I do tat?

Code:
sub get_rating_image {
my ($rating) = @_;
my $img = 0;
if ($rating >= 9.5) { $img = "5"; }
elsif (($rating >= 0) && ($rating < 9.5)) {
my $img1 = int($rating/2);
if ($img1 - ($rating/2) == 0 ) {
$img = "$img1";
}
else { $img = "$img1-5"; }
}
else { $img = "0"; }

$image = qq~<img src="$rating_images_url/rate-$img.gif" width="64" height="12" alt="$rating" border="0">~;

return $image || $rating;
}

i used the above