b2evolution PHP Cross Reference Blogging Systems

Source: /plugins/_facebook.plugin.php - 77 lines - 2321 bytes - Summary - Text - Print

Description: This file implements the facebook like plugin This file is part of the b2evolution project - {@link http://b2evolution.net/}

   1  <?php
   2  /**
   3   * This file implements the facebook like plugin
   4   * 
   5   * This file is part of the b2evolution project - {@link http://b2evolution.net/}
   6   *
   7   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
   8   * 
   9   * @package plugins
  10   * 
  11   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  12   * @author asimo: Evo Factory - Attila Simo
  13   * 
  14   * @version $Id: _facebook.plugin.php 6136 2014-03-08 07:59:48Z manuel $
  15   */
  16  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  17  
  18  /**
  19   * Facebook Plugin
  20   *
  21   * This plugin displays
  22   */
  23  class facebook_plugin extends Plugin
  24  {
  25      /**
  26       * Variables below MUST be overriden by plugin implementations,
  27       * either in the subclass declaration or in the subclass constructor.
  28       */
  29  
  30      var $name;
  31      var $code = 'evo_facebook';
  32      var $priority = 20;
  33      var $version = '1.0';
  34      var $author = 'The b2evo Group';
  35      var $group = 'widget';
  36  
  37      /**
  38       * Init
  39       */
  40  	function PluginInit( & $params )
  41      {
  42          $this->name = T_( 'Facebook Like Widget' );
  43          $this->short_desc = T_('This skin tag displays a Facebook Like button.');
  44          $this->long_desc = T_('Shows how many users like the current page.');
  45      }
  46  
  47      /**
  48       * Event handler: SkinTag (widget)
  49       *
  50       * @param array Associative array of parameters.
  51       * @return boolean did we display?
  52       */
  53  	function SkinTag( $params )
  54      {
  55          /**
  56           * Default params:
  57           */
  58          // This is what will enclose the block in the skin:
  59          if(!isset($params['block_start']) || empty($params['block_start'])) $params['block_start'] = '<div class="bSideItem">';
  60          if(!isset($params['block_end']) || empty($params['block_end'])) $params['block_end'] = "</div>\n";
  61  
  62          global $baseurlroot;
  63          //$test_url = url_absolute( regenerate_url( '', '', '', '&' ), 'http://127.0.0.1' );
  64          $current_url = url_absolute( regenerate_url( '', '', '', '&' ), $baseurlroot );
  65  
  66          echo $params['block_start'];
  67          echo '<iframe src="http://www.facebook.com/plugins/like.php?href='.urlencode($current_url)
  68                      .'&amp;layout=standard&amp;show_faces=true&amp;width=190&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=66" 
  69                      scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:190px; height:66px;" 
  70                      allowTransparency="true"></iframe>';
  71          echo $params['block_end'];
  72  
  73          return true;
  74      }
  75  }
  76  
  77  ?>

title

Description

title

Description

title

Description

title

title

Body