So far i have implemented on HOME - show the last x new (from all), show the last X HitOut, show the last X HitIn, Show the last X for another field; no problem so far; do a query in build and give it out to a new link2.html inside html_templates BUT:
I wanna have: Show the last X for every category on every cat-page
So i do:
1. In sub build_category_pages
I need the right query and pass it tru a new link3.htm with
##--## Best X per Hits on every cat
# Let's get all the searched links and order them alphabetically
my ($sth, $link);
$sth = $LINKDB->prepare (qq!SELECT * FROM Links
WHERE CategoryID = $category_r->{'ID'}
ORDER BY $LINKS{build_sort_order_home_hits}
LIMIT 5!);
$sth->execute();
($sth->rows > 5) and print "\tWarning: Max New links limit of 5 exceeded!\n";
# Build the html organized by date! ###### Aber über site_html_link3
while ($link = $sth->fetchrow_hashref) {
$OUT{'CatHitIn'} = &site_html_link3 ($link);
}
##--##
To implement this you need the Sort_order in links.pm and the new function
&site_html_link3 (is a copy of the &site_html_link and another version for link.hmtl as link3.html)
This give out all links by query for every cat.
Now i need another tag, give out all the X links for the maincats (this routine must give back 0, when no subcat exists)
(This make only sense, when having a two-level-cat-system and links only in the second level!)
Has someone a clue ...?
Robert
I wanna have: Show the last X for every category on every cat-page
So i do:
1. In sub build_category_pages
I need the right query and pass it tru a new link3.htm with
##--## Best X per Hits on every cat
# Let's get all the searched links and order them alphabetically
my ($sth, $link);
$sth = $LINKDB->prepare (qq!SELECT * FROM Links
WHERE CategoryID = $category_r->{'ID'}
ORDER BY $LINKS{build_sort_order_home_hits}
LIMIT 5!);
$sth->execute();
($sth->rows > 5) and print "\tWarning: Max New links limit of 5 exceeded!\n";
# Build the html organized by date! ###### Aber über site_html_link3
while ($link = $sth->fetchrow_hashref) {
$OUT{'CatHitIn'} = &site_html_link3 ($link);
}
##--##
To implement this you need the Sort_order in links.pm and the new function
&site_html_link3 (is a copy of the &site_html_link and another version for link.hmtl as link3.html)
This give out all links by query for every cat.
Now i need another tag, give out all the X links for the maincats (this routine must give back 0, when no subcat exists)
(This make only sense, when having a two-level-cat-system and links only in the second level!)
Has someone a clue ...?
Robert