Page 3 of 5

Re: [DEV] Upload Image

Posted: Mon Jan 05, 2015 10:37 am
by John P
Thanks Holger, merged

Re: [DEV] Upload Image

Posted: Wed Jan 07, 2015 12:31 am
by spaceace
just for anyone that wants to know...

John P did a great job trying to figure out the issue i had with this extension. but ultimately, i can not use it as i would have to change my server configuration as this extension works entirely separate from phpBB and runs solely from the server side php. the script is not able to set file permissions to what is required to view the images. we worked on this without the SEO extension being active so it might not be an issue for others ;)

even though i can't use it, it's a great extension :D

Re: [DEV] Upload Image

Posted: Wed Jan 07, 2015 7:42 pm
by John P
It is said in a wrong way, the extension uses phpbb function for uploading but the user running php at his website isn't his webserver and therefore the webserver doesn't have access to the uploaded images and can't serve them. Beside of that is chmod the image file not possible by his php user.

Re: [DEV] Upload Image

Posted: Wed Jan 07, 2015 8:41 pm
by spaceace
i have a small php script to chmod all the files and recursive directories within and it works like a charm :D

Code: Select all

<?

  header('Content-Type: text/plain');

  /**
  * Changes permissions on files and directories within $dir and dives recursively
  * into found subdirectories.
  */
  function chmod_r($dir, $dirPermissions, $filePermissions) {
      $dp = opendir($dir);
       while($file = readdir($dp)) {
         if (($file == ".") || ($file == ".."))
            continue;

        $fullPath = $dir."/".$file;

         if(is_dir($fullPath)) {
            echo('DIR:' . $fullPath . "\n");
            chmod($fullPath, $dirPermissions);
            chmod_r($fullPath, $dirPermissions, $filePermissions);
         } else {
            echo('FILE:' . $fullPath . "\n");
            chmod($fullPath, $filePermissions);
         }

       }
     closedir($dp);
  }

  chmod_r(dirname(__FILE__), 0755, 0755);
?>
it changes any and all files in the directory to the set permissions. my fix is to upload the files using the extension, then run the script... simple solution to my problem :D

Re: [DEV] Upload Image

Posted: Wed Jan 07, 2015 8:55 pm
by FoFa
There is a simple way to chmod every image when uploading it. I did it on my board will post when possible.

PR

Posted: Wed Jan 14, 2015 5:00 am
by Mauron
PR for Italian translation.

Re: [DEV] Upload Image

Posted: Sun Jan 18, 2015 2:33 am
by spaceace
ForumsFaciles wrote:There is a simple way to chmod every image when uploading it. I did it on my board will post when possible.
still very interested in seeing how you've done it ;)

Re: [DEV] Upload Image

Posted: Sun Jan 18, 2015 11:17 am
by FoFa
Sorry, forgot it...

Open: ext/forumhulp/uploadimage/controller/admin_controller.php

Find:

Code: Select all

        $download_url = $upload_dir . $file->realname; 
REPLACE with:

Code: Select all

        $download_url = chmod($upload_dir . $file->realname, 0775); 
That's all.

Re: [DEV] Upload Image

Posted: Sun Jan 18, 2015 1:19 pm
by spaceace
ForumsFaciles wrote:Sorry, forgot it...

Open: ext/forumhulp/uploadimage/controller/admin_controller.php

Find:

Code: Select all

        $download_url = $upload_dir . $file->realname;
REPLACE with:

Code: Select all

        $download_url = chmod($upload_dir . $file->realname, 0775);
That's all.
works perfect. thank you :D

Re: [DEV] Upload Image

Posted: Wed Feb 25, 2015 3:23 am
by aurquiel
Debug on

Code: Select all

[phpBB Debug] PHP Notice: in file [ROOT]/ext/forumhulp/uploadimage/controller/admin_controller.php on line 205: Undefined index: file
[phpBB Debug] PHP Notice: in file [ROOT]/ext/forumhulp/uploadimage/controller/admin_controller.php on line 205: Undefined index: file
[phpBB Debug] PHP Notice: in file [ROOT]/ext/forumhulp/uploadimage/controller/admin_controller.php on line 205: Undefined index: file
[phpBB Debug] PHP Notice: in file [ROOT]/ext/forumhulp/uploadimage/controller/admin_controller.php on line 205: Undefined index: file
[phpBB Debug] PHP Notice: in file [ROOT]/ext/forumhulp/uploadimage/controller/admin_controller.php on line 205: Undefined index: file
[phpBB Debug] PHP Notice: in file [ROOT]/ext/forumhulp/uploadimage/controller/admin_controller.php on line 205: Undefined index: file
[phpBB Debug] PHP Notice: in file [ROOT]/ext/forumhulp/uploadimage/controller/admin_controller.php on line 205: Undefined index: file
[phpBB Debug] PHP Notice: in file [ROOT]/ext/forumhulp/uploadimage/controller/admin_controller.php on line 205: Undefined index: file

Re: [DEV] Upload Image

Posted: Wed Feb 25, 2015 11:45 am
by spaceace
aurquiel wrote:Debug on

Code: Select all

[phpBB Debug] PHP Notice: in file [ROOT]/ext/forumhulp/uploadimage/controller/admin_controller.php on line 205: Undefined index: file
[phpBB Debug] PHP Notice: in file [ROOT]/ext/forumhulp/uploadimage/controller/admin_controller.php on line 205: Undefined index: file
[phpBB Debug] PHP Notice: in file [ROOT]/ext/forumhulp/uploadimage/controller/admin_controller.php on line 205: Undefined index: file
[phpBB Debug] PHP Notice: in file [ROOT]/ext/forumhulp/uploadimage/controller/admin_controller.php on line 205: Undefined index: file
[phpBB Debug] PHP Notice: in file [ROOT]/ext/forumhulp/uploadimage/controller/admin_controller.php on line 205: Undefined index: file
[phpBB Debug] PHP Notice: in file [ROOT]/ext/forumhulp/uploadimage/controller/admin_controller.php on line 205: Undefined index: file
[phpBB Debug] PHP Notice: in file [ROOT]/ext/forumhulp/uploadimage/controller/admin_controller.php on line 205: Undefined index: file
[phpBB Debug] PHP Notice: in file [ROOT]/ext/forumhulp/uploadimage/controller/admin_controller.php on line 205: Undefined index: file
i fixed that one when i first installed it and forgot about it :lol:

open forumhulp/uploadimage/controller/admin_controller.php
find

Code: Select all

'DELLURL'	=> $this->u_action . '&action=delete&image_id=' . rawurldecode($image_list[$i]['file'])
inline find

Code: Select all

'file'
replace with

Code: Select all

'filename'
that fixed it for me ;)

Re: [DEV] Upload Image

Posted: Sat Aug 08, 2015 7:02 pm
by John P
Just released RC7
Sorting added

Re: [DEV] Upload Image

Posted: Tue Jan 19, 2016 12:01 pm
by Fast_Eddie
I have not seen anyone in this topic with this issue, so here goes. I downloaded the extension through the d/l link. UN-zipped it, made the needed directory's and uploaded. When i went to enable the extension it bombs out saying it's missing the helper.php and can not enable. It gives a link to the file on gethub. But no way to d/l it. I can copy and paste into a new file but i have no idea how to save it php format. I tried to d/l the whole zip file again. And once again the file helper.php is not included in zip file to d/l

Re: [DEV] Upload Image

Posted: Tue Jan 19, 2016 6:46 pm
by dmzx
Fast_Eddie wrote:I have not seen anyone in this topic with this issue, so here goes. I downloaded the extension through the d/l link. UN-zipped it, made the needed directory's and uploaded. When i went to enable the extension it bombs out saying it's missing the helper.php and can not enable. It gives a link to the file on gethub. But no way to d/l it. I can copy and paste into a new file but i have no idea how to save it php format. I tried to d/l the whole zip file again. And once again the file helper.php is not included in zip file to d/l
https://github.com/ForumHulp/helper and click on download zip.
Install it as en extension in forumhulp/helper

Re: [DEV] Upload Image

Posted: Tue Jan 19, 2016 10:37 pm
by spaceace
dmzx wrote:https://github.com/ForumHulp/helper and click on download zip.
Install it as en extension in forumhulp/helper
so you have to install an extra extension to use this one now?

edit: so why not just include it with the extensions?