forked from b2evolution/b2evolution
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_ping_pingomatic.plugin.php
More file actions
90 lines (74 loc) · 2.36 KB
/
_ping_pingomatic.plugin.php
File metadata and controls
90 lines (74 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
/**
* This file implements the ping_pingomatic_plugin.
*
* For the most recent and complete Plugin API documentation
* see {@link Plugin} in ../evocore/_plugin.class.php.
*
* This file is part of the evoCore framework - {@link http://evocore.net/}
* See also {@link https://github.com/b2evolution/b2evolution}.
*
* @license GNU GPL v2 - {@link http://b2evolution.net/about/gnu-gpl-license}
*
* @copyright (c)2003-2015 by Francois Planque - {@link http://fplanque.com/}
* Parts of this file are copyright (c)2004-2006 by Daniel HAHLER - {@link http://thequod.de/contact}.
*
* @package plugins
*
* @author blueyed: Daniel HAHLER
*/
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
/**
* Pingomatic plugin.
*
* @package plugins
*/
class ping_pingomatic_plugin extends Plugin
{
/**
* Variables below MUST be overriden by plugin implementations,
* either in the subclass declaration or in the subclass constructor.
*/
var $code = 'ping_pingomatic';
var $priority = 50;
var $version = '1.9-dev';
var $author = 'http://daniel.hahler.de/';
/*
* These variables MAY be overriden.
*/
var $group = 'ping';
var $number_of_installs = 1;
/**
* Init
*/
function PluginInit( & $params )
{
$this->name = T_('Ping-O-Matic plugin');
$this->short_desc = T_('Pings the Ping-O-Matic service, which relays your ping to the most common services.');
$this->ping_service_name = 'Ping-O-Matic';
$this->ping_service_note = T_('Pings a service that relays the ping to the most common services.');
}
/**
* Ping the pingomatic RPC service.
*/
function ItemSendPing( & $params )
{
global $debug;
global $outgoing_proxy_hostname, $outgoing_proxy_port, $outgoing_proxy_username, $outgoing_proxy_password;
$item_Blog = $params['Item']->get_Blog();
$client = new xmlrpc_client( '/', 'rpc.pingomatic.com', 80 );
$client->debug = ($debug && $params['display']);
// Set proxy for outgoing connections:
if( ! empty( $outgoing_proxy_hostname ) )
{
$client->setProxy( $outgoing_proxy_hostname, $outgoing_proxy_port, $outgoing_proxy_username, $outgoing_proxy_password );
}
$message = new xmlrpcmsg("weblogUpdates.ping", array(
new xmlrpcval( $item_Blog->get('name') ),
new xmlrpcval( $item_Blog->get('url') ) ));
$result = $client->send($message);
$params['xmlrpcresp'] = $result;
return true;
}
}
?>