Showing Author Name for Recent Links plug-in
-
I’ve got a blog with multiple authors, and we just put in the Recent Links plugin. We’d like for the links to show which author wrote them, e.g.,
LINK (by Matt)
LINK (by Gordon)
I’m halfway there, but I don’t know enough MySQL to get the rest of the way. I’ve got it to show author _numbers_, but not author _names_.
I added the following to the plug-in:
*added link_author to the SQL SELECT at the beginning of the plug-in. (link_author is already part of the recent links database).
*added line:
$link->link_author = stripslashes($link->link_author);
to the relevant section, and
*added line:
$after = ‘(by ‘.wptexturize($link->link_author).’)’;
immediately before the .out command. (Yeah, there’s probably a more aesthetic way to do it, but that worked pretty well).
What that has gotten me is:
LINK (by 4)
LINK (by 5)
Now, I think I need to get into another table of the database and somehow match up the author id to an author name. Actually doing that is beyond me right now. How exactly would I go about this? Thanks.
(By the way, the site as currently stands is at http://www.timesandseasons.org . The recent links section is in the sidebar under the title “Bloggernacle Notes.” The direct link to that section is http://www.timesandseasons.org/wp/index.php#notes ).
- The topic ‘Showing Author Name for Recent Links plug-in’ is closed to new replies.