WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: Cool Video Gallery] Playlist not displaying within post content

[Resolved] [Plugin: Cool Video Gallery] Playlist not displaying within post content

  • When I try to embed a gallery playlist within my post content (ie. between two paragraphs), it shows up on the page TWICE- at the top of the post (not within where I put the shortcode), AND again at the end of the post. The showcase feature works great and shows up where I put the shortcode, but that’s not what I need this plugin for.

    wordpress 3.3.1

    http://wordpress.org/extend/plugins/cool-video-gallery/

Viewing 1 replies (of 1 total)
  • Same problem here, again v3.3.1.

    I’m trying to create a solution.

    PS: I have a solution. There is a case in the CVGVideo_Render funciton in

    cool-video-gallery.php

    plugin file. Where the match of the short-code is directly placed on screen (streamed out to browser), by echoing the HTML, instead of replacing the match.

    The problem is located inside the following if statement:

    if(isset($attributes['mode'])) { // This is at line 602 on my version

    Just replace:

    <script type='text/javascript' src='<?php echo $this->plugin_url?>cvg-player/swfobject.js'></script>
    <div>
    <?php
    $video_display = '<div id="mediaplayer_vid_'.$arguments['videoId'].'"><object width="'.$options_player['cvgplayer_width'].'" height="'.$options_player['cvgplayer_height'].'" style="" id="playerID_Video'.$arguments['videoId'].'" data="'.$this->plugin_url.'cvg-player/player.swf" type="application/x-shockwave-flash">';
    $video_display .= '<param value="'.$full_screen.'" name="allowfullscreen">';
    $video_display .= '<param value="transparent" name="wmode">';
    $video_display .= '<param value="file='.$video['filename'].'&image='.$video_preview.'&height='.$options_player['cvgplayer_height'].'&width='.$options_player['cvgplayer_width'].'&autostart='.$autoplay.'&controlbar='.$options_player['cvgplayer_controlbar'].'&backcolor=0x000000&frontcolor=0xCCCCCC&lightcolor=0x557722&skin='.$this->video_player_url . 'skins/' . $options_player['cvgplayer_skin'] . '.swf'.'&volume='.$options_player['cvgplayer_volume'].'&mute='.$mute.'&stretching='.$options_player['cvgplayer_stretching'].'" name="flashvars">';
    $video_display .= '<embed width="'.$options_player['cvgplayer_width'].'" height="'.$options_player['cvgplayer_height'].'" flashvars="file='.$video['filename'].'&image='.$video_preview.'&skin='.$this->video_player_url . 'skins/' . $options_player['cvgplayer_skin'] . '.swf&volume='.$options_player['cvgplayer_volume'].'&mute='.$mute.'&controlbar='.$options_player['cvgplayer_controlbar'].'&stretching='.$options_player['cvgplayer_stretching'].'" lightcolor="0x557722" frontcolor="0xCCCCCC" backcolor="0x000000" wmode="transparent" autostart="'.$autoplay.'" allowscriptaccess="always" allowfullscreen="'.$full_screen.'" quality="high" name="playerID_Video'.$arguments['videoId'].'" id="playerID_Video'.$arguments['videoId'].'" style="" src="'.$this->plugin_url.'cvg-player/player.swf" type="application/x-shockwave-flash">';
    $video_display .= '</object></div>';
    
    echo $video_display;
    ?>
    <div style="float:left;width:<?php echo $options_player['cvgplayer_width']; ?>px;height:auto;margin-bottom:20px;" >
    	<div style="float:left;">
    		<input type="image" src="<?php echo $this->plugin_url?>images/video-button-embed.png" onclick="generate_embed('<?php echo $arguments['videoId'];?>');"/>
    	</div>
    	<div id="embed_content_<?php echo $arguments['videoId'];?>" style="float:left;display:none;padding-left:5px;padding-top: 3px;width: 85%;">
    		<textarea id="embed_text_<?php echo $arguments['videoId'];?>" style="border:medium none;width:<?php echo $options_player['cvgplayer_width'] - 85; ?>px;"></textarea>
    	</div>
    </div>
    </div>
    <br clear="all" />
    <?php
    return;

    with:

    <script type='text/javascript' src='<?php echo $this->plugin_url?>cvg-player/swfobject.js'></script>
    <?php
    $result = '<div>';
    
    $video_display = '<div id="mediaplayer_vid_'.$arguments['videoId'].'"><object width="'.$options_player['cvgplayer_width'].'" height="'.$options_player['cvgplayer_height'].'" style="" id="playerID_Video'.$arguments['videoId'].'" data="'.$this->plugin_url.'cvg-player/player.swf" type="application/x-shockwave-flash">';
    $video_display .= '<param value="'.$full_screen.'" name="allowfullscreen">';
    $video_display .= '<param value="transparent" name="wmode">';
    $video_display .= '<param value="file='.$video['filename'].'&image='.$video_preview.'&height='.$options_player['cvgplayer_height'].'&width='.$options_player['cvgplayer_width'].'&autostart='.$autoplay.'&controlbar='.$options_player['cvgplayer_controlbar'].'&backcolor=0x000000&frontcolor=0xCCCCCC&lightcolor=0x557722&skin='.$this->video_player_url . 'skins/' . $options_player['cvgplayer_skin'] . '.swf'.'&volume='.$options_player['cvgplayer_volume'].'&mute='.$mute.'&stretching='.$options_player['cvgplayer_stretching'].'" name="flashvars">';
    $video_display .= '<embed width="'.$options_player['cvgplayer_width'].'" height="'.$options_player['cvgplayer_height'].'" flashvars="file='.$video['filename'].'&image='.$video_preview.'&skin='.$this->video_player_url . 'skins/' . $options_player['cvgplayer_skin'] . '.swf&volume='.$options_player['cvgplayer_volume'].'&mute='.$mute.'&controlbar='.$options_player['cvgplayer_controlbar'].'&stretching='.$options_player['cvgplayer_stretching'].'" lightcolor="0x557722" frontcolor="0xCCCCCC" backcolor="0x000000" wmode="transparent" autostart="'.$autoplay.'" allowscriptaccess="always" allowfullscreen="'.$full_screen.'" quality="high" name="playerID_Video'.$arguments['videoId'].'" id="playerID_Video'.$arguments['videoId'].'" style="" src="'.$this->plugin_url.'cvg-player/player.swf" type="application/x-shockwave-flash">';
    $video_display .= '</object></div>';
    
    $result .= $video_display;
    
    $result .= '    <div style="float: left; width:' . $options_player['cvgplayer_width'] . 'px; height: auto; margin-bottom: 20px;">';
    $result .= '        <div style="float: left;">';
    $result .= '            <input type="image" src="' . $this->plugin_url . 'images/video-button-embed.png"
                                                        onclick="generate_embed(\'' . $arguments['videoId'] . '\');"/>';
    
    $result .= '        </div>';
    $result .= '        <div id="embed_content_' . $arguments['videoId'] . '" style="float: left; display: none; padding-left: 5px ;padding-top: 3px; width: 85%;">';
    $result .= '            <textarea id="embed_text_' . $arguments['videoId'] . '"
                                                        style="border: medium none; width: ' . ($options_player['cvgplayer_width'] - 85) . 'px;"></textarea>';
    $result .= '        </div>';
    $result .= '    </div>';
    $result .= '</div>';
    $result .= '<br style="clear: both;" />';
    
    return $result;

    This is working for me (WordPress version 3.3.1). I use separate concatenations with $result, beause of debugging, you may use only one or directly to return the value…

    I am unsure why the author had done that in this way, but also keep in mind, it might be for reason and would be, probably replaced in other versions.

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] [Plugin: Cool Video Gallery] Playlist not displaying within post content’ is closed to new replies.