PGreca / pgsocial

Transform your forum in a Social Network
https://pgreca.it
GNU General Public License v2.0
3 stars 7 forks source link

Page Profile Photo Problem #33

Open phxinternational opened 4 years ago

phxinternational commented 4 years ago

Needs to be addressed. Images don't save on the page profile picture.

PGreca commented 4 years ago

Disable, delete data of extension, enable it

phxinternational commented 4 years ago

done, did not work, it does not save the file. then it dissapears.

PGreca commented 4 years ago

Version Php and version Phpbb?

Mightymax44 commented 4 years ago

If you remove this code || !file_exists($this->pg_social_path.'/images/upload/'.$cover) in line 172 controller/helper.php. It works

phxinternational commented 4 years ago

@Mightymax44 then it breaks the cover photo of the main profile. and the page cover photo. That line has nothing to do with page profile photo.

phxinternational commented 4 years ago

If you upload a page "PROFILE PHOTO" immediately you wil see the photo appear in the page profile photo circle... as soon as you refresh your page then the photo is gone. php 7.1 / phpbb 3.2.7. chat and all other features are working fine. but the page profile photo is still broken.

phxinternational commented 4 years ago

@Mightymax44 my apologies.. I had the wrong version of the file.. you are right! Yes it has fixed it. well done!

phxinternational commented 4 years ago

@PGreca you can label this fixed now.

Mightymax44 commented 4 years ago

@phxinternational the fix is not ok for registered user. i tested with an account register and same problem

phxinternational commented 4 years ago

@Mightymax44 I will test it shortly. are you having a problem with both? pages and profile or just pages?

Mightymax44 commented 4 years ago

both with registred account

phxinternational commented 4 years ago

@Mightymax44 I see what you mean. it seems to be ok on my admin, but when a registered user uploads it fails. well spotted.

Mightymax44 commented 4 years ago

@phxinternational I tested (registred user)with photo max 1920x2560 and it works great, probably width and height cause the problem.

Mightymax44 commented 4 years ago

With the last version master, the problem and avatar problem is still present (phpbb3.3 and php 7.3.12)

just remove "!" in line 173"if ($cover == '' || file_exists($this->pg_social_path.'upload/'.$cover))" and it's okay.

Mightymax44 commented 4 years ago

With the fix is not publish on the wall but if you change line 477 on helper.php $m => $message, by 'message'=> $message, it works great and publish on the wall

Leinad4Mind commented 3 years ago

In fact the correct would be this:

if ($cover == '' || empty($this->pg_social_path.'upload/'.$cover))

Leinad4Mind commented 3 years ago

About the message, that's not a good solution, but this is better:


public function pgMessage($message, $type = 'status')
    {
        $options = 0;
        $m = 'message';
        $uid = $bitfield = $allow_img = $allow_flash = $allow_quote = $allow_url = $allow_bbcode = '';

        if ($message)
        {
            $allow_bbcode = $this->config['pg_social_bbcode'];
            $allow_urls = $this->config['pg_social_url'];
            $allow_smilies = $this->config['pg_social_smilies'];
            if ($type == 'chat') 
            {
                $allow_bbcode = $this->config['pg_social_chat_message_bbcode_enabled'];
                $allow_urls = $this->config['pg_social_chat_message_url_enabled'];
                $allow_smilies = $this->config['pg_social_chat_smilies_enabled'];
                $m = 'chat_text';
            }
            generate_text_for_storage($message, $uid, $bitfield, $options, $allow_bbcode, $allow_urls, $allow_smilies, $allow_img, $allow_flash, $allow_quote, $allow_url);
            $message = str_replace("'", ''', $message);
        }

        return array(
            $m                  => $message,
            'bbcode_bitfield'   => $bitfield,
            'bbcode_uid'        => $uid,
            'bbcode_options'    => $options,
        );
    }```