Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Fixed] How to tell if global.js is working properly?

  • Avatar of Connor
    Connor
    Member

    @con101193

    I have an issue on my site where I cannot submit a post without getting a 404 error, I was told it was probably down to the global.js however I don’t know if that is working or not, how do I tell.

    my site is http://www.utraz.com the problem is when trying to post,

    if you would like to try it and see if you can find the problem you can use the log in details :

    User: test
    password: password

Viewing 9 replies - 1 through 9 (of 9 total)
  • Take a look at the HTML source of http://utraz.com/members/test/activity/

    You’ll see

    http://utraz.comWP_PLUGINS_DIR/buddypress/bp-themes/bp-default/_inc/global.js?ver=20110921

    Obviously, that WP_PLUGINS_DIR shouldn’t be there! This is a strange issue. Have you moved your wp-content folder, or the plugins folder, or done any other non-standard ways to customise your BuddyPress install?

    Avatar of Connor
    Connor
    Member

    @con101193

    Thanks for getting back,

    Nope the wp-CONTENTfile is still there, and all in the correct place buddypress is ROOT>WP-CONTENT>PLUGINS>BUDDYPRESS and the themes are also the same

    Avatar of Connor
    Connor
    Member

    @con101193

    I know I added this code here:

    if ( !function_exists( ‘bp_dtheme_enqueue_scripts’ ) ) :
    /**
    * Enqueue theme javascript safely
    *
    * @see http://codex.wordpress.org/Function_Reference/wp_enqueue_script
    * @since 1.5
    */
    function bp_dtheme_enqueue_scripts() {
    // Bump this when changes are made to bust cache
    $version = ’20110921′;

    // Enqueue the global JS – Ajax will not work without it
    wp_enqueue_script( ‘dtheme-ajax-js’, WP_PLUGINS_DIR . ‘/buddypress/bp-themes/bp-default/_inc/global.js’, array( ‘jquery’ ), $version );

    // Add words that we need to use in JS to the end of the page so they can be translated and still used.
    $params = array(
    ‘my_favs’ => __( ‘My Favorites’, ‘buddypress’ ),
    ‘accepted’ => __( ‘Accepted’, ‘buddypress’ ),
    ‘rejected’ => __( ‘Rejected’, ‘buddypress’ ),
    ‘show_all_comments’ => __( ‘Show all comments for this thread’, ‘buddypress’ ),
    ‘show_all’ => __( ‘Show all’, ‘buddypress’ ),
    ‘comments’ => __( ‘comments’, ‘buddypress’ ),
    ‘close’ => __( ‘Close’, ‘buddypress’ ),
    ‘view’ => __( ‘View’, ‘buddypress’ )
    );

    wp_localize_script( ‘dtheme-ajax-js’, ‘BP_DTheme’, $params );
    }
    add_action( ‘wp_enqueue_scripts’, ‘bp_dtheme_enqueue_scripts’ );
    endif;

    I put this in the last section of functions.php

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    WP_PLUGINS_DIR should be renamed to WP_PLUGIN_DIR.

    Not sure how an extra ‘S’ was added, but please remove the ‘S’ and see what happens.

    Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    WP_PLUGIN_DIR

    not plugins

    Avatar of Connor
    Connor
    Member

    @con101193

    Thank you both for that, it directed me in the right direction… I removed the wp_plugins_dir to the full link and now it works.

    Once again thank you :)

    Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    I’m out of here I keep replying and others are too. :O

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    Connor – glad that worked!

    modemlooper – Ha! :p

    Another fix, fixed!

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

You must be logged in to reply to this topic.