Gossamer Forum
Home : Products : Links 2.0 : Customization :

10$ via paypal for letting me know how to show the metaname in category listing

Quote Reply
10$ via paypal for letting me know how to show the metaname in category listing
I wanted it listed in the category listing, but when I put in $meta_name theres nothing there, like it doesn't know what the metaname value is??
It works fine in the category pages (site_html.pl) but in the category listing it doesnt show..... Anybody know how to do this.

It's just the 4th cell from the DB i want there shouldn't be that hard.

Put in your email so I can pay you if you have paypal.
Quote Reply
Re: [jorgenm] 10$ via paypal for letting me know how to show the metaname in category listing In reply to
A long way around it, is to add something like this;

Code:
my (@sliced, $meta_name);
open(DATA, "./data/data.db") || &cgierr("Can't open data file. Reason: $!");
DATAW: while (<DATA>) {

if (/|$category_name|/) {
@sliced = split("|",$_);
$meta_name = $sliced[4];
last DATAW;
}
}

$meta_name should then hold the value of the 5th field in categories.db, which is the 'Meta Description'.

Hope that helps Smile (untested)

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: Mar 13, 2003, 3:51 AM
Quote Reply
Re: [Andy] 10$ via paypal for letting me know how to show the metaname in category listing In reply to
WTF is slice("|", $_); Wink
Quote Reply
Re: [Andy] 10$ via paypal for letting me know how to show the metaname in category listing In reply to
Okay... Where do I put this code??

I thourght meta_name just couldn't be used in the category listings only in category pages??
Quote Reply
Re: [Paul] 10$ via paypal for letting me know how to show the metaname in category listing In reply to
Whoops...that was supposed to be 'split'. Too much PHP coding Tongue (at least I didn't put 'explode'...lol) .I'll edit my above post....

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: [jorgenm] 10$ via paypal for letting me know how to show the metaname in category listing In reply to
That needs to go in site_html_category, if you are using site_html.pl. Just after;

Code:
my ($output);

As I said before, its not guaranteed to work :p

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] 10$ via paypal for letting me know how to show the metaname in category listing In reply to
Damn.. It won't build.. I'm getting a long error...

How come I can't just write $meta_name and it puts the meta name there??
Quote Reply
Re: [jorgenm] 10$ via paypal for letting me know how to show the metaname in category listing In reply to
This is how a line in categories db look like
9|T/Tawny_Roberts|Tawny Roberts||P|Porn||

I just want the "P" from the line to be shown.... Is that hard??
Quote Reply
WTF..... 20$ instead of 10$ for the right answer In reply to
20$ for the help, I really need this :-)
Quote Reply
Re: [jorgenm] 10$ via paypal for letting me know how to show the metaname in category listing In reply to
What the error? Send me a PM, and I'll give it a go for you. Its easier to debug when you can see whats happening Tongue

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] 10$ via paypal for letting me know how to show the metaname in category listing In reply to
PM..?? What's that, I'm kinda a newbee :-(

Sure, give me your e-mail and tell me what PM is??
Quote Reply
Re: [jorgenm] 10$ via paypal for letting me know how to show the metaname in category listing In reply to
Email: webmaster@linkssql.net

A PM is a Private Message Wink You can get to it by clicking on my name, and then clicking 'Send Private Message' in my profile :)

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: [jorgenm] 10$ via paypal for letting me know how to show the metaname in category listing In reply to
Wouldn't it be as simple as adding this red bit to this code in site_html_templates.pl?



sub site_html_link {
# --------------------------------------------------------
# This routine is used to display what a link should look
# like.

my %rec = @_;

# Set new and pop to either 1 or 0 for templates.
($rec{'isNew'} eq 'Yes') ? ($rec{'isNew'} = 1) : (delete $rec{'isNew'});
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});

return &load_template ('link.html', {
detailed_url => "$db_detailed_url/$rec{'ID'}$build_extension",

meta_name => $meta_name,
%rec,
%globals
});
}


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] 10$ via paypal for letting me know how to show the metaname in category listing In reply to
Its for a category....not link Wink He also said he's using site_html.pl, and not templates (although that would be a hell of a lot easier)

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
Found out for myself In reply to
Hehe... I found out for myself... Well, almost, I have to redo the entire datebase, but wtf..... Andy, you have the 10$ one of theese days... I'm not giving 20 since I found out for myself :-)
Quote Reply
Hi Andy In reply to
Hi... I've sent the 10 bucks... See ya
Quote Reply
Re: [jorgenm] Hi Andy In reply to
Can someone explain how this would be done using templates please, I really need the description and keywords on each category page?

thanks, grant
Quote Reply
I dont think you can In reply to
Actually, I never got it to work, I just took my keywords and exchanged them with the description (damn, what a work) in my database. Descriptions CAN be used everywhere, so thats how I got around it :-)