[wellwell-devel] [SCM] Interchange wellwell catalog branch, master, updated. f4e772b5153e934655b20807aaee1b78e894bbcb

Stefan Hornburg racke at rt.icdevgroup.org
Wed Apr 29 08:06:57 UTC 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Interchange wellwell catalog".

The branch, master has been updated
       via  f4e772b5153e934655b20807aaee1b78e894bbcb (commit)
      from  c667a826073dd8977bc44eae46dffdbaa7c1d491 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f4e772b5153e934655b20807aaee1b78e894bbcb
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Wed Apr 29 10:06:51 2009 +0200

    sorting reviews implemented

-----------------------------------------------------------------------

Summary of changes and diff:
 plugins/reviews/code/reviews.tag |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/plugins/reviews/code/reviews.tag b/plugins/reviews/code/reviews.tag
index 545349e..5dfc452 100644
--- a/plugins/reviews/code/reviews.tag
+++ b/plugins/reviews/code/reviews.tag
@@ -94,6 +94,18 @@ sub {
 	}
 	elsif ($function eq 'list') {
 		my $sql = qq{select title,name,review,rating,created,uid from reviews where sku = '$sku' and public is TRUE};
+
+		# sorting reviews
+		if ($opt->{sort} eq 'rating') {
+			$sql .= ' order by rating desc';
+		}
+		elsif ($opt->{sort} eq 'created') {
+			$sql .= ' order by created desc';
+		}
+		elsif ($opt->{sort} eq 'name') {
+			$sql .= ' order by name asc'; 
+		}
+
 		return $Tag->query ({sql => $sql, list => 1, prefix => 'item',
 			body => $body});
 	}


hooks/post-receive
-- 
Interchange wellwell catalog



More information about the wellwell-devel mailing list