Advertisement
irifkin

Patch file for moderate-new-blogs WordPress plugin

Jun 27th, 2011
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 4.96 KB | None | 0 0
  1. --- /var/applications/wordpress/0.70/plugins/moderate-new-blogs/ds_wp3_moderate_new_blogs.php   2011-03-07 15:05:18.000000000 -0500
  2. +++ /var/applications/wordpress/production/plugins/moderate-new-blogs/ds_wp3_moderate_new_blogs.php 2011-06-21 11:08:51.000000000 -0400
  3. @@ -1,5 +1,10 @@
  4.  <?php
  5.  /*
  6. +
  7. +Plugin no longer works as downloaded. Editing by irifkin@brandeis.edu.
  8. +Changed URL paths to new network ones.
  9. +Changed URL paths to include nonce.
  10. +
  11.  Plugin Name: Moderate New Blogs
  12.  Plugin URI: http://dsader.snowotherway.org/wordpress-plugins/moderate-new-blogs/
  13.  Description: New blogs await a final click from a Super Admin to activate. Keep blog registration enabled and open, keep Super Admin email notices enabled, and this keeps new blogs queued in SuperAdmin-->Sites "Awaiting Moderation". WP3.x only
  14. @@ -36,11 +41,11 @@
  15.         // blogs awaiting activation
  16.         $blogs = $wpdb->get_results( $wpdb->prepare("SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND deleted = '2' ", $wpdb->siteid ) , ARRAY_A );
  17.         if( is_array( $blogs ) ) {
  18. -           echo '<div id="update-nag">The following blogs are "Awaiting Moderation" at <a href="'.admin_url().'ms-sites.php">Site Admin->Blogs</a> (or click to activate): ';
  19. +           echo '<div id="update-nag">The following blogs are "Awaiting Moderation" at <a href="'.admin_url().'sites.php">Site Admin->Blogs</a> (or click to activate): ';
  20.             $list   = array();
  21.             foreach( $blogs as $details ) {
  22.                 $blogname = get_blog_option( $details[ 'blog_id' ], 'blogname' );
  23.  
  24. -               $list[] = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=activateblog&amp;ref='. urlencode( $_SERVER['REQUEST_URI'] ) .'&amp;id='. $details['blog_id'] .'&amp;msg='. urlencode( sprintf( __( "You are about to activate the blog %s" ), $blogname ) ) .'">'. $blogname .'</a>';
  25.  
  26. +               $list[] = '<a class="delete" href="edit.php?action=confirm&amp;action2=activateblog&amp;ref='. urlencode( $_SERVER['REQUEST_URI'] ) .'&amp;id='. $details['blog_id'] .'&amp;msg='. urlencode( sprintf( __( "You are about to activate the blog %s" ), $blogname ) ) .'&amp;_wpnonce='. wp_create_nonce('confirm') .'">'. $blogname .'</a>';
  27.  
  28.             }
  29.             if (count($list))  
  30.                 echo implode(' | ', $list);
  31.  
  32. @@ -49,12 +54,12 @@
  33.         // blogs waiting to be deleted
  34.         $blogs = $wpdb->get_results( $wpdb->prepare("SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND deleted = '1' ", $wpdb->siteid ) , ARRAY_A );
  35.             if( is_array( $blogs ) ) {
  36. -           echo '<div id="update-nag">The following blogs are "Awaiting Deletion" at <a href="'.admin_url().'ms-sites.php">Site Admin->Blogs</a> (or click to delete): ';
  37. +           echo '<div id="update-nag">The following blogs are "Awaiting Deletion" at <a href="'.admin_url().'network/sites.php">Site Admin->Blogs</a> (or click to delete): ';
  38.             $list   = array();
  39.             foreach( $blogs as $details ) {
  40.                 $blogname = get_blog_option( $details[ 'blog_id' ], 'blogname' );
  41.                
  42.  
  43. -               $list[] = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=deleteblog&amp;id=' . $details['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to delete the blog %s" ), $blogname ) ) . '">' . $blogname . '</a>';
  44. +               $list[] = '<a class="delete" href="edit.php?action=confirm&amp;action2=deleteblog&amp;id=' . $details['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to delete the blog %s" ), $blogname ) ) .'&amp;_wpnonce='. wp_create_nonce('confirm') . '">' . $blogname . '</a>';
  45.             }
  46.             if (count($list))  
  47.                 echo implode(' | ', $list);
  48.  
  49. @@ -78,7 +83,7 @@
  50.     function wpmu_blogs_actions() {
  51.         global $blog, $blogname;
  52.         if ( get_blog_status( $blog['blog_id'], "deleted" ) == '2' ) {
  53. -       ?><span class="delete"><a href="ms-edit.php?action=confirm&amp;action2=activateblog&amp;ref=<?php echo urlencode( $_SERVER['REQUEST_URI'] ) ?>&amp;id=<?php echo $blog['blog_id'] ?>&amp;msg=<?php echo urlencode( sprintf( __( "You are about to activate the blog %s" ), $blogname ) ) ?>"><?php _e("Awaiting Moderation") ?></a></span>
  54. +       ?><span class="delete"><a href="edit.php?action=confirm&amp;action2=activateblog&amp;ref=<?php echo urlencode( $_SERVER['REQUEST_URI'] ) ?>&amp;id=<?php echo $blog['blog_id'] ?>&amp;msg=<?php echo urlencode( sprintf( __( "You are about to activate the blog %s" ), $blogname ) ) .'&amp;_wpnonce='. wp_create_nonce('confirm') ?>"><?php _e("Awaiting Moderation") ?></a></span>
  55.         <?php
  56.         }
  57.     }
  58. @@ -91,7 +96,7 @@
  59.         <table class="form-table">
  60.             <tr valign="top">
  61.                 <th scope="row">' . __('Moderation Enabled') . '</th>
  62. -               <td><input type="checkbox" name="ds_moderate_blog_signup" value="2" ' . $checked . ' /><br /><small>' . __('New sites await a final click from a Super Admin to <a href="/wp-admin/ms-sites.php">Activate</a>') . '</small>
  63. +               <td><input type="checkbox" name="ds_moderate_blog_signup" value="2" ' . $checked . ' /><br /><small>' . __('New sites await a final click from a Super Admin to <a href="/wp-admin/network/sites.php">Activate</a>') . '</small>
  64.                 </td>
  65.             </tr>
  66.         </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement