Gossamer Forum
Home : Products : Gossamer Links : Discussions :

howto add banner/textlink on the top off all category pages, based on a field in database?

Quote Reply
howto add banner/textlink on the top off all category pages, based on a field in database?
Hi all,
sorry for the dublicated subject, but is there a simple way to create banner/text link on the top of all categories?

Because I'm not a good programmer and I'm not sure what file to edit and what to create?

btw I'm using Links SQL 2.2.1


Thanks
Quote Reply
Re: [rage] howto add banner/textlink on the top off all category pages, based on a field in database? In reply to
The file you want to play with is category.html

Two ways to get to it:

In your admin console, click on Build, User Templates, then call it up from the dropdown list in the center of the page. Make your changes and hit Save, then rebuild your site.

Alternatively, you can download the file from cgi-bin/links/admin/templates/default, make the changes, then upload it to the local directory in default (this way, you'll always have a copy of the original template; i.e., don't upload the changed file over the original template in the default directory).
Quote Reply
Re: [agaffin] howto add banner/textlink on the top off all category pages, based on a field in database? In reply to
I know where is category.html
but what I can change? to set banners on the top of every catecory?

Thanks
Quote Reply
Re: [rage] howto add banner/textlink on the top off all category pages, based on a field in database? In reply to
How are you planning to show your banners? i.e. are you using any banner management software?
Do you have lots of different ones?
Are they the same for each category?
How are they named?

This is simple to do, but before we can walk you through it, you need to tell us a little more.....

Piers
Quote Reply
Re: [Piers1] howto add banner/textlink on the top off all category pages, based on a field in database? In reply to
I want to use it with phpadsnew
Quote Reply
Re: [rage] howto add banner/textlink on the top off all category pages, based on a field in database? In reply to
What follows assumes you're using Links SQL to generate .html rather than .php pages (sorry, I'm not using Links in .php mode, so I don't know how to integrate the two that way):

First thing is to look in phpadsnew for the "invocationcode" page for the zone or banners you want to display. After you set the parameters, you'll get some HTML code. Copy and paste that where you want it to show up in category.html, rebuild your site and, well, that's pretty much it.
Quote Reply
Re: [agaffin] howto add banner/textlink on the top off all category pages, based on a field in database? In reply to
Its also very worth while doing a search in the forums for Phpadsnew as there are many other posts about this software.

Cheers,

Piers
Quote Reply
Re: [Piers1] howto add banner/textlink on the top off all category pages, based on a field in database? In reply to
If someone knows a good free banner script like phpadsnew?
Also I'm using html files for Links.
Quote Reply
Re: [agaffin] howto add banner/textlink on the top off all category pages, based on a field in database? In reply to
Ok but How category.html knows what banner to use in used category?
I mean when I use "Social" category, and I want to show some social banner.

Thanks
Quote Reply
Re: [rage] howto add banner/textlink on the top off all category pages, based on a field in database? In reply to
Ah! This is how I did it; apologies if it's not the most efficient way:

Add a new field to your category database table with a name like ad_zone. If you know the names of your zones, you could even set this up as a dropdown list (you can do this at the bottom of the properties page for the field).

Edit each category page and use that new field to define the type of the ad on each page. For example, on your "social" pages, make sure to put "social" in the ad_zone field.

Now on category.html, do this:

Code:
<%if ad_zone eq 'social'%>
phpnewads call for social ads here
<%elsif ad_zone eq 'sports'%>
phpnewads call for sports ads here
<%else%>
phpnewads call for generic ads here
<%endif%>

Last edited by:

agaffin: Jan 1, 2005, 3:36 PM