The MU forums have moved to WordPress.org

Questions Regarding the Change of BLOGROLL to LINKS (6 posts)

  1. hhuskies
    Member
    Posted 16 years ago #

    Hello,

    Okay, so I have changed both wp-admin/menu.php and wp-admin/link-manager.php files, and now I need to change wpmu-functions.php. Correct?

    Here is the code that I found in wpmu-functions.php that I believe I need to change. But my question is WHAT exactly do I need to change? Every place where blogroll is mentioned? Change that?

    -----------------------------------------------------------
    // Default category
    $wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_count, category_description) VALUES ('0', '".addslashes(__('Uncategorized'))."', '".sanitize_title(__('Uncategorized'))."', 1, '')");
    $blogroll_id = $wpdb->get_var( "SELECT cat_ID FROM {$wpdb->sitecategories} WHERE category_nicename = 'blogroll'" );
    if( $blogroll_id == null ) {
    $wpdb->query( "INSERT INTO " . $wpdb->sitecategories . " (cat_ID, cat_name, category_nicename, last_updated) VALUES (0, 'Blogroll', 'blogroll', NOW())" );
    $blogroll_id = $wpdb->insert_id;
    }
    $wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, link_count, category_description) VALUES ('{$blogroll_id}', '".addslashes(__('Blogroll'))."', '".sanitize_title(__('Blogroll'))."', 2, '')");
    $wpdb->query("INSERT INTO $wpdb->link2cat (link_id, category_id) VALUES (1, $blogroll_id)");
    $wpdb->query("INSERT INTO $wpdb->link2cat (link_id, category_id) VALUES (2, $blogroll_id)");
    $wpdb->query("INSERT INTO $wpdb->link2cat (link_id, category_id) VALUES (3, $blogroll_id)");

    -----------------------------------------------------------

    Another question is whether or not I change where it says $blogroll_id to $link_id, or do I just leave that alone, and only mess with the wording directly in single quotes?

    Thanks!

    Christian

    Thanks!

  2. lunabyte
    Member
    Posted 16 years ago #

    It's only name changes that you would need to do to printed titles.

    Changing variable names wouldn't be too good of an idea.

    __('Blogroll')
    to
    __('Links')

  3. hhuskies
    Member
    Posted 16 years ago #

    Okay, I "think" I figured it out. Basically, this is what I have now. I just changed the areas that said Blogroll or blogroll to Links or links. I didn't change the $blogroll_id. I tested it in a new blog, and it seemed to work. Did I do it right?

    -------------------------------------------------------------

    // Default category
    $wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_count, category_description) VALUES ('0', '".addslashes(__('Uncategorized'))."', '".sanitize_title(__('Uncategorized'))."', 1, '')");
    $blogroll_id = $wpdb->get_var( "SELECT cat_ID FROM {$wpdb->sitecategories} WHERE category_nicename = 'links'" );
    if( $blogroll_id == null ) {
    $wpdb->query( "INSERT INTO " . $wpdb->sitecategories . " (cat_ID, cat_name, category_nicename, last_updated) VALUES (0, 'Links', 'links', NOW())" );
    $blogroll_id = $wpdb->insert_id;
    }
    $wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, link_count, category_description) VALUES ('{$blogroll_id}', '".addslashes(__('Links'))."', '".sanitize_title(__('Links'))."', 2, '')");
    $wpdb->query("INSERT INTO $wpdb->link2cat (link_id, category_id) VALUES (1, $blogroll_id)");
    $wpdb->query("INSERT INTO $wpdb->link2cat (link_id, category_id) VALUES (2, $blogroll_id)");
    $wpdb->query("INSERT INTO $wpdb->link2cat (link_id, category_id) VALUES (3, $blogroll_id)");

  4. hhuskies
    Member
    Posted 16 years ago #

    Thank you Lunabyte. Yeah, if I were changing id's, I think I would have major problems with the database. : )

  5. jalien
    Member
    Posted 16 years ago #

    I don't know if you had a look at this:

    http://mu.wordpress.org/forums/topic.php?id=3138&page&replies=4

    but this is how I did it (the line numbers may be a bit different since they are from an earlier release, but everything should be similar.

  6. hhuskies
    Member
    Posted 16 years ago #

    thanks jalien. Yep, I saw that; and the directions were perfect.

About this Topic

  • Started 16 years ago by hhuskies
  • Latest reply from hhuskies