b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (Version 2.4) [ 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-2008 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://evocms.cvs.sourceforge.net/)
  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.7.2.2 2008/05/11 01:13:35 fplanque 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 = '2.4.2.1';
  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.     var $number_of_installs = 1;
  60.  
  61.  
  62.     /**
  63.      * Init
  64.      */
  65.     function PluginInit$params )
  66.     {
  67.         $this->name = T_('Ping b2evolution.net');
  68.         $this->short_desc = T_('Ping the b2evolution.net site');
  69.         $this->long_desc = T_('Pings the b2evolution.net site to include your post in the list of recently updated blogs.');
  70.  
  71.         $this->ping_service_name = 'b2evolution.net';
  72.         $this->ping_service_note = $this->long_desc;
  73.     }
  74.  
  75.  
  76.     /**
  77.      * Ping the b2evonet RPC service.
  78.      */
  79.     function ItemSendPing$params )
  80.     {
  81.         global $evonetsrv_host$evonetsrv_port$evonetsrv_uri;
  82.         global $debug$baseurl$instance_name$evo_charset;
  83.  
  84.     /**
  85.          * @var Blog
  86.          */
  87.         $item_Blog $params['Item']->get_Blog();
  88.  
  89.         $client new xmlrpc_client$evonetsrv_uri$evonetsrv_host$evonetsrv_port);
  90.         $client->debug $debug == );
  91.  
  92.         $message new xmlrpcmsg'b2evo.ping'array(
  93.                 new xmlrpcval($item_Blog->ID),    // id
  94.                 new xmlrpcval($baseurl),              // user -- is this unique enough?
  95.                 new xmlrpcval($instance_name),        // pass -- fp> TODO: do we actually want randomly generated instance names?
  96.                 new xmlrpcval(convert_charset$item_Blog->get('name')'utf-8'$evo_charset ) ),
  97.                 new xmlrpcval(convert_charset$item_Blog->get('url')'utf-8'$evo_charset ) ),
  98.                 new xmlrpcval($item_Blog->locale),
  99.                 new xmlrpcval(convert_charset$params['Item']->get('title')'utf-8'$evo_charset ) ),
  100.             )  );
  101.         $result $client->send($message);
  102.  
  103.         $params['xmlrpcresp'$result;
  104.  
  105.         return true;
  106.     }
  107.  
  108. }
  109.  
  110.  
  111. /*
  112.  * $Log: _ping_b2evonet.plugin.php,v $
  113.  * Revision 1.7.2.2  2008/05/11 01:13:35  fplanque
  114.  * MFH
  115.  *
  116.  * Revision 1.7.2.1  2008/04/09 15:40:38  fplanque
  117.  * MFH
  118.  *
  119.  * Revision 1.7  2008/01/21 09:35:41  fplanque
  120.  * (c) 2008
  121.  *
  122.  * Revision 1.6  2007/09/11 20:57:51  fplanque
  123.  * minor fixes
  124.  *
  125.  * Revision 1.5  2007/04/26 00:11:04  fplanque
  126.  * (c) 2007
  127.  *
  128.  * Revision 1.4  2007/04/20 02:53:13  fplanque
  129.  * limited number of installs
  130.  *
  131.  * Revision 1.3  2006/11/24 18:27:27  blueyed
  132.  * Fixed link to b2evo CVS browsing interface in file docblocks
  133.  *
  134.  * Revision 1.2  2006/10/11 17:21:09  blueyed
  135.  * Fixes
  136.  *
  137.  * Revision 1.1  2006/10/01 22:26:48  blueyed
  138.  * Initial import of ping plugins.
  139.  *
  140.  */
  141. ?>

Documentation generated on Sat, 06 Mar 2010 03:38:23 +0100 by phpDocumentor 1.4.2. This site is hosted and maintained by Daniel HAHLER (Contact).