Oct 8, 2002, 8:07 AM
Veteran / Moderator (6956 posts)
Oct 8, 2002, 8:07 AM
Post #5 of 7
Views: 2687
Hi,
I think this pre-dates the loop support :)
This was one of the nastiest programs I tried to write, and like a mythical snake creature, it changed form a dozen times before release. I've kind of left it alone because of that.
I'm in the process of cleaning up, updating, and porting most of my released code, programs, and snippets to one "Utility" plugin. You'll get the detailed_page, Days_Old, Updated_Search_Logger, top searches/keywords, modified Yahoo Cats, bad_link, recommend_it, file upload, logo, etc and others in one easy to install plugin, with a library of routines in the Plugins::PUGDOG directory you can call as needed (or ignore).
I'll probably have a free version that is missing the file and logo handling, and contains the stuff I've released in the forums, the downloads area, and more. The paid version will include the file/upload/logo handling. Probably $45. I will update both the free and paid versions with new snippets and such as I write them.
I should have it ready this month, or early next. It will also include many globals I've written over the years, and other odds and ends, all in one place. It's more for my own use, and organization, than anything. :)
I've started to put my stuff into functions/modules that can be called from inside the templates
<%Plugins::PUGDOG::Days_Old%>
for example. Unlike globals, they are not tiggered unless you need/want them. Alex has said processing hits are negligible for these sorts of calls, and while not timing them out, it seems to be true. The database call is the major time waster, beyond that, the rest of the template parsing goes very quickly.
For instance, the Days_Old call is only needed in the link.html template, and perhaps detailed.html depending on your site. Why waste any tests at all on it, unless needed?
So, the point is that I will be looking at the Alpha_Bar for cleanup and insertion into this module system. There is probably a *lot* I can clean up given the time/experience that has gathered since this snake's original release ;)
For those not in the know, so to speak <G> The Alpha_Bar started out as a program to generate a linked alpha_bar on a page. What it turned out to be, is a way to hook into the search_a_column feature of links, using either a _start_of_word_ search, or a _containing_ search of *any* number of characters:
a, an, ang, ange, angels, etc.
without interfering with the regular search system. It was template controlled, so actually, you could alter it's behavior on different pages by passing in a different search column.
For instance, on my IdentityDots.com site, I wanted people to be able to search for domain names that either started with, or contained a letter or string of characters.
It's worked for that.... so I've left it alone <G>
Adding in loop support *should* be mostly a cut/paste procedure.
In the .pm file, try changing:
# And format the link results.
my ($link_results, %link_output, @link_results_loop); ## add/change this
if ($link_count) {
while (my $link = $link_sth->fetchrow_hashref) {
$link_results .= Links::SiteHTML::display('link', $link);
push @link_results_loop, $link; ## add this
}
}
......
# Print the output.
$opts->{link_results} = $link_results;
$opts->{link_results_loop} = \@link_loop; ## add this
$opts->{link_hits} = $link_count;
$opts->{cat_hits} = 0;
$opts->{next} = $toolbar;
That should be all that is needed ie: create the return array, return the array.
PUGDOG� Enterprises, Inc.
The best way to contact me is to NOT use Email.
Please leave a PM here.