1
deka87
Catads RSS
  • 2009/6/25 15:57

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


Hi. I use catads 1.4. I have to approve ads before they get published. However they are up in RSS right after being posted so all the ads submitted get published via RSS. How do I restrict RSS ppublishing to approved ads only? Thanks!
Mind anchors

2
trabis
Re: Catads RSS
  • 2009/6/25 19:52

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Step 1 - Identify the file that delivers the rss.
Step 2 - Identify the query that is made for getting rss items.
Step 3 - Add a condition for that query to get approved ads only, it could be something like published_date>0 or status=1. You need to investigate.

If you show us some code and/or what you have already done then you have higher chances of having someone doing it for you.

3
lmzan
Re: Catads RSS
  • 2010/2/28 18:51

  • lmzan

  • Not too shy to talk

  • Posts: 104

  • Since: 2005/6/21


Hi deka87

Any solution for this? I'm with the same problem and could not sort it out.


4
Peekay
Re: Catads RSS
  • 2010/3/21 14:42

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


This is a fix for the backend.php that shipped with 1.52.

catads/backend.php
Line 28
Replace:

if (isset($_GET['id']) ){
         
$criteria = new Criteria('a.cat_id'$_GET['id']) ;
          
$channel_category .= " > " xoops_utf8_encode(htmlspecialchars($myts->displayTarea(getTitleById($_GET['id']), ENT_QUOTES)));
}

else{
$criteria null;}


with:

if (isset($_GET['id']) ){

         
// pk - bugfix - for category RSS - omit waiting, suspended, un-published and expired.

         
$criteria = new CriteriaCompo(new Criteria('waiting''0'));
         
$criteria->add(new Criteria('suspend'0,'='));
         
$criteria->add(new Criteria('published'time(),'<'));
         
$criteria->add(new Criteria('expired'time(),'>'));
         
$criteria->add(new Criteria('a.cat_id'$_GET['id']));

         
$channel_category .= " > " xoops_utf8_encode(htmlspecialchars($myts->displayTarea(getTitleById($_GET['id']), ENT_QUOTES)));
}

else {
         
// pk - bugfix - omit waiting, suspended, un-published and expired.

         
$criteria = new CriteriaCompo(new Criteria('waiting''0'));
         
$criteria->add(new Criteria('suspend'0,'='));
         
$criteria->add(new Criteria('published'time(),'<'));
         
$criteria->add(new Criteria('expired'time(),'>'));
}


Should work for 1.4 too, but my version of 1.4 didn't have a backend.php.

5
deka87
Re: Catads RSS
  • 2010/3/21 18:19

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


i have taken the backend.php from a later version. i've tried it and i guess it works! peekay now i owe you too much beer im afraid your liver won't handle it. if you pm me your moneybookers.com account i'll send you a little $thank you$ thanks so much!

6
Peekay
Re: Catads RSS
  • 2010/3/21 20:52

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


I'm glad it works. No payment required. Your thanks is reward enough.

My liver is grateful too!

Login

Who's Online

309 user(s) are online (209 user(s) are browsing Support Forums)


Members: 0


Guests: 309


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits