WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Video Plugin
Adding Zshare Player (8 posts)

  1. DivaythFyr
    Member
    Posted 3 years ago #

    Since this player is not included amongst the other 63 players, I tried adding it myself, but it did not work. Fatal error.

    // Zshare code
    
    define("Zshare_WIDTH", 622);
    define("Zshare_HEIGHT", 440);
    define("Zshare_REGEXP", "/\[zshare (:print:+)\]/");
    define("Zshare_TARGET", "<iframe src="http://www.zshare.net/videoplayer/player.php?SID=###URL###&iframewidth=622&iframeheight=395&width=622&height=360" border="0" frameborder="0" height="438" scrolling=\"no\" width="622"></iframe>");
    
    function tutv_plugin_callback($match)
    {
            $output = Zshare_TARGET;
            $output = str_replace("###URL###", $match[1], $output);
            return ($output);
    }
    
    function zshare_plugin($content)
    {
            return (preg_replace_callback(Zshare_REGEXP, 'Zshare_plugin_callback', $content));
    }
    
    add_filter('the_content', 'Zshare_plugin');
    add_filter('the_content_rss', 'Zshare_plugin');
    add_filter('comment_text', 'Zshare_plugin');
    add_filter('the_excerpt', 'Zshare_plugin');

    Is there a way for this to work, or a reason for why it doesn't?

  2. DivaythFyr
    Member
    Posted 3 years ago #

    By the way, awesome plug-in.

  3. DivaythFyr
    Member
    Posted 3 years ago #

    I have created a 4shared one:

    // 4Shared code by Divayth Fyr
    
    define("four_WIDTH", 622); // default width
    define("four_HEIGHT", 440); // default height
    define("four_REGEXP", "/\[4S (<a href="http://codex.wordpress.org/:print:">:print:</a>+)\]/");
    define("four_TARGET", "<object width=\"###WIDTH###\" height=\"###HEIGHT###\"><param name=\"movie\" value=\"http://www.4shared.com/embed/###URL###\" /><param name=\"allowScriptAccess\" value=\"always\" /><param name=\"allowFullScreen\" value=\"true\" /><embed src=\"http://www.4shared.com/embed/###URL###\" type=\"application/x-shockwave-flash\" width=\"###WIDTH###\" height=\"###HEIGHT###\" allowScriptAccess=\"always\" allowFullScreen=\"true\"></embed></object>");
    
    function four_plugin_callback($match)
    {
    	$tag_parts = explode(" ", rtrim($match[0], "]"));
    	$output = four_TARGET;
    	$output = str_replace("###URL###", $tag_parts[1], $output);
    	if (count($tag_parts) > 2) {
    		if ($tag_parts[2] == 0) {
    			$output = str_replace("###WIDTH###", four_WIDTH, $output);
    		} else {
    			$output = str_replace("###WIDTH###", $tag_parts[2], $output);
    		}
    		if ($tag_parts[3] == 0) {
    			$output = str_replace("###HEIGHT###", four_HEIGHT, $output);
    		} else {
    			$output = str_replace("###HEIGHT###", $tag_parts[3], $output);
    		}
    	} else {
    		$output = str_replace("###WIDTH###", four_WIDTH, $output);
    		$output = str_replace("###HEIGHT###", four_HEIGHT, $output);
    	}
    	return ($output);
    }
    function four_plugin($content)
    {
    	return (preg_replace_callback(four_REGEXP, 'four_plugin_callback', $content));
    }
    
    add_filter('the_content', 'four_plugin');
    add_filter('the_content_rss', 'four_plugin');
    add_filter('comment_text', 'four_plugin');
    add_filter('the_excerpt', 'four_plugin');

    However, I'm still having trouble with the Zshare one.

    This is a normal Zshare embed:

    <iframe src="http://www.zshare.net/videoplayer/player.php?SID=dl042&FID=75007216&FN=Cowboy%20Bebop%20Episode%206%20English%20Subbed.flv&iframewidth=622&iframeheight=395&width=622&height=360" border="0" frameborder="0" height="438" scrolling="no" width="622"></iframe>

    I really need this since 90% of the videos I embed use one these embeds, and it's a pain to manually change three width tags each time..

  4. DivaythFyr
    Member
    Posted 3 years ago #

    I any help at all would be great..

    Novamov is a similar iframe embed:

    [Code moderated as per the Forum Rules. Please use the pastebin]

  5. daburna
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks DivaythFyr! I will try your code and then integrate it.

  6. DivaythFyr
    Member
    Posted 3 years ago #

    Is there any place I could get help on this issue?

  7. DivaythFyr
    Member
    Posted 3 years ago #

    Could anyone help at all?

  8. DivaythFyr
    Member
    Posted 3 years ago #

    Well, if anyone gets a chance to figure it out, great.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic