$strong_link = $s == $thumb_size ? '<strong>%s</strong>' : '%s'; printf($strong_link, '<a href="' . html::escapeURL($page_url) . '&id=' . $id . '&size=' . $s . '">' . $core->media->thumb_sizes[$s][2] . '</a> | '); } echo '<a href="' . html::escapeURL($page_url) . '&id=' . $id . '&size=o">' . __('original') . '</a>'; echo '</p>'; if (isset($file->media_thumb[$thumb_size])) { echo '<p><img src="' . $file->media_thumb[$thumb_size] . '" alt="" /></p>'; } elseif ($thumb_size == 'o') { $S = getimagesize($file->file); $class = $S[1] > 500 ? ' class="overheight"' : ''; unset($S); echo '<p id="media-original-image"' . $class . '><img src="' . $file->file_url . '" alt="" /></p>'; } } if ($file->type == 'audio/mpeg3') { echo dcMedia::mp3player($file->file_url, 'index.php?pf=player_mp3.swf'); } if ($file->type == 'video/x-flv' || $file->type == 'video/mp4' || $file->type == 'video/x-m4v') { echo dcMedia::flvplayer($file->file_url, 'index.php?pf=player_flv.swf'); } echo '<h3>' . __('Media details') . '</h3>' . '<ul>' . '<li><strong>' . __('File owner:') . '</strong> ' . $file->media_user . '</li>' . '<li><strong>' . __('File type:') . '</strong> ' . $file->type . '</li>' . '<li><strong>' . __('File size:') . '</strong> ' . files::size($file->size) . '</li>' . '<li><strong>' . __('File URL:') . '</strong> <a href="' . $file->file_url . '">' . $file->file_url . '</a></li>' . '</ul>'; if (empty($_GET['find_posts'])) { echo '<p><strong><a href="' . html::escapeHTML($page_url) . '&id=' . $id . '&find_posts=1">' . __('Show entries containing this media') . '</a></strong></p>'; } else { echo '<h3>' . __('Entries containing this media') . '</h3>'; $params = array('post_type' => '', 'from' => 'LEFT OUTER JOIN ' . $core->prefix . 'post_media PM ON P.post_id = PM.post_id ', 'sql' => 'AND (' . 'PM.media_id = ' . (int) $id . ' ' . "OR post_content_xhtml LIKE '%" . $core->con->escape($file->relname) . "%' " . "OR post_excerpt_xhtml LIKE '%" . $core->con->escape($file->relname) . "%' "); if ($file->media_image) { # We look for thumbnails too $media_root = $core->blog->host . path::clean($core->blog->settings->public_url) . '/'; foreach ($file->media_thumb as $v) { $v = preg_replace('/^' . preg_quote($media_root, '/') . '/', '', $v);
$http = netHttp::initClient('http://api.jamendo.com/get2/' . $req . '/' . $type . '/plain/?streamencoding=mp31&id=' . $id, $media_path); $http->setTimeout(5); $http->setUserAgent($_SERVER['HTTP_USER_AGENT']); $http->get($media_path); if ($http->getStatus() != 200) { throw new Exception(__('Invalid page URL')); } if ($type != 'track') { $m_title = $http->getContent(); $m_object = '<object width="200" height="300" type="application/x-shockwave-flash"' . "\n" . 'data="http://widgets.jamendo.com/fr/' . $type . '/?playertype=2008&' . $type . '_id=' . $id . '">' . "\n" . '</object>'; $m_url = $media_page; } else { $t = explode("\t", $http->getContent()); $m_title = $t[0]; $url = $t[1]; $m_object = dcMedia::mp3player($url, $core->blog->getQmarkURL() . 'pf=player_mp3.swf'); $m_url = $media_page; } } break; case 'deezer': if (preg_match('#/track/(.+?)(&|$)#', $media_path, $m)) { $idSong = $m[1]; if (preg_match('#<title>(.+?) \\| Deezer</title>#si', $content, $M)) { $m_title = $M[1]; } $m_object = '<object width="220" height="55" type="application/x-shockwave-flash"' . "\n" . ' data="http://www.deezer.com/embedded/small-widget-v2.swf?idSong=' . $idSong . '&colorBackground=0x555552&textColor1=0xFFFFFF&colorVolume=0x39D1FD&autoplay=0">' . "\n" . '</object>'; } break; } } catch (Exception $e) {
function mediaItemLine($f, $i) { global $core, $page_url, $popup, $post_id; $fname = $f->basename; if ($f->d) { $link = html::escapeURL($page_url) . '&d=' . html::sanitizeURL($f->relname); if ($f->parent) { $fname = '..'; } } else { $link = 'media_item.php?id=' . $f->media_id . '&popup=' . $popup . '&post_id=' . $post_id; } $class = 'media-item media-col-' . $i % 2; $res = '<div class="' . $class . '"><a class="media-icon media-link" href="' . $link . '">' . '<img src="' . $f->media_icon . '" alt="" /></a>' . '<ul>' . '<li><a class="media-link" href="' . $link . '">' . $fname . '</a></li>'; if (!$f->d) { $res .= '<li>' . $f->media_title . '</li>' . '<li>' . $f->media_dtstr . ' - ' . files::size($f->size) . ' - ' . '<a href="' . $f->file_url . '">' . __('open') . '</a>' . '</li>'; } $res .= '<li class="media-action"> '; if ($post_id && !$f->d) { $res .= '<form action="post_media.php" method="post">' . '<input type="image" src="images/plus.png" alt="' . __('Attach this file to entry') . '" ' . 'title="' . __('Attach this file to entry') . '" /> ' . form::hidden('media_id', $f->media_id) . form::hidden('post_id', $post_id) . form::hidden('attach', 1) . $core->formNonce() . '</form>'; } if ($popup && !$f->d) { $res .= '<a href="' . $link . '"><img src="images/plus.png" alt="' . __('Insert this file into entry') . '" ' . 'title="' . __('Insert this file into entry') . '" /></a> '; } if ($f->del) { $res .= '<a class="media-remove" ' . 'href="' . html::escapeURL($page_url) . '&d=' . rawurlencode($GLOBALS['d']) . '&remove=' . rawurlencode($f->basename) . '">' . '<img src="images/trash.png" alt="' . __('delete') . '" title="' . __('delete') . '" /></a>'; } $res .= '</li>'; if ($f->type == 'audio/mpeg3') { $res .= '<li>' . dcMedia::mp3player($f->file_url, 'index.php?pf=player_mp3.swf') . '</li>'; } $res .= '</ul></div>'; return $res; }