Support Forums - Classified Ads Script Osclass

Osclass theme support => Beta Osclass Theme => Topic started by: Jesus on September 08, 2019, 05:35:57 PM

Title: Error with profile picture plugin
Post 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
Title: Re: Error with profile picture plugin
Post by: MB Themes on September 09, 2019, 01:44:30 PM
@Jesus
As new image has same name as old one, you must clear browser cache to show newly uploaded image in user profile
Title: Re: Error with profile picture plugin
Post by: Jesus on September 09, 2019, 02:20:54 PM
@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
Title: Re: Error with profile picture plugin
Post by: MB Themes on September 09, 2019, 02:56:14 PM
I am not able to reproduce such problem
Title: Re: Error with profile picture plugin
Post by: Jesus on September 13, 2019, 12:42:49 AM
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



Title: Re: Error with profile picture plugin
Post by: MB Themes on September 13, 2019, 07:47:04 AM
@Jesus
That is good question on cloudfare, but when you are caching, then you are caching...
Title: Re: Error with profile picture plugin
Post by: Jesus on September 13, 2019, 10:47:35 PM
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)
Title: Re: Error with profile picture plugin
Post by: Jesus on September 13, 2019, 11:50:16 PM
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!
Title: Re: Error with profile picture plugin
Post by: Jesus on September 13, 2019, 11:56:58 PM
@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
Title: Re: Error with profile picture plugin
Post by: MB Themes on September 14, 2019, 01:36:21 PM
It could work ok