b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (Version 1.9) [ class tree: plugins ] [ index: plugins ] [ all elements ]

Source for file _ping_b2evonet.plugin.php

Documentation is available at _ping_b2evonet.plugin.php

  1. <?php
  2. /**
  3.  * This file implements the ping_b2evonet_plugin.
  4.  *
  5.  * For the most recent and complete Plugin API documentation
  6.  * see {@link Plugin} in ../evocore/_plugin.class.php.
  7.  *
  8.  * This file is part of the evoCore framework - {@link http://evocore.net/}
  9.  * See also {@link http://sourceforge.net/projects/evocms/}.
  10.  *
  11.  * @copyright (c)2003-2006 by Francois PLANQUE - {@link http://fplanque.net/}
  12.  *  Parts of this file are copyright (c)2004-2006 by Daniel HAHLER - {@link http://thequod.de/contact}.
  13.  *
  14.  *  {@internal License choice
  15.  *  - If you have received this file as part of a package, please find the license.txt file in
  16.  *    the same folder or the closest folder above for complete license terms.
  17.  *  - If you have received this file individually (e-g: from http://cvs.sourceforge.net/viewcvs.py/evocms/)
  18.  *    then you must choose one of the following licenses before using the file:
  19.  *    - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
  20.  *    - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
  21.  *  }}}
  22.  *
  23.  *  {@internal Open Source relicensing agreement:
  24.  *  Daniel HAHLER grants Francois PLANQUE the right to license
  25.  *  Daniel HAHLER's contributions to this file and the b2evolution project
  26.  *  under any OSI approved OSS license (http://www.opensource.org/licenses/).
  27.  *  }}}
  28.  *
  29.  * @package plugins
  30.  *
  31.  * @author blueyed: Daniel HAHLER
  32.  *
  33.  * @version $Id: _ping_b2evonet.plugin.php,v 1.2.2.2 2006/10/12 21:21:19 blueyed Exp $
  34.  */
  35. if!defined('EVO_MAIN_INIT') ) die'Please, do not access this page directly.' );
  36.  
  37.  
  38. /**
  39.  * Pingomatic plugin.
  40.  *
  41.  * @package plugins
  42.  */
  43. class ping_b2evonet_plugin extends Plugin
  44. {
  45.     /**
  46.      * Variables below MUST be overriden by plugin implementations,
  47.      * either in the subclass declaration or in the subclass constructor.
  48.      */
  49.     var $code = 'ping_b2evonet';
  50.     var $priority = 50;
  51.     var $version = '1.9-dev';
  52.     var $author = 'The b2evo Group';
  53.  
  54.     /*
  55.      * These variables MAY be overriden.
  56.      */
  57.     var $apply_rendering = 'never';
  58.     var $group = 'ping';
  59.  
  60.  
  61.     /**
  62.      * Init
  63.      */
  64.     function PluginInit$params )
  65.     {
  66.         $this->name = T_('Ping b2evolution.net');
  67.         $this->short_desc = T_('Ping the b2evolution.net site');
  68.         $this->long_desc = T_('Pings the b2evolution.net site to include your post in the list of recently updated blogs.');
  69.  
  70.         $this->ping_service_name = 'b2evolution.net';
  71.         $this->ping_service_note = $this->long_desc;
  72.     }
  73.  
  74.  
  75.     /**
  76.      * Ping the pingomatic RPC service.
  77.      */
  78.     function ItemSendPing$params )
  79.     {
  80.         global $evonetsrv_host$evonetsrv_port$evonetsrv_uri;
  81.         global $debug;
  82.  
  83.         $item_Blog $params['Item']->get_Blog();
  84.  
  85.         $client new xmlrpc_client$evonetsrv_uri$evonetsrv_host$evonetsrv_port);
  86.         $client->debug ($debug && $params['display']);
  87.  
  88.         $message new xmlrpcmsg'b2evo.ping'array(
  89.                 new xmlrpcval('id',            // Reserved
  90.                 new xmlrpcval('user'),        // Reserved
  91.                 new xmlrpcval('pass'),        // Reserved
  92.                 new xmlrpcval($item_Blog->dget('name''xml')),
  93.                 new xmlrpcval($item_Blog->dget('url''xml')),
  94.                 new xmlrpcval($item_Blog->dget('locale''xml')),
  95.                 new xmlrpcval($params['Item']->dget('title''xml' )),
  96.             )  );
  97.         $result $client->send($message);
  98.  
  99.         $params['xmlrpcresp'$result;
  100.  
  101.         return true;
  102.     }
  103.  
  104. }
  105.  
  106.  
  107. /*
  108.  * nolog
  109.  */
  110. ?>

Documentation generated on Tue, 18 Dec 2007 22:49:53 +0100 by phpDocumentor 1.4.0