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.
Dec 28, 2001, 7:52 AM
Veteran / Moderator (18436 posts)
Dec 28, 2001, 7:52 AM
Post #2 of 4
Views: 1490
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;
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
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!
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

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!
Dec 28, 2001, 10:51 AM
User (105 posts)
Dec 28, 2001, 10:51 AM
Post #4 of 4
Views: 1472
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?
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
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