Forum Replies Created

Viewing 12 replies - 1 through 12 (of 12 total)
  • Forum: Plugins
    In reply to: dbdelta doesn’t work
    Thread Starter god0fgod

    (@god0fgod)

    I’m surprised, thought this would be a simple problem to experienced people.

    I suppose I’ll have to analyse wordpress myself and try to figure it out.

    Alternatively I could try not using dbdelta but that is the proper way, apparently.

    Oh, and the table isn’t created.

    It’s the same with me. What the heck is wrong with it. I tried looking for any output in the source but it isn’t there:

    Nothing from “echo “DBINFO:” . dbDelta($sql);” here. Only the relevant parts were copied.
    <?
    function create_links_table(){
    //Create link table
    global $wpdb;
    $table_name = $wpdb->prefix . “fim_links”;
    if($wpdb->get_var(“SHOW TABLES LIKE ‘$table_name'”) != $table_name) {
    $sql = “CREATE TABLE ” . $table_name . ” (
    order mediumint(9) NOT NULL AUTO_INCREMENT,
    href text DEFAULT ‘#’ NOT NULL,
    id text DEFAULT ‘0’ NOT NULL,
    block mediumint(9) DEFAULT ‘1’ NOT NULL,
    PRIMARY KEY order (order)
    );”;
    require_once(ABSPATH . ‘wp-admin/includes/upgrade.php’);
    echo “DBINFO:” . dbDelta($sql);
    $sql = “INSERT INTO ” . $table_name .
    ” (href, id) ” .
    “VALUES (‘http://crytekuk.info&#8217;,’link_example’)”;
    $wpdb->query($sql);
    }
    }
    function setup_fim(){
    setup_themes();
    add_option(“fim_version”,FIM_VERSION);
    add_option(“fim_widgets”,”links,ajax_login”);
    create_links_table();
    }
    register_activation_hook(__FILE__, “setup_fim”);
    ?>

    Thread Starter god0fgod

    (@god0fgod)

    I fixed this by finding in nggallery.php:

    define(‘NGGALLERY_ABSPATH’, str_replace(“\\”,”/”, WP_PLUGIN_DIR . ‘/’ . plugin_basename( dirname(__FILE__) ) . ‘/’ ));

    And I replaced it with:

    define(‘NGGALLERY_ABSPATH’, str_replace(“\\”,”/”, WP_PLUGIN_DIR . ‘/nextgen-gallery/’ ));

    But now the slideshow fails and all the pictures are in one column.

    Thread Starter god0fgod

    (@god0fgod)

    Try what i suggested to see what you get.

    I’m going to look for that constant in a little while.

    Thread Starter god0fgod

    (@god0fgod)

    Okay, in lib/core.php where the error is made, which I found, I altered the error to give debug information. I replaced the render function with:

    function render($template_name, $vars = array ()) {
    foreach ($vars AS $key => $val) {
    $$key = $val;
    }

    if (file_exists (TEMPLATEPATH . “/nggallery/$template_name.php”)) {
    include (TEMPLATEPATH . “/nggallery/$template_name.php”);
    } else if (file_exists (NGGALLERY_ABSPATH . “/view/$template_name.php”)) {
    include (NGGALLERY_ABSPATH . “/view/$template_name.php”);
    } else {
    echo “<p>Rendering of template $template_name.php failed</p>

    DEBUG INFOMATION:
    TEMPLATEPATH: ” . TEMPLATEPATH . “
    NGGALLERY_ABSPATH: ” . NGGALLERY_ABSPATH . “
    template_name: “. $template_name;
    }
    }

    Now I get:

    DEBUG INFOMATION:
    TEMPLATEPATH: /home/users/web/b2863/d5.godofgod/public_html/frd/wordpress/wp-content/themes/fluid-blue-10
    NGGALLERY_ABSPATH: /home/users/web/b2863/d5.godofgod/public_html/frd/wordpress/wp-content/plugins//hermes/bosweb/web286/b2863/d5.godofgod/public_html/frd/wordpress/wp-content/plugins/nextgen-gallery/
    template_name: gallery

    So the NGGALLERY_ABSPATH is completely, bizarrely wrong. Where is that constant defined so I can fix it?

    I recommend others try replacing the function and see what they get.

    Thread Starter god0fgod

    (@god0fgod)

    I deactivated all other plugins and it doesn’t work still.

    I thought this would be the case because it stopped working at a random time without any changes.

    Where is this error made? What file? I’d like to see if I can find any cause.

    Thread Starter god0fgod

    (@god0fgod)

    Oh, what permission is it supposed to be?

    I have 755 for the nextgen-gallery/view folder.

    I may have broke this when I had to change my file permissions for my blog because I kept getting 500 Server Errors.

    And thank you for this fast reply.

    Thread Starter god0fgod

    (@god0fgod)

    I’ve added the tag “nextgen-gallery” so the plugin author may respond, as was said on http://alexrabe.boelinger.com/forums/

    Thread Starter god0fgod

    (@god0fgod)

    I’m completely lost with this and I definitely need help, so I’ll bump this topic.

    Thread Starter god0fgod

    (@god0fgod)

    Yes I found one that looks good for now. I’ll have a wider look later. : )

    Thread Starter god0fgod

    (@god0fgod)

    Okay then I’ll take a look. I’ll try to find something that looks similar to the default theme. THanks for the quick reply.

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