<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Draft Notification Plugin for WordPress</title>
	<atom:link href="http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/</link>
	<description>WordPress Plugins, PHP Scripts, Tools, and Tutorials</description>
	<pubDate>Sat, 17 May 2008 10:36:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Pat</title>
		<link>http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-276137</link>
		<dc:creator>Pat</dc:creator>
		<pubDate>Mon, 28 Apr 2008 06:57:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-276137</guid>
		<description>thank! it works now. i tried to inform the author /and/ the admin this wat:

		$admin = get_bloginfo('admin_email');
		$poster = get_the_author_email();

		mail($admin, $subject, $message);
		mail($poster, $subject, $message);

but i end up with both emails going to the admin - do you see the problem?

PAT</description>
		<content:encoded><![CDATA[<p>thank! it works now. i tried to inform the author /and/ the admin this wat:</p>
<p>		$admin = get_bloginfo(&#8217;admin_email&#8217;);<br />
		$poster = get_the_author_email();</p>
<p>		mail($admin, $subject, $message);<br />
		mail($poster, $subject, $message);</p>
<p>but i end up with both emails going to the admin - do you see the problem?</p>
<p>PAT</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Admin</title>
		<link>http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-265657</link>
		<dc:creator>Admin</dc:creator>
		<pubDate>Tue, 22 Apr 2008 00:02:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-265657</guid>
		<description>&lt;b&gt;Pat&lt;/b&gt;: I am still planning to check all the plugins for compatibility :) I know most of them work with no problems (Sitemap generator, Contact form), but there are a couple others I am going to fix when I get a chance.</description>
		<content:encoded><![CDATA[<p><b>Pat</b>: I am still planning to check all the plugins for compatibility <img src='http://www.dagondesign.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> I know most of them work with no problems (Sitemap generator, Contact form), but there are a couple others I am going to fix when I get a chance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pat</title>
		<link>http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-265030</link>
		<dc:creator>Pat</dc:creator>
		<pubDate>Mon, 21 Apr 2008 11:02:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-265030</guid>
		<description>hi, could you make it compatible with vesion wordpress 2.5? it seems the db structure canged and the query is not working anymore..</description>
		<content:encoded><![CDATA[<p>hi, could you make it compatible with vesion wordpress 2.5? it seems the db structure canged and the query is not working anymore..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Uwe</title>
		<link>http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-89299</link>
		<dc:creator>Uwe</dc:creator>
		<pubDate>Fri, 12 Oct 2007 08:58:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-89299</guid>
		<description>Hello,

I want use your plugin for my blog but I don't get the recipient bis the function

$recipient = get_the_author_email();

I checked it to input the recipient into the message, but this part is empty. I don't get the author email.

I hope, you can help me.

Thanks a lot
Uwe from germany</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>I want use your plugin for my blog but I don&#8217;t get the recipient bis the function</p>
<p>$recipient = get_the_author_email();</p>
<p>I checked it to input the recipient into the message, but this part is empty. I don&#8217;t get the author email.</p>
<p>I hope, you can help me.</p>
<p>Thanks a lot<br />
Uwe from germany</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: josh</title>
		<link>http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-86772</link>
		<dc:creator>josh</dc:creator>
		<pubDate>Wed, 03 Oct 2007 16:15:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-86772</guid>
		<description>Great plugin!!  Thanks for making it available. 

In case anyone else wants to be notified upon "Pending Review" instead of Draft (with the introduction of Pending Review in 2.3), it's easy to do.  Just change the line that says:

if ($result-&#62;post_status == "draft")

to


if ($result-&#62;post_status == "pending")

and it seems to work great.

-Josh</description>
		<content:encoded><![CDATA[<p>Great plugin!!  Thanks for making it available. </p>
<p>In case anyone else wants to be notified upon &#8220;Pending Review&#8221; instead of Draft (with the introduction of Pending Review in 2.3), it&#8217;s easy to do.  Just change the line that says:</p>
<p>if ($result-&gt;post_status == &#8220;draft&#8221;)</p>
<p>to</p>
<p>if ($result-&gt;post_status == &#8220;pending&#8221;)</p>
<p>and it seems to work great.</p>
<p>-Josh</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mifouane</title>
		<link>http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-82638</link>
		<dc:creator>mifouane</dc:creator>
		<pubDate>Tue, 18 Sep 2007 18:22:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-82638</guid>
		<description>Works now.  The USERS table prefix was different in my DB.</description>
		<content:encoded><![CDATA[<p>Works now.  The USERS table prefix was different in my DB.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mifouane</title>
		<link>http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-82627</link>
		<dc:creator>mifouane</dc:creator>
		<pubDate>Tue, 18 Sep 2007 17:06:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-82627</guid>
		<description>Oops! I just saw the change log that says this now works with Wordpress 2.2.  However, has anyone tried this with Wordpress MU?</description>
		<content:encoded><![CDATA[<p>Oops! I just saw the change log that says this now works with Wordpress 2.2.  However, has anyone tried this with Wordpress MU?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mifouane</title>
		<link>http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-82611</link>
		<dc:creator>mifouane</dc:creator>
		<pubDate>Tue, 18 Sep 2007 15:15:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-82611</guid>
		<description>hi,
Thanks, this is exactly what I'm looking for.  Unfortunately, I haven't been able to make it work so far.  I am using Wordpress MU 1.0 (which uses the core Wordpress version 2.2).  Any idea if this plugin should work with Wordpress MU or at least with Wordpress 2.2?</description>
		<content:encoded><![CDATA[<p>hi,<br />
Thanks, this is exactly what I&#8217;m looking for.  Unfortunately, I haven&#8217;t been able to make it work so far.  I am using Wordpress MU 1.0 (which uses the core Wordpress version 2.2).  Any idea if this plugin should work with Wordpress MU or at least with Wordpress 2.2?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rumman</title>
		<link>http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-80915</link>
		<dc:creator>Rumman</dc:creator>
		<pubDate>Wed, 12 Sep 2007 10:21:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-80915</guid>
		<description>hi,
I've slightly modified your handy plugin. I've add an administration menu, where admins can choose, which users will get notifications. Here's the code:
&lt;code&gt;

&lt;?php

function dddn_menu () {
  add_options_page('Notifikation', 'Notifikation', 8, basename(__FILE__), 'dddn_options_page');
}
function dddn_options_page() {
  global $wpdb;

  // get all users
  $tp = $wpdb-&gt;prefix;
	$users = $wpdb-&gt;get_results("
		SELECT ID, user_login
    FROM {$tp}users    
	");
  if ($_POST['hidden_field']==='Y') { // form processing
    $notify= $_POST['notify'];  
    for ($j=0; $j &lt; count($users); $j++) {
      if ($notify[$j] != get_usermeta($users[$j]-&gt;ID,'notify') ) {
        update_usermeta($users[$j]-&gt;ID,'notify',$notify[$j]);
        $output.=$users[$j]-&gt;user_login."&lt;br /&gt;\n";
      }
    }
    if ($output) {
      ?&gt;
      &lt;div class="updated"&gt;&lt;h3&gt;Updated users:&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;&lt;?php echo $output; ?&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;
      &lt;?php
    }
  }
  // form	
  ?&gt;  
  &lt;div class="wrap"&gt;
    &lt;h2&gt;Notifikation&lt;/h2&gt;
    &lt;p&gt;Sends an email to selected users when a draft is saved.
    &lt;/p&gt;
    &lt;form name="form1" method="post" action="&lt;?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?&gt;"&gt;
      &lt;input type="hidden" name="hidden_field" value="Y"&gt;
      &lt;p&gt;&lt;?php 
        $i=0;
        foreach ($users as $user) {  
          if (get_usermeta($user-&gt;ID,"notify")) $checked.=" checked=\"checked\" ";
          echo "&lt;input type=\"checkbox\" name=\"notify[$i]\" value=\"1\" id=\"notify[$i]\" $checked&gt;&#160;";
          echo "&lt;label for=\"notify[$i]\" &gt;{$user-&gt;user_login}&lt;/label&gt;&lt;br /&gt;\n";
          unset($checked);
          $i++;
        }    
      
        ?&gt; 
      &lt;/p&gt;&lt;hr /&gt;
      &lt;p class="submit"&gt;
        &lt;input type="submit" name="Submit" value="&lt;?php _e('Update Options') ?&gt;" /&gt;
      &lt;/p&gt;
    &lt;/form&gt;
  &lt;/div&gt;
  &lt;?php
} // dddn_options_page

function dddn_process($id) {

	global $wpdb;
	
	$tp = $wpdb-&gt;prefix;

	$result = $wpdb-&gt;get_row("
		SELECT post_status, post_title, user_login, user_nicename, display_name 
		FROM {$tp}posts, {$tp}users 
		WHERE {$tp}posts.post_author = {$tp}users.ID 
		AND {$tp}posts.ID = '$id'
	");

	if ($result-&gt;post_status == "draft") {

		$message = "";
		$message .= "Draft updated on '" . get_bloginfo('name') . "'\n\n";
		$message .= "Title: " . $result-&gt;post_title . "\n\n";

	
		// *** Choose one of the following options to show the author's name
	
		$message .= "Author: " . $result-&gt;display_name . "\n\n";
		// $message .= "Author: " . $result-&gt;user_nicename . "\n\n";
		// $message .= "Author: " . $result-&gt;user_login . "\n\n";



		$message .= "Link: " . get_permalink($id);

		$subject = "Draft updated on '" . get_bloginfo('name') . "'";

		// get recipients from db
    $recipients = $wpdb-&gt;get_results("
		  SELECT {$tp}users.user_email 
      FROM {$tp}users, {$tp}usermeta
      WHERE {$tp}users.ID={$tp}usermeta.user_id
      AND {$tp}usermeta.meta_key= 'notify' AND {$tp}usermeta.meta_value= '1' 
	  ");
	  // send mails
	  foreach ($recipients as $recipient) {
		  mail($recipient, $subject, $message);
    }
	}

}

if (function_exists('add_action')) {
  add_action('save_post', 'dddn_process');
  add_action('admin_menu', 'dddn_menu');
}
?&gt;


&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>hi,<br />
I&#8217;ve slightly modified your handy plugin. I&#8217;ve add an administration menu, where admins can choose, which users will get notifications. Here&#8217;s the code:<br />
<pre><code>

&lt;?php

function dddn_menu () {
  add_options_page('Notifikation', 'Notifikation', 8, basename(__FILE__), 'dddn_options_page');
}
function dddn_options_page() {
  global $wpdb;

  // get all users
  $tp = $wpdb-&gt;prefix;
	$users = $wpdb-&gt;get_results("
		SELECT ID, user_login
    FROM {$tp}users    
	");
  if ($_POST['hidden_field']==='Y') { // form processing
    $notify= $_POST['notify'];  
    for ($j=0; $j &lt; count($users); $j++) {
      if ($notify[$j] != get_usermeta($users[$j]-&gt;ID,'notify') ) {
        update_usermeta($users[$j]-&gt;ID,'notify',$notify[$j]);
        $output.=$users[$j]-&gt;user_login."&lt;br /&gt;\n";
      }
    }
    if ($output) {
      ?&gt;
      &lt;div class="updated"&gt;&lt;h3&gt;Updated users:&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;&lt;?php echo $output; ?&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;
      &lt;?php
    }
  }
  // form	
  ?&gt;  
  &lt;div class="wrap"&gt;
    &lt;h2&gt;Notifikation&lt;/h2&gt;
    &lt;p&gt;Sends an email to selected users when a draft is saved.
    &lt;/p&gt;
    &lt;form name="form1" method="post" action="&lt;?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?&gt;"&gt;
      &lt;input type="hidden" name="hidden_field" value="Y"&gt;
      &lt;p&gt;&lt;?php 
        $i=0;
        foreach ($users as $user) {  
          if (get_usermeta($user-&gt;ID,"notify")) $checked.=" checked=\"checked\" ";
          echo "&lt;input type=\"checkbox\" name=\"notify[$i]\" value=\"1\" id=\"notify[$i]\" $checked&gt;&amp;nbsp;";
          echo "&lt;label for=\"notify[$i]\" &gt;{$user-&gt;user_login}&lt;/label&gt;&lt;br /&gt;\n";
          unset($checked);
          $i++;
        }    
      
        ?&gt; 
      &lt;/p&gt;&lt;hr /&gt;
      &lt;p class="submit"&gt;
        &lt;input type="submit" name="Submit" value="&lt;?php _e('Update Options') ?&gt;" /&gt;
      &lt;/p&gt;
    &lt;/form&gt;
  &lt;/div&gt;
  &lt;?php
} // dddn_options_page

function dddn_process($id) {

	global $wpdb;
	
	$tp = $wpdb-&gt;prefix;

	$result = $wpdb-&gt;get_row("
		SELECT post_status, post_title, user_login, user_nicename, display_name 
		FROM {$tp}posts, {$tp}users 
		WHERE {$tp}posts.post_author = {$tp}users.ID 
		AND {$tp}posts.ID = '$id'
	");

	if ($result-&gt;post_status == "draft") {

		$message = "";
		$message .= "Draft updated on '" . get_bloginfo('name') . "'\n\n";
		$message .= "Title: " . $result-&gt;post_title . "\n\n";

	
		// *** Choose one of the following options to show the author's name
	
		$message .= "Author: " . $result-&gt;display_name . "\n\n";
		// $message .= "Author: " . $result-&gt;user_nicename . "\n\n";
		// $message .= "Author: " . $result-&gt;user_login . "\n\n";



		$message .= "Link: " . get_permalink($id);

		$subject = "Draft updated on '" . get_bloginfo('name') . "'";

		// get recipients from db
    $recipients = $wpdb-&gt;get_results("
		  SELECT {$tp}users.user_email 
      FROM {$tp}users, {$tp}usermeta
      WHERE {$tp}users.ID={$tp}usermeta.user_id
      AND {$tp}usermeta.meta_key= 'notify' AND {$tp}usermeta.meta_value= '1' 
	  ");
	  // send mails
	  foreach ($recipients as $recipient) {
		  mail($recipient, $subject, $message);
    }
	}

}

if (function_exists('add_action')) {
  add_action('save_post', 'dddn_process');
  add_action('admin_menu', 'dddn_menu');
}
?&gt;


</code></pre></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Admin</title>
		<link>http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-52436</link>
		<dc:creator>Admin</dc:creator>
		<pubDate>Sun, 10 Jun 2007 23:55:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-52436</guid>
		<description>&lt;b&gt;Graham&lt;/b&gt;: In the WordPress admin panel, go to 'Manage -&gt; Plugins'</description>
		<content:encoded><![CDATA[<p><b>Graham</b>: In the WordPress admin panel, go to &#8216;Manage -> Plugins&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Graham</title>
		<link>http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-52384</link>
		<dc:creator>Graham</dc:creator>
		<pubDate>Sun, 10 Jun 2007 12:38:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-52384</guid>
		<description>I have installed the above plug in; how do I enable it?
Thansk</description>
		<content:encoded><![CDATA[<p>I have installed the above plug in; how do I enable it?<br />
Thansk</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Admin</title>
		<link>http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-47085</link>
		<dc:creator>Admin</dc:creator>
		<pubDate>Wed, 23 May 2007 00:56:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-47085</guid>
		<description>&lt;b&gt;tyson&lt;/b&gt;: That should work fine, except you do not want that 'echo' there.</description>
		<content:encoded><![CDATA[<p><b>tyson</b>: That should work fine, except you do not want that &#8216;echo&#8217; there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tyson</title>
		<link>http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-47053</link>
		<dc:creator>tyson</dc:creator>
		<pubDate>Tue, 22 May 2007 23:03:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-47053</guid>
		<description>How could the $recipient line be changed so that one (or more ) static e-mail addresses could be entered? Something like this?

&lt;code&gt;$recipient = echo "jon@mail.com, mary@mail.com"; &lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>How could the $recipient line be changed so that one (or more ) static e-mail addresses could be entered? Something like this?</p>
<p><code>$recipient = echo "jon@mail.com, mary@mail.com"; </code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Admin</title>
		<link>http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-45842</link>
		<dc:creator>Admin</dc:creator>
		<pubDate>Fri, 18 May 2007 01:16:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-45842</guid>
		<description>&lt;b&gt;Manne&lt;/b&gt;: I just added some alternate code you can try.</description>
		<content:encoded><![CDATA[<p><b>Manne</b>: I just added some alternate code you can try.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manne</title>
		<link>http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-45537</link>
		<dc:creator>Manne</dc:creator>
		<pubDate>Wed, 16 May 2007 17:33:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.dagondesign.com/articles/draft-notification-plugin-for-wordpress/#comment-45537</guid>
		<description>Unfortunately the author mod didn't work for me...</description>
		<content:encoded><![CDATA[<p>Unfortunately the author mod didn&#8217;t work for me&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
