HEX
Server: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips
System: Linux WORDPRESS 3.10.0-1160.118.1.el7.x86_64 #1 SMP Thu Apr 4 03:33:23 EDT 2024 x86_64
User: digital (1020)
PHP: 7.2.24
Disabled: NONE
Upload Files
File: /datos/www/www.colombia.co/public_html/wp-content/plugins/playbuzz/class-playbuzzembedcodes.php
<?php

/**
 * Created by PhpStorm.
 * User: Lior
 * Date: 06/12/2016
 * Time: 15:45
 */

/**
 * Security check
 * Exit if file accessed directly.
 */
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}


/**
 * Class EmbedCodes
 *
 * Generate Playbuzz embed codes
 * TODO -- use this for shortcodes.
 * TODO -- add GetOptions method.
 */

class PlaybuzzEmbedCodes {

	public  $item_script_url = '//cdn.playbuzz.com/widget/feed.js';

	public  $item_script_handle = 'pb-feed-js';


	public function __construct() {

	}


	public function item( $item_id, $options ) {

		global $wp_version;

		$site_key       = ( ( ( array_key_exists( 'key',               $options ) ) ) ? $options['key'] : str_replace( 'www.', '', parse_url( home_url(), PHP_URL_HOST ) ) );
		$site_info      = ( ( ( array_key_exists( 'info',              $options ) ) && ( '1' == $options['info']      ) ) ? 'true' : 'false' );
		$site_shares    = ( ( ( array_key_exists( 'shares',            $options ) ) && ( '1' == $options['shares']    ) ) ? 'true' : 'false' );
		$site_comments  = ( ( ( array_key_exists( 'comments',          $options ) ) && ( '1' == $options['comments']  ) ) ? 'true' : 'false' );
		$site_margintop = ( ( ( array_key_exists( 'margin-top',        $options ) ) ) ? $options['margin-top'] : '' );
		$width = 'auto';
		$height = 'auto';

		$code = '<script type="text/javascript" src="' . esc_url( $this -> item_script_url ) . '"></script>
                <div class="pb_feed" data-provider="WordPress ' . esc_attr( $wp_version ) . '"
                data-version=2
                data-key="' . esc_attr( $site_key ) . '"
                data-item="' . esc_attr( $item_id ) . '"
                data-game-info="' . esc_attr( $site_info ) . '"
                data-comments="' . esc_attr( $site_comments ) . '"
                data-shares="' . esc_attr( $site_shares ) . '"
                data-recommend="false"
                data-links=""
                data-width="' . esc_attr( $width ) . '"
                data-height="' . esc_attr( $height ) . '"
                data-margin-top="' . esc_attr( $site_margintop ) . '"></div>
	    ';

		return $code;

	}
}