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

Global to display category dropdown...

(Page 3 of 3)
> >
Quote Reply
Re: [fuzzy logic] Global to display category dropdown... In reply to
Limecat may not be pleased.

But your a Genius :D

Thank you

Philip


Sandra Roussel
Chonsa Group Design - Fresh Start Housing
Quote Reply
Re: [antoined] Global to display category dropdown... In reply to
In Reply To:
1- is it possible to let work in Dynamic Mode?

Is is possible to have it work in dynamic mode?


Sandra Roussel
Chonsa Group Design - Fresh Start Housing
Quote Reply
Re: [SandraR] Global to display category dropdown... In reply to
Code:
$output .= qq|<option value="$CFG->{db_cgi_url}/page.cgi?g=| . $db->as_url($safe_full) . qq|/$CFG->{build_index};d=1">$back ($cnt)</option>|. "\n";

Just a slight modification of the code ;-)

Philip
------------------
Limecat is not pleased.
Quote Reply
Re: [fuzzy logic] Global to display category dropdown... In reply to
Curious anomaly:

Added a few more categories, the drop down is not recognizing them.

Hey, Phillip nice to see you working like me on the weekend :D


fixed it: took out

,'LIMIT 100'


Sandra Roussel
Chonsa Group Design - Fresh Start Housing

Last edited by:

SandraR: Oct 14, 2006, 10:11 AM
Quote Reply
Re: [SandraR] Global to display category dropdown... In reply to
I changed it so it contains the number of links:
Here is a view of it in action Sitemap

Would it be possble to make it contain New or Updated?

Code:
sub {
# -------------------------------------------------------------------
my $tags = shift;
my $cat_db = $DB->table('Category');
$cat_db->select_options ('ORDER BY Full_Name');
my $sth = $cat_db->select (['Full_Name','ID','Name','CatDepth','Number_of_Links'] );
my $output=qq~<table width="100%"><tr valign=top><td width="50%"><table>~;
my $i=0;
while (my ($cat,$ID,$heading,$depth,$cnt) = $sth->fetchrow_array) {
$i++;
my $url1 = $cat_db->as_url($cat);
$output.= qq~<tr><td>~;
my $depth = ($cat =~ tr/\///);
if ($depth > 0){$output .= "&nbsp;&nbsp;"x$depth."<font size=-1>";}
else {$output.="<b>";}
$output.=qq~<a href="$CFG->{build_root_url}/$url1" class="toc">$heading</a> ($cnt)~;
if ($depth > 0){$output .= "</font>";}
else {$output.="</b>";}
$output.=qq~</td></tr>~;
if (($i eq '91')){ $output.=qq~</table></td><td width="50%"><table align=top>~;}
}
$output.="</table></td></tr></table>";
return $output;
}


Sandra Roussel
Chonsa Group Design - Fresh Start Housing
Quote Reply
Re: [SandraR] Global to display category dropdown... In reply to
Hi,

Something like this should do the trick;

Code:
sub {
# -------------------------------------------------------------------
my $tags = shift;
my $cat_db = $DB->table('Category');
$cat_db->select_options ('ORDER BY Full_Name');

my $sth = $cat_db->select (['Full_Name','ID','Name','CatDepth','Number_of_Links','Has_New_Links','Has_Changed_Links'] );
my $output=qq~<table width="100%"><tr valign=top><td width="50%"><table>~;
my $i=0;
while (my ($cat,$ID,$heading,$depth,$cnt,$new,$changed) = $sth->fetchrow_array) {
$i++;
my $url1 = $cat_db->as_url($cat);
$output.= qq~<tr><td>~;
my $depth = ($cat =~ tr/\///);
if ($depth > 0){
$output .= "&nbsp;&nbsp;"x$depth."<font size=-1>";
} else { $output.="<b>"; }
$output.=qq~<a href="$CFG->{build_root_url}/$url1" class="toc">$heading</a> ($cnt)~;
if ($new eq "Yes") { $output .= qq| <sup>new</sup> |; }
if ($changed eq "Yes") { $output .= qq| <sup>changed</sup> |; }
if ($depth > 0){
$output .= "</font>";
} else {$output.="</b>";}
$output.=qq~</td></tr>~;
if (($i eq '91')){ $output.=qq~</table></td><td width="50%"><table align=top>~;}
}
$output.="</table></td></tr></table>";
return $output;
}

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!

Last edited by:

Andy: Nov 7, 2006, 4:53 PM
Quote Reply
Re: [Andy] Global to display category dropdown... In reply to
Hey Andy,

Did not work - it showed both option:

Rector-Area News Media (9) new changed


Sandra Roussel
Chonsa Group Design - Fresh Start Housing
Quote Reply
Re: [SandraR] Global to display category dropdown... In reply to
Hi,

Please try the modified version above (changes are in red)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Global to display category dropdown... In reply to
Worked :) Woohoo

Thanks Andy


Sandra Roussel
Chonsa Group Design - Fresh Start Housing
> >