The MU forums have moved to WordPress.org

Home page list all posts extending functionality.(ah_recent_posts_mu) (29 posts)

  1. Radecki
    Member
    Posted 16 years ago #

    I have recently begun developing a MU powered blogs section for my work at http://blogs.itworldcanada.com, I want to start by saying that I have found this forum and the readme monumentially helpfull in setting it up thus far.

    Now to the problem,

    I am using the plugin "ah_recent_posts_mu" (developed by Ron Rennick and Andrea) to list the most recent post from all pages in order to display them on the main blogs front page. At first it simply displayed the post title and blog title as links. Using that as a starting point I have developed it a little further so that it shows a summary of the posts with the lengths trimmed to a max of 200 words , author, date ...etc.

    The problem is that the post_author attribute returns a number and not a display name. I am assuming that i would have to compare this number (author ID?) to the table wp_users and get the display_name value. With my limited php skill i'm not quite sure how to do this.

    The next problem is more simple. I simply want to format the date output from post_date into a more reader friendly format like 9:40-Thurday, June 21, 2007 insted of 2007-06-21 09:40:11.

    Looking through all the forums I notice that displaying recent post on the main blog is a very common request so once i get this thing stable enough (and talk with Ron and Andrea) I see a very usefull mu-plugin.

    *Side note - not my actual problem
    The reason i am using ah_recent_posts_mu instead of a site wide feed for this is because I am using subdirectories and not subdomains which seems to act wierd with rss inside my actual blogs. Ie, If i go to a subdirectory blog in FF I can subsribe to its feeds no problem via live bookmarks or other rss readers but if i go to my home page blog code and call that rss it isn't display it on the page and gives errors.

    -for cleanliness I will post the code in a reply

  2. Radecki
    Member
    Posted 16 years ago #

    [removed code - drmike]

  3. drmike
    Member
    Posted 16 years ago #

    No, please don't paste the code. Please upload it somewhere for download like http://wpmudevorg.wordpress.com The forums much code up too muck and it breaks the forums as well. Usually you can't copy and paste it either.

    Thanks,
    -drmike

  4. Radecki
    Member
    Posted 16 years ago #

    yeah i was wondering why that took me so long to get the formating right without messing up the page, thanks for the tip.

    Code link
    http://blogs.itworldcanada.com/code/ah-recent-posts-mu.txt

    Although it does say below send post submit button to put code in

    backticks

    which made me assume we would be able to put code up here.....

  5. andrea_r
    Moderator
    Posted 16 years ago #

    Yep, it is a useful starting point, I'll give it that. We've modified it for others to do various things for the front page as well.

    (and yay for canadians!)

  6. Radecki
    Member
    Posted 16 years ago #

    Am I to understand you are "the Andrea" co-developer of this handy plugin....

    If so any idea on what query i would have to run to compare the user id with the display_name ...I can see it all in mySql i just can't php my way there.

    see it so far in action at:

    http://blogs.itworldcanada.com/

    Thanks,

    P.s. Beers and Hockey.. how could anyone not like Canada, oh and igloos of course(everyone lives in them, especially in june).

  7. andrea_r
    Moderator
    Posted 16 years ago #

    Yep, that's me.. although the Ron part did most of the coding and SQL magic. I shall ask him after I feed him.

    He gets hungry having to drive the dogsled home thru all that snow, you know...

  8. andrea_r
    Moderator
    Posted 16 years ago #

    There's a function get_user_details that you could probably squeeze in there.

  9. naijin
    Member
    Posted 16 years ago #

    Radecki, I was playing around with this plugin this morning, you can take a look, might help you out.

    http://www.sendspace.com/file/rq77wk

  10. Radecki
    Member
    Posted 16 years ago #

    naijin ...yes, thank you i finally got the user name to display, I was like 89% there but I have only worked in php that had nothing to do with databases before and very little of it.

    Once I had the query sturcture form the file u provided I was good to go.

    P.S. If your interested in displaying the first 200 words of the post_content I have figured that out and find it quite usefull.

    Thanks again

  11. demonicume
    Member
    Posted 16 years ago #

    Radecki - i'm interested in your mod, care to share?

  12. Radecki
    Member
    Posted 16 years ago #

    http://blogs.itworldcanada.com/code/ah-recent-posts-mu-mod.txt

    You should know that i strip out all the html characters from the post_content as i am only showing a paragraph or 2 too keep away from having huge posts take over the main blog page. I had to strip out html because before i was truncating the text in the middle of an open tag.......oops = messed everything up real bad for a while untill i figured out what was going on.

    resave .txt file as ah-recent-posts-mu.php and add in mu-plugins file then in your home.php folder simply call

    <?php ah_recent_posts_mu(10) ?>
  13. andrea_r
    Moderator
    Posted 16 years ago #

    Nice work. :)

  14. drmike
    Member
    Posted 16 years ago #

    Oh, yeah. Posting it as a *.txt file works as well too. ;)

  15. BillyD
    Member
    Posted 16 years ago #

    Hey Radecki, very nice work. Is there any way to not strip the html and not truncate in the middle of an open tag? I basically want my pictures to be included in the feed.

  16. Radecki
    Member
    Posted 16 years ago #

    Ummm.. maybe basically in the tag

    $strippedDesc = strip_tags($desc);

    you can add allowable tags... If you know the images are going to be at the beggining of every post and wont get cut off you could simply add,

    strip_tags($desc, '<a>');

    and maybe pump up the words to more ie, 120 - 250

    If theres a chance it would be cut off in the middle of the tag it would get a lil more complicated... I am seeing something like(pseudocode)
    if index of

    <a
    and not
    </a>
    then add
    </a>
    at the end or something to that effect.

  17. klezmer41
    Member
    Posted 16 years ago #

    Where do I call:

    <?php ah_recent_posts_mu(10) ?>

    ?

  18. andrea_r
    Moderator
    Posted 16 years ago #

    Wherever you want it to show - like in a sidebar or below posts.

    ie - go into the server file manager and paste in in the main blog's template files.

  19. Radecki
    Member
    Posted 16 years ago #

    BillyD ... aparently I was asleep when i was wriing the reply obvious

    <a>

    isn't the tag you want ... it should be strip_tags($desc, '<img>');

  20. justmaho
    Member
    Posted 16 years ago #

    We fixed the plugin to show display_name instead ID
    http://www.justmaho.com/wpPluggins/ah_recent_posts_mu.txt

  21. yetimmy
    Member
    Posted 16 years ago #

    there is a bug in it
    when some one Customize Permalink Structure
    the link of "...Read this article" is wrong

  22. Bike
    Member
    Posted 16 years ago #

    I just tried this plugin, but noticed that:

    - also the Hello World posts of banned/spam/deleted blogs are being pulled, how can these be excluded?
    - Only one post per blog is included, is that correct? Can it be the latest 10 posts, even if it means that 7 came from the same blog?

    Please see http://biketravellers.com/ (still in test :) for example

    Cheers, Bike

  23. shaythong
    Member
    Posted 16 years ago #

    "Only one post per blog is included, is that correct? Can it be the latest 10 posts, even if it means that 7 came from the same blog?"

    Hi, I want that feature to, to show the latest posts, not just one from each author. I use this plugin: http://wpmudevorg.wordpress.com/project/Most-recent-posts---updated

    And is there anyway to show the date next to the post link?

  24. ColinFilmJournal
    Member
    Posted 16 years ago #

    Not sure if it's 100% what you need but I wrote this:

    http://wpmudevorg.wordpress.com/project/Search

    It includes some functionality to pull posts from multiple blogs into one area for searching and other bits. It's not ideal, but far more efficient to use than trying to carry the queries out at runtime.

    It's used on FilmJournal.net to display the latest posts and comments from across the whole site.

  25. Anonymous
    Unregistered
    Posted 15 years ago #

    It seems like lots of people have been requesting modifications to this plugin so it pulls more than one post from each blog. Does anyone have an update?

  26. morganfardo
    Member
    Posted 15 years ago #

    Can somebody help me on showing the author_name and not the blogname using ah_recent_post_mu plugin?

    another thing... my MU has posts in 3 languages (portuguese/english/spanish) it´s possible to show in portuguese home just the posts in portuguese; in the english home just the english posts, and so on.

    I´m using something like:

    http://www.informeeconomico.com.br/ for portuguese home
    http://www.informeeconomico.com.br/blogname/ for each blog in portuguese

    http://www.informeeconomico.com.br/en/ for english home
    http://www.informeeconomico.com.br/en/blogname/ for each blog in english

    any help would be appreciate.

    thanks in advance,

  27. Work at Home Mom
    Member
    Posted 15 years ago #

    @morganfardo: Perhaps you could try creating a subdomain for each language and then installing a copy of WordPress MU on each subdomain?

  28. andrea_r
    Moderator
    Posted 15 years ago #

    Morgan has fixed this.

  29. Working at Home
    Member
    Posted 15 years ago #

    Has anyone recently tried to start using this plugin? I am very interested in it for my blog. I see that a lot of the bugs have been ironed out.

    Oh... and very nice to meet and talk to the actual developer on a blog!

About this Topic

  • Started 16 years ago by Radecki
  • Latest reply from Working at Home