Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Last X on category again

Quote Reply
Last X on category again
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















Quote Reply
Re: Last X on category again In reply to
Hi Robert,

I don't have the answer to your question, but i was looking for something similar, with your code you have implimented, could i tell the script to list by a-z z-a rating etc. If so, it would be very much appreciated if you release the code..

Best of luck.

Regards

MDJ1
http://www.isee-multimedia.co.uk
Quote Reply
Re: Last X on category again In reply to
Hmm, i could release my changes, but they are very near for my system;
What would you do? Calling a script with differnt queries and show them on a new site?
Then look for the "last x keywords" somewhere in forum; with this you could write for every query an extern .cgi for all kind of things.
Or would you like to have new tags for the home?

Robert

Quote Reply
Re: Last X on category again In reply to
Hi Robert,

It's hard to say, maybe waiting until the new release as pluggins are supposed to be made a whole lot easier. This way you could create a seperate script and run the comands from their, call a template and print the results. Having to re-build pages would make the load on the server a lot bigger, so printing to one HTML would be better I think, Like the search.cgi does.



Regards

MDJ1
http://www.isee-multimedia.co.uk