WordPress.org

Forums

Automatic Youtube Video Posts Plugin
Fixing "more tag" bug and the break descripiton. (8 posts)

  1. LCMAquino
    Member
    Posted 1 year ago #

    Hi Guys,

    There is a little bug with "more tag" feature (in AYVP version 3.2). If the video description has some link, then sometimes the "<!--more-->" code is inserted inside an "<a href>" html tag and so crashing it. The same problem happened sometimes with "<br />" tags. To fix this bug, just swap the order of some codes in "automatic-youtube-video-posts/core/parse.php" (around line 212) to look like this:

    //add more tag
    $s = explode(' ',(string)$s);
    if($tern_wp_youtube_o['words'] and count($s) > $tern_wp_youtube_o['words']) {
        $s = array_merge(array_splice($s,0,$tern_wp_youtube_o['words']),array('<!--more-->'),$s);
    }
    $s = implode(' ',$s);
    
    //replace links
    $s = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.#!-]*(\?\S+)?)?)?)@',"<a href=\"$1\" target=\"_blank\" rel=\"nofollow\">$1</a>",$s);
    
    //add linebreaks
    $s = preg_replace("/[\r\n]/",'<br />',$s);

    I hope this fix can help!

    http://wordpress.org/plugins/automatic-youtube-video-posts/

  2. lonewolfers
    Member
    Posted 1 year ago #

    Hmm I have replace the code as explained by the description text but it is still broken sadly :(

    Am I missing something? My current code in the PARSE.PHP file currently looks like this (I have added more so you can see either side of the code I pasted in, and bolded the new code order):

    $a["media:group"]['media:description'];
    				}
    				/*
    				elseif(!empty($a['content'])) {
    					$s = !empty($a['content']['value']) ? $a['content']['value'] : $a['content'];
    				}
    				*/
    
    				if(!empty($s) and !is_array($s)) {
    					//add more tag
    $s = explode(' ',(string)$s);
    if($tern_wp_youtube_o['words'] and count($s) > $tern_wp_youtube_o['words']) {
        $s = array_merge(array_splice($s,0,$tern_wp_youtube_o['words']),array('<!--more-->'),$s);
    }
    $s = implode(' ',$s);
    
    //replace links
    $s = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.#!-]*(\?\S+)?)?)?)@',"<a href=\"$1\" target=\"_blank\" rel=\"nofollow\">$1</a>",$s);
    
    //add linebreaks
    $s = preg_replace("/[\r\n]/",'<br />',$s);
    				}
    				else {
    					$s = '';
    				}
    
    				//get keywords
    				$t = isset($w['media:group']['media:keywords']) ? $w['media:group']['media:keywords'] : '';
  3. LCMAquino
    Member
    Posted 1 year ago #

    Hi lonewolfers,

    My code in "parse.php" also looks like you posted. What's the problem with your video description? Could you give me an example? Tell me what YouTube video you're trying to import.

  4. lonewolfers
    Member
    Posted 1 year ago #

    Hi basically when I import a video using this plugin, the video imports without any issues but if the description has a webpage link in it then the description is cut off.

    All you see if the first letter of the description so for example if a video description contained the below example:

    My god we have moved into the wonderful diverse world of Bollywood. Now I am going to go straight out there and say I am loving the music, but I am not so sure about my dance moves!

    Check out more about the game at http://www.bollywoodwannabe.com/

    All you would see is 'A' in the imported video description field

    However if it had not webpage link in it then it would show the complete description

    Hope that clarifies it

  5. LCMAquino
    Member
    Posted 1 year ago #

    Hi lonewolfers,

    I think this description comes from http://www.youtube.com/watch?v=KFb-lUqgu7E.

    So I created a playlist with only this video. After that I added this playlist to my local WordPress using the ayvp plugin. It worked fine! The description in the post was fine. No problems with the link.

    Just to be clear, here is my setup:

    • WordPress 3.8;
    • plugin AYVP 3.2;
    • Apache 2.2.22;
    • PHP 5.3.10;
    • MySQL 5.5.22.
  6. multivideojungle
    Member
    Posted 1 year ago #

    Hi, i have same problem of lonewolfers, and i make a playlist with video that you post, my problem is still here, i see only C as description and so on all videos that have links in description.

    I have WordPress 3.8, Php 5.3, AYVP 3.2, i don't know exact version of Apache.

    I tried also first patch you posted but nothing happned.

    Maybe have you guys solved this problem?

  7. LCMAquino
    Member
    Posted 1 year ago #

    Hi multivideojungle,

    Well, my problem was solved with just this patch.

    Ps.: My setup is running on Ubuntu 12.04.

  8. comawhite
    Member
    Posted 1 year ago #

    Here's a quick Fix >>>
    hope it works for you as it did for me :-

    let me help you out...

    to overcome this...

    When typing your YouTube description =
    Dont Press ENTER.

    Just keep on typing in a single paragraph.
    Allow youtube to drop to the next line for you.

    Tell me if it works. Coz it works for me.

    To the Author : mpraetzel
    Please take note of this and why is it this way ?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Automatic Youtube Video Posts Plugin
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic