Life Span of Classifieds Ads.

Hello,

For the Classifieds section of my web site, I would like to make it so advertisements never expire. Is there a way to do this?

Thank you.

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 2 Nov 2008

Hi there.

Open your /inc/classes/BxDolClassifieds.php file

find all

AND DATE_ADD(`ClassifiedsAdvertisements`.`DateTime` , INTERVAL `ClassifiedsAdvertisements`.`LifeTime` DAY) > NOW()

and remove them.

after it find all

AND DATE_ADD(`ClassifiedsAdvertisements`.`DateTime`, INTERVAL `ClassifiedsAdvertisements`.`LifeTime` DAY) > NOW()

and delete it.

next - find all

DATE_ADD(`ClassifiedsAdvertisements`.`DateTime`, INTERVAL `ClassifiedsAdvertisements`.`LifeTime` DAY) > NOW()

and change it to 1

And then find

AND DATE_ADD( `ClassifiedsAdvertisements`.`DateTime` , INTERVAL `ClassifiedsAdvertisements`.`LifeTime` DAY ) > NOW( )

It should help.

Regards

Artur

Quote · 3 Nov 2008

Hello,

Thanks for the reply, but when I do that, I get database errors. Am I doing something wrong?

Thank you.

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 3 Nov 2008

I have edited answer.

Quote · 3 Nov 2008

Thanks, it's working now. Laughing

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 3 Nov 2008

Anyone on this please?

Quote · 4 Apr 2009

Change what to "1"? I am looking to keep my ads in indefinitely, but these instructions sound unclear to me.

-

~~L

-

Hi there.

Open your /inc/classes/BxDolClassifieds.php file

find all

AND DATE_ADD(`ClassifiedsAdvertisements`.`DateTime` , INTERVAL `ClassifiedsAdvertisements`.`LifeTime` DAY) > NOW()

and remove them.

after it find all

AND DATE_ADD(`ClassifiedsAdvertisements`.`DateTime`, INTERVAL `ClassifiedsAdvertisements`.`LifeTime` DAY) > NOW()

and delete it.

next - find all

DATE_ADD(`ClassifiedsAdvertisements`.`DateTime`, INTERVAL `ClassifiedsAdvertisements`.`LifeTime` DAY) > NOW()

and change it to 1

And then find

AND DATE_ADD( `ClassifiedsAdvertisements`.`DateTime` , INTERVAL `ClassifiedsAdvertisements`.`LifeTime` DAY ) > NOW( )

It should help.

Regards

Artur

Quote · 4 Apr 2009

I just need to know exactly how to do this....I have changed it in the admin, but when folks post their ad it still says for 30 days only. That would be ok if I could get them to last 365 days initially. Help please.

-

~~ L

Quote · 4 Apr 2009

 

I just need to know exactly how to do this....I have changed it in the admin, but when folks post their ad it still says for 30 days only. That would be ok if I could get them to last 365 days initially. Help please.

-

~~ L

 

Worked fine for me..

 

Check your Advanced Settings again,

Used you Save Changes button

(not Save button)

 

Post New Ads will use your new setting 365 days

 

Ads posted before you edit setting, can you change from DB

(Table ClassifiedsAdvertisements and LifeTime)

Quote · 4 Apr 2009

Thanks for the response okweb!

-

So I just change the 30 to 365 or whatever number of days? (I am looking at it now.)

-

~~ L

I just need to know exactly how to do this....I have changed it in the admin, but when folks post their ad it still says for 30 days only. That would be ok if I could get them to last 365 days initially. Help please.

-

~~ L

Worked fine for me..

Check your Advanced Settings again,

Used you Save Changes button

(not Save button)

Post New Ads will use your new setting 365 days

Ads posted before you edit setting, can you change from DB

(Table ClassifiedsAdvertisements and LifeTime)

Quote · 4 Apr 2009

I changed the 30 to 365 by clicking correct button. Thx.

-

But I went into database and changed each individual ad Lifespan to 365 and they don't appear. I even changed the date and they don't appear....? Cleared cache etc.

Quote · 4 Apr 2009

 

I changed the 30 to 365 by clicking correct button. Thx.

-

But I went into database and changed each individual ad Lifespan to 365 and they don't appear. I even changed the date and they don't appear....? Cleared cache etc.

 

If you changed DateTime in Table ClassifiedsAdvertisements it will not work,

date coming from table ClassifiedsAdvertisementsMedia.

 

Change How long can Classifieds live (days) form 365 to 3650

Ads don't expire before after about 10 years, no need to edit it after 365 daysSmile

(if users do not select anything lower, for example 1 day)

Quote · 4 Apr 2009

If you change How long can Classifieds live (days) to 3650 days,
you'll get a pretty long drop down box and the smallest number of days users can choose are still 1 days.


The code below shows how you can change this,
smallest days ads are shown is 730 days before it disappears.(if users chooses smallest number of days)
You will now have a drop down box with 4 options.


Edit inc/classes/BxDolClassifieds.php

 

 

Find ~line 341:

 

$sStepOptions = '';
  for ($i=5; $i<$iMaxLt; $i+=5) {
        $sStepOptions .= "<option value=\"{$i}\"";
        if ($iLifeTime>0 AND $i==$iLifeTime) $sStepOptions .= "selected";
        $sStepOptions .= ">{$i}</option>";
  }
  $sMinStep = '<option value="1">1</option>';
  $sMaxedSelected = ($iLifeTime==$iMaxLt OR $iLifeTime==NULL) ? "selected" : "";
  $sMaxedStep = "<option value=\"{$iMaxLt}\" {$sMaxedSelected}>{$iMaxLt}</option>";
  $sMaxedString = ($iMaxLt) ? _t('_WARNING_MAX_LIVE_DAYS', $iMaxLt) : "db sql error";

 
Change to:

 
$sStepOptions = '';
  for ($i=1460; $i<$iMaxLt; $i+=1460) {
        $sStepOptions .= "<option value=\"{$i}\"";
        if ($iLifeTime>0 AND $i==$iLifeTime) $sStepOptions .= "selected";
        $sStepOptions .= ">{$i}</option>";
  }
  $sMinStep = '<option value="730">730</option>';
  $sMaxedSelected = ($iLifeTime==$iMaxLt OR $iLifeTime==NULL) ? "selected" : "";
  $sMaxedStep = "<option value=\"{$iMaxLt}\" {$sMaxedSelected}>{$iMaxLt}</option>";
  $sMaxedString = ($iMaxLt) ? _t('_WARNING_MAX_LIVE_DAYS', $iMaxLt) : "db sql error";

Quote · 4 Apr 2009

I know this is an old post and i apologise for being a pain in the ....

 

But, I cannot find the right file to change and im assuming its because of the new updates etc.

 

I just need to know where the file is now so i can change it.

 

Thank you

MeMe

Quote · 29 Aug 2012

 

I know this is an old post and i apologise for being a pain in the ....

 

But, I cannot find the right file to change and im assuming its because of the new updates etc.

 

I just need to know where the file is now so i can change it.

 

Thank you

MeMe

 

Hi you can try this, will change Classifieds live (days) to 3650 days.
You will now have a drop down box with 10 options, user can choose from 365days/1 year to 3650 days/10 years. Default will now be 3650 days.

1)
Table bx_ads_main edit LifeTime from 30 to 3650


2)
Open file modules/boonex/ads/classes/BxAdsModule.php


a)
find this code

    $sNewAdC = _t('_Add Post');
    $sDaysC = _t('_days');
    $sMaxedString = _t('_bx_ads_Warn_max_live_days', 30);

edit last line to

$sMaxedString = _t('_bx_ads_Warn_max_live_days', 3650);


b)
find this code

    // Life time values
    $iMaxLt = (int)getParam('bx_ads_max_live_days');
        $aLifeTimeValues = array();
        for ($i=5; $i<=$iMaxLt; $i+=5) {
        $aLifeTimeValues[] = array('key' => $i, 'value' => $i);
    }


edit to

    // Life time values
        $iMaxLt = (int)getParam('bx_ads_max_live_days');
        $aLifeTimeValues = array();
        for ($i=365; $i<=$iMaxLt; $i+=365) {
            $aLifeTimeValues[] = array('key' => $i, 'value' => $i);
        }


c)
find this code

    'LifeTime' => array(
        'type' => 'select',
        'name' => 'LifeTime',
        'caption' => _t('_bx_ads_Life_Time') . " ({$sDaysC})",
        'info' => $sMaxedString,
        'value' => 30,
        'values' => $aLifeTimeValues,
        'required' => true,
        'checker' => array (
            'func' => 'length',
            'params' => array(1,2),
            'error' => _t('_Error Occured'),
        ),
        'db' => array (
            'pass' => 'Int',
        ),
    ),


edit to

    'LifeTime' => array(
        'type' => 'select',
        'name' => 'LifeTime',
        'caption' => _t('_bx_ads_Life_Time') . " ({$sDaysC})",
        'info' => $sMaxedString,
        'value' => 3650,
        'values' => $aLifeTimeValues,
        'required' => true,
        'checker' => array (
            'func' => 'length',
            'params' => array(1,4),
            'error' => _t('_Error Occured'),
        ),
        'db' => array (
            'pass' => 'Int',
        ),
    ),

don't forget to edit params from 2 to 4 here, else you will have an error and form will not work


3)
Go to Modules -> Ads -> Settings and edit setting bellow from 30 to 3650

How long can Classifieds live (days): 3650


4)
Done...

Quote · 2 Sep 2012

Thank you.

 

I will check it out.

Quote · 5 Sep 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.