Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
coding-topic
Simple Press not working with Dynamix Premium Theme
Avatar
tidusuper91
Member
Free Members
Offline
Mar 4, 2012 - 12:27 pm

Hi to everyone.

I am experiencing some problems with SP on Dynamix Premium Theme. Looking around with Firebug on Console i have this error:

 

vtip not defined
jspf(function(jspf){vtip();})

and i can't do anything because Add Topic, Add Reply doesn't call any js event and the Reply Textarea doesn't show.

PS: I forced the theme to load the wp-version of Jquery and added the include of jquery.cookie plugin that was missing. Someone can help me solving that?

http://www.tuttingegneri.com/blog/forum

Avatar
Brandon
U.S.
SP Wrangler
Free Members
Offline
Mar 4, 2012 - 2:28 pm

Looking at your site it looks like you are still using a Google API js. ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
Offline
Mar 4, 2012 - 3:19 pm

http://codex.simple-press.com/.....-conflict/

for more info...

Avatar
tidusuper91
Member
Free Members
Offline
Mar 4, 2012 - 7:57 pm

Ok. In the functions.php file of my template there were all the

 

wp_deregister_script('jquery-ui-core');

I have replaced all of them with:

wp_enqueue_script('jquery-ui-core');
wp_enqueue_script('jquery-ui-tabs');

[...]

but it seems that jquery-ui is not loaded.

 

Here's my functions.php js loading section (now. The old version below this):

<?php if (!is_admin()) if(!session_id()) session_start();
/***************************************************************/
/*    Initialise DynamiX and JQUERY Scripts                       */
/***************************************************************/

function init_dynscripts() {
    if (!is_admin()) {

        if ( function_exists('bp_is_blog_page')) {
            if (!bp_is_blog_page()) {
                wp_enqueue_script( 'bp-js', BP_PLUGIN_URL . '/bp-themes/bp-default/_inc/global.js', array( 'jquery' ) );
            }
        }

        wp_register_style('dynamix-style', get_bloginfo('stylesheet_url'),false,null);
        wp_enqueue_style('dynamix-style');
            
        wp_dequeue_style('em-ui-css'); // stop Event Manager jQuery UI CSS interfering. 
        
        wp_enqueue_script('jquery');
        wp_enqueue_script('jquery-ui-core');
        wp_enqueue_script('jquery-ui-tabs');
        
        
        
        wp_register_script('jquery-cookie', get_bloginfo('template_directory').'/js/jquery.cookie.js',false,null);
        wp_enqueue_script('jquery-cookie');

        wp_deregister_script( 'dynamix' );    
        wp_register_script( 'dynamix', get_bloginfo('template_directory').'/js/dynamix.min.js',false,null);
        wp_enqueue_script( 'dynamix' );
        
        if(get_option('jwplayer_js')) { // Check jw player javascript file is present
        
        $CWZ_jwplayer_js = get_option('jwplayer_js');
        
        wp_deregister_script( 'jw-player' );    
        wp_register_script( 'jw-player', $CWZ_jwplayer_js );
        wp_enqueue_script( 'jw-player' );        
        }
    
    }
}    
add_action('init', 'init_dynscripts',100);


/***************************************************************/
/*    Initialise DynamiX and JQUERY Scripts *END*               */
/***************************************************************/

Here's the originial with just the jquery loaded as WP-version:

<?php if (!is_admin()) if(!session_id()) session_start();
/***************************************************************/
/*    Initialise DynamiX and JQUERY Scripts                       */
/***************************************************************/

function init_dynscripts() {
    if (!is_admin()) {

        if ( function_exists('bp_is_blog_page')) {
            if (!bp_is_blog_page()) {
                wp_enqueue_script( 'bp-js', BP_PLUGIN_URL . '/bp-themes/bp-default/_inc/global.js', array( 'jquery' ) );
            }
        }

        wp_register_style('dynamix-style', get_bloginfo('stylesheet_url'),false,null);
        wp_enqueue_style('dynamix-style');
            
        wp_dequeue_style('em-ui-css'); // stop Event Manager jQuery UI CSS interfering. 
        
        wp_deregister_script('jquery-ui-core');
        wp_deregister_script('jquery-ui-tabs');
        wp_deregister_script('jquery-ui-sortable');
        wp_deregister_script('jquery-ui-draggable');
        wp_deregister_script('jquery-ui-droppable');
        wp_deregister_script('jquery-ui-selectable');
        wp_deregister_script('jquery-ui-resizable');
        wp_deregister_script('jquery-ui-dialog');
        wp_deregister_script('jquery-ui');
        wp_deregister_script('jquery-ui-core');
        wp_deregister_script('jquery-ui-datepicker');
        
        wp_enqueue_script( 'jquery' );    
        
        wp_register_script('jquery-cookie', get_bloginfo('template_directory').'/js/jquery.cookie.js',false,null);
        wp_enqueue_script('jquery-cookie');

        wp_register_script( 'jquery-ui-core', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js',false,null);
        wp_enqueue_script( 'jquery-ui-core' );            

        wp_deregister_script( 'dynamix' );    
        wp_register_script( 'dynamix', get_bloginfo('template_directory').'/js/dynamix.min.js',false,null);
        wp_enqueue_script( 'dynamix' );
        
        if(get_option('jwplayer_js')) { // Check jw player javascript file is present
        
        $CWZ_jwplayer_js = get_option('jwplayer_js');
        
        wp_deregister_script( 'jw-player' );    
        wp_register_script( 'jw-player', $CWZ_jwplayer_js );
        wp_enqueue_script( 'jw-player' );        
        }
    
    }
}    
add_action('init', 'init_dynscripts',100);


/***************************************************************/
/*    Initialise DynamiX and JQUERY Scripts *END*               */
/***************************************************************/
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
Offline
Mar 4, 2012 - 9:10 pm

I still see jquery ui loaded from google apis:

<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js'></script>

what about the other jquery ui elements?  not needed?

Avatar
tidusuper91
Member
Free Members
Offline
Mar 5, 2012 - 4:39 am

You're seeing that because i restored the default theme loading from googleapis. Now i enqueued all the Ui components but the sliding show effect of the dropdown menu tab named Chi Siamo (there's the subpage that should show with sliding effect but in Firebug when i am onmouseover i get:

 

f.easing[i.animatedProperties[this.prop]] is not a function

Here's my functions.php

<?php if (!is_admin()) if(!session_id()) session_start();
/***************************************************************/
/*    Initialise DynamiX and JQUERY Scripts                       */
/***************************************************************/

function init_dynscripts() {
    if (!is_admin()) {

        if ( function_exists('bp_is_blog_page')) {
            if (!bp_is_blog_page()) {
                wp_enqueue_script( 'bp-js', BP_PLUGIN_URL . '/bp-themes/bp-default/_inc/global.js', array( 'jquery' ) );
            }
        }

        wp_register_style('dynamix-style', get_bloginfo('stylesheet_url'),false,null);
        wp_enqueue_style('dynamix-style');
            
        wp_dequeue_style('em-ui-css'); // stop Event Manager jQuery UI CSS interfering. 
        
        wp_enqueue_script('jquery-ui-core');
        wp_enqueue_script('jquery-ui-tabs');
        wp_enqueue_script('jquery-ui-sortable');
        wp_enqueue_script('jquery-ui-draggable');
        wp_enqueue_script('jquery-ui-droppable');
        wp_enqueue_script('jquery-ui-selectable');
        wp_enqueue_script('jquery-ui-resizable');
        wp_enqueue_script('jquery-ui-dialog');
        wp_enqueue_script('jquery-ui');
        wp_enqueue_script('jquery-ui-core');
        wp_enqueue_script('jquery-ui-datepicker');
        
        wp_enqueue_script( 'jquery' );    
        
        wp_register_script('jquery-cookie', get_bloginfo('template_directory').'/js/jquery.cookie.js',array('jquery'),null);
        wp_enqueue_script('jquery-cookie');

        wp_register_script( 'jquery-ui-core', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js',false,null);
        wp_enqueue_script( 'jquery-ui-core' );            

        wp_deregister_script( 'dynamix' );    
        wp_register_script( 'dynamix', get_bloginfo('template_directory').'/js/dynamix.min.js',false,null);
        wp_enqueue_script( 'dynamix' );
        
        if(get_option('jwplayer_js')) { // Check jw player javascript file is present
        
        $CWZ_jwplayer_js = get_option('jwplayer_js');
        
        wp_deregister_script( 'jw-player' );    
        wp_register_script( 'jw-player', $CWZ_jwplayer_js );
        wp_enqueue_script( 'jw-player' );        
        }
    
    }
}    
add_action('init', 'init_dynscripts',100);


/***************************************************************/
/*    Initialise DynamiX and JQUERY Scripts *END*               */
/***************************************************************/

Now it seems loading ui components but anyway i have the problem i explained up here on sliding dropdowns. 😀

Avatar
tidusuper91
Member
Free Members
Offline
Mar 5, 2012 - 4:55 am

Ok i solved. It was missing jquery.easing plugin, so here's the complete workaround:

  1. Download Jquery.cookie and Jquery.easing plugins
  2. Rename them in jquery.cookie.js and jquery.easing.js
  3. Put them in /wordpressfolder/wp-content/themes/Dynamix/js
  4. Edit functions.php of the theme from
***************************************************************/
/*    Initialise DynamiX and JQUERY Scripts                       */
/***************************************************************/

to:

/***************************************************************/
/*    Initialise DynamiX and JQUERY Scripts *END*               */
/***************************************************************/

 

pasting this:

 

/***************************************************************/
/*    Initialise DynamiX and JQUERY Scripts                       */
/***************************************************************/

function init_dynscripts() {
    if (!is_admin()) {

        if ( function_exists('bp_is_blog_page')) {
            if (!bp_is_blog_page()) {
                wp_enqueue_script( 'bp-js', BP_PLUGIN_URL . '/bp-themes/bp-default/_inc/global.js', array( 'jquery' ) );
            }
        }

        wp_register_style('dynamix-style', get_bloginfo('stylesheet_url'),false,null);
        wp_enqueue_style('dynamix-style');
            
        wp_dequeue_style('em-ui-css'); // stop Event Manager jQuery UI CSS interfering. 
        
        wp_enqueue_script('jquery-ui-core');
        wp_enqueue_script('jquery-ui-tabs');
        wp_enqueue_script('jquery-ui-sortable');
        wp_enqueue_script('jquery-ui-draggable');
        wp_enqueue_script('jquery-ui-droppable');
        wp_enqueue_script('jquery-ui-selectable');
        wp_enqueue_script('jquery-ui-resizable');
        wp_enqueue_script('jquery-ui-dialog');
        wp_enqueue_script('jquery-ui');
        wp_enqueue_script('jquery-ui-core');
        wp_enqueue_script('jquery-ui-datepicker');
        
        wp_enqueue_script( 'jquery' );    
        
        wp_register_script('jquery-cookie', get_bloginfo('template_directory').'/js/jquery.cookie.js',array('jquery'),null);
        wp_enqueue_script('jquery-cookie');
        
        wp_register_script('jquery-easing', get_bloginfo('template_directory').'/js/jquery.easing.js',array('jquery'),null);
        wp_enqueue_script('jquery-easing');
        

        wp_deregister_script( 'dynamix' );    
        wp_register_script( 'dynamix', get_bloginfo('template_directory').'/js/dynamix.min.js',false,null);
        wp_enqueue_script( 'dynamix' );
        
        if(get_option('jwplayer_js')) { // Check jw player javascript file is present
        
        $CWZ_jwplayer_js = get_option('jwplayer_js');
        
        wp_deregister_script( 'jw-player' );    
        wp_register_script( 'jw-player', $CWZ_jwplayer_js );
        wp_enqueue_script( 'jw-player' );        
        }
    
    }
}    
add_action('init', 'init_dynscripts',100);


/***************************************************************/
/*    Initialise DynamiX and JQUERY Scripts *END*               */
/***************************************************************/

hope it will be useful to others. 😀 Thanks for your support!

Avatar
tidusuper91
Member
Free Members
Offline
Mar 5, 2012 - 5:29 am

A better solution could be to use a Child Theme and write the functions.php as this:

<?php 
/**
 * DynamiX Child Theme Functions
 * Load languages directory for translation
*/ 
// Removing original init_dynscripts replacing with personal one

/*********************************************
Replacing the action for embedding JS scripts
with one more compatible with plugins
**********************************************/

function my_init_dynscripts_new_action () {
    remove_action('init','init_dynscripts',100);
    add_action('init','my_init_dynscripts',100);
}
function my_init_dynscripts() {
    if (!is_admin()) {

        if ( function_exists('bp_is_blog_page')) {
            if (!bp_is_blog_page()) {
                wp_enqueue_script( 'bp-js', BP_PLUGIN_URL . '/bp-themes/bp-default/_inc/global.js', array( 'jquery' ) );
            }
        }

        wp_register_style('dynamix-style', get_bloginfo('stylesheet_url'),false,null);
        wp_enqueue_style('dynamix-style');
            
        wp_dequeue_style('em-ui-css'); // stop Event Manager jQuery UI CSS interfering. 
        
        wp_enqueue_script('jquery-ui-core');
        wp_enqueue_script('jquery-ui-tabs');
        wp_enqueue_script('jquery-ui-sortable');
        wp_enqueue_script('jquery-ui-draggable');
        wp_enqueue_script('jquery-ui-droppable');
        wp_enqueue_script('jquery-ui-selectable');
        wp_enqueue_script('jquery-ui-resizable');
        wp_enqueue_script('jquery-ui-dialog');
        wp_enqueue_script('jquery-ui');
        wp_enqueue_script('jquery-ui-core');
        wp_enqueue_script('jquery-ui-datepicker');
        
        wp_enqueue_script( 'jquery' );    
        
        wp_register_script('jquery-cookie', get_bloginfo('template_directory').'/js/jquery.cookie.js',array('jquery'),null);
        wp_enqueue_script('jquery-cookie');
        
        wp_register_script('jquery-easing', get_bloginfo('template_directory').'/js/jquery.easing.js',array('jquery'),null);
        wp_enqueue_script('jquery-easing');        

        wp_deregister_script( 'dynamix' );    
        wp_register_script( 'dynamix', get_bloginfo('template_directory').'/js/dynamix.min.js',false,null);
        wp_enqueue_script( 'dynamix' );
        
        if(get_option('jwplayer_js')) { // Check jw player javascript file is present
        
        $CWZ_jwplayer_js = get_option('jwplayer_js');
        
        wp_deregister_script( 'jw-player' );    
        wp_register_script( 'jw-player', $CWZ_jwplayer_js );
        wp_enqueue_script( 'jw-player' );        
        }
    
    }
} 
add_action('after_setup_theme', 'my_init_dynscripts_new_action');
?>

In this way we're replacing the action of the parent theme with the one edited without hard coding anything. This will be useful for futhrt upgrades of the theme.

Avatar
Yellow Swordfish
Glinton, England
SP Master
Offline
Mar 5, 2012 - 8:26 am

... which is always a good goal to aim for.

andy-signature.png
YELLOW
SWORDFISH
Avatar
tidusuper91
Member
Free Members
Offline
Mar 5, 2012 - 1:24 pm

:D. Hope it will help others. 😀

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625