Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter codecks

    (@codecks)

    Hey Nazmul,

    Thank you so much, this is working!

    Is there a way to pass the response.data (url of the photo) as an argument to the fotoblog() function? I’m looking online on how to do this but currently this way above my level of understanding.

    Thread Starter codecks

    (@codecks)

    Thanks t-p,

    I’m taking the dropzone related questions further on the dedicated support forum.
    Thanks for your suggestion Joy, also for your answer on wp-dropzone support forum.

    Thread Starter codecks

    (@codecks)

    Thanks for your reply Joy. I’ve been trying to use the callback to trigger the post creation but with no success so far.

    Basically what I have been doing is to create a custom-page template where I inserted the do_shortcode funtion to display the wp-dropzone form. The form works, and I’m able to upload files to the media library. The code looks like this:

    add_action('genesis_before_entry_content', 'dropit');
    function dropit()
    {
        echo do_shortcode('[wp-dropzone callback="success: function(file, response){ 
        console.log(response) }" desc="Drop your images here"]');
    }

    You can see the callback has a success event. So, on success it executes what’s inside. The content now function(file, response){ console.log(response) } is simply the example from the plugin instructions page. I’m not sure what I should replace it with so it triggers function to create a blog post.

    The function to create a blog post looks like this. It currently resides inside my custom page template, but I’m not sure if this is the good location, maybe functions.php would be a better location?

    add_action( 'wp_ajax_fotoblog', 'fotoblog' );
    function fotoblog()
    {
        $post = array(
        'post_title'    => 'My Title',
        'post_content'  => 'My Content',
        'post_status'   => 'publish',
        'post_type'     => 'post'
        );
        wp_insert_post($post);
        wp_die();
    }

    What I’m failing to grasp is the relationsship between the callback and the function to create a blog post. Of what I have been reading so far, I think I should create a javascript function that triggers the wp_ajax hook so it fires the post creation, but I might be wrong in my understanding of that?

    Thread Starter codecks

    (@codecks)

    it seems the function get_mediatags() will do the trick.

    I had the same kind of problems. I deleted the whole db using the setup function, removed the pluging and reinstalled everything from scratch. It works like a charm now.

    It doesn’t work for me too.

    Server Settings:
    * Operating System : Linux
    * Server : Apache/2.0.59 (Unix) mod_ssl/2.0.59 OpenSSL/0.9.8g
    * Memory usage : 10.7 MByte
    * MYSQL Version : 5.0.44-log
    * SQL Mode : Not set
    * PHP Version : 5.2.5-pl1-gentoo
    * PHP Safe Mode : Off
    * PHP Allow URL fopen : On
    * PHP Memory Limit : 32M
    * PHP Max Upload Size : 2M
    * PHP Max Post Size : 8M
    * PHP Max Script Execute Time : 30s
    * PHP Exif support : Yes ( V1.4 )
    * PHP IPTC support : Yes
    * PHP XML support : Yes

    GD Library:
    * GD Version : bundled (2.0.34 compatible)
    * FreeType Support : Yes
    * FreeType Linkage : with freetype
    * T1Lib Support : No
    * GIF Read Support : Yes
    * GIF Create Support : Yes
    * JPG Support : Yes
    * PNG Support : Yes
    * WBMP Support : Yes
    * XPM Support : Yes
    * XBM Support : Yes
    * JIS-mapped Japanese Font Support : No

    Tried with smaller images, same problem.

Viewing 6 replies - 1 through 6 (of 6 total)