Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-04-17 18:14:08

grundgesetz
Plugin Author
From: Germany
Registered: 2009-04-17
Posts: 24

jbx_multiple_image_upload

Hi Guys,

for my first plugin I tried to alter Dirk Steins fpx_image_import to use it for Batch Uploading.

I know there already is a plugin for Batch Uploading, but I was not willing to pay for it, although it would guarantee me a high quality plugin.

So, here it is. As I don´t have time to maintain the plugin for a month or two, I thought I would first post it here.

jbx_multiple_image_upload v0.4
(Zip)
Req. Textpattern 4.0.7+

UPDATE for Textpattern 4.5.5

What do you think? I know I´m not an Expert. So please feel free to help me.

Greetings,
Jonas.

{Edited title to make the topic more visible. – Uli}

Last edited by grundgesetz (2014-05-26 22:03:22)

Offline

#2 2009-04-17 18:39:01

keith
Member
From: Blyth, Northumberland, England
Registered: 2004-12-08
Posts: 199
Website

Re: jbx_multiple_image_upload

Hi Jonas,

very interested in this – thanks for the work so far.

I’ve installed and activated it, but can’t see it under my Extensions tab.

Are there any Txp/php version restrictions on its use?

Added: I am using fpx_image_import successfully incidentally, but deactivating it doesn’t help.

Last edited by keith (2009-04-17 18:45:35)


Keith
Blyth, Northumberland, England
Capture The Moment

Offline

#3 2009-04-17 18:49:44

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: jbx_multiple_image_upload

I tried installing this plugin but get the following error after activating

Fatal error: Cannot redeclare fpx_prepare_prefs() (previously declared in/path/to/public_html/site.com/textpattern/lib/txplib_misc.php(580) : eval()'d code:321) in /path/to/public_html/site.com/textpattern/lib/txplib_misc.php(580) : eval()'d code on line 472

Looks like some code from fpx_image_import is still in the plugin.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#4 2009-04-17 18:56:04

grundgesetz
Plugin Author
From: Germany
Registered: 2009-04-17
Posts: 24

Re: jbx_multiple_image_upload

Okay, I´m currently cleaning the plugin of fpx_ tags.

And I don´t know why, but by now it just works with Textpattern 4.08

Be patient, please.

Offline

#5 2009-04-17 20:22:25

keith
Member
From: Blyth, Northumberland, England
Registered: 2004-12-08
Posts: 199
Website

Re: jbx_multiple_image_upload

Hi again,

Matt, I got that message too just now after I’d left the site then went back in – I’ve had to deactivate that plugin to get my site back.

Jonas, don’t feel under any pressure – take your time and just do what you can when you can.

Last edited by keith (2009-04-17 20:23:24)


Keith
Blyth, Northumberland, England
Capture The Moment

Offline

#6 2009-04-17 21:59:13

grundgesetz
Plugin Author
From: Germany
Registered: 2009-04-17
Posts: 24

Re: jbx_multiple_image_upload

Okay, I hope that the plugin is now compatible with:

  • Textpattern 4.0.7 and 4.0.8
  • PHP 4
  • fpx_image_import

Would you try it, please? As I said, I´m no professional. ;)

I want to add that if you are in instant need of a plugin with more sophisticated features, see Eric´s EBL Upload.
I just want to provide this simple mod of fpx_image_import.

Greetings,
Jonas

Last edited by grundgesetz (2009-04-17 23:37:56)

Offline

#7 2009-04-17 22:45:05

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: jbx_multiple_image_upload

I got confused thinking it was for files and not images. Maybe change the description in the future.

Looks pretty sweet so far. Uploaded a couple images with no issues. Tried uploading a non-image file and an error displayed quickly then the page refreshed.

Edit: Just noticed that the upload form still shows up in the image_edit step.

Last edited by MattD (2009-04-17 22:49:27)


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#8 2009-04-17 22:52:58

grundgesetz
Plugin Author
From: Germany
Registered: 2009-04-17
Posts: 24

Re: jbx_multiple_image_upload

ah okay thanks for reporting that! I also renamed the plugin

Offline

#9 2009-04-18 01:31:17

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: jbx_multiple_image_upload

A few comments:

  1. Why not use jQuery instead of Mootools? If you’re stuck with Mootools, consider including the JS in the source code, so the plugin will work for offline users.
  2. That’s a whole lot of global variables and other code outside a function. Since most only need to be used by your own code, you could use a class or two.
  3. if (txpinterface …)@: @ is unnecessary (and a little slower). Use the identical operator when possible, since it’s faster. You can throw your init code in jbx_image_main, so it’s a little cleaner too.
  4. Can you display an error message if mkdir fails (it does for me)?

Other than that, nice work!

Offline

#10 2009-04-18 01:47:16

grundgesetz
Plugin Author
From: Germany
Registered: 2009-04-17
Posts: 24

Re: jbx_multiple_image_upload

jm wrote:

A few comments:

  1. Why not use jQuery instead of Mootools? If you’re stuck with Mootools, consider including the JS in the source code, so the plugin will work for offline users.
  2. That’s a whole lot of global variables and other code outside a function. Since most only need to be used by your own code, you could use a class or two.
  3. if (txpinterface …)@: @ is unnecessary (and a little slower). Use the identical operator when possible, since it’s faster. You can throw your init code in jbx_image_main, so it’s a little cleaner too.
  4. Can you display an error message if mkdir fails (it does for me)?
    Other than that, nice work!

  1. As far as I know, there is no jQuery-Implementation of FancyUpload. Furthermore, I never worked with jQuery. But I´ll include the core within the code.
  2. Just took it all from fpx_image_import. I´ll think about the class.
  3. next version
  4. see 3.

By now, most of the “import”-code is still fpx. Will revise all as soon as I´ve got more time.

Offline

#11 2009-04-18 15:48:03

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: jbx_multiple_image_upload

Still getting the fatal error…

Offline

#12 2009-04-19 07:29:43

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: jbx_multiple_image_upload

I get an error on line 67 (no permissions …)
Where put the “upload” directory ? In the images directory ? Textpattern directory ? I try without success.

Offline

#13 2009-04-19 14:43:19

grundgesetz
Plugin Author
From: Germany
Registered: 2009-04-17
Posts: 24

Re: jbx_multiple_image_upload

I´m currently facing some permission problems. The script tries to create the “upload” directory beneath the “textpattern” directory. Then it tries to create the files FancyUpload requires.

Problem is this: On my webhost, this works out fine. But I found out that on some other hosts, the creation of this folder fails due to the lack of permissions. So, just chmod your textpattern to 0777, then install the plugin. Check the “content/images” tab to see whether it worked out.

If so, set permissions of /textpattern/ back to 0755.

Could an expert help me out, please? On Linux systems, files/folders created by PHP have a different permission user/group than they would have if you upload them via FTP. Thus, manual deletion of the files fails. How to avoid this without foregoing the PHP file creation? I know it would work out if people just upload the folder. But I would feel sorry for the lack of comfort ;)

Last edited by grundgesetz (2009-04-19 14:45:53)

Offline

#14 2009-04-19 14:54:28

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,452
Website GitHub

Re: jbx_multiple_image_upload

grundgesetz wrote:

The script tries to create the “upload” directory beneath the “textpattern” directory.

Forgive the naive question: couldn’t you create the ‘upload’ directory beneath the ‘images’ directory? That has to have write permission in order for Textpatten to work correctly.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#15 2009-04-19 15:33:44

grundgesetz
Plugin Author
From: Germany
Registered: 2009-04-17
Posts: 24

Re: jbx_multiple_image_upload

I feel quite ashamed now… thanks for that! :)
-> directory will be located at /images/upload/ in the next version

I really have to revise the code from ground up after my final exams. Getting into this slowly…

Last edited by grundgesetz (2009-04-19 15:42:26)

Offline

Board footer

Powered by FluxBB