<?php
	
	/*
	 *
	 * 2003 - 2016 @ Yal Publicidad - Weby+
	 * www.yalpublicidad.com
	 * online@yalpublicidad.com
	 *
	 * @yp_includes index.php
	 *
	 * cargo modulo del sitio web Weby+
	 *
	 */
	 
	 /* Autorizo acceso */
		defined('WY_Ini_Weby') or die( 'No dispones de acceso' );
	
	function mi_link_post( $idPost = NULL ){
		global $wy;
		$slug	= ( $idPost != NULL ) ? $wy->obt_slug( $idPost, 'Contenido', false ) : $wy->obt_slug();
		$link = 'http://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['SCRIPT_NAME']), '/\\') . '/' . $slug;
		return $link;
	}
	
	/* Compartir Post */
	function compartir_post( $idPost = NULL, $texto = NULL ){
		global $wy;
		
		$texto = urlencode( strip_tags( $texto ) );
		echo 'Compartir en <a class="fa fa-facebook" href="https://www.facebook.com/sharer.php?u=' . mi_link_post( $idPost ) . '" target="_blank" onClick="abrir_ventana( this )"></a>
			 <a class="fa fa-twitter" href="https://twitter.com/intent/tweet?original_referer=' . mi_link_post( $idPost ) . '&tw_p=tweetbutton&text=' . $texto . '&url=' . mi_link_post( $idPost ) . '&via=' . WYCFG_ORGANIZACION . '" target="_blank" onClick="abrir_ventana( this )"></a>
			 <a class="fa fa-google-plus" href="https://plus.google.com/share?url=' . mi_link_post( $idPost ) . '" target="_blank" onClick="abrir_ventana( this )"></a>
			 <!--a class="fa fa-instagram" href="https://www.linkedin.com/shareArticle?mimi=true&url=' . mi_link_post( $idPost ) . '" target="_blank" onClick="abrir_ventana( this )"></a-->
			 <a class="fa fa-linkedin" href="https://www.linkedin.com/shareArticle?mimi=true&url=' . mi_link_post( $idPost ) . '" target="_blank" onClick="abrir_ventana( this )"></a>';
	}
?>