Plugin does not work on my website joomla 2.5

More
9 years 9 months ago #23257 by juankmin
Hello, I need help, i've installed the plugin really easy, activated and set to modus operandi 1.
I've tried all options and does not works. here is the code and the url website:


{
}

{
}




{soundcloud.com/iglesia-el-encuentro/la-frescura-de-dios-el-pozo}

www.iglesiaelencuentro.net/index.php/rec.../item/171-junio-2014

Thanks!

Please Log in or Create an account to join the conversation.

More
9 years 9 months ago #23279 by nordmograph
Hello

You have a server restricion on https and/or simplexml
you can try opening
plugins/content/loadsoundcloud/loadsoundcloud.php
and replace every occurences of https by http

hope it helps. Let me know

- Need help? Post the URL of the related page (eventualy as confidential info), it will help solve your issue faster.
- An error, notice or warning? report the exact message including the line number
- If you get a white page , enable error reporting and / or check your server error logs.

Please Log in or Create an account to join the conversation.

More
9 years 9 months ago #23294 by juankmin
I did what you say and is still not working!
Here's the loadsoundcloud.php fixed:

<?php
/**
* @package Joomla.Plugin
* @subpackage Content.loadmodule
* @copyright Copyright (C) 2010 - 2014 Nordmograph.com, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// no direct access
defined('_JEXEC') or die;
jimport('joomla.plugin.plugin');
class plgContentLoadsoundcloud extends JPlugin{
public function onContentPrepare($context, &$article, &$params, $page = 0) {
// simple performance check to determine whether bot should process further
if (strpos($article->text, '://soundcloud.com/') === false) {
return true;
}
$mode = $this->params->def('mode','1');
$auto_play = $this->params->def('auto_play',0);
$visual = $this->params->def('visual',1);
$show_comments = $this->params->def('show_comments',1);
$show_description = $this->params->def('show_description',1);
$show_artwork = $this->params->def('show_artwork',1);
$hide_related = $this->params->def('hide_related',1); // seems to be ignored by API ??
$color = $this->params->def('color','#3B5998');
$player_height = $this->params->def('player_height','200');
if($mode==1)
$regex = '/{http?:\/\/soundcloud.com\/+(.*?)}/i'; //{
}
elseif($mode==2)
$regex = '/http?:\/\/soundcloud.com\/+(.*?)\s/i'; //http://soundcloud.com/blabla/moi
elseif($mode==3)
$regex = '/{soundcloud\s+(.*?)}/i'; //{
}
$matches = array();
// find all instances of plugin and put in $matches
preg_match_all($regex, $article->text, $matches, PREG_SET_ORDER);

foreach ($matches as $match) {
//if(substr_count($match[1] ,'/')==1)
//$player_height='81';
// $match[0] is full pattern match, $match[1] is the position
$output = $this->_load($match[1],$mode,$auto_play,$visual,$player_height,$show_comments,$show_description,$show_artwork,$hide_related,$color);
// We should replace only first occurrence in order to allow positions with the same name to regenerate their content:
$article->text = preg_replace("|$match[0]|", $output, $article->text, 1);
}
}
protected function _load($url,$mode,$auto_play,$visual,$player_height,$show_comments,$show_description,$show_artwork,$hide_related,$color)
{
$url=urlencode($url);
$html = '<div>';

$zurl = '
;
if( $auto_play)
$zurl = $zurl."&auto_play=true";
else
$zurl = $zurl."&auto_play=false";
if( $show_comments)
$zurl = $zurl."&show_comments=true";
else
$zurl = $zurl."&show_comments=false";
if( $hide_related)
$zurl = $zurl."&hide_related=true";
else
$zurl = $zurl."&hide_related=false";

if( $show_artwork)
$zurl = $zurl."&show_artwork=true";
else
$zurl = $zurl."&show_artwork=false";
if( $visual)
$zurl = $zurl."&visual=true";
else
$zurl = $zurl."&visual=false";

$color = trim($color);
if( !empty($color))
$zurl .= "&color=".str_replace('#','',$color);
$zurl .= "&maxheight=".$player_height ;
$zurl;
$result = simplexml_load_file($zurl);
if( $show_description )
$html .= $result->description;

$result_html = $result->html;
if($visual == 0)
$result_html = str_replace('?visual=true&','?', $result_html);

///////////////////////////// debug

/*$string = $result_html;
$string = " ".$string;
$ini = strpos($string,'src="');
if ($ini == 0) return "";
$ini += strlen('src="');
$len = strpos($string,'"></iframe>',$ini) - $ini;
echo $src = substr($string,$ini,$len);*/

/////////////////////////////


$html .= $result_html;
$html .= '</div>';
$return = $html;
return $return;
}
}

Please Log in or Create an account to join the conversation.

More
9 years 9 months ago #23298 by nordmograph
If you want, provide me admin access and an article where I can test it.
So I can investigate why not working. Email me using the footer menu contect form

Note: when posting code to a forum, use the code tags.

- Need help? Post the URL of the related page (eventualy as confidential info), it will help solve your issue faster.
- An error, notice or warning? report the exact message including the line number
- If you get a white page , enable error reporting and / or check your server error logs.

Please Log in or Create an account to join the conversation.

More
9 years 9 months ago - 9 years 9 months ago #23319 by nordmograph
Hello

http:// wrapper is disabled in the server configuration by allow_url_fopen=0

Set allow_url_fopen =1
in your server php.ini file if you can.

- Need help? Post the URL of the related page (eventualy as confidential info), it will help solve your issue faster.
- An error, notice or warning? report the exact message including the line number
- If you get a white page , enable error reporting and / or check your server error logs.
Last edit: 9 years 9 months ago by nordmograph.

Please Log in or Create an account to join the conversation.

More
9 years 9 months ago #23328 by juankmin
I can't find the php.ini file on my server!!

Please Log in or Create an account to join the conversation.

Time to create page: 0.354 seconds
Powered by Kunena Forum
Disclaimer: Nordmograph is not affiliated with or endorsed by The Joomla! Project™. Any products and services provided through this site are not supported or warrantied by The Joomla! Project or Open Source Matters, Inc. Use of the Joomla!® name, symbol, logo and related trademarks is permitted under a limited license granted by Open Source Matters, Inc.