Is this possible? Can I set up an alphabetical hyperlink list so that when a user clicks on 'G' for example I will display a page that lists all links in alphabetical order that start with that letter on a separate page (or custom template)?
Dec 2, 2009, 10:35 AM
Veteran / Moderator (17366 posts)
Dec 2, 2009, 10:35 AM
Post #2 of 7
Views: 825
Like this?
http://www.ultranerds.com/...ugins/AlphaBar_L170/
Cheers
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
http://www.ultranerds.com/...ugins/AlphaBar_L170/
Cheers
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Dec 2, 2009, 11:12 PM
Veteran / Moderator (17366 posts)
Dec 2, 2009, 11:12 PM
Post #4 of 7
Views: 797
Should be possible with a global like this:
get_links_by_letter
my $tbl = $DB->table('Links');
$tbl->select_options("ORDER BY Title");
my $letter = $IN->param('letter');
my $sth = $tbl->select( GT::SQL::Condition->new('isValidated','=',"Yes",'Title','LIKE',"$letter%") );
my @loop;
while (my $hit = $sth->fetchrow_hashref) {
if ($CFG->{build_detailed}) { $hit->{detailed_url} = $CFG->{build_root_url} . "/" . $DB->table('Links')->detailed_url( $hit->{ID} ); }
if ($hit->{isNew} eq "Yes") { $hit->{isNew} = 1; } else { $hit->{isNew} = 0; }
if ($hit->{isPopular} eq "Yes") { $hit->{isPopular} = 1; } else { $hit->{isPopular} = 0; }
if ($hit->{isChanged} eq "Yes") { $hit->{isChanged} = 1; } else { $hit->{isChanged} = 0; }
push @loop, $hit;
}
return { links_loop => \@loop };
}
Then make a new template (called get_links_by_letter.html) ... and call that global with:
<%if links_loop.length%>
<ul>
<%loop links_loop%>
<li><%Title%></li>
<%endloop%>
</ul>
<%else%>
No matches
<%endif%>
Then call with page.cgi?p=get_links_by_letter;letter=A (that should get a list of all links where "Title" starts with "A" or "a")
Untested - and was written literally after getting out of bed - so could be some issues that may need fixing :)
Cheers
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
get_links_by_letter
Code:
sub { my $tbl = $DB->table('Links');
$tbl->select_options("ORDER BY Title");
my $letter = $IN->param('letter');
my $sth = $tbl->select( GT::SQL::Condition->new('isValidated','=',"Yes",'Title','LIKE',"$letter%") );
my @loop;
while (my $hit = $sth->fetchrow_hashref) {
if ($CFG->{build_detailed}) { $hit->{detailed_url} = $CFG->{build_root_url} . "/" . $DB->table('Links')->detailed_url( $hit->{ID} ); }
if ($hit->{isNew} eq "Yes") { $hit->{isNew} = 1; } else { $hit->{isNew} = 0; }
if ($hit->{isPopular} eq "Yes") { $hit->{isPopular} = 1; } else { $hit->{isPopular} = 0; }
if ($hit->{isChanged} eq "Yes") { $hit->{isChanged} = 1; } else { $hit->{isChanged} = 0; }
push @loop, $hit;
}
return { links_loop => \@loop };
}
Then make a new template (called get_links_by_letter.html) ... and call that global with:
Code:
<%get_links_by_letter%> <%if links_loop.length%>
<ul>
<%loop links_loop%>
<li><%Title%></li>
<%endloop%>
</ul>
<%else%>
No matches
<%endif%>
Then call with page.cgi?p=get_links_by_letter;letter=A (that should get a list of all links where "Title" starts with "A" or "a")
Untested - and was written literally after getting out of bed - so could be some issues that may need fixing :)
Cheers
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Dec 3, 2009, 11:55 PM
Veteran / Moderator (17366 posts)
Dec 3, 2009, 11:55 PM
Post #7 of 7
Views: 756
Oops, have updated my post above
Cheers
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Cheers
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates

