Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2007-10-03 00:07:52

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: stm_image_uploader: directly upload images from Write tab

robin746 wrote:

I am not sure what the Image tab has to do with this plugin which is appearing on the Write tab.

Everything. Because the plugin just cuts picture_upload_form from image.php (known as images-tab) by using JavaScript. So, it uses users own browser to do the job, and if user has no permissions to image-tab, plugin won’t work. In that case it only outputs blank, as it cant include form from image tab.

Cheers!

Offline

#14 2007-10-03 00:51:39

robin746
Member
From: Ireland
Registered: 2007-09-22
Posts: 113
Website

Re: stm_image_uploader: directly upload images from Write tab

Interesting. I would never have guessed at that sort of method.

Opening up all permissions still gives me the error. This is one of the last bugs I have to nail down. If it cannot be solved with this plugin does anyone have alternative code? All I want is for the writer to be able to upload a single image and have it applied directly to the article image field.

(Any further work — deleting, renaming — can be done by the editor.)


robin

Offline

#15 2007-10-03 15:08:42

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: stm_image_uploader: directly upload images from Write tab

Turns out, only a Publisher can upload. I assumed the plugin works depending on the rights above the image tab, but seems not.
Have to take a look at the code.

regards, marios


⌃ ⇧ < ⌃ ⇧ >

Offline

#16 2007-10-04 00:27:27

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: stm_image_uploader: directly upload images from Write tab

Ok, so the privileges need to be added to the plugin functions, which arent’ in there yet. So to have the image upload available for all privs levels, right above the register_callbacks add these two lines to the plugin code:

add_privs('handle_picture_upload_form','1,2,3,4,5');
	add_privs('picture_upload_form','1,2,3,4,5');

( After the txp_interface include call )

regards, marios


⌃ ⇧ < ⌃ ⇧ >

Offline

#17 2007-10-04 02:13:50

robin746
Member
From: Ireland
Registered: 2007-09-22
Posts: 113
Website

Re: stm_image_uploader: directly upload images from Write tab

That works!

Now, perfection would be achieved if you could tell me how to patch your plugin to:

1. automatically fill in the Article image field with the uploaded image ID

2. display a thumbnail of the image beside the form, so it is clear to the writer which one was uploaded


robin

Offline

#18 2007-10-04 03:17:21

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: stm_image_uploader: directly upload images from Write tab

robin746 wrote:

1. automatically fill in the Article image field with the uploaded image ID

I’d want to see that as well, better would be even, if the plugin checks against logged in User privs and the automatically inserts the value into the corresponding table.

2. display a thumbnail of the image beside the form, so it is clear to the writer which one was uploaded.

As a preview, before anything gets inserted and uploaded.

May be the plugin author could give it a whirl, else I’ll take a look some time later.
I’d need that as well.

regards, marios

Last edited by marios (2007-10-04 03:17:41)


⌃ ⇧ < ⌃ ⇧ >

Offline

#19 2007-10-05 01:21:13

robin746
Member
From: Ireland
Registered: 2007-09-22
Posts: 113
Website

Re: stm_image_uploader: directly upload images from Write tab

Hey Marios, that would be cool!


robin

Offline

#20 2007-10-05 03:57:33

robin746
Member
From: Ireland
Registered: 2007-09-22
Posts: 113
Website

Re: stm_image_uploader: directly upload images from Write tab

I made the mistake of trying this in IE6 and IE7… error of course. After much gnashing of teeth (two other issues were causing errors simultaneously) I found that one must replace this line:

iframe.border = "none";

With this one:

iframe.frameborder = "0";

Looks the same under FireFox. Works under IE but with an ugly border. CSS should take care of that.


robin

Offline

#21 2007-10-06 07:22:36

skamuel
New Member
From: Sweden
Registered: 2007-09-21
Posts: 3
Website

Re: stm_image_uploader: directly upload images from Write tab

robin746 wrote:

I made the mistake of trying this in IE6 and IE7… error of course. After much gnashing of teeth (two other issues were causing errors simultaneously) I found that one must replace this line:

iframe.border = “none”;

With this one:

iframe.frameborder = “0”;

Looks the same under FireFox. Works under IE but with an ugly border. CSS should take care of that.

Yep, just like I suggested on page 1 of this thread. ;-)

Offline

#22 2007-10-06 12:53:18

robin746
Member
From: Ireland
Registered: 2007-09-22
Posts: 113
Website

Re: stm_image_uploader: directly upload images from Write tab

Doh!


robin

Offline

#23 2007-10-11 16:30:52

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: stm_image_uploader: directly upload images from Write tab

Robin746 Wrote

1. automatically fill in the Article image field with the uploaded image ID

2. display a thumbnail of the image beside the form, so it is clear to the writer which one was uploaded

Anyone got either of these things working?
These would REALLY make this plugin amazing.

Anyone out there with the skills have time to take a quick look?


Tom

Offline

#24 2007-12-03 15:57:31

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: stm_image_uploader: directly upload images from Write tab

What about adding title and entering sizes of creating thumbnail? I tried to look into plugin’s code, but it seems to be difficult.


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

Board footer

Powered by FluxBB