i was wondering if there was a variable for the total number of categories in the database. Also, is there someone that has a comprehensive list of the global variables standard for all installations?
Mar 7, 2001, 6:08 PM
Administrator (9387 posts)
Mar 7, 2001, 6:08 PM
Post #2 of 15
Views: 4771
Hi,
No, but:
sub { return $DB->table('Links')->count ( { isValidated => 'Yes' }); }
as a global would do the trick.
Cheers,
Alex
--
Gossamer Threads Inc.
No, but:
sub { return $DB->table('Links')->count ( { isValidated => 'Yes' }); }
as a global would do the trick.
Cheers,
Alex
--
Gossamer Threads Inc.
Mar 7, 2001, 7:30 PM
Veteran (1187 posts)
Mar 7, 2001, 7:30 PM
Post #3 of 15
Views: 4770
Actuallay for category you should use:
sub { return $DB->table('Category')->count; }
The one alex mentioned is for Number of links.
Regards
Abd
http://www.idleb.com
sub { return $DB->table('Category')->count; }
The one alex mentioned is for Number of links.
Regards
Abd
http://www.idleb.com
Mar 8, 2001, 12:12 AM
Veteran / Moderator (6956 posts)
Mar 8, 2001, 12:12 AM
Post #4 of 15
Views: 4766
For a list of the globals, just look at the globals on the BUILD menu in the Links Admin.
The other tags available are the CFG tags (from the Settings) and then Links and/or category tags depending on what template you are in.
PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
The other tags available are the CFG tags (from the Settings) and then Links and/or category tags depending on what template you are in.
PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Mar 8, 2001, 12:35 AM
Administrator (9387 posts)
Mar 8, 2001, 12:35 AM
Post #5 of 15
Views: 4802
Hi,
What do you think of a tag you could put on a template like:
<%AVAILABLE_TAGS%>
and it would produce a nice HTML table showing you all the tags currently available and the value. Would this be useful for debugging?
Cheers,
Alex
--
Gossamer Threads Inc.
What do you think of a tag you could put on a template like:
<%AVAILABLE_TAGS%>
and it would produce a nice HTML table showing you all the tags currently available and the value. Would this be useful for debugging?
Cheers,
Alex
--
Gossamer Threads Inc.
Mar 8, 2001, 12:41 AM
Veteran / Moderator (6956 posts)
Mar 8, 2001, 12:41 AM
Post #6 of 15
Views: 4791
Very!
Such a simple idea :) Takes a great mind to think of it!
PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Such a simple idea :) Takes a great mind to think of it!
PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Mar 8, 2001, 1:38 PM
Administrator (9387 posts)
Mar 8, 2001, 1:38 PM
Post #9 of 15
Views: 4721
If you add the following code to GT::Template:
# ---------------------------------------------------------------
# Dumps the variables.
#
my $tags = (ref $_[0] eq 'GT::Template') ? $_[0]->{VARS} : shift;
my $font = 'font face="Tahoma,Arial,Helvetica" size="2"';
my $output = qq~<table border=1 cellpadding=3 cellspacing=0><tr><td colspan=2><$font><b>Available Variables</b></font></td></tr>~;
foreach my $key (sort keys %$tags) {
my $val = GT::CGI->html_escape($tags->{$key});
$val =~ s/\n/<BR>\n/g;
$val =~ s/ / /g;
$output .= qq~<tr><td valign="top"><$font>$key</font></td><td valign="top"><font face="Courier,fixedsys">$val</font></td></tr>~;
}
$output .= qq~</table>~;
}and then put <%GT::Template::dump%> anywhere on your template it will dump the current tags available.
Let me know what you think,
Cheers,
Alex
--
Gossamer Threads Inc.
Code:
sub dump { # ---------------------------------------------------------------
# Dumps the variables.
#
my $tags = (ref $_[0] eq 'GT::Template') ? $_[0]->{VARS} : shift;
my $font = 'font face="Tahoma,Arial,Helvetica" size="2"';
my $output = qq~<table border=1 cellpadding=3 cellspacing=0><tr><td colspan=2><$font><b>Available Variables</b></font></td></tr>~;
foreach my $key (sort keys %$tags) {
my $val = GT::CGI->html_escape($tags->{$key});
$val =~ s/\n/<BR>\n/g;
$val =~ s/ / /g;
$output .= qq~<tr><td valign="top"><$font>$key</font></td><td valign="top"><font face="Courier,fixedsys">$val</font></td></tr>~;
}
$output .= qq~</table>~;
}
Let me know what you think,
Cheers,
Alex
--
Gossamer Threads Inc.
Mar 10, 2001, 1:33 AM
User (127 posts)
Mar 10, 2001, 1:33 AM
Post #11 of 15
Views: 4678
<%GT::Template::dump%> is case sensitive, I think.
Andreas
--------------------------------------------
http://www.archaeologie-online.de
Mar 10, 2001, 4:31 AM
Veteran (19537 posts)
Mar 10, 2001, 4:31 AM
Post #12 of 15
Views: 4694
Yes GT::Template.pm is similar to a path.
GT is the name of the directory and so if you look inside that directory you will see Template.pm which is the file you need to edit.
For example if Alex has said Links::Plugins::Plugin.pm
Then you would find the plugin.pm file in the following location.. /Links/Plugins/Plugin.pm
Paul Wilson.
http://www.wiredon.net/gt/
Coming soon => www.perlmad.com
GT is the name of the directory and so if you look inside that directory you will see Template.pm which is the file you need to edit.
For example if Alex has said Links::Plugins::Plugin.pm
Then you would find the plugin.pm file in the following location.. /Links/Plugins/Plugin.pm
Paul Wilson.
http://www.wiredon.net/gt/
Coming soon => www.perlmad.com
Mar 12, 2001, 7:40 PM
Administrator (9387 posts)
Mar 12, 2001, 7:40 PM
Post #13 of 15
Views: 4678
Hi,
Digger has it right, make sure you use <%GT::Template::dump%>.
Cheers,
Alex
--
Gossamer Threads Inc.
Digger has it right, make sure you use <%GT::Template::dump%>.
Cheers,
Alex
--
Gossamer Threads Inc.
Apr 26, 2001, 12:14 PM
User (155 posts)
Apr 26, 2001, 12:14 PM
Post #15 of 15
Views: 4565
Evoir, I haven't tried any of the admin templates, but it's worked in all of the "default" templates I've tried... i.e. /admin/templates/default/link.html, etc.
In other words, paste it into any template for which you want to see available tags... some templates have different tags available than others.
--
Matt Glaspie
In other words, paste it into any template for which you want to see available tags... some templates have different tags available than others.
--
Matt Glaspie