The MU forums have moved to WordPress.org

Anything wrong with this code? (5 posts)

  1. drmike
    Member
    Posted 17 years ago #

    Greets:

    For some reason, the third link won't get tagged with a category. Anyone see anything wrong with it? I can't. :(

    Thanks,
    -drmike

    $wpdb->query("INSERT INTO $wpdb->linkcategories (cat_id, cat_name) VALUES (1, '".addslashes(__('Blogroll'))."')");
    $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_owner, link_rss) VALUES ('http://tdjc.be/', 'Dr Mikes Blog', 1, '$user_id', 'http://tdjc.be/feed/');");
    $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_owner, link_rss) VALUES ('http://daria.be/', 'daria.be', 1, '$user_id', 'http://daria.be/feed/');");
    $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_owner, link_rss) VALUES ('http://daria.be/forums/', 'daria.be Support Forums', 1, '$user_id', 'http://daria.be/feed/');");

  2. kahless
    Member
    Posted 17 years ago #

    Mike,

    Did you add these tables to the db? My install doesn't have linkcategories or links. I've had to find workarounds for themes that assume these tables.

  3. drmike
    Member
    Posted 17 years ago #

    Actually I had that on my todo list as I remember you had an issue.

    That's actually a PHP function that allows you to work with changing table prefixes in your database. Open up wp-settings.php and go down about 80 lines. You'll see how and where they're translated.

    For example, I have:

    wp_1_links
    wp_2_links
    wp_3_links

    As for the linkcategories, I know that they're being translated elsewhere into the:

    wp_1_categories
    wp_2_categories
    wp_3_categories

    tables since that's where they wind up in.

    That maybe a solution right there as, I know here, Blogroll is actually cat_ID 2 for me. Might not be though as two fo the links go in there and the thrid one doesn't. So I know the code should be right but something is throwing it off for me.

    My guess is that you're looking at the Connections Reloaded theme as I saw that occur but haven't in any others as of yet. Haven't had a chance to look at it either.

    Thanks,
    -drmike

  4. kahless
    Member
    Posted 17 years ago #

    I figured out how to do what I wanted in this thread. The themes I had trouble with are

    aalglatt
    Connections
    Daisy Rae Gemini
    Dixie Belle
    Freshy
    K2 (maybe have to check again)
    lightCMS
    Out There

    I'm up to about 70 themes. I downloaded the theme pack and tried to clean them up and add in my footer info and added my admin bar to all of them. There are still a few minor issues with some of them but those can be worked out later. I also tried to widget enable any of the themes I installed that weren't, like treacle.

  5. drmike
    Member
    Posted 17 years ago #

    I know that Daisy Rae Gemini appears to be coded for WP 1.5. The template tag names are different now in 2.0.

About this Topic