Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Any reason Title, detailed_url don't exist in review_add_success?

Quote Reply
Any reason Title, detailed_url don't exist in review_add_success?
Hi,

I'm just working on a new design set for GLinks (as a plugin), but it seems that the link values don't exist in review_add_success.html . Is there any reason for this? If its a bug, any chance of a fix? I can fix it my end - but seeing as this is going to be installed by other people, I would prefer a "proper" fix Whistle

UPDATE - looks like this was fixed up in 3.3... but the below one still exists Angelic

TIA

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!

Last edited by:

Andy: Aug 10, 2013, 2:24 AM
Quote Reply
Re: [Andy] Any reason Title, detailed_url don't exist in review_add_success? In reply to
Oh, and another one. Amazed this one's not been picked up before! On detailed pages (with Review_Loop), it seems the Review_Contents doesn't get its newline added when you have review_convert_br_tags enabled. I managed to fix it by adding the bit in red in /Links/Table/Links.pm in _plg_add_reviews:

Code:
while (my $review = $sth->fetchrow_hashref) {
$CFG->{review_convert_br_tags} and $review->{Review_Contents} = Links::User::Review::_translate_html($review->{Review_Contents});
push @{$reviews{$review->{Review_LinkID}}}, $review;
$review_count{$review->{Review_LinkID}}++;
}

Again, would be nice to get a fix out for this :) (it works fine on review.cgi... just not when loaded via _plg_add_reviews)

TIA

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: [Andy] Any reason Title, detailed_url don't exist in review_add_success? In reply to
Sorry, busy with a project at the moment - will look into this one next week.

Adrian
Quote Reply
Re: [brewt] Any reason Title, detailed_url don't exist in review_add_success? In reply to
Hi,

I know you're busy, but just thought I would bump this up Angelic

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!
Quote Reply
Re: [Andy] Any reason Title, detailed_url don't exist in review_add_success? In reply to
I committed this:
Code:
--- Table/Links.pm 11 May 2009 05:57:45 -0000 1.33
+++ Table/Links.pm 9 Sep 2013 19:55:50 -0000
@@ -608,14 +608,29 @@
if (ref $links eq 'HASH') {
$links = [ $links ];
}
- my $review_db = $DB->table('Reviews');
my @ids = map { $_->{ID} } @$links;
return unless (@ids);

+ my $review_db = $DB->table('Reviews');
+ if ($CFG->{review_sort_by}) {
+ my $order = $CFG->{review_sort_order} || 'DESC';
+ $review_db->select_options("ORDER BY $CFG->{review_sort_by} $order");
+ }
my $sth = $review_db->select({ Review_Validated => 'Yes' }, { Review_LinkID => \@ids });
my %reviews;
my %review_count;
+ require Links::User::Review;
while (my $review = $sth->fetchrow_hashref) {
+ if ($review->{Review_ModifyDate} ne $review->{Review_Date} and $review->{Review_ModifyDate} !~ /^0000-00-00 00:00:00/) {
+ $review->{Review_ModifyDate} = GT::Date::date_transform($review->{Review_ModifyDate}, GT::Date::FORMAT_DATETIME, $CFG->{date_review_format});
+ }
+ else {
+ delete $review->{Review_ModifyDate};
+ }
+ $review->{Review_Date} = GT::Date::date_transform($review->{Review_Date}, GT::Date::FORMAT_DATETIME, $CFG->{date_review_format});
+ $review->{Num} = $review->{Review_WasHelpful} + $review->{Review_WasNotHelpful};
+ $CFG->{review_convert_br_tags} and $review->{Review_Contents} = Links::User::Review::_translate_html($review->{Review_Contents});
+
push @{$reviews{$review->{Review_LinkID}}}, $review;
$review_count{$review->{Review_LinkID}}++;
}
But you can fix it on the template level by calling:

<%Links::Utils::load_reviews($ID, $detailed_max_reviews)~%>

like it does in the luna template.

Adrian
Quote Reply
Re: [brewt] Any reason Title, detailed_url don't exist in review_add_success? In reply to
Great thanks. I fixed it up myself by just editing the core code, but a proper fix is better for those who don't wanna do that Angelic

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!