Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Won't let me post new topic
Avatar
David Long
Member
Free Members
sp_UserOfflineSmall Offline
Apr 27, 2013 - 2:01 pm

Downloaded the plugin, installation was easy, set up a category, created groups, created forums......only problem is that when I click on the New Topic button.....nothing happens. Won't let me create a new topic.....any ideas?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 27, 2013 - 2:10 pm

You most probably have a JavaScript conflict - your wp theme or another plugin - which needs to be fixed. This codex article explains what this means and what to look for:

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

A link to your forum page might help us identify if this is the case although you can also check using a script console tool like Firebug.

andy-signature.png
YELLOW
SWORDFISH
Avatar
David Long
Member
Free Members
sp_UserOfflineSmall Offline
Apr 27, 2013 - 2:41 pm

Firebug shows two errors:

$ is not a function
http://alti2udeoutdoors.com/wp.....?ver=3.5.1
Line 103

$ is not a function
http://alti2udeoutdoors.com/forum/
Line 124

Any ideas?

Here is a link:

http://alti2udeoutdoors.com/forum/

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 27, 2013 - 5:06 pm

Andy gave you a link with the issue...

<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js?ver=3.5.1'></script>

you have a theme or plugin incorrectly loading jquery from external source... and a quite old version at that...  it wont work well with other wp plugins or themes that use jquery and expect the version that comes with wp...

first step is identify the culprit... try a quick switch to wp default theme and see if it works... I doubt it, but easiest to try first...

then disable all other plugins and see if it works... when it does, enable one by one until it breaks...

then we can see about helping you fix the bad plugin or theme...

 

Avatar
David Long
Member
Free Members
sp_UserOfflineSmall Offline
Apr 27, 2013 - 11:11 pm

It works in the WP default theme.....so it's not a plugin. Any ideas what my next step would be? Thanks for your help.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 27, 2013 - 11:19 pm

that means it would be your wp theme doing it wrong...  so lets find where in the theme it loads that line of code.. and we can help fix it... so search your theme... often in header.php or functions.php.. but could be anywhere based on theme structure...

Avatar
David Long
Member
Free Members
sp_UserOfflineSmall Offline
Apr 28, 2013 - 12:05 am

I found this line in functions.php

wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js');

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 28, 2013 - 1:20 am

yup. thats the culprit - at least the first one we see...  Now unfortunately, I dont have a context for how that is used... which hook will get to it... so will give some code to try, but might need more of the code around that one line..  There is likely an wp_deregister_script(...) and wp_enqueue_script(...) around it too...  so guessing it looks something like this:

wp_deregister_script('jquery');
wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js');
wp_register_script('jquery');

if so, we want to replace that section or those lines with this:

if (!sp_is_forumpage()) {
    wp_deregister_script('jquery');
    wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js');
}
wp_register_script('jquery');

Now that new code will continue to load the old, external library on non forum pages so something else doesnt break... but on forum pages, it will follow wp standards and load the wp version of jquery...

assuming, I have done that right and I am guessing at the other lines...

 

Avatar
David Long
Member
Free Members
sp_UserOfflineSmall Offline
Apr 28, 2013 - 8:33 am

Here is the script I currently have surrounding the call to js:

if (!function_exists('load_theme_scripts')) {
    function load_theme_scripts() {

    $jscriptURL = get_template_directory_uri().'/js/';
    wp_deregister_script( 'jquery' );
    wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js');
    wp_enqueue_script( 'jquery' );
    wp_register_script('jsEasing', ($jscriptURL.'jquery.easing.1.3.js'), array('jquery'), NULL, true );
    wp_enqueue_script('jsEasing');                
    wp_register_script('myScript', ($jscriptURL.'script.js'), array('jquery'), NULL, true );
    wp_enqueue_script('myScript');
    wp_register_script('mySlides', ($jscriptURL.'slides.min.jquery.js'), array('jquery'), NULL, true );
    wp_enqueue_script('mySlides');
    wp_register_script('myCycle', ($jscriptURL.'jquery.cycle.min.js'), array('jquery'), NULL, true );
    wp_enqueue_script('myCycle');
    wp_register_script('jselectBox', ($jscriptURL.'jquery.selectBox.js'), array('jquery'), NULL, true );
    wp_enqueue_script('jselectBox');

    }
}

The name of the page where my forum is located is forum, so, with that being said, here is how the new code looks:

if (!function_exists('load_theme_scripts')) {
    function load_theme_scripts() {

if (!sp_is_forum()) {

    $jscriptURL = get_template_directory_uri().'/js/';
    wp_deregister_script( 'jquery' );
    wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js');
    wp_enqueue_script( 'jquery' );
    wp_register_script('jsEasing', ($jscriptURL.'jquery.easing.1.3.js'), array('jquery'), NULL, true );
    wp_enqueue_script('jsEasing');                
    wp_register_script('myScript', ($jscriptURL.'script.js'), array('jquery'), NULL, true );
    wp_enqueue_script('myScript');
    wp_register_script('mySlides', ($jscriptURL.'slides.min.jquery.js'), array('jquery'), NULL, true );
    wp_enqueue_script('mySlides');
    wp_register_script('myCycle', ($jscriptURL.'jquery.cycle.min.js'), array('jquery'), NULL, true );
    wp_enqueue_script('myCycle');
    wp_register_script('jselectBox', ($jscriptURL.'jquery.selectBox.js'), array('jquery'), NULL, true );
    wp_enqueue_script('jselectBox');

    }
}

}

Unfortunately, when I alter the functions.php to look like this, the entire screen goes solid white and I can't access any pages. I am forced to re-upload the original functions.php over it to be able to access the site again. Am I doing something wrong with how I am inserting it?

 

Thanks for your patience.

Avatar
David Long
Member
Free Members
sp_UserOfflineSmall Offline
Apr 28, 2013 - 8:58 am

Ok, realizing my error in the above code, here is my new code and IT WORKS!

if (!function_exists('load_theme_scripts')) {
    function load_theme_scripts() {

if (!sp_is_forumpage('forum')) {

    $jscriptURL = get_template_directory_uri().'/js/';
    wp_deregister_script( 'jquery' );
    wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js');
    wp_enqueue_script( 'jquery' );
    wp_register_script('jsEasing', ($jscriptURL.'jquery.easing.1.3.js'), array('jquery'), NULL, true );
    wp_enqueue_script('jsEasing');                
    wp_register_script('myScript', ($jscriptURL.'script.js'), array('jquery'), NULL, true );
    wp_enqueue_script('myScript');
    wp_register_script('mySlides', ($jscriptURL.'slides.min.jquery.js'), array('jquery'), NULL, true );
    wp_enqueue_script('mySlides');
    wp_register_script('myCycle', ($jscriptURL.'jquery.cycle.min.js'), array('jquery'), NULL, true );
    wp_enqueue_script('myCycle');
    wp_register_script('jselectBox', ($jscriptURL.'jquery.selectBox.js'), array('jquery'), NULL, true );
    wp_enqueue_script('jselectBox');

    }
}

}

Thanks for all your help! Works great!

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: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625