Login or create new account.

By registering on joomprod.com, you will have immediate access to all our free products and to the public side of our support forum.

Enjoy our subscriptions.

Each of our subscriptions allow you to enjoy the private side of the support forum and all the update of our products for a period ranging from 3 months to 1 year.

Payment And immediate download.

After subscribing to one of our subscription, the products are immediately downloadable.

Login

Or Register
Accueil / forum / Public Forum / Main Forum / Change sourcefield for calculating the expiration

Support Availability Because we must sleep sometimes

Working days: Monday to Friday.
Reply time: Depending on the complexity of your support issue it's usually between a few hours to 48 hours.

Support is only guaranteed to paid subscribers

AdsManager - End of life

It is with great regrets that we have chosen to end the developpement of Adsmanager and its other associated components.

AdsManager is born 10 years ago and, as of today, the number of new subscriptions and downloads have fallen and we cannot maintain the component anymore.

All active subscribers will be able to continue enjoying support until the end of their subscription.

The components will be free and no support will be provided anymore for the other users.

×

Notice

The forum is in read only mode.

× OLD Forum post could be checked here : forum.joomprod.com

Change sourcefield for calculating the expiration

More
11 years 6 months ago - 11 years 6 months ago #1465 by emperor_nld
I've got a lot great help in solving issues to customize adsmanger to my needs :)

I know have a big challenge.
I want a different (date) sourcefield for calculating the expiration date.
In a new ad, a customer can fill in a specific date (not the publication date).
The ad has to be deleted x days after the date filled in the specific date field.

I've tried to edit the contents.php in the backend\tables part but with no result
on rule 323 I changed:
$this->expiration_date = date("Y-m-d H:i:s",time()+($delta*24*3600));
in
$this->expiration_date = $this->ad_datumladen +($delta*24*3600);
where ad_datumladen the specific datefield is.

Somebody any idea?

Thx a lot
Ronald
Last edit: 11 years 6 months ago by emperor_nld. Reason: forgot some text
More
11 years 6 months ago - 11 years 6 months ago #1466 by Ads4ever
Hello,

try
$str = $this->ad_datumladen   ;
$timestamp = strtotime($str);
$this->expiration_date = date('Y-m-d', $timestamp+($delta*24*3600));

Founder of ITechnoDev
Last edit: 11 years 6 months ago by Ads4ever.
More
11 years 6 months ago #1468 by emperor_nld
Replied by emperor_nld on topic Change sourcefield for calculating the expiration
Hello thx for the help, but it didn't worked out.
I changed the way you suggested. Location: backend > tables\contents.php
$app = JFactory::getApplication();
		if (($app->isAdmin() == false)&&($this->id == 0)) {
			$this->date_created = date("Y-m-d H:i:s");
            $delta = $conf->ad_duration;
			//$this->expiration_date = date("Y-m-d H:i:s",time()+($delta*24*3600));   //original rule
			$str = $this->ad_datumladen ;
			$timestamp = strtotime($str);
			$this->expiration_date = date('Y-m-d', $timestamp+($delta*24*3600)); // changed on 09-10-2013.
			if ($conf->auto_publish == 1)
				$this->published = 1;
			else
				$this->published = 0;
		}

Maybe more suggestions?

Thx
Ronald
More
11 years 6 months ago #1512 by tompap
For a custom code like this. you can contact us for a quote by email (this will be extra job)
More
11 years 6 months ago #1606 by emperor_nld
Replied by emperor_nld on topic Change sourcefield for calculating the expiration
I sent you a PM
Moderators: perry
Time to create page: 0.185 seconds
Powered by Kunena Forum