The MU forums have moved to WordPress.org

Notify on Draft Post MU (5 posts)

  1. maka1
    Member
    Posted 16 years ago #

    Guys, has someone tried to adapt Notify on Draft post plugin to WP MU (http://www.gradin.com/2007/05/23/wp-plugin-notify-on-draft-post/).

    The plugin seems to be working fine, but the emails about new drafted posts come empty :(

    There must be a problem with this bit of code, but i dont know how to adapt it to WP MU :(( plsss help...

    function nd_notify_moderator($id) {
    global $wpdb;

    $nd = $wpdb->prefix;

    $post = $wpdb->get_row("SELECT * FROM {$nd}posts, {$nd}users WHERE {$nd}posts.post_author = {$nd}users.ID AND {$nd}posts.ID = $id");

    $posts_waiting = $wpdb->get_var("SELECT count(ID) FROM {$nd}posts WHERE post_status = 'draft'");

    $notify_message = sprintf( __('A new post #%1$s "%2$s" is waiting for your approval'), $id, $post->post_title ) . "\r\n";
    $notify_message .= get_permalink($id) . "\r\n\r\n";
    $notify_message .= sprintf( __('Author : %1$s'), $post->display_name ) . "\r\n";
    $notify_message .= sprintf( __('E-mail : %s'), $post->user_email ) . "\r\n";
    $notify_message .= __('Post: ') . "\r\n" . $post->post_content . "\r\n\r\n";
    $notify_message .= sprintf( __('To approve this post, visit: %s'), get_settings('siteurl').'/wp-admin/post.php?action=edit&p='.$id."&post=$id" ) . "\r\n";

  2. maka1
    Member
    Posted 16 years ago #

    up :)

  3. maka1
    Member
    Posted 16 years ago #

    please help :(

  4. SteveAtty
    Member
    Posted 16 years ago #

    Can you move the SQL statement out into a variable so you can see if its syntactically correct because if it isn't then its never going to work.

  5. andrea_r
    Moderator
    Posted 16 years ago #

    It's got nothing in there to determine *which* blog on the system has a draft, that's why it doesn't work.

About this Topic