Is there any way to show when the image will delete?

Aljawaid

Network license
License owner
Hello, is there any way to show/display when the posted image will delete/expire?

I am trying the free version out before getting the license but I need to show "This image will expire in x days" based on the expiry days which were set during uploading.
 

Aljawaid

Network license
License owner
Thanks for the reply. Is it an option after upgrading to the paid license or does it still have to be manually coded?

A setting in the dashboard or I'm guessing something like this...
HTML:
<a>This image will expire in <?php echo CHV\get_safe_post()['image_expiration'] : get_user()['image_expiration']);?> days</a>
 

Rodolfo

Chevereto Developer
Chevereto Staff
Like I said, by editing the theme you can show that expiration date.

I never mentioned a dashboard setting because there's no setting for that at this time.
 

Aljawaid

Network license
License owner
My code:

After line 78 in /app/themes/Peafowl/views/image.php, add:

/app/themes/Peafowl/views/image.php:
<div class="breadcrum-item">
                    <?php
                            if (get_image()['expiration_date_gmt']) {
                                $date1=date_create(date());
                                $date2=date_create(get_image()['expiration_date_gmt']);
                                $diff=date_diff($date1,$date2);
                                echo $diff->format("This picture will expire in %a days");
                               
                                // echo (get_image()['expiration_date_gmt']);
                            }
                            ?>
                            <a href="https://domain.co.uk/chevereto/page/faq" rel="tooltip" data-tiptip="top" title="Find out more about our live rolling feed"> <small>Why?</small></a>
                </div>

Will produce:

2019-12-12 22_02_23-Window.png

Under the image, in the image view. The 'why?' text (line 12 of code) links to a FAQ page that I have created for my needs.

Hope that helps.
 
Top