Viewing 14 Topics - 16 through 29 (of 29 total)
Author Posts
July 9, 2013 at 8:43 pm 5774
Tareq Hasan Tareq Hasan

You could add all the plupload library with a single line: wp_enqueue_script( 'plupload-handlers' );

You don’t need to hardcode them. As you need the scripts in all pages, may be remove the logic from the plugin by editing wpuf.php line 167, and /class/upload.php line 27.

if ( wpuf_has_shortcode( 'wpuf_form' ) || wpuf_has_shortcode( 'wpuf_edit' ) || wpuf_has_shortcode( 'wpuf_profile' ) ) {

I think it’ll be a good idea to give an option to enable/disable the script loading on every page or specific pages, hmm.

July 9, 2013 at 9:14 pm 5783
polykrom polykrom

Mmhh .. Yes.. it helps a little more !

maybe would it be better to support do_shortcode() or to implement a “select templates” or “select pages” as you told…

So, now everything seems ok apart one form (a registration form that only upload one image without others fields) .. The upload works well but redirects to /wp-admin/admin-ajax.php?msg=profile_update and display 0 …

Is it ajax related or something like that ?

July 9, 2013 at 10:06 pm 5798
Tareq Hasan Tareq Hasan

I suspect it’s not getting some JS variables and can’t make the request properly. The url misses an action parameter which is necessary. Do you see any error when hitting the submit button?

July 9, 2013 at 10:29 pm 5801
polykrom polykrom

Nops Tareq… i’ve checked it and nothing special else the 0 displayed on the top.
Think it’s also parameter related but wich one ?

July 9, 2013 at 11:34 pm 5807
polykrom polykrom

Nothing new for the JS Script Issue …

I’ve finally successfully enqueued all the scripts neeeded by WPFU in order for do_shortcode to work …
Here it si the function to include in the main theme function :

add_action( ‘wp_enqueue_scripts’, ‘add_my_scripts’);


function add_my_scripts() {
if ( !is_admin() ) { 
    wp_enqueue_script('jqueryuidateadd-script',home_url().'/wp-content/plugins/wp-user-frontend-pro/js/jquery-ui-timepicker-addon.js?ver=3.5.2',array('jquery-ui-datepicker'));
    wp_enqueue_script( 'jquery-ui-autocomplete' );
    wp_enqueue_script( 'jquery-ui-slider' );
    

    wp_enqueue_script('front-end-script',home_url().'/wp-content/plugins/wp-user-frontend-pro/js/frontend-form.js?ver=3.5.2',array( 'jquery','plupload-handlers' ));  
    wp_enqueue_script('upload-script',home_url().'/wp-content/plugins/wp-user-frontend-pro/js/upload.js?ver=3.5.2',array( 'jquery', 'plupload-handlers' ));

   

    wp_localize_script( 'front-end-script', 'wpuf_frontend', array(
        'ajaxurl' => admin_url( 'admin-ajax.php' ),
        'error_message' => __( 'Please fix the errors to proceed', 'wpuf' ),
        'nonce' => wp_create_nonce( 'wpuf_nonce' )
    ) );
  

    wp_localize_script( 'upload-script', 'wpuf_frontend_upload', array(
        'confirmMsg' => __( 'Are you sure?', 'wpuf' ),
        'nonce' => wp_create_nonce( 'wpuf_nonce' ),
        'ajaxurl' => admin_url( 'admin-ajax.php' ),
        'plupload' => array(
            'url' => admin_url( 'admin-ajax.php' ) . '?nonce=' . wp_create_nonce( 'wpuf_featured_img' ),
            'flash_swf_url' => includes_url( 'js/plupload/plupload.flash.swf' ),
            'filters' => array(array('title' => __( 'Allowed Files' ), 'extensions' => '*')),
            'multipart' => true,
            'urlstream_upload' => true,
        )
    ) );

  }
}
July 10, 2013 at 12:01 am 5813
Tareq Hasan Tareq Hasan

Nice to know you made it. You could just edit the plugin and remove the if blocks for shortcode checking 🙂

July 10, 2013 at 12:34 am 5817
polykrom polykrom

Well, i’ll be happy when i found the solution to the latest issue with JS … :-/

July 11, 2013 at 5:38 am 5858
Tareq Hasan Tareq Hasan

If your site is in a live site, I could see by myself?

July 11, 2013 at 5:52 am 5860
polykrom polykrom This reply has been marked as private.
July 11, 2013 at 6:20 am 5861
Tareq Hasan Tareq Hasan

The problem is, you are using the form in the authors profile page. To redirect to the same page, WPUF tries get the current page ID, in your case it’s not a page. Thats why it gets 0 as page ID and can’t generate an URL to be redirected.

So here is the solution, I think you’ll understand whats going on:
[php]
function wpufe_profile_redirect( $response, $user_id, $form_id ) {

if ( $form_id == ‘3648’ ) {
$url = get_author_posts_url( get_current_user_id() );
$response[‘redirect_to’] = $url;
}

return $response;
}

add_filter( ‘wpuf_update_profile_resp’, ‘wpufe_profile_redirect’ );
[/php]

July 11, 2013 at 11:19 am 5868
polykrom polykrom

Wooow thanks so Lot !

Again and again i didn’t imagine that kind of support from you !
I really appreciate it 🙂

I think also that it would be usefull for WTUF to have the option to be implemented everywhere we need in a WP theme … so, i launch the idea 😉

Keep the good work guys !

cheers !

July 11, 2013 at 12:16 pm 5870
polykrom polykrom

MMhhh…
Try your code ‘as is’ and doesn’t seem to work, maybe i miss something.

Have to investigate more, but that’s a good way to begin !

😉

July 11, 2013 at 12:30 pm 5871
polykrom polykrom

Ok !

It works but not investigate more, just added

 if ( $form_id == '3648' ) {
        $url = get_author_posts_url( get_current_user_id() );
        $response['redirect_to'] = $url;
    }

in update_profile function

😉 so thanks Tareq !

July 11, 2013 at 1:29 pm 5872
Tareq Hasan Tareq Hasan

Oh, I missed the parameter number in the add_filter, should be add_filter( 'wpuf_update_profile_resp', 'wpufe_profile_redirect', 10, 3 );

Viewing 14 Topics - 16 through 29 (of 29 total)