Search in support tickets

#708 – How display ad date

Posted in ‘Support’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Monday, 03 February 2020 15:01 CET
pat01
Hello

How can I display ads date on ads detail page?

There I want to show date of when the ad was created.

In configuration I find "Display date in date column", but this is for list of ads. I need it on ad detail page.

Thanks.

Best regards.
Custom Fields
Joomla Version
3.9.15
PHP Version
7.2
Product
AdsManager
Product Version
latest
Tuesday, 04 February 2020 13:45 CET
loic
Hello,

It the details page view
in adsclarity -> templates/adsclarity/html/com_adsmanager/details/default_jssor.php

or in components/com_adsmanager/views/details/tmpl/default.php if you don't use a template.

you need to add those line of code :
$date = $this->content->date_created;
$dateformat = JText::_('ADSMANAGER_DATE_FORMAT_LC');
		
		if ($date && (preg_match("/([0-9]{4})-([0-9]{2})-([0-9]{2})/",$date,$regs))) {
			$date = mktime( 0, 0, 0, $regs[2], $regs[3], $regs[1] );
			$date = $date > -1 ? strftime( $dateformat , $date) : '-';
		}


echo $date;


Best regards.
 
Wednesday, 05 February 2020 08:54 CET
pat01
Hello

Works fine, thanks.

Just a small note:

or in components/com_adsmanager/views/details/tmpl/default.php if you don't use a template.

It is file default_jssor.php instead of default.php

Best regards
Wednesday, 05 February 2020 14:16 CET
loic
Hello,

Yes I forgot to mention that if you are displaying the images is a slideshow then it is default_jssor, sorry about that.

I close that ticket.

Best regards.
 
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.