The MU forums have moved to WordPress.org

Pinging multiple services (16 posts)

  1. tdh
    Member
    Posted 16 years ago #

    I've searched in this forum but fail to find a definite answer to this issue.

    I need to ping multiple services, just Pingomatic might work for US centric blogs, but internationally it's a poor solution. The field in Mu Admin is an one-line input field, so I can't very well list several ping services there, can I?

    How do I ping multiple services? For all blogs, or on a per-blog basis, doesn't matter.

    Thanks in advance!

  2. andrea_r
    Moderator
    Posted 16 years ago #

    "The field in Mu Admin is an one-line input field, so I can't very well list several ping services there, can I?"

    Well, usually you can when you separate them with a comma. I'd double-check but can't for the life of me find what you're looking at. I thought that option was taken out?

  3. tdh
    Member
    Posted 16 years ago #

    As far as I could tell from the posts in this forum, commas wouldn't work. Have I gotten it wrong?

    You'll find the Ping Sites input field on:
    /wp-admin/wpmu-blogs.php?action=editblog&id=X

    X = your blog id

    I tried this in the field, should it work then?

    http://rpc.pingomatic.com/, http://nyligen.se/ping/

  4. andrea_r
    Moderator
    Posted 16 years ago #

    Well, that would be just for one blog. If you don't mind hacking, you could find the spot where it ping pingomatic and add whatever you wanted.

    I'm thinking the comma thingy should work. have to wait and see I guess.

  5. tdh
    Member
    Posted 16 years ago #

    I'm sorry to say that it does not seem to work, putting it in that particular field and separating with a comma.

    Any idea where in the code I would add more ping services, and how I would do that?

    Thanks!

  6. tdh
    Member
    Posted 16 years ago #

    Any other suggestions here?

  7. tdh
    Member
    Posted 16 years ago #

    I'm really stuck here. Anyone here that can point me in the right direction?

  8. soldierbeetle
    Member
    Posted 16 years ago #

    for each blog there is an option "ping_sites" that determines which services are pinged for activity within the blog. the wpmu code allows for multiple entries within this option, expecting them to be newline \n delimited.

    so, for example if you wanted to set up multiple services for a single blog youd enter sql of the following form:

    update wp_2_options set option_value = 'http://rpc.pingomatic.com/\nhttp://topicexchange.com/RPC2' where option_name = 'ping_sites'

    there is a function named populate_options that youll find somewhere in your install - its shifted around within different wpmu versions - that installs the default option for each new blog. if you look for the line that populates ping_sites then you can edit it so that new blogs automatically get the new ping server set.

    so for example if you want to set it up so that all future blogs use a new set of ping servers, youd simply change the line that reads:

    add_option('ping_sites', 'http://rpc.pingomatic.com/');

    to:

    add_option('ping_sites', "http://rpc.pingomatic.com/\nhttp://topicexchange.com/RPC2");

    nb. the double quotes are required for the escaping of the newline character

  9. tdh
    Member
    Posted 16 years ago #

    Thanks for this, I found it in wp-admin/includes/schema.php and edited the code there.

    There doesn't seem to be a wp_2_options table in the latest version of MU though. Any ideas?

  10. andrea_r
    Moderator
    Posted 16 years ago #

    Do you have a second blog? The 2 is for blog #2, so if there's a second blog, that table should be there.

  11. tdh
    Member
    Posted 16 years ago #

    There are 8 or 9 blogs I believe.

    So the 2 is for the blog with ID 2, the 3 is for ID 3 and so on? That means I need to run that same command multiple times, changing the number to correspond with the blog ID? Did I get that correctly?

  12. andrea_r
    Moderator
    Posted 16 years ago #

    Yep, the number in each of those is that blog's ID.

    In the post above, the example was given *for a single blog*. This will change the ones that already exist, and any new blogs created will use the change mentioned at the bottom of the previous answer ( about the add_option. I think that's in wpmu-functions.php somewhere.)

    Lemme go check one fo my installs...

  13. tdh
    Member
    Posted 16 years ago #

    I found the add_option thing in wp-includes/schema.php - not the right one?

    So I need to do the SQL query for each blog that is already created then, and these are separated in the db by the _X_ digit, where X is the blog's ID?

  14. andrea_r
    Moderator
    Posted 16 years ago #

    Yes to the last one. I'd have to double-check the first one. :)

  15. tdh
    Member
    Posted 16 years ago #

    Roger that, and thanks. Will you check please? :)

  16. jaiasmit
    Member
    Posted 16 years ago #

    Adding your ping list to the add_option call in schema.php is right for all newly created blogs, but you'll have to manually edit those blogs that have already been created. The only other option is to override the pinging routine to set your own list, but I'd avoid that or you'll have to keep doing the same thing in the future if you ever upgrade WP versions.

About this Topic