Support Forums - Classified Ads Script Osclass
Osclass theme support => Beta Osclass Theme => Topic started by: Jesus on September 08, 2019, 05:35:57 PM
-
The plugin works well when uploading and displaying the profile photos, the problem is when the user "changes" the photo, the "new" is uploaded but the old "deleted" photo is displayed (technically never deleted) and never shown the new profile picture, always the old one
-
@Jesus
As new image has same name as old one, you must clear browser cache to show newly uploaded image in user profile
-
@Jesus
As new image has same name as old one, you must clear browser cache to show newly uploaded image in user profile
I thought it was that, but no, I've tried it in different browsers and it doesn't work, the first photo the user uploaded is always shown
I speak of the profile picture that is seen in the items, the old one is always seen and never the new one (although it is seen in the user's dashboard) in the items only the old one is shown
-
I am not able to reproduce such problem
-
After days looking for what to do I found the problem, Cloudflare! :o
if I do not purge the cache, the profile photo changes "Fast" are not effective
What could I do to make Cloudflare not give me that problem with the plugin? ;D
-
@Jesus
That is good question on cloudfare, but when you are caching, then you are caching...
-
I got how to fix it! I leave it here for everyone to know ;D
in your account go to Cloudflare - Page Rules:
Create a Page Rule:
To write: https://yourweb.com/oc-content/plugins/profile_picture/images/* ("yourweb" change for your domain)
choose: Cache Level - Bypass
And save!
(I leave a capture of how it should be done)
-
Do this (and cloudflare):
Go to functions.php
line: 952
before
echo '<div class="wrap">';
echo '<div class="img">';
echo '<div class="box"><img src="' . bet_profile_picture(osc_logged_user_id(), 'large') . '"/>
after:
echo '<div class="wrap">';
$today = date("d-m-Y H:i:s");
echo '<div class="img">';
echo '<div class="box"><img src="' . bet_profile_picture(osc_logged_user_id(), 'large') . '?'.urlencode($today).'"/></div>
Photography is always updated without problems!
-
@Jesus
That is good question on cloudfare, but when you are caching, then you are caching...
Do you think my solution is good ?, it is for the users dashboard!, so they change the profile photo quickly and without problems using cloudflare
-
It could work ok