Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#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
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
Re: stm_image_uploader: directly upload images from Write tab
Hey Marios, that would be cool!
robin
Offline
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
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
Re: stm_image_uploader: directly upload images from Write tab
Doh!
robin
Offline
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
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
Re: stm_image_uploader: directly upload images from Write tab
Anyone out there still working on this?
I was using it for a while, but fell out-of-love with it due to a few missing features.
Would love to rekindle the relationship.
- )
—
Tom
Offline
Re: stm_image_uploader: directly upload images from Write tab
renobird wrote:
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
i don’t think this will be too hard. just started learning some javascript today and i played around with the plugin.
so far this is what i have:
1. once user uploads an image, an “Insert Article Image” text link appears. the user can click on it, and the id of the image is automatically placed into the ‘article image’ text field. this is similar to what up_img_popper does. i’ll see what i can do to make this automatic instead of having to click.
2. i haven’t tried displaying a thumbnail of the image yet but i don’t think this will be too hard to add.
3. i have absolutely little to none javascript knowledge and have not written a single line of js in my life minus toying around with a few jquery/packaged lightbox type scripts. i can’t believe no one else has attempted this…come on guys :P
Last edited by iblastoff (2007-12-23 10:35:36)
Offline
Re: stm_image_uploader: directly upload images from Write tab
after a bit of toying around i now also have the thumbnail showing up…albeit everything isn’t too pretty as i havent added any styling yet.
basically the screenshot is what shows up after you have uploaded an image. you can see the “Insert Article Image” text link there. once clicked, via javascript it inserts the id into the “Article Image” text field. it also displays the thumbnail of the image you just uploaded.
the only issue is since that whole image upload area is in an embedded iframe, if you have a relatively large thumbnail then scrollbars will appear vertically and horizontally to accomodate it. i had to increase the iframes height just to accomodate that little thumbnail in the picture below. as i haven’t toyed with frames in ages i have no idea if it can auto-expand like a div can (i assume not?)

next step is to figure out how the hell i would go about assigning a category to an image…
Last edited by iblastoff (2007-12-23 14:36:07)
Offline
Re: stm_image_uploader: directly upload images from Write tab
That’s looking very useful. Keep us appraised of your progress!
robin
Offline
#29 2007-12-23 15:11:13
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: stm_image_uploader: directly upload images from Write tab
Wow! This is great, thanks!
A little question: adding “insert article image” doesen’t make “txp:image_id” no more necessary?
Offline
Re: stm_image_uploader: directly upload images from Write tab
redbot wrote:
Wow! This is great, thanks!
A little question: adding “insert article image” doesen’t make “txp:image_id” no more necessary?
yah that can be removed. though i guess it depends on peoples needs if they choose to copy and paste directly into article instead? not sure if i should take it out or not.
Offline