Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • If I remember right, get_links() is deprecated since Version 2.1, so let’s use wp_list_bookmarks() instead.

    Try this:
    <?php wp_list_bookmarks('categorize=1&before=<li>&after=</li>&show_images=0&show_description=0&orderby=name'); ?>

    I think it does everything you’re looking for in that code. Take a look at the wp_list_bookmarks Codex page if you need further customization.

    Thread Starter aslee

    (@aslee)

    I’m still not sure why this fails on the default theme and such, but I did work a hack up to get around it. In comments.php there is a piece of code that looks something like this:

    < ?php if ( $user_ID ) : ?>
       <p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"> < ?php echo $user_identity; ?></a>. <br /> <a href="<?php echo get_option(’siteurl’); ?>/wp-login.php?action=logout" title="Log out of this account">Logout &raquo;</a></p>
    < ?php else : ?>

    I changed it to look like this instead:

    < ?php if ( $user_ID ) : ?>
       < ?php global $user_email; global $user_url; get_currentuserinfo(); ?>
       <p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"> < ?php echo $user_identity; ?></a>. <br /> <a href="<?php echo get_option(’siteurl’); ?>/wp-login.php?action=logout" title="Log out of this account">Logout &raquo;</a></p>
    		<input type="hidden" name="author" id="author" value="<?php echo $user_identity; ?/>" />
    		<input type="hidden" name="email" id="email" value="<?php echo $user_email; ?/>" />
    		<input type="hidden" name="url" id="url" value="<?php echo $user_url; ?/>" />
    < ?php else : ?>

    Note the < ?php global $user_email; global $user_url; get_currentuserinfo(); ?> along with the input type="hidden" fields. It initializes $user_url and $user_email so that you can reference them.

    I don’t think author/email/url will need changing to fit themes, but I could be wrong.

    I do the reverse a lot of the time – I host on a PowerMac but I do a lot of fiddling-around on a Linux box. I copy the WordPress install back and forth without any trouble.

    You <i>might</i> have to make a tiny change to your wp-config.php, as per the Warker instructions (step 13). More than likely, you changed it for MAMP and have to change it back now.

    I’m not 100% familiar with how hard they stack the boxes at Hostgator, but a shared plan is probably enough for the immediate future, and then some. I’m sure they’ll be more than happy to help you with migration if you grow big enough to need a dedicated box.

    Log into your old blog as Admin. Go to Manage>Export and download the export file.
    Then, consulting the Codex page for safety, log into your new blog (also as Admin). Go to Manage>Import and upload the export file and follow the import directions. =)

    Thread Starter aslee

    (@aslee)

    This is very true. =D I thought I could work from a general solution to the specific one, but my SQL-fu is weak. I think having both in one place will be good for future reference, though.

    That works beautifully!
    Thanks again!

    chmod the file to be group and world writable (666).

    OK, so I downloaded Purpling and took it apart for you.

    in rsidebar.php, there’s a set of lines that looks like this:

    <?php get_links($link_cat->cat_id, '<li>', '</li>', '<br />', FALSE, 'id', TRUE,
    TRUE, -1, TRUE); ?>

    If you look at the Codex page for get_links you can see what this means, and change it to your heart’s content.

    If you’re happy with it otherwise, you find out that the second TRUE after ‘id’ determines whether your ratings will show up (try editing one of the links’ rating to 9, and you’ll see it change to 9). You want it to go away, so change it to look like so:

    <?php get_links($link_cat->cat_id, '<li>', '</li>', '<br />', FALSE, 'id', TRUE,
    FALSE, -1, TRUE); ?>

    You could also change ‘id’ to ‘name’ to alphabetize your links, if you’d like.

    The call to wp_list_bookmarks in the PHP file probably has show_rating=1. I’m not familiar with Purpling, but it’s probably rightsidebar.php or something similar.

    If you set show_rating=0, it should go away.

    Thread Starter aslee

    (@aslee)

    That’s very helpful, thank you!

    However, I can’t figure out how to pull from one specific link category in that case. I tried changing the SQL query to “SELECT link_id FROM $wpdb->links where link_category=something ORDER BY RAND() LIMIT 5″, which seems intuitive (looking at the SQL structure, but on further inspection all of my links have the link_category=0, even though they belong to separate categories in WordPress.

    Going into mySQL and doing “SELECT * FROM wp_links” I’m afraid I don’t see any other easy way to distinguish them.

    Am I missing something obvious?
    Thanks!

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