| 1 |
<?php |
<?php |
| 2 |
|
|
| 3 |
// $Id$ |
// $Id: drigg_embed.module,v 1.1.2.6.2.1 2008/11/07 01:00:11 mercmobily Exp $ |
| 4 |
|
|
| 5 |
/** |
/** |
| 6 |
* @file |
* @file |
| 7 |
*/ |
*/ |
| 8 |
|
|
| 9 |
|
|
| 10 |
/** |
/** |
| 11 |
* Implementation of hook_help(). |
* Implementation of hook_help(). |
| 12 |
*/ |
*/ |
| 13 |
function drigg_embed_help($path, $arg) { |
function drigg_embed_help($path, $arg) { |
| 14 |
switch ($path) { |
switch ($path) { |
| 15 |
} |
} |
| 16 |
} |
} |
| 17 |
|
|
| 18 |
/** |
/** |
| 19 |
* Implementation of hook_menu(). |
* Implementation of hook_menu(). |
| 20 |
* |
* |
| 21 |
* This is again "the usual story". However, note that this "menu" is |
* This is again "the usual story". However, note that this "menu" is |
| 22 |
* quite tricky, because it needs to pass the right arguments to |
* quite tricky, because it needs to pass the right arguments to |
| 23 |
* drigg_node_list(). The function is commented throughout |
* drigg_node_list(). The function is commented throughout |
| 24 |
*/ |
*/ |
| 25 |
function drigg_embed_menu() { |
function drigg_embed_menu() { |
| 26 |
$items = array(); |
$items = array(); |
| 27 |
|
|
| 28 |
$items['admin/settings/drigg/drigg_embed'] = array( |
$items['admin/settings/drigg/drigg_embed'] = array( |
| 29 |
'title' => 'Embedded objects', |
'title' => 'Embedded objects', |
| 30 |
'description' => "Drigg module's preview of embedded content", |
'description' => "Drigg module's preview of embedded content", |
| 31 |
'page callback' => 'drupal_get_form', |
'page callback' => 'drupal_get_form', |
| 32 |
'page arguments' => array('drigg_embed_admin_settings'), |
'page arguments' => array('drigg_embed_admin_settings'), |
| 33 |
'access callback' => 'user_access', |
'access callback' => 'user_access', |
| 34 |
'access arguments' => array('administer site configuration'), |
'access arguments' => array('administer site configuration'), |
| 35 |
'type' => MENU_LOCAL_TASK, |
'type' => MENU_LOCAL_TASK, |
| 36 |
); |
); |
| 37 |
return $items; |
return $items; |
| 38 |
} |
} |
| 39 |
|
|
| 40 |
|
|
| 41 |
/** |
/** |
| 42 |
* Another secondary "settings" function for the module. This is a bunch |
* Another secondary "settings" function for the module. This is a bunch |
| 43 |
* of settings options to configure the embedded options for embedded |
* of settings options to configure the embedded options for embedded |
| 44 |
* contents |
* contents |
| 45 |
* |
* |
| 46 |
*/ |
*/ |
| 47 |
function drigg_embed_admin_settings() { |
function drigg_embed_admin_settings() { |
| 48 |
|
|
| 49 |
$form['drigg_embed_before'] = array( |
$form['drigg_embed_before'] = array( |
| 50 |
'#type' => 'textarea', |
'#type' => 'textarea', |
| 51 |
'#rows' => 5, |
'#rows' => 5, |
| 52 |
'#title' => t('What to show before embedded objects'), |
'#title' => t('What to show before embedded objects'), |
| 53 |
'#default_value' => variable_get('drigg_embed_before', ''), |
'#default_value' => variable_get('drigg_embed_before', ''), |
| 54 |
'#description' => t('This will be shown before embedded objects'), |
'#description' => t('This will be shown before embedded objects'), |
| 55 |
); |
); |
| 56 |
|
|
| 57 |
$form['drigg_embed_after'] = array( |
$form['drigg_embed_after'] = array( |
| 58 |
'#type' => 'textarea', |
'#type' => 'textarea', |
| 59 |
'#rows' => 5, |
'#rows' => 5, |
| 60 |
'#title' => t('What to show after embedded objects'), |
'#title' => t('What to show after embedded objects'), |
| 61 |
'#default_value' => variable_get('drigg_embed_after', ''), |
'#default_value' => variable_get('drigg_embed_after', ''), |
| 62 |
'#description' => t('This will be shown after embedded objects'), |
'#description' => t('This will be shown after embedded objects'), |
| 63 |
); |
); |
| 64 |
|
|
| 65 |
$form['youtube'] = array( |
$form['youtube'] = array( |
| 66 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 67 |
'#title' => t('Youtube settings'), |
'#title' => t('Youtube settings'), |
| 68 |
'#collapsible' => FALSE, |
'#collapsible' => FALSE, |
| 69 |
'#collapsed' => FALSE, |
'#collapsed' => FALSE, |
| 70 |
); |
); |
| 71 |
|
|
| 72 |
$form['youtube']['drigg_embed_show_youtube'] = array( |
$form['youtube']['drigg_embed_show_youtube'] = array( |
| 73 |
'#type' => 'checkbox', |
'#type' => 'checkbox', |
| 74 |
'#title' => t('Enable Youtube video embedding in stories'), |
'#title' => t('Enable Youtube video embedding in stories'), |
| 75 |
'#default_value' => variable_get('drigg_embed_show_youtube', FALSE), |
'#default_value' => variable_get('drigg_embed_show_youtube', FALSE), |
| 76 |
'#required' => FALSE, |
'#required' => FALSE, |
| 77 |
); |
); |
| 78 |
|
|
| 79 |
$form['metacafe'] = array( |
$form['metacafe'] = array( |
| 80 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 81 |
'#title' => t('Metacafe settings'), |
'#title' => t('Metacafe settings'), |
| 82 |
'#collapsible' => FALSE, |
'#collapsible' => FALSE, |
| 83 |
'#collapsed' => FALSE, |
'#collapsed' => FALSE, |
| 84 |
); |
); |
| 85 |
|
|
| 86 |
$form['metacafe']['drigg_embed_show_metacafe'] = array( |
$form['metacafe']['drigg_embed_show_metacafe'] = array( |
| 87 |
'#type' => 'checkbox', |
'#type' => 'checkbox', |
| 88 |
'#title' => t('Enable Metacafe video embedding in stories'), |
'#title' => t('Enable Metacafe video embedding in stories'), |
| 89 |
'#default_value' => variable_get('drigg_embed_show_metacafe', FALSE), |
'#default_value' => variable_get('drigg_embed_show_metacafe', FALSE), |
| 90 |
'#required' => FALSE, |
'#required' => FALSE, |
| 91 |
); |
); |
| 92 |
|
|
| 93 |
$form['revver'] = array( |
$form['revver'] = array( |
| 94 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 95 |
'#title' => t('Revver settings'), |
'#title' => t('Revver settings'), |
| 96 |
'#collapsible' => FALSE, |
'#collapsible' => FALSE, |
| 97 |
'#collapsed' => FALSE, |
'#collapsed' => FALSE, |
| 98 |
); |
); |
| 99 |
|
|
| 100 |
$form['revver']['drigg_embed_show_revver'] = array( |
$form['revver']['drigg_embed_show_revver'] = array( |
| 101 |
'#type' => 'checkbox', |
'#type' => 'checkbox', |
| 102 |
'#title' => t('Enable Revver video embedding in stories'), |
'#title' => t('Enable Revver video embedding in stories'), |
| 103 |
'#default_value' => variable_get('drigg_embed_show_revver', FALSE), |
'#default_value' => variable_get('drigg_embed_show_revver', FALSE), |
| 104 |
'#required' => FALSE, |
'#required' => FALSE, |
| 105 |
); |
); |
| 106 |
|
|
| 107 |
$form['veoh'] = array( |
$form['veoh'] = array( |
| 108 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 109 |
'#title' => t('Veoh settings'), |
'#title' => t('Veoh settings'), |
| 110 |
'#collapsible' => FALSE, |
'#collapsible' => FALSE, |
| 111 |
'#collapsed' => FALSE, |
'#collapsed' => FALSE, |
| 112 |
); |
); |
| 113 |
|
|
| 114 |
$form['veoh']['drigg_embed_show_veoh'] = array( |
$form['veoh']['drigg_embed_show_veoh'] = array( |
| 115 |
'#type' => 'checkbox', |
'#type' => 'checkbox', |
| 116 |
'#title' => t('Enable Veoh video embedding in stories'), |
'#title' => t('Enable Veoh video embedding in stories'), |
| 117 |
'#default_value' => variable_get('drigg_embed_show_veoh', FALSE), |
'#default_value' => variable_get('drigg_embed_show_veoh', FALSE), |
| 118 |
'#required' => FALSE, |
'#required' => FALSE, |
| 119 |
); |
); |
| 120 |
|
|
| 121 |
$form['ifilm'] = array( |
$form['ifilm'] = array( |
| 122 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 123 |
'#title' => t('iFilm settings'), |
'#title' => t('iFilm settings'), |
| 124 |
'#collapsible' => FALSE, |
'#collapsible' => FALSE, |
| 125 |
'#collapsed' => FALSE, |
'#collapsed' => FALSE, |
| 126 |
); |
); |
| 127 |
|
|
| 128 |
$form['ifilm']['drigg_embed_show_ifilm'] = array( |
$form['ifilm']['drigg_embed_show_ifilm'] = array( |
| 129 |
'#type' => 'checkbox', |
'#type' => 'checkbox', |
| 130 |
'#title' => t('Enable iFilm video embedding in stories'), |
'#title' => t('Enable iFilm video embedding in stories'), |
| 131 |
'#default_value' => variable_get('drigg_embed_show_ifilm', FALSE), |
'#default_value' => variable_get('drigg_embed_show_ifilm', FALSE), |
| 132 |
'#required' => FALSE, |
'#required' => FALSE, |
| 133 |
); |
); |
| 134 |
|
|
| 135 |
$form['google_video'] = array( |
$form['google_video'] = array( |
| 136 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 137 |
'#title' => t('Google Video settings'), |
'#title' => t('Google Video settings'), |
| 138 |
'#collapsible' => FALSE, |
'#collapsible' => FALSE, |
| 139 |
'#collapsed' => FALSE, |
'#collapsed' => FALSE, |
| 140 |
); |
); |
| 141 |
|
|
| 142 |
$form['google_video']['drigg_embed_show_google_video'] = array( |
$form['google_video']['drigg_embed_show_google_video'] = array( |
| 143 |
'#type' => 'checkbox', |
'#type' => 'checkbox', |
| 144 |
'#title' => t('Enable Google Video video embedding in stories'), |
'#title' => t('Enable Google Video video embedding in stories'), |
| 145 |
'#default_value' => variable_get('drigg_embed_show_google_video', FALSE), |
'#default_value' => variable_get('drigg_embed_show_google_video', FALSE), |
| 146 |
'#required' => FALSE, |
'#required' => FALSE, |
| 147 |
); |
); |
| 148 |
|
|
| 149 |
$form['yahoo_video'] = array( |
$form['yahoo_video'] = array( |
| 150 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 151 |
'#title' => t('Yahoo Video settings'), |
'#title' => t('Yahoo Video settings'), |
| 152 |
'#collapsible' => FALSE, |
'#collapsible' => FALSE, |
| 153 |
'#collapsed' => FALSE, |
'#collapsed' => FALSE, |
| 154 |
); |
); |
| 155 |
|
|
| 156 |
$form['yahoo_video']['drigg_embed_show_yahoo_video'] = array( |
$form['yahoo_video']['drigg_embed_show_yahoo_video'] = array( |
| 157 |
'#type' => 'checkbox', |
'#type' => 'checkbox', |
| 158 |
'#title' => t('Enable Yahoo Video video embedding in stories'), |
'#title' => t('Enable Yahoo Video video embedding in stories'), |
| 159 |
'#default_value' => variable_get('drigg_embed_show_yahoo_video', FALSE), |
'#default_value' => variable_get('drigg_embed_show_yahoo_video', FALSE), |
| 160 |
'#required' => FALSE, |
'#required' => FALSE, |
| 161 |
); |
); |
| 162 |
|
|
| 163 |
$form['sapo'] = array( |
$form['sapo'] = array( |
| 164 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 165 |
'#title' => t('Sapo settings'), |
'#title' => t('Sapo settings'), |
| 166 |
'#collapsible' => FALSE, |
'#collapsible' => FALSE, |
| 167 |
'#collapsed' => FALSE, |
'#collapsed' => FALSE, |
| 168 |
); |
); |
| 169 |
|
|
| 170 |
$form['sapo']['drigg_embed_show_sapo'] = array( |
$form['sapo']['drigg_embed_show_sapo'] = array( |
| 171 |
'#type' => 'checkbox', |
'#type' => 'checkbox', |
| 172 |
'#title' => t('Enable Sapo video embedding in stories'), |
'#title' => t('Enable Sapo video embedding in stories'), |
| 173 |
'#default_value' => variable_get('drigg_embed_show_sapo', FALSE), |
'#default_value' => variable_get('drigg_embed_show_sapo', FALSE), |
| 174 |
'#required' => FALSE, |
'#required' => FALSE, |
| 175 |
); |
); |
| 176 |
|
|
| 177 |
$form['mp3'] = array( |
$form['mp3'] = array( |
| 178 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 179 |
'#title' => t('Mp3 settings'), |
'#title' => t('Mp3 settings'), |
| 180 |
'#collapsible' => FALSE, |
'#collapsible' => FALSE, |
| 181 |
'#collapsed' => FALSE, |
'#collapsed' => FALSE, |
| 182 |
); |
); |
| 183 |
|
|
| 184 |
$form['mp3']['drigg_embed_show_mp3'] = array( |
$form['mp3']['drigg_embed_show_mp3'] = array( |
| 185 |
'#type' => 'checkbox', |
'#type' => 'checkbox', |
| 186 |
'#title' => t('Enable Mp3 embedding in stories'), |
'#title' => t('Enable Mp3 embedding in stories'), |
| 187 |
'#default_value' => variable_get('drigg_embed_show_mp3', FALSE), |
'#default_value' => variable_get('drigg_embed_show_mp3', FALSE), |
| 188 |
'#required' => FALSE, |
'#required' => FALSE, |
| 189 |
); |
); |
| 190 |
|
|
| 191 |
$form['mp3']['drigg_url_noshow_mp3'] = array( |
$form['mp3']['drigg_url_noshow_mp3'] = array( |
| 192 |
'#type' => 'checkbox', |
'#type' => 'checkbox', |
| 193 |
'#title' => t('Do not link the story to the Mp3'), |
'#title' => t('Do not link the story to the Mp3'), |
| 194 |
'#default_value' => variable_get('drigg_url_noshow_mp3', FALSE), |
'#default_value' => variable_get('drigg_url_noshow_mp3', FALSE), |
| 195 |
'#required' => FALSE, |
'#required' => FALSE, |
| 196 |
); |
); |
| 197 |
|
|
| 198 |
return system_settings_form($form); |
return system_settings_form($form); |
| 199 |
} |
} |
| 200 |
|
|
| 201 |
function drigg_embed_contents($o, $node_url, $teaser, $check_only = FALSE) { |
function drigg_embed_contents($o, $node_url, $teaser, $check_only = FALSE) { |
| 202 |
$url = $o->url; |
$url = $o->url; |
| 203 |
|
|
| 204 |
// NOTE: you can also check things by $o->content_type |
// NOTE: you can also check things by $o->content_type |
| 205 |
|
|
| 206 |
if (variable_get('drigg_embed_show_sapo', FALSE)) { |
if (variable_get('drigg_embed_show_sapo', FALSE)) { |
| 207 |
|
|
| 208 |
if (preg_match('|http://videos.sapo.pt/(.*)/?$|', $url, $matches)) { |
if (preg_match('|http://videos.sapo.pt/(.*)/?$|', $url, $matches)) { |
| 209 |
if ($teaser) { |
if ($teaser) { |
| 210 |
$return = '<div class="embedded-sapo teaser"><a href="'. $node_url .'"><img src="http://imgs.sapo.pt/sapovideo/imgs/logo_video.gif" width="80" height="60" title="'. $o->title .'"/></div>'; |
$return = '<div class="embedded-sapo teaser"><a href="'. $node_url .'"><img src="http://imgs.sapo.pt/sapovideo/imgs/logo_video.gif" width="80" height="60" title="'. $o->title .'" /></div>'; |
| 211 |
} |
} |
| 212 |
else { |
else { |
| 213 |
$return = '<div class="embedded-sapo"><embed src="http://rd3.videos.sapo.pt/play?file=http://rd3.videos.sapo.pt/'. $matches[1] .'" type="application/x-shockwave-flash" width="400" height="322"> </embed>'; |
$return = '<div class="embedded-sapo"><embed src="http://rd3.videos.sapo.pt/play?file=http://rd3.videos.sapo.pt/'. $matches[1] .'" type="application/x-shockwave-flash" width="400" height="322"> </embed>'; |
| 214 |
} |
} |
| 215 |
return variable_get('drigg_embed_before', '') . $return . variable_get('drigg_embed_after', ''); |
return variable_get('drigg_embed_before', '') . $return . variable_get('drigg_embed_after', ''); |
| 216 |
} |
} |
| 217 |
} |
} |
| 218 |
|
|
| 219 |
if (variable_get('drigg_embed_show_yahoo_video', FALSE)) { |
if (variable_get('drigg_embed_show_yahoo_video', FALSE)) { |
| 220 |
|
|
| 221 |
if (preg_match('|video.yahoo.com/watch/([^/]*)/(.*)$|', $url, $matches)) { |
if (preg_match('|video.yahoo.com/watch/([^/]*)/(.*)$|', $url, $matches)) { |
| 222 |
if ($teaser) { |
if ($teaser) { |
| 223 |
$return = '<div class="embedded-yahoo_video teaser"><a href="'. $node_url .'"><img src="http://thmg01.video.search.yahoo.com/image/'. $matches[1] .'_01" width="80" height="60" title="'. $o->title .'"/></div>'; |
$return = '<div class="embedded-yahoo_video teaser"><a href="'. $node_url .'"><img src="http://thmg01.video.search.yahoo.com/image/'. $matches[1] .'_01" width="80" height="60" title="'. $o->title .'" /></div>'; |
| 224 |
} |
} |
| 225 |
else { |
else { |
| 226 |
$return = '<div class="embedded-yahoo_video"><object width="512" height="323"><param name="movie" value="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.0.41" /><param name="allowFullScreen" value="true" /><param name="flashVars" value="id='. $matches[1] .'&vid='. $matches[2] .'&lang=en-US&intl=us" /><embed src="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.0.41" type="application/x-shockwave-flash" width="512" height="323" allowFullScreen="true" flashVars="id='. $matches[2] .'&vid='. $matches[1] .'&lang=en-US&intl=us"></embed></object></div>'; |
$return = '<div class="embedded-yahoo_video"><object width="512" height="323"><param name="movie" value="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.0.41" /><param name="allowFullScreen" value="true" /><param name="flashVars" value="id='. $matches[1] .'&vid='. $matches[2] .'&lang=en-US&intl=us" /><embed src="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.0.41" type="application/x-shockwave-flash" width="512" height="323" allowFullScreen="true" flashVars="id='. $matches[2] .'&vid='. $matches[1] .'&lang=en-US&intl=us"></embed></object></div>'; |
| 227 |
} |
} |
| 228 |
return variable_get('drigg_embed_before', '') . $return . variable_get('drigg_embed_after', ''); |
return variable_get('drigg_embed_before', '') . $return . variable_get('drigg_embed_after', ''); |
| 229 |
} |
} |
| 230 |
} |
} |
| 231 |
|
|
| 232 |
if (variable_get('drigg_embed_show_google_video', FALSE)) { |
if (variable_get('drigg_embed_show_google_video', FALSE)) { |
| 233 |
|
|
| 234 |
if (preg_match('|video.google.com/videoplay\?docid=(.*)$|', $url, $matches)) { |
if (preg_match('|video.google.com/videoplay\?docid=(.*)$|', $url, $matches)) { |
| 235 |
if ($teaser) { |
if ($teaser) { |
| 236 |
$return = '<div class="embedded-google_video teaser"><a href="'. $node_url .'"><img src="http://video.google.com/img/logo_video.gif" width="80" height="60" title="'. $o->title .'"/></div>'; |
$return = '<div class="embedded-google_video teaser"><a href="'. $node_url .'"><img src="http://video.google.com/img/logo_video.gif" width="80" height="60" title="'. $o->title .'" /></div>'; |
| 237 |
} |
} |
| 238 |
else { |
else { |
| 239 |
$return = '<div class="embedded-google_video"><embed class="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId='. $matches[1] .'&hl=en" flashvars=""> </embed></div>'; |
$return = '<div class="embedded-google_video"><embed class="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId='. $matches[1] .'&hl=en" flashvars=""> </embed></div>'; |
| 240 |
} |
} |
| 241 |
return variable_get('drigg_embed_before', '') . $return . variable_get('drigg_embed_after', ''); |
return variable_get('drigg_embed_before', '') . $return . variable_get('drigg_embed_after', ''); |
| 242 |
} |
} |
| 243 |
} |
} |
| 244 |
|
|
| 245 |
if (variable_get('drigg_embed_show_ifilm', FALSE)) { |
if (variable_get('drigg_embed_show_ifilm', FALSE)) { |
| 246 |
|
|
| 247 |
if (preg_match('|www.spike.com/video/(.*)$|', $url, $matches)) { |
if (preg_match('|www.spike.com/video/(.*)$|', $url, $matches)) { |
| 248 |
$split = explode("/", $matches[1]); |
$split = explode("/", $matches[1]); |
| 249 |
if ($teaser) { |
if ($teaser) { |
| 250 |
$return = '<div class="embedded-ifilm teaser"><a href="'. $node_url .'"><img src="http://img1.ifilmpro.com/resize/image/stills/films/resize/istd/'. $split[1] .'.jpg?width=80&height=60" width="80" height="60" title="'. $o->title .'"/></div>'; |
$return = '<div class="embedded-ifilm teaser"><a href="'. $node_url .'"><img src="http://img1.ifilmpro.com/resize/image/stills/films/resize/istd/'. $split[1] .'.jpg?width=80&height=60" width="80" height="60" title="'. $o->title .'" /></div>'; |
| 251 |
} |
} |
| 252 |
else { |
else { |
| 253 |
$return = '<div class="embedded-ifilm"><embed wmode="transparent" width="425" height="350" src="http://www.spike.com/efp" quality="high" bgcolor="000000" name="efp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="flvbaseclip='. $matches[1] .'&"> </embed></div>'; |
$return = '<div class="embedded-ifilm"><embed wmode="transparent" width="425" height="350" src="http://www.spike.com/efp" quality="high" bgcolor="000000" name="efp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="flvbaseclip='. $matches[1] .'&"> </embed></div>'; |
| 254 |
} |
} |
| 255 |
return variable_get('drigg_embed_before', '') . $return . variable_get('drigg_embed_after', ''); |
return variable_get('drigg_embed_before', '') . $return . variable_get('drigg_embed_after', ''); |
| 256 |
} |
} |
| 257 |
} |
} |
| 258 |
|
|
| 259 |
if (variable_get('drigg_embed_show_veoh', FALSE)) { |
if (variable_get('drigg_embed_show_veoh', FALSE)) { |
| 260 |
|
|
| 261 |
if (preg_match('|veoh.com/videos/([^/?]*)|', $url, $matches)) { |
if (preg_match('|veoh.com/videos/([^/?]*)|', $url, $matches)) { |
| 262 |
if ($teaser) { |
if ($teaser) { |
| 263 |
$return = '<div class="embedded-veoh teaser"><a href="'. $node_url .'"><img src="http://p-appserver.veoh.com/static/images/PlayThumbVeoh.jpg" width="80" height="60" title="'. $o->title .'"/></div>'; |
$return = '<div class="embedded-veoh teaser"><a href="'. $node_url .'"><img src="http://p-appserver.veoh.com/static/images/PlayThumbVeoh.jpg" width="80" height="60" title="'. $o->title .'" /></div>'; |
| 264 |
} |
} |
| 265 |
else { |
else { |
| 266 |
$return = '<div class="embedded-veoh"><embed src="http://www.veoh.com/videodetails2.swf?permalinkId='. $matches[1] .'&id=anonymous&player=videodetailsembedded&videoAutoPlay=0" allowFullScreen="true" width="400" height="300" bgcolor="#000000" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></div>'; |
$return = '<div class="embedded-veoh"><embed src="http://www.veoh.com/videodetails2.swf?permalinkId='. $matches[1] .'&id=anonymous&player=videodetailsembedded&videoAutoPlay=0" allowFullScreen="true" width="400" height="300" bgcolor="#000000" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></div>'; |
| 267 |
} |
} |
| 268 |
return variable_get('drigg_embed_before', '') . $return . variable_get('drigg_embed_after', ''); |
return variable_get('drigg_embed_before', '') . $return . variable_get('drigg_embed_after', ''); |
| 269 |
} |
} |
| 270 |
} |
} |
| 271 |
|
|
| 272 |
if (variable_get('drigg_embed_show_revver', FALSE)) { |
if (variable_get('drigg_embed_show_revver', FALSE)) { |
| 273 |
|
|
| 274 |
if (preg_match('|revver.com/video/(.*?)/.*$|', $url, $matches)) { |
if (preg_match('|revver.com/video/(.*?)/.*$|', $url, $matches)) { |
| 275 |
if ($teaser) { |
if ($teaser) { |
| 276 |
$return = '<div class="embedded-revver teaser"><a href="'. $node_url .'"><img src="http://frame.revver.com/frame/80x60/'. $matches[1] .'.jpg" title="'. $o->title .'"></a></div>'; |
$return = '<div class="embedded-revver teaser"><a href="'. $node_url .'"><img src="http://frame.revver.com/frame/80x60/'. $matches[1] .'.jpg" title="'. $o->title .'"></a></div>'; |
| 277 |
} |
} |
| 278 |
else { |
else { |
| 279 |
$return = '<div class="embedded-revver"><script src="http://flash.revver.com/player/1.0/player.js?mediaId:'. $matches[1] .';width:480;height:392" type="text/javascript"></script> </div>'; |
$return = '<div class="embedded-revver"><script src="http://flash.revver.com/player/1.0/player.js?mediaId:'. $matches[1] .';width:480;height:392" type="text/javascript"></script> </div>'; |
| 280 |
} |
} |
| 281 |
return variable_get('drigg_embed_before', '') . $return . variable_get('drigg_embed_after', ''); |
return variable_get('drigg_embed_before', '') . $return . variable_get('drigg_embed_after', ''); |
| 282 |
} |
} |
| 283 |
} |
} |
| 284 |
|
|
| 285 |
if (variable_get('drigg_embed_show_metacafe', FALSE)) { |
if (variable_get('drigg_embed_show_metacafe', FALSE)) { |
| 286 |
|
|
| 287 |
if (preg_match('|www\.metacafe\.com/watch/(.*?)/?$|', $url, $matches)) { |
if (preg_match('|www\.metacafe\.com/watch/(.*?)/?$|', $url, $matches)) { |
| 288 |
$split = explode("/", $matches[1]); |
$split = explode("/", $matches[1]); |
| 289 |
if ($teaser) { |
if ($teaser) { |
| 290 |
$return = '<div class="embedded-metacafe teaser"><a href="'. $node_url .'"><img src="http://s3.mcstatic.com/thumb/'. $split[0] .'.jpg" width="80" height="60" border=1 title="'. $o->title .'"></a></div>'; |
$return = '<div class="embedded-metacafe teaser"><a href="'. $node_url .'"><img src="http://s3.mcstatic.com/thumb/'. $split[0] .'.jpg" width="80" height="60" border=1 title="'. $o->title .'" /></a></div>'; |
| 291 |
} |
} |
| 292 |
else { |
else { |
| 293 |
$return = '<div class="embedded-metacafe"><embed src="http://www.metacafe.com/fplayer/'. $matches[1] .'.swf" width="400" height="345" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"> </embed></div>'; |
$return = '<div class="embedded-metacafe"><embed src="http://www.metacafe.com/fplayer/'. $matches[1] .'.swf" width="400" height="345" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"> </embed></div>'; |
| 294 |
} |
} |
| 295 |
return variable_get('drigg_embed_before', '') . $return . variable_get('drigg_embed_after', ''); |
return variable_get('drigg_embed_before', '') . $return . variable_get('drigg_embed_after', ''); |
| 296 |
} |
} |
| 297 |
} |
} |
| 298 |
|
|
| 299 |
// Youtube: 'youtube' |
// Youtube: 'youtube' |
| 300 |
if (variable_get('drigg_embed_show_youtube', FALSE)) { |
if (variable_get('drigg_embed_show_youtube', FALSE)) { |
| 301 |
|
|
| 302 |
if (preg_match('/youtube\.com\/watch\?v=([A-Za-z0-9._%-]*)[&\w;=\+_\-]*/', $url, $matches)) { |
if (preg_match('/youtube\.com\/watch\?v=([A-Za-z0-9._%-]*)[&\w;=\+_\-]*/', $url, $matches)) { |
| 303 |
if ($teaser) { |
if ($teaser) { |
| 304 |
$return = '<div class="embedded-youtube teaser"><a href="'. $node_url .'"><img src="http://img.youtube.com/vi/'. $matches[1] .'/0.jpg" width="80" height="60" border=1 title="'. $o->title .'"></a></div>'; |
$return = '<div class="embedded-youtube teaser"><a href="'. $node_url .'"><img src="http://img.youtube.com/vi/'. $matches[1] .'/0.jpg" width="80" height="60" border=1 title="'. $o->title .'"></a></div>'; |
| 305 |
} |
} |
| 306 |
else { |
else { |
| 307 |
$return = '<div class="embedded-youtube"><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/'. $matches[1] .'&rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'. $matches[1] .'&rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></div>'; |
$return = '<div class="embedded-youtube"><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/'. $matches[1] .'&rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'. $matches[1] .'&rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></div>'; |
| 308 |
} |
} |
| 309 |
return variable_get('drigg_embed_before', '') . $return . variable_get('drigg_embed_after', ''); |
return variable_get('drigg_embed_before', '') . $return . variable_get('drigg_embed_after', ''); |
| 310 |
|
|
| 311 |
} |
} |
| 312 |
} |
} |
| 313 |
|
|
| 314 |
// mp3 with player |
// mp3 with player |
| 315 |
if (variable_get('drigg_embed_show_mp3', FALSE)) { |
if (variable_get('drigg_embed_show_mp3', FALSE)) { |
| 316 |
|
|
| 317 |
if (preg_match("|\.mp3$|", $url)) { |
if (preg_match("|\.mp3$|", $url)) { |
| 318 |
if ($teaser) { |
if ($teaser) { |
| 319 |
return '<div class="embedded-mp3 teaser"><a href="'. $node_url .'"><img src="'. path_to_theme() .'/img/audio_icon.png" width="32" height="32" border=0 title="'. $o->title .'"></a></div>'; |
return '<div class="embedded-mp3 teaser"><a href="'. $node_url .'"><img src="'. path_to_theme() .'/img/audio_icon.png" width="32" height="32" border=0 title="'. $o->title .'" /></a></div>'; |
| 320 |
} |
} |
| 321 |
else { |
else { |
| 322 |
if (variable_get('drigg_url_noshow_mp3', FALSE)) { |
if (variable_get('drigg_url_noshow_mp3', FALSE)) { |
| 323 |
$o->url = "node/"; |
$o->url = "node/"; |
| 324 |
} |
} |
| 325 |
$playerurl = base_path() . drupal_get_path('module', 'drigg_embed') .'/players/1pixelout.swf'; |
$playerurl = base_path() . drupal_get_path('module', 'drigg_embed') .'/players/1pixelout.swf'; |
| 326 |
$flashvars = "playerID=1&soundFile=". $url; |
$flashvars = "playerID=1&soundFile=". $url; |
| 327 |
return '<div><object type="application/x-shockwave-flash" data="'. $playerurl .'" width="290" height="24" ><param name="movie" value="'. $playerurl .'" /><param name="wmode" value="transparent" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="FlashVars" value="'. $flashvars .'" /><embed src="'. $playerurl .'" flashvars="'. $flashvars .'" width="290" height="24" /></object></div>'; |
return '<div><object type="application/x-shockwave-flash" data="'. $playerurl .'" width="290" height="24" ><param name="movie" value="'. $playerurl .'" /><param name="wmode" value="transparent" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="FlashVars" value="'. $flashvars .'" /><embed src="'. $playerurl .'" flashvars="'. $flashvars .'" width="290" height="24" /></object></div>'; |
| 328 |
} |
} |
| 329 |
} |
} |
| 330 |
|
|
| 331 |
} |
} |
| 332 |
|
|
| 333 |
return ''; |
return ''; |
| 334 |
|
|
| 335 |
} |
} |