Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [gotze] Active categories global

Quote Reply
Re: [gotze] Active categories global In reply to
I have not given up. I have made some progress, but really would appreciate some helpCrazy

Issue 1: Active Tags

I am still struggling with the linkability issue.

This code:

Code:
sub {
my $output;
my $cat_db = $DB->table('Category');
$cat_db->select_options ('ORDER BY Full_Name');
my $sth = $cat_db->select ({Has_New_Links => 'Yes'} );
while (my $cat = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('newcategory', $cat);
}
return $output;
}
is fine except it doesn't create the right urls. I've tried as_url etc, but just can't get it to work.

This code, however:

Code:
sub {
my $output;
my $cat_db = $DB->table('Category');
$cat_db->select_options ('ORDER BY Full_Name');
my $sth = $cat_db->select ( ['Full_Name','Name'], { Has_New_Links => 'Yes' });
while (my ($cat,$name) = $sth->fetchrow_array) {
$cat =~ s/ /_/g;
my $cat1 = $cat;
$output .=qq~<a href="$CFG->{build_root_url}/$cat1">$name</a>, ~;
}
return $output;
}
works, but uses a cheap trick to create the right urls. I don't like having to hardcode the HTML.

So, why can't I get it to work with the template?

Issue 2: Technorati Tags-style
It is important to me to be able to style the output. Here is stuff I want to do:

Code:
<%if Number_of_Links > 50 or Has_New_Links eq Yes%>
<big>
<a href="/links/<%Full_Name%>"><%Name%></a>
</big>
<%else%>
<a href="/links/<%Full_Name%>"><%Name%></a>
<%endif%>

This can be used to present something like this (here: all categories, categories with more than 50 links or with new links have bigger font)

Now I just need to combine these two.

I'll promise to write up a reusable global and stuff if I get help getting it to work.

John
Subject Author Views Date
Thread Active categories gotze 16740 Apr 17, 2005, 4:43 AM
Thread Re: [gotze] Active categories
Alba 15898 Apr 17, 2005, 5:33 AM
Thread Re: [Alba] Active categories
gotze 15938 Apr 17, 2005, 5:56 AM
Post Re: [gotze] Active categories
Alba 15864 Apr 17, 2005, 6:33 AM
Thread Active categories global
gotze 15826 Apr 23, 2005, 1:26 PM
Thread Re: [gotze] Active categories global
gotze 15964 Apr 23, 2005, 1:36 PM
Post Re: [gotze] Active categories global
gotze 15819 May 7, 2005, 7:00 PM
Thread Re: [gotze] Active categories
brewt 15845 May 9, 2005, 7:47 PM
Post Re: [brewt] Active categories
Payooo 15731 May 9, 2005, 11:47 PM
Thread Re: [brewt] Active categories
gotze 15806 May 10, 2005, 12:35 AM
Thread Re: [gotze] Active categories
brewt 15836 May 10, 2005, 12:47 AM
Post Re: [brewt] Active categories
Payooo 15769 May 10, 2005, 12:59 AM
Thread Re: [brewt] Active categories
gotze 15818 May 10, 2005, 1:04 AM
Thread Re: [gotze] Active categories
brewt 15788 May 10, 2005, 1:20 AM
Thread Re: [brewt] Active categories
brewt 15687 May 10, 2005, 1:23 AM
Thread Sorting
gotze 15777 May 10, 2005, 7:21 AM
Thread Re: [gotze] Sorting
Matthias70 15312 Sep 25, 2007, 1:48 PM
Thread Re: [Matthias70] Sorting
Andy 15367 Sep 26, 2007, 6:35 AM
Post Re: [Andy] Sorting
Matthias70 15275 Sep 26, 2007, 8:56 AM
Thread Re: [Andy] Sorting
Andy 15313 Sep 26, 2007, 9:09 AM
Thread Re: [Andy] Sorting
Matthias70 15279 Sep 26, 2007, 9:47 AM
Thread Re: [Matthias70] Sorting
Andy 15298 Sep 26, 2007, 9:51 AM
Thread Re: [Andy] Sorting
Matthias70 15247 Sep 26, 2007, 10:01 AM
Thread Re: [Matthias70] Sorting
Matthias70 15297 Sep 26, 2007, 10:24 AM
Thread Re: [Matthias70] Sorting
Matthias70 6930 Sep 26, 2007, 12:25 PM
Thread Re: [Matthias70] Sorting
Andy 6921 Sep 27, 2007, 1:03 AM
Thread Re: [Andy] Sorting
Matthias70 6948 Sep 27, 2007, 5:38 AM
Thread Re: [Matthias70] Sorting
Jesus 6863 Oct 2, 2007, 2:27 PM
Thread Re: [Jesus] Sorting
Matthias70 6891 Oct 2, 2007, 3:11 PM
Post Re: [Matthias70] Sorting
Jesus 6817 Oct 2, 2007, 11:11 PM
Thread Re: [Matthias70] Sorting
Matthias70 6692 Apr 13, 2008, 11:39 AM
Thread Re: [Matthias70] Sorting
Andy 6733 Apr 13, 2008, 12:03 PM
Thread Re: [Andy] Sorting
Matthias70 6765 Apr 13, 2008, 12:41 PM
Thread Re: [Matthias70] Sorting
Andy 6756 Apr 13, 2008, 1:29 PM
Thread Re: [Andy] Sorting
Matthias70 6692 Apr 13, 2008, 2:17 PM
Post Re: [Matthias70] Sorting
Andy 6662 Apr 14, 2008, 12:15 AM
Post Re: [brewt] Active categories
brewt 15717 May 10, 2005, 12:57 AM