Notify Authors WordPress plugin for WordPress 2.0

June 9th, 2006

This was a plugin Adam Howell showed me, it’s useful for group blogs. However, it only worked with WordPress 1.5. Tonight at work I hacked the PHP and got it working on WordPress 2.0.3, you can see the new code here, or below:

function notify_users($post_ID) {
	global $wpdb;
	$users = $wpdb->get_results( "SELECT ID FROM $wpdb->users, $wpdb->usermeta WHERE $wpdb->usermeta.user_id = $wpdb->users.ID AND $wpdb->usermeta.meta_key = 'wpredesign_user_level' AND $wpdb->usermeta.meta_value = 10" );
	$post = $wpdb->get_row( "SELECT post_author, post_title FROM $wpdb->posts WHERE ID = " . $post_ID );
	$authordata = get_usermeta( $post->post_author, 'nickname' );
	$blogname = get_settings( "blogname" );
	$subject = "[Redesign Blog] New or updated content by " . $authordata;

	$text = $authordata . " has posted new content or updated content on the website.";
	$text = $text . "\n\nNew or updated article: " . $post->post_title;
	$text = $text . "\n\nRead it here: " . get_permalink( $post_ID );

	foreach ($users as $user) {
		$user_data = get_userdata( $user->ID );
		mail( $user_data->user_email,
			  $subject,
			  $text,
			  "From: " . $blogname . " <" . get_settings( "admin_email" ) . ">" );
	}
}

Related Posts:

  1. I’m posting on tumblr now: freejoe76.tumblr.com
  2. Monday fun links
  3. New here on Joe Write: My photos

Internet, Joe, Work | Comments | Trackback Jump to the top of this page

5 comments on “Notify Authors WordPress plugin for WordPress 2.0”

  1. 01

    Where’d your zombie revive board go? I’m stuck outside the Pagram Library and am very dead. 🙁

    beccabecca at June 11th, 2006 around 12:44 pm
    Jump to the top of this page
  2. 02

    i wish i understood this stuff. i imagine it’s useful, unlike this bond angle shit i don’t understand.

    tom at June 20th, 2006 around 2:08 am
    Jump to the top of this page
  3. 03

    Who’s Bond? What’s his angle?

    Joe Murphy at June 20th, 2006 around 9:14 am
    Jump to the top of this page
  4. 04

    Frowning but not angry. There’s only a certain amount plastic shit I can take, seriously.

    Hey man I’m glad you’re
    “out there.
    thanks for directing me towards Adam’s Jillion site also.
    party,

    DANIEL VON fucking SEGGEN at June 26th, 2006 around 9:36 pm
    Jump to the top of this page
  5. 05

    Hello!

    I installed WordPress on my server, and set up a site. It’s a relly nice piece of software. However, I am missing a piece of functionality, and

    couldn’t find a suitable answer for it. Mayou you know a plugin I could use?I need to automatically inserts ads in my posts.And not AdSense ads, but rather HTML snippets defined by me (affiliate links, etc). Let’s say I would insert a tag in my post:
    — ad here —
    and the plugin would automatically replace it with some HTML code, when the post is displayed on my site.I really don’t need any fancy configuration options etc, just the basic replace functionality.
    Do you know a plugin that can handle this?

    lil wyte at July 22nd, 2006 around 8:47 am
    Jump to the top of this page

Leave a Reply

  •  
  •  
  •  

You can keep track of new comments to this post with the comments feed.

This blog? It's about stuff I did, people and things I like.

Recent Comments

My 'Awesome' List

Newspaper #000 Poems

Subscribe / Web Feeds

Meta