Random order

Permalink Browser Info Environment
Hi, you think it is possible to add the possibility of random order in the car list (featured & exclusive)

Tanks

Type: Pre-Sale
Status: Archived
marcellocitzia
View Replies:
marcellocitzia replied on at Permalink Reply
marcellocitzia
Other feature:
When I update the car, the date (timestamp) is updated, I would like this to not happen or, better yet, I would like if possible, ceckbox to enable or disable the date (timestamp) update.

Other feature:
In car new/update, multiple selection images in one time

Best Regards
Marcello

p.s. to seehttp://www.delpianomotors.com
linuxoid replied on at Permalink Reply
linuxoid
Hi,
1. Re. random order, I think it may be better if I make a separate Random List block
2. Re. selecting multiple images, the last I knew was that concrete5 file manager doesn't allow multiple image selection, I can only do what the core provides
3. Re. the timestamp, you can disable it by changing line 740 in ab_car_sale/controllers/single_page/dashboard/car_sale/cars.php from:
$data['timestamp'] = time();

to:
$data['timestamp'] = $data['timestamp'] != '' ? $data['timestamp'] : time();

and add after line 290 in ab_car_sale/single_pages/dashboard/car_sale/cars.php:
<?php echo t('Car listing date:') . ' ' . $dh->formatDateTime($car->getTimestamp(), true, false, 'system'); ?></td>

the following:
<?php echo $form->hidden('timestamp', $dh->formatDateTime($car->getTimestamp(), true, false, 'system')); ?>
marcellocitzia replied on at Permalink Reply
marcellocitzia
this change return 1 gen 1970, 01:00
marcellocitzia replied on at Permalink Reply
marcellocitzia
Hello!
linuxoid replied on at Permalink Reply
linuxoid
Hello, please try the following:
Change line 740 in ab_car_sale/controllers/single_page/dashboard/car_sale/cars.php from:
$data['timestamp'] = time();

to:
$data['timestamp'] = $data['update_timestamp'] ? time() : $data['timestamp'];

and change line 290 in ab_car_sale/single_pages/dashboard/car_sale/cars.php from:
<?php echo t('Car listing date:') . ' ' . $dh->formatDateTime($car->getTimestamp(), true, false, 'system'); ?></td>

to:
<?php 
echo t('Car listing date:') . ' ' . $dh->formatDateTime($car->getTimestamp(), true, false, 'system');
echo $form->hidden('timestamp', $car->getTimestamp());
echo $form->checkbox('update_timestamp', 1, '1');
echo $form->label('update_timestamp', t('Update timestamp on saving'));
?>
linuxoid replied on at Permalink Reply
linuxoid
Hello.
Hope you're well.
I've finally made a random list block. I'll upload a new version shortly.

There are 4 settings:
1. Neither Exclusive nor Featured selected => all cars are shown
2. If only Exclusive selected => only Exclusive cars are shown
2. If only Featured selected => only Featured cars are shown
2. If both Exclusive and Featured selected => both Exclusive and Featured cars are shown

Cheers,
Alex

concrete5 Environment Information

8.5.1

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.2 Safari/605.1.15

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.