Thread: Major Additions - Links and Downloads Manager
View Single Post
  #603  
Old 11-08-2006, 07:54 PM
AndrewD AndrewD is offline
 
Join Date: Jul 2002
Location: Scotland
Posts: 3,486
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by |oR|Greg
I'm SO close to making Google Video and You Tube videos play within LDM... I just need one last step!!!!

Andrew, I got the IF statement working inside the links_playbit template by adding some more code to the original WIMPY Player plugin that I changed for the FLV Player. Here is the code that I added to the plugin:
PHP Code:
if(stristr($url'video.google.com/videoplay?docid=') == TRUE) { 
$player "google"

$google_patterns = array(
    
'http://video.google.com/videoplay\?docid=(.*?)&(.*?)',
    
'http://video.google.com/videoplay\?docid=(.*?)',
);
$google_rep = array(
    
'http://video.google.com/videoplay?docid=$1',
    
'http://video.google.com/videoplay?docid=$1',
);
$url preg_replace($google_patterns$google_rep$url);
}

if(
stristr($url'youtube.com/watch?v=') == TRUE) { 
$player "youtube";

$youtube_patterns = array(
    
'http://www.youtube.com/watch\?v=(.*?)&(.*?)',
    
'http://www.youtube.com/watch\?v=(.*?)',
    
'http://youtube.com/watch\?v=(.*?)&(.*?)',
    
'http://youtube.com/watch\?v=(.*?)',
);
$youtube_rep = array(
    
'http://www.youtube.com/watch?v=$1',
    
'http://www.youtube.com/watch?v=$1',
    
'http://www.youtube.com/watch?v=$1',
    
'http://www.youtube.com/watch?v=$1',
);
$url preg_replace($youtube_patterns$youtube_rep$url);

Now, here is the code I added to the links_playbit:
HTML Code:
<if condition="$player=='youtube'">
<object width="640" height="480" type="application/x-shockwave-flash" data="$url">
<param name="movie" value="$url" />
<param name="wmode" value="transparent" />
<em><strong>ERROR:</strong> If you can see this, then <a href="http://www.youtube.com/">YouTube</a> is down or you don't have Flash installed.</em>
</object>
</if>

<if condition="$player=='google'">
<object width="640" height="480" type="application/x-shockwave-flash" data="$url">
<param name="movie" value="$url" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="quality" value="best" />
<param name="scale" value="noScale" />
<param name="wmode" value="transparent" />
<param name="salign" value="TL" />
<param name="FlashVars" value="playerMode=embedded" />
<em><strong>ERROR:</strong> If you can see this, then <a href="http://video.google.com/">Google Video</a> is down or you don't have Flash installed.</em>
</object>
</if>
There are 2 prolems I think...
  1. When I add a new url entry to LDM like http://www.youtube.com/watch?v=X4ery9QRfpA, it goes OFF-site and opens a new window rather then opening in the same window with an embeded player, all because it's not a local file.
  2. The jukebox settings require a file type. There is none for this, so I don't know what to do for that either.
Pretty please help me out, I'm SOOO close to embedding these (I think). Aren't you proud of me too, because I wrote my first plugin code?
For your second question, edit includes/local_links_include.php, and go to line 2451 (in 2.2.6 rc), which reads

Code:
if (($user_mac or $user_windows) and get_mimetype($urlType) and in_array($urlType, $musicboxtypes)) $is_musicbox = 1;
Try adding something like:

Code:
if(stristr($linkurlurl, 'video.google.com/videoplay?docid='))  $is_musicbox = 1;
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01622 seconds
  • Memory Usage 1,797KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code
  • (1)bbcode_html
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete