Advertisement:

Author Topic: [PLUGIN] Image uploader v0.1 - multi upload and drag&drop images.  (Read 43453 times)

garciademarina

  • Administrator
  • Hero Member
  • *****
  • Posts: 974
Hi all,

Most of you have asked improvements on how osclass manage uploads image, first this plugin is still in development and you will need to change some code of your theme files.

Replace current image upload system for ajax image upload using fineuploader javascript library.

Features
- Multiple file upload.
- Drag & drop files.
- Image preview.
- Daily purge of old temporary images (Cron).
- Prevent upload images again when occurs some error adding or editing.
- Make image as primary/main image on add listing action.





Instructions of installations (Bender theme):

Only tested at frontend with Osclass 3.2 and Bender theme, it should work well with version 3.1 and up.

Once plugin is installed, you need to edit item-post.php theme file, under the folder oc-content/themes/THEME_NAME.

Find and remove all code related to image upload action, using Bender theme as example:

Code: [Select]
<?php if(osc_images_enabled_at_items()) ItemForm::photos_javascript(); ?>
Code: [Select]
<?php if( osc_images_enabled_at_items() ) { ?>
<div class="box photos">
    <h2><?php _e('Photos''bender'); ?></h2>
    <div class="control-group">
        <label class="control-label" for="photos[]"><?php _e('Photos''bender'); ?></label>
        <div class="controls">
            <div id="photos">
                <?php ItemForm::photos(); ?>
            </div>
        </div>
        <div class="controls">
            <a href="#" onclick="addNewPhoto(); return false;"><?php _e('Add new photo''bender'); ?></a>
        </div>
    </div>
</div>
<?php ?>

Add as replacement this code

Code: [Select]
<?php if( osc_images_enabled_at_items() ) { ?>
<div class="box photos">
    <h2><?php _e('Photos''bender'); ?></h2>
    <div class="control-group">
        <?php ItemForm::photos(); ?>
        <?php print_image_uploader(); ?>
    </div>
    <div style="clear:both;"></div>
    <br/>
</div>
<?php ?>

Note Most likely you will need to edit styles to integrate the plugin with your theme, now its compatible with default theme Bender

Download  http://garciademarina.com/image_uploader.v0.1.zip
Download image_uploader.v0.9.zip 15/09/2013

https://github.com/garciademarina/osclass-image-upload


Regards


TODO:

-Add admin menu with help section.
-i18n all fine uploader strings
« Last Edit: September 16, 2013, 12:01:20 am by garciademarina »

strata

  • Sr. Member
  • ****
  • Posts: 411
  • Always good, always...
Re: [PLUGIN] Image uploader v0.1 - multi upload and drag&drop images.
« Reply #1 on: August 30, 2013, 12:40:36 pm »
This is great, I'm never try it but very-very interesting plugins ...great job Osclass Team  ;D

lexosc

  • Sr. Member
  • ****
  • Posts: 344
Re: [PLUGIN] Image uploader v0.1 - multi upload and drag&drop images.
« Reply #2 on: August 30, 2013, 12:56:08 pm »
Very nice plugin i wanted this and was looking for this long time! thank you garcia!!!!
Just tried it with bender theme and osclass 3.2.1, done everything exactly as in example but when i add images they don't show on preview (i can see only the title of the image) and when i post the ad it sends me to blank page, the ad is posted but without images do you know what is the problem? maybe permissions?

garciademarina

  • Administrator
  • Hero Member
  • *****
  • Posts: 974
Re: [PLUGIN] Image uploader v0.1 - multi upload and drag&drop images.
« Reply #3 on: August 30, 2013, 01:11:54 pm »
Hi alexgr,

With which browser are you testing ?

http://garciademarina.com/320/Osclass/index.php

I test it with chrome and I can see preview image. Have your site online ?

Can you turn on the debug ? http://doc.osclass.org/Debug_PHP_errors

Regards
« Last Edit: August 30, 2013, 01:27:20 pm by garciademarina »

lexosc

  • Sr. Member
  • ****
  • Posts: 344
Re: [PLUGIN] Image uploader v0.1 - multi upload and drag&drop images.
« Reply #4 on: August 30, 2013, 01:42:58 pm »
Hi garcia, i use firefox, i enabled php debug and i found problem was with spammkiller plugin and watermark image, i disabled those and now its working the only problem now is that everytime you go to post ad the previous images are still there on preview (only the second time you post ad after you posted previous)
also when upload images doesn't show on preview just the title of the image
my site is not online right now
« Last Edit: August 30, 2013, 01:47:10 pm by alexgr »

garciademarina

  • Administrator
  • Hero Member
  • *****
  • Posts: 974
Re: [PLUGIN] Image uploader v0.1 - multi upload and drag&drop images.
« Reply #5 on: August 30, 2013, 02:25:49 pm »
hi @alexgr,

Fixed issue with previous images uploaded.

I don't cannot reproduce your issue with preview images, can you provide more information ?


I updated the zip, you only need to upload it again from oc-admin -> plugins

Thanks for reporting

Aficionado

  • Guest
Re: [PLUGIN] Image uploader v0.1 - multi upload and drag&drop images.
« Reply #6 on: August 30, 2013, 03:58:50 pm »
Most people use Modern theme.

Please keep than in mind.

 ;)

lexosc

  • Sr. Member
  • ****
  • Posts: 344
Re: [PLUGIN] Image uploader v0.1 - multi upload and drag&drop images.
« Reply #7 on: August 30, 2013, 04:01:20 pm »
Plugin works nice now! only problem with image preview now, when it get uploaded to oc-content/uploads/temp it has 0644 permissions maybe this is the problem?
i tried this with wampp localhost and on vps server with debian but had same problem with preview image
« Last Edit: August 30, 2013, 05:09:32 pm by alexgr »

garciademarina

  • Administrator
  • Hero Member
  • *****
  • Posts: 974
Re: [PLUGIN] Image uploader v0.1 - multi upload and drag&drop images.
« Reply #8 on: August 30, 2013, 05:59:47 pm »
@alexgr, 644 have read permissions for all groups and users... don't should be that.

What operating system are you using ?

Can you try with other browsers ?

Thanks for testing

lexosc

  • Sr. Member
  • ****
  • Posts: 344
Re: [PLUGIN] Image uploader v0.1 - multi upload and drag&drop images.
« Reply #9 on: August 30, 2013, 06:27:26 pm »
i use windows 7 64 bit i tested with chrome and firefox, the server where the site is, its Debian Linux 7

garciademarina

  • Administrator
  • Hero Member
  • *****
  • Posts: 974
Re: [PLUGIN] Image uploader v0.1 - multi upload and drag&drop images.
« Reply #10 on: August 30, 2013, 06:34:06 pm »
Hi,

works fine on your server ? can you give me your url ?

Regards

demonio45

  • Newbie
  • *
  • Posts: 17
Re: [PLUGIN] Image uploader v0.1 - multi upload and drag&drop images.
« Reply #11 on: August 30, 2013, 10:17:03 pm »
works fine on osclass3.2+real estate theme
but is possible add sorting functionality that would allow us to re-order the images after they've been uploaded ¿¿

could be great if the style like gallery view can be changed to list view

has a small bug when you remove one a picture the next picture you upload does not show image preview.

Thanks for the plugin


garciademarina

  • Administrator
  • Hero Member
  • *****
  • Posts: 974
Re: [PLUGIN] Image uploader v0.1 - multi upload and drag&drop images.
« Reply #12 on: August 30, 2013, 10:37:14 pm »
Hi @demonio45,

Sorting images can be possible coding some extra javascript, I will try to add this feature and highlight primary image can be useful.

It's possible to add more layouts such list layout but, with a list layout the preview images maybe are too small or can be too big to be a list... just what I think.

Quote
has a small bug when you remove one a picture the next picture you upload does not show image preview.

I will take a look on it asap.

Regards and thanks for your feedback.

sigivr

  • Sr. Member
  • ****
  • Posts: 471
Re: [PLUGIN] Image uploader v0.1 - multi upload and drag&drop images.
« Reply #13 on: August 31, 2013, 01:04:36 am »
Good idea, but this will affect the movil version? on bender theme

sigivr

  • Sr. Member
  • ****
  • Posts: 471
Re: [PLUGIN] Image uploader v0.1 - multi upload and drag&drop images.
« Reply #14 on: August 31, 2013, 01:19:01 am »
preview of uploaded images is not working in my site, but it is working  in your demo , why? thank you

i have windows 7 64 bits