The MU forums have moved to WordPress.org

Solution to PLUGIN COMMANDER and NEXTGEN Gallery (7 posts)

  1. enriqueg
    Member
    Posted 16 years ago #

    Hi to all.

    My name is Enrique.

    I´ve seen you have some problems with the combination "PLUGIN COMMANDER" and "NEXTGEN GALLERY".

    I spent some hours "debugging" the code and i found a fast solution.

    The problem of that compatibility on the NEXTGEN case, is that the plugin checks "current_user_can('activ...plugins')... that cannot be evaluated correctly when let´s say the blog is in a "batch" process. (Creation from registration, or Admin creation).

    So: Wanna solve it? MAKE THIS ON YOUR OWN RISK.

    Instructions: MODIFY just 2 LINES FROM FILE: ngginstall.php of the nextgen plugins folder.

    Just add this //, to the lines 2 lines below "//Check for capability" (Lines 9 and 10) of the last version of that plugin.

    ----------------------------------------------------
    IT MUST LOOK LIKE THIS ;)

    function nggallery_install () {

    global $wpdb , $wp_roles, $wp_version;

    // Check for capability
    // if ( !current_user_can('activate_plugins') )
    // return;

    --------------------------
    Pls: Reply me with your feedback.
    Worked? Want to thank me a lot?? haha. paypal me to: admin@headhunterfinder.com some cents ;)

    Cheers,
    Enrique

  2. enriqueg
    Member
    Posted 16 years ago #

    *********************************************************
    COMPLETE SOLUTION - Sorry, one step missing.
    ********************************************************
    Please, don´t think i can fail you!!!

    I ommited one step. Now the solution is tested in every possible way and i am writing the complete solution here)

    First of all i am using:
    * WPMU 2.6.1,
    * NEXT-GEN Gallery 0.99.1
    * PLUGIN COMMANDER 1.1.5

    TESTED CASES:
    *without Plugin commander, with Plugin commander, auto-activation, mass act, mass deact, real new user/new blog plug-in auto-activation, admin user existentnew blog plug-in auto-activation, existing user new blog plug-in auto-activation. Almost every test case had different technical aspects to consider of the env. of both plugins relation.

    ERGO - i think there are no more possibilities.

    AGAIN: MAKE THIS MODs UNDER YOUR OWN RISK.

    FIRST STEP:
    -----------

    FILE: ngginstall.php of the nextgen plugins folder.
    ADD "//" BEFORE. (line 9, and 10) (Check it with my code)
    --------------------------------
    function nggallery_install () {

    global $wpdb , $wp_roles, $wp_version;

    // Check for capability
    // if ( !current_user_can('activate_plugins') )
    // return;

    SECOND STEP:
    ------------

    FILE: nggallery.php(Line 213 aprox) in the nextgen plugins folder.
    LOOK FOR THIS:
    // init tables in wp-database if plugin is activated
    function ngg_install() {
    // Check for tables
    AND ADD:
    include_once (dirname (__FILE__)."/ngginstall.php");
    AFTER // Check for tables.

    SO THE FINAL RESULT IS:

    // init tables in wp-database if plugin is activated
    function ngg_install() {
    // Check for tables
    include_once (dirname (__FILE__)."/ngginstall.php");
    nggallery_install();
    }

    ----------------------------------------------------
    That´s all.

    Pls: Reply with your feedback.

    Cheers,
    Enrique

  3. mediafetish
    Member
    Posted 16 years ago #

    I just tried these modifications and they worked perfectly. I haven' tested every scenario I can think of but these mods solved the problem I was having.

    I don't know if they should be submitted to the author for the next version or not cuz I'm not sure about vulnerabilities and so on - but in my case, this did what I wanted - caused plugin commander's settings to work on NextGEN. Wonderful!

    Thank you Enrique for taking the time to post this - I was afraid to get into NextGEN's code - it's a pretty big plug-in.

    You saved me a major headache. Thanks!

  4. VentureMaker
    Member
    Posted 16 years ago #

    BTW, I tracked down one interesting bug (or 'feature'...) of WP e-Commerce.

    When you create a new blog and activate WP e-Commerce in it - it'll not create default setting in DB and it'll also show directory permissions errors in 2.6.3

    But if you upload an image (or any other file) when creating post/page BEFORE activating WP e-Commerce - everything will be OK.

    I saw that WP e-Commerce does not create a directory structure inside blogs.dir/<blog_id> while uploading an image will create that structure and thus WP e-Commerce will start working well.

  5. gpo1
    Member
    Posted 16 years ago #

    I want to use WP e-commerce accessible only to admin, not to users,how can I achieve this?

  6. Ovidiu
    Member
    Posted 16 years ago #

    delete-me :-( sorry posted in the wrong topic

  7. gpo1
    Member
    Posted 16 years ago #

    @ enriqueg, can you submit this fix to the author for NextGEN?

About this Topic