Ayuda con PLUGIN embed para Joomla 2.5

Para cuestiones relativas a cualquier tipo de extensión: componentes, módulos y plugins. Todas las versiones de Joomla.

Moderator: hefesto

Locked
dtcmx
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Nov 04, 2014 3:46 am

Ayuda con PLUGIN embed para Joomla 2.5

Post by dtcmx » Tue Nov 04, 2014 4:31 am

Buen dia saludo a todos hace un mes encontre me llamo la atencion un plugin para la 2.5 que tengo para [youtube] el cual si yo pongo la url del video [youtube] ejemplo

http://www. [youtube] .com/watch?v=aHjpOzsQ9YI en el editor automaticamente en la entrada del Fontend y lo ponga con un iframe el visualizador de [youtube] reproductor y tiene una hoja css ajusto las medidas que son estandarizadas y me gusto mucho el plugin se llama [youtube] para joomla 2.5 este es el codigo del plugin que tengo instalado.

<?php

defined('_JEXEC') or die();

jimport('joomla.plugin.plugin');

/**
* Sound Cloud Embedder Content Plugin
*
*/
class plgContentsoundcloudembed extends JPlugin
{
public function __construct(&$subject, $config = array())
{
parent::__construct($subject, $config);

$lang = JFactory::getLanguage();
$lang->load('plg_content_soundcloudembed.sys', __DIR__);
}

/**
* @param string $context
* @param object $article
* @param object $params
* @param int $page
*
* @return bool
*/
public function onContentPrepare($context, &$article, &$params, $page = 0)
{
if (JString::strpos($article->text, '://www.[youtube].com/watch') === false) {
return true;
}

// Note! The order of these expressions matters
$regex = array(
'#(?:<a.*?href=["\'](?:https?://(?:www\.)?[youtube].com/watch\?v=([^\'"]+)[\'"][^>]*>(.+)?(?:</a>)))#',
'#https?://(?:www\.)?[youtube].com/watch\?v=([a-zA-Z0-9-_&;=]+)#'
);

foreach ($regex as $r) {
if (preg_match_all($r, $article->text, $matches)) {
foreach ($matches[0] as $k => $source) {
$article->text = str_replace(
$source,
$this->soundcloudembed($matches[1][$k]),
$article->text
);
}
}
}

return true;
}

protected function soundcloudembed($vCode)
{
$output = '';
$params = $this->params;

$width = $params->get('width', 425);
$height = $params->get('height', 344);
$responsive = $params->get('responsive', 1);

if ($responsive) {
$doc = JFactory::getDocument();
$doc->addStyleSheet(JURI::base() . "plugins/content/soundcloudcontent/style.css");
$output .= '<div class="video-responsive">';
}

$query = explode('&', htmlspecialchars_decode($vCode));
$vCode = array_shift($query);
if ($query) {
$vCode .= '?' . http_build_query($query);
}

$attribs = array(
'width' => $width,
'height' => $height,
'src' => '//www.[youtube].com/embed/' . $vCode,
'frameborder' => '0'
);

$output .= '<iframe class="[youtube]" ' . JArrayHelper::toString($attribs) . ' allowfullscreen></iframe>';

if ($responsive) {
$output .= '</div>';
}

return $output;
}
}

Ahora estoy en busca la misma funcionamiento pero para SOUND CLOUD con la URL por ejemplo en el editor al poner htppp p sound cloud .com/lindseystomp/crystallize-1
me Inserte el embed automaticamente en el Fontend salga el iframe igual con una hoja css se ajusta, tamaño centrado px ect.


SOLO EXISTE PARA WORDPRESS EMBED AUTOMATICAMENTE DE [URL not permitted]

http://plugins.svn.wordpress.org/soundc ... rtcode.php

QUIERO PONER UNA URL de [URL not permitted] DENTRO DEL editor de joomla 2.5 [htppp sound cloud .com/lindseystomp/crystallize-1 ] y al publicar el articulo en el Fontend automaticamente la url de [URL not permitted] traiga el reproductor para escuchar el audio


ESPERO SUS PRONTAS RESPUESTAS Y SI LO LOGRO ACEPTAN CREDITOS Y SUBIDA EN EXTENCIONES COMO PLUGIN PARA SOUND CLOUD es un excelente complemento enserio

gracias

carcam
Joomla! Hero
Joomla! Hero
Posts: 2176
Joined: Sat Dec 29, 2007 1:53 am
Location: Spain
Contact:

Re: Ayuda con PLUGIN embed para Joomla 2.5

Post by carcam » Wed Nov 05, 2014 9:49 am

Ese código que muestras parece que hace algo parecido también para [URL not permitted] ¿lo has probado?
La web es Mejor Con Joomla ¡envíanos tu sitio en Joomla 4!: https://mejorconjoomla.com/showcase
Twitter: @carcam


Locked

Return to “Extensiones”