Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Creating list of isPaidLink outside of a category

Quote Reply
Creating list of isPaidLink outside of a category
I'm hoping someone can help me again, I posted a message a few months ago enquiring about customizing the way paid links are displayed. We managed to get this to work on a category level by doing a simple check for the isPaidLink flag and then running a loop of links to display at the top of that category.

I am having some trouble with getting a list/pool of paid ads from all categories to display on the home/landing page of the classifieds section.

We have set up something similar before in that we have a premium membership function running and ads that are submitted by these premium members are displayed on the home page from the following query:

Code:
<%RC::Classifieds::query(prefix => "newads", mh => 5, paid_status => "paid","Links.Image-gt" => "a", 'sb', 'Add_Date', 'so', 'DESC' )%>
Which then goes into a link loop.

Now we're attempting to do something very similar, but instead of premium members, we want to display a list of the 3 most recent paid links, though can't seem to get it right. I am more a content manager and admin than I am anything close to a developer so my knowledge is very limited.

This is what we're currently attempting to us to fetch the paid listings to no avail:

Code:
<%RC::Classifieds::query(prefix => "featured", mh => 3, isPaidLink => "1", "Links.Image-gt" => "a", 'sb', 'Add_Date', 'so', 'DESC' )%>

<%loop featured_loop%>

<%include link_featured.html%>

<%endloop%>
At present it grabs all the featured ads, paid or unpaid, so that check for the 'isPaidLink' seems to not work.

Any assistance in helping to get only the paid links from all categories to show up on the page would be appreciated.

Attached is an image of what the home/landing page currently looks like with the premium members ads displayed above the 'paid' links, and then the current links that are being brought through that are supposed to be isPaidLinks but are actually not.
Quote Reply
Re: [meso] Creating list of isPaidLink outside of a category In reply to
Hi,

If you want to search for paid links, you need the ExpiryDate as a condition:

Code:
ExpiryDate < 2147483647 AND ExpiryDate > CORE::time()

Basically, if a link has 2147483647 as its expiry date - that means its free (so we want to look for LESS THAN 2147483647). Then, just to make sure its an active link you would need to check its > CORE::time() (the server time)

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!
Quote Reply
Re: [Andy] Creating list of isPaidLink outside of a category In reply to
Hi,

Thanks for your response Andy. Adding that phrase to the query being used resulted in no results being displayed.

Is there a reason why one has to use the expiry date as opposed to the isPaidLink? The payment system is enabled and we have a couple of paid ads already up so we can trigger off the isPaidLink, like we're doing successfully on the category page.

Is it possible that this value simply doesn't exist on the classifieds homepage template and only does on the detailed and category pages? Or shouldn't this be the case? I've created a dump on the home page and couldn't find any mention of the isPaidLink.

For example on the classifieds category we use a simple "<%if isPaidLink%> to check for the paid ads, this same statement doesn't seem to work on the home page level.

Thanks
Cheers
Quote Reply
Re: [meso] Creating list of isPaidLink outside of a category In reply to
Hi,

Its hard to know why its giving no results without seeing a query thats being run ;) RC::Classifieds I'm guessing is a 3rd part plugin by someone else.

The reason isPaidLink works in the template, is cos you use this before putting it into the loop:

Code:
$link = Links::SiteHTML::tags('link', $link);

That gets the review loop, isNew/isCool/isPoipular/isPaidLink/isLinkOwner stuff all filled out correctly. isPaidLink will NOT work if you try and do it in the SQL query (as its not a field)

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] Creating list of isPaidLink outside of a category In reply to
Thanks for your help Andy, we managed to get what we wanted from the information you provided.