• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.

Random Home Cover/Background Image

SMP

💖 Chevereto Fan
Seen some of you request this... so here you go...

Note: This disables the upload functionality in dashboard.

1) Go to... app/themes/Peafowl/header.php

Find:

Code:
<style>
#home-cover {
    background-image: url(<?php echo CHV\get_system_image_url(CHV\Settings::get('homepage_cover_image')); ?>);
}
</style>

Replace it with:

Code:
<style>
#home-cover {
  background-image: url("<?php $rPic = rand(1,10); echo G\get_base_url('content/images/system/default/home_cover'); echo $rPic; ?>.jpg");
}
</style>

2) Change the number 10 to the no of images you wish to add.

3) Upload your images with below file names to content/images/system/default/ folder..

For 5 covers...
home_cover1.jpg
home_cover2.jpg
home_cover3.jpg
home_cover4.jpg
home_cover5.jpg
etc

N Joy
 
Last edited:
thank.

Hoping to achieve the display corresponding copyright in the lower right corner of each picture link function
 
Last edited:
This doesn't break anything...

As we are replacing the code which would be used to display the cover when you upload image from dashboard... it makes it null (i.e... even if u add an image from dashboard it doesn't show)
 
This doesn't break anything...

As we are replacing the code which would be used to display the cover when you upload image from dashboard... it makes it null (i.e... even if u add an image from dashboard it doesn't show)
 
Hey guys, thanks for the tip. I'd like to display a friend's pictures and so put the credits in the footer. Sadly I don't know which file to edit. Can anyone help? Thanks
 
Doesn't seem to work. Follow all the steps correctly and nothing shows up.

Edit: Nvm I got it to work.
 
Last edited:
I don't see how this code will conflict with 3.6.8. Make sure you don't have cache over your .php files.
 
I don't see how this code will conflict with 3.6.8. Make sure you don't have cache over your .php files.
I tried without php-cache, it still returns me with blank black page.

The current 3.6.8 code is:
Code:
<style>
#home-cover {
  background-image: url(<?php echo G\starts_with('http', CHV\getSetting('homepage_cover_image')) ? CHV\getSetting('homepage_cover_image') : CHV\get_system_image_url(CHV\getSetting('homepage_cover_image')); ?>);
}
</style>
Different with the one on the first post.
 
You don't need to find the exact code, just replace it with the new one. This mod is not official and if you don't know how to edit PHP then wait for the official implementation.
 
You don't need to find the exact code, just replace it with the new one. This mod is not official and if you don't know how to edit PHP then wait for the official implementation.
Ok, if I may suggest, please make it like this:

Chevereto will find random background from:

content/images/system/default/home_cover/*

Thank you!
 
sadly the 3.10.5 has code changed again. So I will wait for Rodolfo to add this feature if he now will be doing that.
 
Back
Top