Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • Bruce Valle Friend
    #201405

    Hi i want to use the mod_jacontentslider that come with PlayMag with another template and now after to put the mod_jacontentslider folder into templates/mytheme/html i get the message below described:

    Fatal error: Class ‘PlaymagHelper’ not found in /home/xxxx/public_html/2014/templates/yoo_everest/html/mod_jacontentslider/video.php on line 224

    i track the line of code and its related to:

    $videoinfo = PlaymagHelper::loadVideoInfo($contn->text);

    TomC Moderator
    #549891

    Which template are you trying to integrate the PlayMag content slider files into?

    Bruce Valle Friend
    #549893

    Yootheme Avenue
    <em>@TomC 446230 wrote:</em><blockquote>Which template are you trying to integrate the PlayMag content slider files into?</blockquote>

    TomC Moderator
    #549895

    <em>@bruce valle 446232 wrote:</em><blockquote>Yootheme Avenue</blockquote>

    Unfortunately, this is an issue for which you’re going to have to seek assistance from the YooTheme folks – as their code structure is likely different than that of JoomlArt’s – even for extensions – and they would be the best one’s to advise as to any modifications that may need to be made to allow for the integration.

    Bruce Valle Friend
    #549906

    extension is working fine, this just stop to work when i include this folder mod_jacontentslider into the templates/mytheme/html

    TomC Moderator
    #549910

    <em>@bruce valle 446246 wrote:</em><blockquote>extension is working fine, this just stop to work when i include this folder mod_jacontentslider into the templates/mytheme/html</blockquote>

    Exactly – which suggests to me that the overall code/call structure may be different within YooTheme’s coding structure – hence my recommendation to seek assistance from the YooTheme folks.

    Bruce Valle Friend
    #549913

    I found this file into the local folder templateHelper.php maybe the code inside this file could help?
    This file is located into the joomlart template
    class PlaymagHelper {

    public static function loadParamsContents($item, $pdata = ‘attribs’){
    $data = $item->$pdata;
    if(is_string($pdata)){
    $data = new JRegistry;
    $data->loadString($item->$pdata);
    }

    if($data instanceof JRegistry){
    return array(
    ‘jdepartment_name’ => $data->get(‘jdepartment_name’, ”),
    ‘facebook_link’=>$data->get(‘facebook_link’, ”),
    ‘flickr_link’=>$data->get(‘flickr_link’, ”),
    ‘google_plus_link’=>$data->get(‘google_plus_link’, ”),
    ‘twitter_link’=>$data->get(‘twitter_link’, ”)
    );
    }

    return array(
    ‘jdepartment_name’ => ”,
    ‘facebook_link’=> ”,
    ‘flickr_link’=>”,
    ‘google_plus_link’=>”,
    ‘twitter_link’=>”
    );
    }
    public static function loadJSAjaxPaging(){
    //Load Ajax paginations
    $doc = jFactory::getDocument();
    $doc->addScriptDeclaration(‘
    var T3JSVars = {
    baseUrl: “‘.JUri::base(true).'”,
    tplUrl: “‘.T3_TEMPLATE_URL.'”,
    finishedMsg: “‘.addslashes(JText::_(‘TPL_JSLANG_FINISHEDMSG’)).'”
    };
    ‘);
    $doc->addScript(T3_TEMPLATE_URL.’/js/jainfinitesloaded.js’);
    return;
    }
    public static function parseVideo($text){
    $obj = new stdClass;
    preg_match(‘#<iframe(.*?)></iframe>#is’, $text, $matches);
    if(isset($matches[0])){
    $obj->iframe = $matches[0];
    }
    $obj->introtext = preg_replace(‘/<iframe.*?/iframe>/i’,”, $text);
    return $obj;
    }
    // function to parse a video <entry>
    static function parseVideoEntry($entry) {
    $obj= new stdClass;
    // get nodes in media: namespace for media information
    $media = $entry->children(‘http://search.yahoo.com/mrss/’);
    $obj->title = $media->group->title;
    $obj->description = $media->group->description;
    // get <yt:duration> node for video length
    $yt = $media->children(‘http://gdata.youtube.com/schemas/2007’);
    $attrs = $yt->duration->attributes();
    $obj->length = $attrs[‘seconds’];
    // return object to caller
    return $obj;
    }
    static function getYoutubeImage($vid){
    $result = array();
    // set video data feed URL
    $feedURL = ‘http://gdata.youtube.com/feeds/api/videos/’ . $vid;

    // read feed into SimpleXML object
    $entry = simplexml_load_file($feedURL);

    // parse video entry
    $video = PlaymagHelper::parseVideoEntry($entry);

    // display video image, title and duration
    $result[‘vimgsrc’] = ‘http://img.youtube.com/vi/’.$vid.’/0.jpg’;
    $result[‘title’] = $video->title;
    $result[‘time’] = $video->length;

    return $result;
    }
    static function getVimeoImage($vid){
    // set video data feed URL
    $feedURL = ‘http://vimeo.com/api/oembed.json?url=’ . rawurlencode(‘http://vimeo.com/’.$vid);
    $video = file_get_contents($feedURL);
    $video = json_decode($video, TRUE);

    $result = array();
    $result[‘vimgsrc’] = $video[‘thumbnail_url’];
    $result[‘title’] = $video[‘title’];
    $result[‘time’] = $video[‘duration’];
    return $result;
    }
    //Gen images and time from youtube or vimeo video
    public static function loadVideoInfo($text){
    $vid = ”;
    if(preg_match_all(‘@<iframes[^>]*src=[“|’]([^”‘>]+)[^>].*?</iframe>@ms’, $text, $iframesrc) > 0){
    if(isset($iframesrc[1])){

    if(strpos($iframesrc[1][0], ‘vimeo.com’) !== false ) {
    $vid = str_replace(
    array(
    ‘http:’,
    ‘https:’,
    ‘//player.vimeo.com/video/’
    ), ”, $iframesrc[1][0]);
    //remove any parameter
    $vid = preg_replace(‘@(/|?).*@i’, ”, $vid);
    if(!(empty($vid))){
    return PlaymagHelper::getVimeoImage($vid);
    }
    } else {
    $vid = str_replace(
    array(
    ‘http:’,
    ‘https:’,
    ‘//youtu.be/’,
    ‘//www.youtube.com/embed/’,
    ‘//youtube.googleapis.com/v/’
    ), ”, $iframesrc[1][0]);
    //remove any parameter
    $vid = preg_replace(‘@(/|?).*@i’, ”, $vid);
    if(!(empty($vid))){
    return PlaymagHelper::getYoutubeImage($vid);
    }
    }
    }
    }
    return;
    }
    }
    <em>@TomC 446250 wrote:</em><blockquote>Exactly – which suggests to me that the overall code/call structure may be different within YooTheme’s coding structure – hence my recommendation to seek assistance from the YooTheme folks.</blockquote>

    Bruce Valle Friend
    #549926

    For others that could need a similar solution, i found the way to implement it into a different template

    Do you need to replace this

    JLoader::register(‘PlaymagHelper’,T3_TEMPLATE_PATH.’/templateHelper.php’);

    with this

    JLoader::register(‘PlaymagHelper’,’templates/your_template_name/local/templateHelper.php’);

    <em>@bruce valle 446253 wrote:</em><blockquote>I found this file into the local folder templateHelper.php maybe the code inside this file could help?
    This file is located into the joomlart template
    class PlaymagHelper {

    public static function loadParamsContents($item, $pdata = ‘attribs’){
    $data = $item->$pdata;
    if(is_string($pdata)){
    $data = new JRegistry;
    $data->loadString($item->$pdata);
    }

    if($data instanceof JRegistry){
    return array(
    ‘jdepartment_name’ => $data->get(‘jdepartment_name’, ”),
    ‘facebook_link’=>$data->get(‘facebook_link’, ”),
    ‘flickr_link’=>$data->get(‘flickr_link’, ”),
    ‘google_plus_link’=>$data->get(‘google_plus_link’, ”),
    ‘twitter_link’=>$data->get(‘twitter_link’, ”)
    );
    }

    return array(
    ‘jdepartment_name’ => ”,
    ‘facebook_link’=> ”,
    ‘flickr_link’=>”,
    ‘google_plus_link’=>”,
    ‘twitter_link’=>”
    );
    }
    public static function loadJSAjaxPaging(){
    //Load Ajax paginations
    $doc = jFactory::getDocument();
    $doc->addScriptDeclaration(‘
    var T3JSVars = {
    baseUrl: “‘.JUri::base(true).'”,
    tplUrl: “‘.T3_TEMPLATE_URL.'”,
    finishedMsg: “‘.addslashes(JText::_(‘TPL_JSLANG_FINISHEDMSG’)).'”
    };
    ‘);
    $doc->addScript(T3_TEMPLATE_URL.’/js/jainfinitesloaded.js’);
    return;
    }
    public static function parseVideo($text){
    $obj = new stdClass;
    preg_match(‘#<iframe(.*?)></iframe>#is’, $text, $matches);
    if(isset($matches[0])){
    $obj->iframe = $matches[0];
    }
    $obj->introtext = preg_replace(‘/<iframe.*?/iframe>/i’,”, $text);
    return $obj;
    }
    // function to parse a video <entry>
    static function parseVideoEntry($entry) {
    $obj= new stdClass;
    // get nodes in media: namespace for media information
    $media = $entry->children(‘http://search.yahoo.com/mrss/’);
    $obj->title = $media->group->title;
    $obj->description = $media->group->description;
    // get <yt:duration> node for video length
    $yt = $media->children(‘http://gdata.youtube.com/schemas/2007’);
    $attrs = $yt->duration->attributes();
    $obj->length = $attrs[‘seconds’];
    // return object to caller
    return $obj;
    }
    static function getYoutubeImage($vid){
    $result = array();
    // set video data feed URL
    $feedURL = ‘http://gdata.youtube.com/feeds/api/videos/’ . $vid;

    // read feed into SimpleXML object
    $entry = simplexml_load_file($feedURL);

    // parse video entry
    $video = PlaymagHelper::parseVideoEntry($entry);

    // display video image, title and duration
    $result[‘vimgsrc’] = ‘http://img.youtube.com/vi/’.$vid.’/0.jpg’;
    $result[‘title’] = $video->title;
    $result[‘time’] = $video->length;

    return $result;
    }
    static function getVimeoImage($vid){
    // set video data feed URL
    $feedURL = ‘http://vimeo.com/api/oembed.json?url=’ . rawurlencode(‘http://vimeo.com/’.$vid);
    $video = file_get_contents($feedURL);
    $video = json_decode($video, TRUE);

    $result = array();
    $result[‘vimgsrc’] = $video[‘thumbnail_url’];
    $result[‘title’] = $video[‘title’];
    $result[‘time’] = $video[‘duration’];
    return $result;
    }
    //Gen images and time from youtube or vimeo video
    public static function loadVideoInfo($text){
    $vid = ”;
    if(preg_match_all(‘@<iframes[^>]*src=[“|’]([^”‘>]+)[^>].*?</iframe>@ms’, $text, $iframesrc) > 0){
    if(isset($iframesrc[1])){

    if(strpos($iframesrc[1][0], ‘vimeo.com’) !== false ) {
    $vid = str_replace(
    array(
    ‘http:’,
    ‘https:’,
    ‘//player.vimeo.com/video/’
    ), ”, $iframesrc[1][0]);
    //remove any parameter
    $vid = preg_replace(‘@(/|?).*@i’, ”, $vid);
    if(!(empty($vid))){
    return PlaymagHelper::getVimeoImage($vid);
    }
    } else {
    $vid = str_replace(
    array(
    ‘http:’,
    ‘https:’,
    ‘//youtu.be/’,
    ‘//www.youtube.com/embed/’,
    ‘//youtube.googleapis.com/v/’
    ), ”, $iframesrc[1][0]);
    //remove any parameter
    $vid = preg_replace(‘@(/|?).*@i’, ”, $vid);
    if(!(empty($vid))){
    return PlaymagHelper::getYoutubeImage($vid);
    }
    }
    }
    }
    return;
    }
    }</blockquote>

    TomC Moderator
    #549927

    So you were able to resolve your issue to your liking ??

Viewing 9 posts - 1 through 9 (of 9 total)

This topic contains 9 replies, has 2 voices, and was last updated by  TomC 9 years, 8 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum