Hi,
1) Using sb in category pages won't work. You need to update the category sort order defined in Setup > Build Options. sb is only effeective for things like review.cgi / search.cgi
2) As Tandat said, this is used by the rate.cgi system. I would leave that alone. Just add a new one called "ReviewRating" or something (as a FLOAT)...then make a script to simply go through each link and get the average rating nightly:
use strict;
use CGI::Carp qw(fatalsToBrowser);
use lib '/path/to/admin';
use Links qw/$PLG $IN $DB/;
local $SIG{__DIE__} = \&Links::fatal;
Links::init('/path/to/admin');
my $Reviews = $DB->table("Reviews");
my $Links = $DB->table("Links");
my $sth = $Links->select( ['ID'], { isValidated => "Yes" } );
while (my $id = $sth->fetchrow) {
$Links->update( { ReviewRating => $Reviews->select( ['AVG(Review_Rating)'], { Review_LinkID => $id } )->fetchrow }, { ID => $id }) || die $GT::SQL::error;
}
Untested, but should work =)
Cheers
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!
1) Using sb in category pages won't work. You need to update the category sort order defined in Setup > Build Options. sb is only effeective for things like review.cgi / search.cgi
2) As Tandat said, this is used by the rate.cgi system. I would leave that alone. Just add a new one called "ReviewRating" or something (as a FLOAT)...then make a script to simply go through each link and get the average rating nightly:
Code:
#!/usr/local/bin/perl use strict;
use CGI::Carp qw(fatalsToBrowser);
use lib '/path/to/admin';
use Links qw/$PLG $IN $DB/;
local $SIG{__DIE__} = \&Links::fatal;
Links::init('/path/to/admin');
my $Reviews = $DB->table("Reviews");
my $Links = $DB->table("Links");
my $sth = $Links->select( ['ID'], { isValidated => "Yes" } );
while (my $id = $sth->fetchrow) {
$Links->update( { ReviewRating => $Reviews->select( ['AVG(Review_Rating)'], { Review_LinkID => $id } )->fetchrow }, { ID => $id }) || die $GT::SQL::error;
}
Untested, but should work =)
Cheers
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!