Gossamer Forum
Home : Products : Gossamer Links : Discussions :

How can I do an "if" statement with AdvertPRO?

Quote Reply
How can I do an "if" statement with AdvertPRO?
Hello, my Links SQL site has over 750 categories in it. I would like to be able to use a banner within my category template, but only on those cats & subcats where I have assigned relationships using the plugin. If I put this call <%Plugins::AdvertPRO::display_category_region('Which_Region')%> in the template it works great, but AdvertPro generates an error on the pages where I haven't assigned a region to an LSQL category. I don't want to have to assign 750 categories at present, but I would like to have the banners run on those that I have already assigned.

Can anyone think of a way I could use an "if" statement that would call <%Plugins::AdvertPRO::display_category_region('Which_Region')%> only if the relationship has been set through the plugin?

Thanks,

Bryce
Quote Reply
Re: [Demolitioncrew] How can I do an "if" statement with AdvertPRO? In reply to
Can't you set a default banner to show with AdvertPro?

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] How can I do an "if" statement with AdvertPRO? In reply to
Hello Andy,

I sure don't see anything like that. The only thing that looks close is that they have a "panic campaign" which takes over in the event a campaign that is running expires.

I could create a generic campaign with nonspecific banners in it that would show, but it looks like I would still have to go through all 700 categories that I have and assign them to that generic campaign one by one. That would keep from having the error show up where a banner should appear, but it would still require me going through and setting all of the cats to that generic campaign, and it would look pretty lame having the same banner appear over and over, IMHO. I would rather have LSQL display a banner if I have gotten around to creating it and ignore the call, if I haven't.

Thanks,

Bryce
Quote Reply
Re: [Demolitioncrew] How can I do an "if" statement with AdvertPRO? In reply to
Shame you didn't get AdCycle, as I beleive that offers the feature you need...

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] How can I do an "if" statement with AdvertPRO? In reply to
And it would have been $500 cheaper, no less :(
Quote Reply
Re: [Demolitioncrew] How can I do an "if" statement with AdvertPRO? In reply to
I use AdvertPro, but not the plugin, however if it is similar you should be able to assign a default banner of 1x1 pixels so that if there is no actual banner to call (relationship with a category) the 1x1 pixel should appear in its place ... I think that would solve your problem.

All the best
Shaun
Quote Reply
Re: [qango] How can I do an "if" statement with AdvertPRO? In reply to
Hello,

I don't think I quite understand. Would I assign this default banner somewhere in AdvertPro? I don't see anyway of doing it through the actual LSQL plugin.

Thanks,

Bryce
Quote Reply
Re: [Demolitioncrew] How can I do an "if" statement with AdvertPRO? In reply to
I don't use the plugin myself, but looking at the line in your previous post I assume a region is assigned by the plugin when LSQL makes the call for a banner.
Code:
<%Plugins::AdvertPRO::display_category_region('Which_Region')%>
What you'd do is setup a new default region within AdvertPro and set the 'panic' banner to a 1x1 pixel image, maybe call it nobanner or something.

When LSQL calls the plugin have it check the value of Which_Region and if there is no value push the default region name into it, i.e.; nobanner

Then it will either display a banner (found a value in Which_Region), or else the default nobanner region would be called and display the 1x1 pixel banner.

I'm also assuming you'd need to change the plugin a little to 'check' and insert the default name. Maybe something along the lines of:
Code:
if $Which_Region eq '' {$Which_Region = "nobanner"};
... but since I don't have the plugin I'm not sure what the variables are called or where you'd put the 'check'.

Does this make any sense?

I realise that you'd really wanted a method of not using the plugin if no region was assigned, but this way you'd have the advantage of being able to update your 'default' whenever you wanted, maybe you might decide to run some PPC ads in the default spaces later and with this solution you'd just create a new banner to run in the nobanner region Smile

All the best
Shaun

Last edited by:

qango: Oct 10, 2002, 1:16 AM