Changeset 874


Ignore:
Timestamp:
Nov 11, 2006, 3:42:55 PM (13 years ago)
Author:
nick
Message:

Add ping support

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MANIFEST

    r868 r874  
    112112t/72_node_moderation.t
    113113t/73_toggle_moderation.t
     114t/74_ping_plugin.t
    114115t/templates/15_test.tt
    115116wiki.cgi
  • trunk/lib/OpenGuides.pm

    r872 r874  
    4848    $self->{wiki} = $wiki;
    4949    $self->{config} = $args{config};
     50
    5051    my $geo_handler = $self->config->geo_handler;
    5152    my $locator;
     
    6263    $wiki->register_plugin( plugin => $locator );
    6364    $self->{locator} = $locator;
     65
    6466    my $differ = Wiki::Toolkit::Plugin::Diff->new;
    6567    $wiki->register_plugin( plugin => $differ );
    6668    $self->{differ} = $differ;
     69
     70    if($self->config->ping_services) {
     71        use Wiki::Toolkit::Plugin::Ping;
     72
     73        my @ws = split(/\s*,\s*/, $self->config->ping_services);
     74        my %well_known = Wiki::Toolkit::Plugin::Ping->well_known;
     75        my %services;
     76        foreach my $s (@ws) {
     77            if($well_known{$s}) {
     78                $services{$s} = $well_known{$s};
     79            } else {
     80                warn("Ignoring unknown ping service '$s'");
     81            }
     82        }
     83        my $ping = Wiki::Toolkit::Plugin::Ping->new(
     84            node_to_url => $self->{config}->script_name . '?$node',
     85            services => \%services
     86        );
     87        $wiki->register_plugin( plugin => $ping );
     88    }
     89
    6790    return $self;
    6891}
  • trunk/lib/OpenGuides/Config.pm

    r868 r874  
    1010   admin_pass stylesheet_url site_name navbar_on_home_page home_name
    1111   site_desc default_city default_country contact_email
    12    default_language http_charset
     12   default_language http_charset ping_services
    1313   formatting_rules_node formatting_rules_link backlinks_in_title template_path
    1414   custom_template_path geo_handler ellipsoid gmaps_api_key centre_long
     
    7474                     enable_common_categories => 0,
    7575                     enable_common_locales => 0,
     76                     ping_services => "",
    7677                     site_name => "Unconfigured OpenGuides site",
    7778                     navbar_on_home_page => 1,
     
    144145        enable_common_categories => "Do you want a common list of categories shown on all node pages?",
    145146        enable_common_locales => "Do you want a common list of locales shown on all node pages?",
     147        ping_services => "Which services do you wish to ping whenever you write a page? Can be pingerati, geourl, or both",
    146148        site_name => "What's the site called? (should be unique)",
    147149        navbar_on_home_page => "Do you want the navigation bar included on the home page?",
Note: See TracChangeset for help on using the changeset viewer.