little tiny addition to matrix

This commit is contained in:
JT Smith 2005-12-01 23:28:12 +00:00
parent c8cc6ddf8d
commit 6189cdfd10
2 changed files with 29 additions and 0 deletions

View file

@ -906,6 +906,16 @@ sub view {
$var{'ratings.details.url'} = $self->getUrl("func=viewRatingDetails");
my $data = WebGUI::SQL->quickHashRef("select lastUpdated, productName, listingId from Matrix_listing
where assetId=".quote($self->getId)." and status='approved' order by lastUpdated desc limit 1");
my @lastUpdated;
my $sth = WebGUI::SQL->read("select listingId,lastUpdated,productName from Matrix_listing order by lastUpdated desc limit 20");
while (my ($listingId, $lastUpdated, $productName) = $sth->array) {
push(@lastUpdated, {
url => $self->formatURL("viewDetail",$listingId),
name=>$productName,
lastUpdated=>WebGUI::DateTime::epochToHuman($lastUpdated,"%z")
});
}
$var{'last_updated_loop'} = \@lastUpdated;
$var{'best.updated.url'} = $self->formatURL("viewDetail",$data->{listingId});
$var{'best.updated.date'} = WebGUI::DateTime::epochToHuman($data->{lastUpdated},"%z");;
$var{'best.updated.name'} = $data->{productName};

View file

@ -483,6 +483,25 @@ our $I18N = {
<b>best.updated.name</b><br />
The name of the listing that was most recently updated.
</p>
<p>
<b>last_update_loop</b><br />
A loop containing the 20 most recently updated listings.
<blockquote>
<p>
<b>url</b><br />
The URL to view this listing.
</p>
<p>
<b>name</b><br />
The name of the product.
</p>
<p>
<b>lastUpdated</b><br />
The date this listing was updated.
</p>
</blockquote>
</p>
<p>
<b>user.count</b><br />