function scripts()
 {
     $max_file_size = intval(wpuf_get_option('attachment_max_size', 'wpuf_frontend_posting')) * 1024;
     $max_upload = intval(wpuf_get_option('attachment_num', 'wpuf_frontend_posting'));
     $attachment_enabled = wpuf_get_option('allow_attachment', 'wpuf_frontend_posting');
     wp_enqueue_script('jquery');
     if (wpuf_has_shortcode('wpuf_addpost') || wpuf_has_shortcode('wpuf_edit')) {
         wp_enqueue_script('plupload-handlers');
     }
     wp_enqueue_script('jquery-ui-sortable');
     wp_enqueue_script('wpuf_attachment', plugins_url('js/attachment.js', dirname(__FILE__)), array('jquery'));
     wp_localize_script('wpuf_attachment', 'wpuf_attachment', array('nonce' => wp_create_nonce('wpuf_attachment'), 'number' => $max_upload, 'attachment_enabled' => $attachment_enabled == 'yes' ? true : false, 'plupload' => array('runtimes' => 'html5,flash,html4', 'browse_button' => 'wpuf-attachment-upload-pickfiles', 'container' => 'wpuf-attachment-upload-container', 'file_data_name' => 'wpuf_attachment_file', 'max_file_size' => $max_file_size . 'b', 'url' => admin_url('admin-ajax.php') . '?action=wpuf_attach_upload&nonce=' . wp_create_nonce('wpuf_audio_track'), 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'filters' => array(array('title' => __('Allowed Files'), 'extensions' => '*')), 'multipart' => true, 'urlstream_upload' => true)));
 }
예제 #2
0
 /**
  * Enqueues Styles and Scripts when the shortcodes are used only
  *
  * @uses has_shortcode()
  * @since 0.2
  */
 function enqueue_scripts()
 {
     $path = plugins_url('', __FILE__);
     //for multisite upload limit filter
     if (is_multisite()) {
         require_once ABSPATH . '/wp-admin/includes/ms.php';
     }
     require_once ABSPATH . '/wp-admin/includes/template.php';
     wp_enqueue_style('wpuf', $path . '/css/wpuf.css');
     if (wpuf_has_shortcode('wpuf_addpost') || wpuf_has_shortcode('wpuf_edit')) {
         wp_enqueue_script('plupload-handlers');
     }
     wp_enqueue_script('wpuf', $path . '/js/wpuf.js', array('jquery'));
     $posting_msg = wpuf_get_option('updating_label', 'wpuf_labels');
     $feat_img_enabled = wpuf_get_option('enable_featured_image', 'wpuf_frontend_posting') == 'yes' ? true : false;
     wp_localize_script('wpuf', 'wpuf', array('ajaxurl' => admin_url('admin-ajax.php'), 'postingMsg' => $posting_msg, 'confirmMsg' => __('Are you sure?', 'wpuf'), 'nonce' => wp_create_nonce('wpuf_nonce'), 'featEnabled' => $feat_img_enabled, 'plupload' => array('runtimes' => 'html5,silverlight,flash,html4', 'browse_button' => 'wpuf-ft-upload-pickfiles', 'container' => 'wpuf-ft-upload-container', 'file_data_name' => 'wpuf_featured_img', 'max_file_size' => wp_max_upload_size() . 'b', 'url' => admin_url('admin-ajax.php') . '?action=wpuf_featured_img&nonce=' . wp_create_nonce('wpuf_featured_img'), 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), 'filters' => array(array('title' => __('Allowed Files'), 'extensions' => '*')), 'multipart' => true, 'urlstream_upload' => true)));
 }
예제 #3
0
 /**
  * add custom css to head
  */
 function add_custom_css()
 {
     global $post;
     if (wpuf_has_shortcode('wpuf_form', $post->ID) || wpuf_has_shortcode('wpuf_edit', $post->ID) || wpuf_has_shortcode('wpuf_profile', $post->ID) || wpuf_has_shortcode('wpuf_dashboard', $post->ID) || wpuf_has_shortcode('wpuf_sub_pack', $post->ID) || wpuf_has_shortcode('wpuf-login', $post->ID) || wpuf_has_shortcode('wpuf_form', $post->ID) || wpuf_has_shortcode('wpuf_profile', $post->ID)) {
         ?>
         <style>
             <?php 
         echo $custom_css = wpuf_get_option('custom_css', 'wpuf_general');
         ?>
         </style>
         <?php 
     }
 }
/**
 * After avatar container
 * @since 1.6
 * @uses bbp_is_edit()
 * @uses wpuf_has_shortcode()
 */
function wpua_do_after_avatar()
{
    ?>
  <?php 
    if (class_exists('bbPress') && bbp_is_edit()) {
        // Add to bbPress profile with same style
        ?>
    </fieldset>
  <?php 
    } elseif (class_exists('WPUF_Main') && wpuf_has_shortcode('wpuf_editprofile')) {
        // Add to WP User Frontend profile with same style
        ?>
          </td>
        </tr>
      </table>
    </fieldset>
  <?php 
    } else {
        // Add to profile without table
        ?>
    </div>
  <?php 
    }
    ?>
  <?php 
}
예제 #5
0
파일: wpuf.php 프로젝트: mithublue/testrepo
 /**
  * Enqueues Styles and Scripts when the shortcodes are used only
  *
  * @uses has_shortcode()
  * @since 0.2
  */
 function enqueue_scripts()
 {
     $scheme = is_ssl() ? 'https' : 'http';
     wp_enqueue_script('google-maps', $scheme . '://maps.google.com/maps/api/js?sensor=true');
     wp_enqueue_script('wpuf-form', WPUF_ASSET_URI . '/js/frontend-form.js', array('jquery'));
     wp_enqueue_script('wpuf-conditional-logic', WPUF_ASSET_URI . '/js/conditional-logic.js', array('jquery'), false, true);
     wp_enqueue_script('wpuf-subscriptions', WPUF_ASSET_URI . '/js/subscriptions.js', array('jquery'), false, true);
     wp_enqueue_style('wpuf-css', WPUF_ASSET_URI . '/css/frontend-forms.css');
     if (wpuf_get_option('load_script', 'wpuf_general', 'on') == 'on') {
         $this->plugin_scripts();
     } else {
         if (wpuf_has_shortcode('wpuf_form') || wpuf_has_shortcode('wpuf_edit') || wpuf_has_shortcode('wpuf_profile') || wpuf_has_shortcode('wpuf_dashboard')) {
             $this->plugin_scripts();
         }
     }
 }
예제 #6
0
 /**
  * Enqueues Styles and Scripts when the shortcodes are used only
  *
  * @uses has_shortcode()
  * @since 0.2
  */
 function enqueue_scripts()
 {
     $path = plugins_url('', __FILE__);
     $scheme = is_ssl() ? 'https' : 'http';
     //wp_enqueue_script( 'google-maps', $scheme . '://maps.google.com/maps/api/js?sensor=true' );
     wp_enqueue_style('wpuf-css', $path . '/css/frontend-forms.css');
     wp_enqueue_script('wpuf-form', $path . '/js/frontend-form.js', array('jquery'));
     if (wpuf_get_option('load_script', 'wpuf_general', 'on') == 'on') {
         $this->plugin_scripts();
     } else {
         if (wpuf_has_shortcode('wpuf_form') || wpuf_has_shortcode('wpuf_edit') || wpuf_has_shortcode('wpuf_profile') || wpuf_has_shortcode('wpuf_dashboard')) {
             $this->plugin_scripts();
         }
     }
 }