TRIPAWDS: Home to 23115 Members and 2160 Blogs.
HOME » NEWS » BLOGS » FORUMS » CHAT » YOUR PRIVACY » RANDOM BLOG

How Tripawds Got Their Feed Back

Tripawds bloggers may have wondered where their dashboard notice announcing the most recent Tripawds News blog post went a few weeks ago. If not, they’re certain to notice the new announcement listing the five most recent posts from all the Tripawds Featured Blogs.

Tripawds WordPress Dashboard Feed of Most Recent Featured PostsWith the WordPress 3.1.2 update, the “Dashboard Feed” option mysteriously disappeared, leaving site administrators no way to show recent posts in the dashboard of all blogs across the network. It left me wondering what the heck happened! I posted in the WordPress forums about our Missing Recent Posts Feed in User Dashboard, asking if anyone else noticed or had an answer as to why it was gone. Silence.

About a week later, one member finally confirmed the issue and came up with a fix. The solution, however, required hacking the functions.php file which would not work for this community since Tripawds members can choose from more than 130 blog themes. Thanks to our Supporter plugin from WPMU Dev, Tripawds Supporters have access to even more premium themes.

How to Show Recent Posts from RSS Feed in User Dashboard

Piet from WordPress Tips quickly developed this plugin to show the latest posts from the main site of a multisite install in the user dashboard of all sub-sites across the network. By default the widget displays the three most recent posts from the main site. While no configuration is required for those happy with these settings, the plugin can easily be modified.

Multisite Dashboard Feed Widget Configuration Options:

  • Edit msrss.php to add the feed of your choice. (Default: blog_id=1)
  • Edit msrss.php to change the number of posts displayed (Default: 3).
  • Edit msdbfeed.php to change the widget’s title. (Default: Recent Updates)
  • See installation instructions for complete details.

We took things a step further by adding the extra information and links shown below the recent posts, as shown in our screenshot above. We also created a created a custom feed for multiple blogs to use in the widget.

How to Create a Recent Featured Posts Feed

WPMU DEV - The WordPress ExpertsTripawds uses the Recent Global Posts Feed plugin from WPMU Dev to generate our feed for recent posts from all member blogs. This convenient plugin includes a Recent Global Posts Feed Widget for showing our global posts feed as a sidebar widget.

Tripawds Recent Featured Posts

When we wanted to only show posts from certain blogs in Piet’s Dashboard Feed Widget, however, I turned to the WPMU Dev Forums for support. As usual, masonjames had a quick answer for creating our Featured Blogs feed. Following his suggestions, here’s how I did it:

  1. Download the Recent Global Posts Feed plugin.
  2. Save a copy and rename the file “recent-featured-posts-feed.php”
  3. Edit line 3 to change the  plugin name (Plugin Name: Recent Featured Posts Feed)

Next, I added the specific blogs we wanted to include in the feed by editing line 58 as follows:

$query = $wpdb->prepare( "SELECT * FROM " . $wpdb->base_prefix . "site_posts WHERE blog_id IN (1, 167, 500, 138, 113, 262, 3) AND site_id = %d AND blog_public = '1' AND post_type = %s ORDER BY post_published_gmt DESC LIMIT %d", $current_site->id, $posttype, $number);

This is the key part where you will need to replace the blog IDs for sites you want included in the feed:

WHERE blog_id IN (1, 167, 500, 138, 113, 262, 3) AND

Upload the file to wp-content/ and check your new feed. It’s that simple. All thanks to our WPMU Dev Premium subscription!

WPMU DEV - The WordPress Experts

Like and Send Tripawds Posts to Facebook Friends

Facebook recently launched a new Send button for sharing blog posts and other web content with your friends or group members. While the well known Like button lets Facebook members share content with all their friends, the Send button allows them to select a specific friend or group of friends to share what they found.

new facebook share button for sharing blog posts with friends

Now Tripawds members and Facebook Fans – and any visitors who have a Facebook account – can now share the news about great gear, nutrition, gifts or other resources for three legged dogs with the click of a button! The new Send button can now be found on all the Tripawds Featured Blogs, and throughout Jerry’s News Blog.

Find something one of your Facebook friends may find helpful?

  1. Click the Send button.
  2. Enter your friend’s name.
  3. Add a comment. (optional)
  4. Facebook does the rest!

In fact, all Tripawds blogs using the default theme will now show the Send button on all single posts, and pages. Any members using a different theme who would like to have the button added, just let us know and we’ll see what we can do.

For those keeping score of popular posts, sending a post also counts as a “Like” so get sending those Tripawds posts to all your Facebook friends. For anyone interested in how we did this, read on…

How to add Facebook Send Button to Blog Posts

If you’re having a hard time figuring out Facebook’s Send Button instructions, don’t bother. They don’t work with WordPress anyway. The WordPress multisite gurus at WPMU Dev will likely release an awesome Facebook plugin soon, but if you can’t wait, here’s how I did it.

NOTE: Full credit is due to Ronnie at WPMU.org who wrote complete details about Using the new Facebook ‘Send’ button with WordPress.

1. Assuming you’re comfortable editing theme files and know how, copy this entire bit of code:

<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<fb:like href="<?php echo get_permalink(); ?>" show_faces="true" width="450" send="true">

</fb:like>

2. Depending on your theme, find the file single.php or loop-single.php and save a copy, just in case.

3. If you have plenty of time on your hands, learn all about the Loop. You don’t need to know what it does, just where it is. But I digress.

4. Paste the code above somewhere in the loop. Search for “entry-content” and insert the code on a new line before the <div> to show the Facebook Like and Send buttons before at the top of all your blog posts.

4b. The proper location may be determined by “the-entry” or “post-content” – again, this will depend upon your selected theme. Play with positioning and check your work.

5. Finally, you can customize how the buttons display with some attributes.

That’s it! You can see the buttons in action at the top of this post. I also added the buttons to page.php so readers can send their friends helpful pages like the Tripawds Gear Shop. And I added it to various page theme files I customized during our Tripawds makeover, so they show on the Tripawds Forums, Chat and Store pages.

I also chose to hide facebook user profile avatars from showing beneath the buttons by adding the attribute: show_faces=”false”

Adding Facebook Send Button using an iFrame

As with any coding project it seems, there is bound to be conflict somewhere. And I found it with this one upon discovering that the new Send button code provided above broke our dropdown navigation menus on the News blog.

facebook send button script breaks dropdown menu navigation iframe fix

Either the <div> or the script was causing the buttons to show through the menu, or the menu to drop down behind the buttons. However you choose to frame that, it wouldn’t work. So I fixed it with an iframe.

The WPMU Nelo Custom CMS WordPress theme from WPMU Dev that we use for the Tripawds News blog came with an integrated Facebook Like button option. I was able to fix the issue with a simple edit to the iframe by adding the attribute: send=true

Below is the iframe code we’re using on the News blog. It would get inserted in the same place as described above. (Use at your own risk.)

<iframe src="https://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;send=true&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:30px"></iframe>

We have a blog ring now.

Wanna see a random Tripawds Blog?

Every Tripawds Blog is now linked together in a true Blogger style Ring of Blogs. Users can now stumble upon another totally random three legged dog blog by following the links now found site-wide here at Tripawds. Each Tripawds Blog now has a common navigation strip, something like this…

» RANDOM TRIPAWDS BLOG » FORUMS » CHAT » DIRECTORY » JERRY’S BLOG »

By clicking the RANDOM TRIPAWDS BLOG link, you will be taken to the next RANDOM TRIPAWDS BLOG which has the same strip for visiting the next RANDOM TRIPAWDS BLOG, and so on, and so on.

For those wondering just who might be blogging about their dogs here, this is a easy way to discover what you’re missing. The top 100 active Tripawds Blogs are always listed on the directory page, but cruising the blogs this way should be more fun. We hope you enjoy it.

The only problem I see so far, is that many Tripawds members create a blog upon signup, but never actually start blogging. 🙁

So why not drop on comment on those blogs to let them know what they are missing? The more stories we can share here, the better a resource this community becomes for those facing cancer or amputation with their dogs.

So, how did I do this?

For anyone interested, I implemented this Blogger style blog ring for WorPress MU using these two free plugins available from the WPMUDev.org project repository:

WPMU Footer HTML
This WPMU Plugin enables you to insert any HTML into the footer of all blogs posted within a single WPMU install. With a little hacking, it will place inserts in the header too. Sure, it’s takes a little hardcode effort to customize, but for a CSS neophyte like me it just worked better than Global Header which had the sweet Admin interface I preferred.

WPMU Random Blog Redirect
This mu-plugin allowed me to create a global link to http://tripawds.com/?random which will redirect readers to a random Tripawds blog, in classic StumbleUpon-like fashion.

I am always cautious about installing old WPMU plugins, especially those that appear to be no longer maintained or supported. I much prefer to install the plug and play plugins available with our WPMU Dev Premium membership. But I wanted to make this specific functionality work, and I carefully tested things first on our development installation.

This version of Random Blog may be two years old, but it is apparently working fine. And since the discussion about WPMU Footer that helped me get it working seems to have disappeared into the ether, I’ll share how to ad header inserts in this global footer plugin…

First, I’m using v. 1.0 since v. 1.1 had some issues with the header inserts, which I just added right before the final php function:

add_action(‘wp_head’,’jas_wpmu_css_footer’)

Correct, the header insert code goes after that for the footer. Whatever, it works for me! No promises for anyone else. 😉

But your saying Jim, banner ads are in the header too? Using the WPMU Dev Premium Supporter plugin, we are able to automatically remove banner ads from all blogs while keeping the community navigation strip. I did this by wrapping the ad code within an optional Supporter script and placing HTML for the navigation after that.

Hope this helps clear up any questions about the new Random Tripawds Blogs navigation strip, and how it got there.

UPDATE: Download WPMU Footer HTML v.1 here.

Quick Fix for WordPress Trackback DoS Exploit

One thing about the WordPress development community, is that they are on top of things when it comes to potential exploits of the system. Just this morning there were numerous reports of Denial of Service (DoS) attacks upon hosted WordPress websites and WPMU blog communities, like this one. Steve Fortuna quickly posted a fix. Within minutes I found the detailed WordPress DoS Attack Script Solutions described in the HashBangCode blog and implemented them on all our sites. The last thing we need is another mysterious server load spike bringing down the Tripawds server.

For anyone interested, and daring enough to follow my directions — note this blog’s tagline — the fix is relatively simple:

Just insert the following to your wp-trackback.php file at line 47:

// DoS attack fix.
if ( strlen($charset) > 50 ) {
die;
}

The HashBangCode blog goes one step further and recommends adding the following at line 57 (assuming you added the above already):

// DoS attack fix.
if ( strlen($title) > 200 ) {
die;
}

For those who may be uncomfortable with editing core files, this plugin stops WordPress trackback DoS attacks.

I understand this all may mean absolutely nothing to Tripawds Bloggers, except to know that we too are on top of things when it comes to keeping Tripawds Blogs Community up and running. But I figure the faster news of fixes like this can be spread, the more likely we are to stop spammers and hackers in their tracks.


125x125-banner.png
Many thanks to drmike for first bringing this to my attention in the WPMU DEV Premium discussion forums. Yet another reason we are happy with our WPMU DEV Premium membership!

Behind the Scenes is brought to you by Tripawds.
HOME » NEWS » BLOGS » FORUMS » CHAT » YOUR PRIVACY » RANDOM BLOG