• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space

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

Status
Not open for further replies.

Aljawaid

Chevereto Member
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.
 
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>
 
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.
 
My code:

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

[CODE lang="php" title="/app/themes/Peafowl/views/image.php" highlight="12"]<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>[/CODE]


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.
 
This does not seem to work anymore, does it?

My code:

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

[CODE lang="php" title="/app/themes/Peafowl/views/image.php" highlight="12"]<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>[/CODE]


Will produce:

View attachment 2588

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.
 
V4.0.0.beta.5 adds this.


Regardless of the beta, can you give me a hint why the code isn't working anymore?

Code:
<?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']);
}
?>
 
Status
Not open for further replies.
Back
Top