$10 to whoever can fix it first, have a feeling it will be easy ??

Discussion in 'PHP' started by ryanlanane, Dec 14, 2010.

  1. #1
    O.K. I am running a copy of WPMU

    I realized right away only a select couple of blogs that I chose to ping myself manually were showing up in the SERPS ... So I figured out WPMU doesn't support enabling multi pings.

    I found a plugin, the code for it is below that enables you to let your users (network wide) select their own ping servers. It is enabled and working.

    Not the problem is I would like to be able to import a list of ping servers I have to at least newly created blogs, if possible all existing blogs as well. They are in the main installation's list of servers to ping but not any of the existing WPMU user blogs or newly created blogs after the script was installed.

    Here is the current code for the plugin to simply enable to capibility for users to ping when posting. Also, still kind of re learning WP. Is it automatically pinging those web sites when an entry is made or is there is a setting I need to make sure is checked for it to do that ?

    <?php
    /*
    Plugin Name: Enable Site Ping WPMU
    Plugin URI: http://sean-fisher.com
    Description: Enable site ping for a WPMU site.
    Version: 1.0
    Author: Sean Fisher
    Author URI: http://sean-fisher.com/
    */
    
    /**
     *	Enabling the site ping input on Options -> Writing.
    **/
    function enable_ping() {
    	remove_filter('enable_update_services_configuration', '__return_false');
    	add_filter( 'enable_update_services_configuration', '_do_return_true' );
    }
    
    /**
     *	Return true
    **/
    function _do_return_true() {
    	return true;
    }
    
    /**
     *	Allow the user to update the ping list.
    **/
    function enable_ping_whitelist($list = NULL) {
    	if ( is_null( $list )) 
    		$list = array( );
    	
    	//	Removing it if it already existed.
    	foreach($list['writing'] as $key => $writing) {
    		if ($writing == 'ping_sites') 
    			unset($list['writing'][$key]);
    	}
    	
    	$list['writing'][] = 'ping_sites';
    	return $list;	
    }
    
    /**
     *	Making sure the ping list exists.
    **/
    if ( !has_action('do_pings', 'do_all_pings') )
    	add_action( 'do_pings',' do_all_pings', 10, 1 );
    
    //	Filters
    add_filter('whitelist_options', 'enable_ping_whitelist');
    add_action('init', 'enable_ping');
    
    
    Code (markup):
     
    ryanlanane, Dec 14, 2010 IP
  2. ryanlanane

    ryanlanane Peon

    Messages:
    304
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I am going through blog by blog for my current 150 or so users and adding the following entries ...

    UPDATE `ryans_wpmu`.`wp_12_options` SET `option_value` = '
    http://1470.net/api/ping
    http://api.feedster.com/ping
    http://api.moreover.com/RPC2
    http://api.moreover.com/ping
    http://api.my.yahoo.com/RPC2
    http://api.my.yahoo.com/rss/ping
    http://bblog.com/ping.php'

    My list is larger, however rather than manually doing this for every single user and possibly missing a post they make I would like this to be run every time a new user's blog is created with WPMU - Anyone ? Easy $10 now for sure ... Just another mysql entry needs to be made upon signup
     
    ryanlanane, Dec 14, 2010 IP