Changeset 201420
- Timestamp:
- 02/03/2010 03:06:42 PM (16 years ago)
- Location:
- fw-vimeo-videowall/trunk
- Files:
-
- 1 added
- 9 edited
-
fw-vimeo-videowall-ajax-handler.php (modified) (1 diff)
-
fw-vimeo-videowall-widget.class.php (modified) (1 diff)
-
fw-vimeo-videowall.class.php (modified) (11 diffs)
-
fw-vimeo-videowall.css (modified) (1 diff)
-
fw-vimeo-videowall.js (modified) (3 diffs)
-
fw-vimeo-videowall.php (modified) (2 diffs)
-
languages/fwvvw-fr_FR.mo (modified) (previous)
-
languages/fwvvw-fr_FR.po (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
-
screenshot-2.png (added)
Legend:
- Unmodified
- Added
- Removed
-
fw-vimeo-videowall/trunk/fw-vimeo-videowall-ajax-handler.php
r195350 r201420 11 11 echo '<img src="'.FWVVW_URL.'/images/cross.png" class="closewindow" alt="'.__("Close window","fwvvw").'" title="'.__("Close window","fwvvw").'" />'; 12 12 break; 13 case 'show_page' : 14 fw_vimeowall_display('paginate=0&id='.$_POST['id'].'&source='.$_POST['source'].'&type='.$_POST['type'].'&width='.$_POST['width'].'&height='.$_POST['height'].'&number='.$_POST['number'].'&page='.$_POST['page'], false); 15 break; 16 default: break; 13 17 } 14 18 ?> -
fw-vimeo-videowall/trunk/fw-vimeo-videowall-widget.class.php
r198637 r201420 3 3 * @package fw-vimeo-videowall 4 4 * @author fairweb 5 * @version 1.16 5 */ 7 6 8 /**9 * Description of fwvimeovideowallwidgetclass10 *11 * @author Fairweb12 */13 7 class FW_widget_vimeowall extends WP_Widget { 14 8 -
fw-vimeo-videowall/trunk/fw-vimeo-videowall.class.php
r198637 r201420 3 3 * @package fw-vimeo-videowall 4 4 * @author fairweb 5 * @version 1.16 5 */ 7 6 8 /**9 * Description of fwvimeovideowallclass10 *11 * @author Fairweb12 */13 7 class FW_vimeo_videowall { 14 8 public $id; … … 17 11 public $vcall; 18 12 public $api_endpoint; 13 public $info_endpoint; 19 14 public $vwidth; 20 15 public $vheight; 21 16 public $vnumber; 17 public $vperpage = 20; 22 18 public $vecho; 19 public $vpage = 1; 20 public $vpagination = true; 23 21 24 22 function FW_vimeo_videowall() { … … 32 30 global $fwvvw_user_name; 33 31 switch ($this->vsource) { 34 case 'user' : $this->api_endpoint = 'http://www.vimeo.com/api/v2/'.$this->id.'/videos.json'; break; 35 case 'group' : $this->api_endpoint = 'http://www.vimeo.com/api/v2/group/'.$this->id.'/videos.json'; break; 36 case 'album' : $this->api_endpoint = 'http://www.vimeo.com/api/v2/album/'.$this->id.'/videos.json'; break; 37 case 'channel' : $this->api_endpoint = 'http://www.vimeo.com/api/v2/channel/'.$this->id.'/videos.json'; break; 32 case 'user' : $this->api_endpoint = 'http://www.vimeo.com/api/v2/'.$this->id.'/videos.json?page='.$this->vpage; 33 $this->info_endpoint = 'http://vimeo.com/api/v2/'.$this->id.'/info.json'; break; 34 case 'group' : $this->api_endpoint = 'http://www.vimeo.com/api/v2/group/'.$this->id.'/videos.json?page='.$this->vpage; 35 $this->info_endpoint = 'http://vimeo.com/api/v2/group/'.$this->id.'/info.json'; break; 36 case 'album' : $this->api_endpoint = 'http://www.vimeo.com/api/v2/album/'.$this->id.'/videos.json?page='.$this->vpage; 37 $this->info_endpoint = 'http://vimeo.com/api/v2/album/'.$this->id.'/info.json'; break; 38 case 'channel' : $this->api_endpoint = 'http://www.vimeo.com/api/v2/channel/'.$this->id.'/videos.json?page='.$this->vpage; 39 $this->info_endpoint = 'http://vimeo.com/api/v2/channel/'.$this->id.'/info.json'; break; 38 40 case 'video' : $this->api_endpoint = 'http://www.vimeo.com/api/oembed.json'; break; 39 41 default : $this->api_endpoint = 'http://www.vimeo.com/api/v2/'.$this->id.'/videos.json'; break; … … 41 43 } 42 44 43 public function video_wall($args ) {45 public function video_wall($args, $wrapper) { 44 46 $this->id = $args['id']; 45 47 $this->vsource = $args['source']; … … 48 50 $this->vheight = $args['height']; 49 51 $this->vtype = $args['type']; 52 $this->vpage = $args['page']; 53 // $this->vperpage = $args['perpage']; 54 // $this->vpaginate = $args['paginate']; 55 56 $html = ''; 57 50 58 $this->choose_endpoint (); 59 if ($this->vnumber == 0) { 60 $this->vnumber = $this->get_total_videos(); 61 $this->vpagination == true; 62 } 63 // echo $this->vnumber; 64 /* $this->vperpage = $this->vperpage > $this->vnumber ? $this->vnumber : $this->vperpage; 65 $this->vperpage = $this->vperpage > 20 ? 20 : $this->vperpage;*/ 66 if ($this->vnumber > 20) { 67 $this->vpagination == true; 68 } 51 69 $video_details = $this->get_datas(); 52 70 53 if ($this->vtype == 'title' && $video_details) { 54 $html ='<ul class="fwvvw-'.$this->vsource.'">'; 55 } else { 56 $html='<div class="fwvvw-'.$this->vsource.'">'; 57 } 71 if ($wrapper == true) { 72 $html .='<div id="wall-fwvvw-'.$this->vsource.'-'.$this->id.'" class="fwvvw-'.$this->vsource.'">'; 73 } 74 if ($this->vtype == 'title' && $video_details) { 75 $html .='<ul id="walllist-fwvvw-'.$this->vsource.'-'.$this->id.'">'; 76 } 77 58 78 59 79 if (!$video_details) { … … 65 85 } 66 86 $html .= $this->get_html($video_details); 67 if ($this->vtype == 'title' && $video_details) { 87 if ($this->vtype == 'title' && $video_details) { 88 68 89 $html .='</ul>'; 69 } else { 70 $html .='<div class="fwclear"></div></div>'; 90 91 92 } 93 94 $html .= $this->paginate(); 95 if ($wrapper == true) { 96 97 $html .='<div class="fwclear"></div>'; 98 $html.= '</div>'; 99 71 100 } 101 102 103 72 104 if ($args['echo'] == false) { 73 105 return $html; … … 111 143 } 112 144 } 145 113 146 return $full_html; 114 147 } … … 119 152 $oembed_req = wp_remote_retrieve_body( wp_remote_get($oembed_url)); 120 153 $oembed = json_decode($oembed_req); 121 $html_code = '<div id=" '.$video->id.'" class="fwvvw_vthumb">';154 $html_code = '<div id="video_'.$video->id.'" class="fwvvw_vthumb">'; 122 155 $html_code .= html_entity_decode($oembed->html); 123 156 $html_code .= '</div>'; … … 126 159 127 160 public function get_image_html ($video) { 128 $html_code = '<div id=" '.$video->id.'" class="fwvvw_vthumb">';161 $html_code = '<div id="video_'.$video->id.'" class="fwvvw_vthumb">'; 129 162 $html_code .= '<img src="'.$video->thumbnail_small.'" alt="'.$video->title.'" title="'.$video->title.'" width="'.$this->vwidth.'" />'; 130 163 $html_code .= '</div>'; … … 133 166 134 167 public function get_title_html ($video) { 135 $html_code = '<li id=" '.$video->id.'" class="fwvvw_vthumb">';168 $html_code = '<li id="video_'.$video->id.'" class="fwvvw_vthumb">'; 136 169 $html_code .= '<a href="#" title="'.$video->title.'">'.$video->title.'</a>'; 137 170 $html_code .= '</li>'; … … 139 172 } 140 173 174 public function get_total_videos () { 175 $info_req = wp_remote_retrieve_body( wp_remote_get($this->info_endpoint)); 176 $infos = json_decode($info_req ); 177 178 if (!$infos) { return false; } 179 if ($this->vsource == 'user') { 180 $total_videos = $infos->total_videos_uploaded; 181 } else { 182 $total_videos = $infos->total_videos; 183 } 184 return $total_videos; 185 } 186 187 public function paginate() { 188 $html = ''; 189 if ($this->vpagination == false ) { return; } 190 191 if ($this->vnumber > 20) { 192 $nb_pages = ceil($this->vnumber / 20); 193 //echo $nb_pages; 194 if ($nb_pages > 1) { 195 $html .= '<div id="fwvvw-paginate-'.$this->vsource.'-'.$this->id.'" class="fwvvw-pagination">'; 196 $pagelinkid = 'fwvvw_'.$this->vsource.'_'.$this->id.'_'.$this->vtype.'_'.$this->vwidth.'_'.$this->vheight.'_'.$this->vnumber; 197 for ($i = 1; $i <= $nb_pages; $i++) { 198 $selected = ''; 199 if ($this->vpage == $i) { 200 $selected = 'fwvvw_current_page'; 201 } 202 $html .= '<a id="'.$pagelinkid.'_'.$i.'" class="fwvvw_pagelink '.$selected.'" href="#wall-fwvvw-'.$this->vsource.'-'.$this->id.'">'.$i.'</a> '; 203 } 204 $html .= '</div>'; 205 206 } 207 } 208 return $html; 209 } 210 141 211 public function get_datas() { 142 212 //echo $this->api_endpoint; 143 213 $endpoint_req = wp_remote_retrieve_body( wp_remote_get($this->api_endpoint)); 144 214 $videos = json_decode($endpoint_req ); 145 215 //print_r($videos); 146 216 $video_details = array(); 147 $nb = count($videos); 148 $this->vnumber = $this->vnumber == 0 ? $nb : $this->vnumber; 149 for ($i=0; $i < $this->vnumber; $i++) { 217 218 //$nb = $this->vsource == 'video' ? 1 : $this->vperpage; 219 //$this->vnumber = $this->vnumber == 0 ? $nb : $this->vnumber; 220 if ($this->vnumber != false ) { 221 /* for ($i=0; $i < $this->vperpage; $i++) { 150 222 if ($i == $nb) { break; } 151 223 $videos_details [] = $videos[$i]; 224 }*/ 225 $i=0; 226 do { 227 $videos_details [] = $videos[$i]; 228 $i++; 229 } 230 while (isset($videos[$i])); 152 231 } 153 232 return $videos_details; -
fw-vimeo-videowall/trunk/fw-vimeo-videowall.css
r198637 r201420 61 61 cursor:pointer; 62 62 } 63 64 /* added in v 1.2 */ 65 .fwvvw-pagination { 66 clear:both; 67 } 68 69 .fwvvw-pagination a.fwvvw_current_page { 70 border:#ebebeb 1px solid; 71 font-weight:bold; 72 } -
fw-vimeo-videowall/trunk/fw-vimeo-videowall.js
r198637 r201420 1 1 jQuery(document).ready( function() { 2 2 jQuery(".fwvvw_vthumb").livequery('click', 3 function() { 3 function() { 4 4 5 var idreq = jQuery(this).attr('id'); 6 var expl_idreq = idreq.split('_'); 7 var idvideo = expl_idreq[1]; 5 8 jQuery("#fwvvw_full_video").remove(); 6 9 jQuery("#fwvvw_bg_video").remove(); … … 21 24 22 25 action: 'show_video', 23 'id': id req26 'id': idvideo 24 27 25 28 }, … … 38 41 39 42 43 jQuery(".fwvvw_pagelink").livequery('click', 44 function() { 40 45 46 var idreq = jQuery(this).attr('id'); 47 var expl_idreq = idreq.split('_'); 48 var source = expl_idreq[1]; 49 var idsrc = expl_idreq[2]; 50 var typesrc = expl_idreq[3]; 51 var w = expl_idreq[4]; 52 var h = expl_idreq[5]; 53 var number = expl_idreq[6]; 54 55 var page = expl_idreq[7]; 56 57 58 59 var responsediv = '#wall-fwvvw-'+source+'-'+idsrc; 60 61 jQuery.post( fwvvw_ajax_handler, { 62 63 action: 'show_page', 64 'id': idsrc, 65 'source' : source, 66 'type' : typesrc, 67 'width' : w, 68 'height' : h, 69 'number' : number, 70 71 'page' : page 72 73 }, 74 75 function(response) { 76 jQuery(responsediv).html(response); 77 }); 78 }); 41 79 42 80 } -
fw-vimeo-videowall/trunk/fw-vimeo-videowall.php
r198637 r201420 2 2 * @package fw-vimeo-videowall 3 3 * @author fairweb 4 * @version 1.15 4 */ 6 5 /* 7 6 Plugin Name: fw-vimeo-videowall 8 7 Plugin URI: http://www.fairweb.fr/en/my-wordpress-plugins/fw-vimeo-videowall/ 9 Description: Displays a user, group, album or channel vimeo videowall with thumbnails or small videos in sidebar or content .8 Description: Displays a user, group, album or channel vimeo videowall with thumbnails or small videos in sidebar or content with pagination if needed. 10 9 Author: fairweb 11 Version: 1. 110 Version: 1.2 12 11 Author URI: http://www.fairweb.fr/ 13 12 */ … … 38 37 } 39 38 40 function fw_vimeowall_display($args='' ) {39 function fw_vimeowall_display($args='', $wrapper = true) { 41 40 $defaults = array('id' => 'petole', 42 41 'number' => 4, 'width' => 100, 43 42 'height' => 100, 'type' => 'image', 44 'source' => 'user', ' echo' => true43 'source' => 'user', 'paginate' => true, 'page' => 1, 'echo' => true 45 44 ); 46 45 47 46 $args = wp_parse_args( $args, $defaults ); 47 $paginate = ''; 48 48 $wall = new FW_vimeo_videowall(); 49 $thewall = $wall->video_wall($args); 49 $thewall = $wall->video_wall($args, $wrapper); 50 50 51 if ($args['echo'] == false ) { 51 52 return $thewall; 52 } 53 } 53 54 } 54 55 -
fw-vimeo-videowall/trunk/languages/fwvvw-fr_FR.po
r198637 r201420 3 3 "Project-Id-Version: fwvvw\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 "POT-Creation-Date: 2010-0 1-27 06:46+0100\n"5 "POT-Creation-Date: 2010-02-03 15:58+0100\n" 6 6 "PO-Revision-Date: \n" 7 7 "Last-Translator: Myriam Faulkner <[email protected]>\n" … … 20 20 msgstr "Fermer la fenêtre" 21 21 22 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:1 822 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:12 23 23 msgid "Adds a Vimeo Videowall in your sidebar. The videowall may contain a user's, a group's, an album's or channel's Vimeo videos" 24 24 msgstr "Ajoute un mur de vidéos Vimeo dans votre sidebar. Le mur de vidéos peut contenir des vidéos d'un utilisateur, d'un groupe, d'un album ou d'un canal." 25 25 26 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php: 2426 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:18 27 27 msgid "Vimeo Videowall" 28 28 msgstr "Videowall Vimeo" 29 29 30 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:7 930 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:73 31 31 msgid "Videos" 32 32 msgstr "Vidéos" 33 33 34 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php: 8334 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:77 35 35 msgid "Title" 36 36 msgstr "Titre" 37 37 38 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:8 838 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:82 39 39 msgid "Vimeo source type" 40 40 msgstr "Type de source Vimeo" 41 41 42 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php: 9042 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:84 43 43 msgid "Vimeo User" 44 44 msgstr "Utilisateur Vimeo" 45 45 46 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php: 9146 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:85 47 47 msgid "Vimeo Group" 48 48 msgstr "Groupe Vimeo" 49 49 50 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php: 9250 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:86 51 51 msgid "Vimeo Album" 52 52 msgstr "Album Vimeo" 53 53 54 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php: 9354 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:87 55 55 msgid "Vimeo Channel" 56 56 msgstr "Canal Vimeo" 57 57 58 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:9 858 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:92 59 59 msgid "Vimeo ID" 60 60 msgstr "ID Vimeo" 61 61 62 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:9 862 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:92 63 63 msgid "user, group, album or channel ID" 64 64 msgstr "ID de l'utilisateur, du groupe, de l'album ou du canal" 65 65 66 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php: 10366 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:97 67 67 msgid "Display" 68 68 msgstr "Afficher" 69 69 70 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php: 10570 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:99 71 71 msgid "clickable video thumbnails" 72 72 msgstr "des miniatures cliquables" 73 73 74 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:10 674 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:100 75 75 msgid "playable videos" 76 76 msgstr "des vidéos jouables" 77 77 78 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:10 778 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:101 79 79 msgid "list of video titles" 80 80 msgstr "Liste de titres" 81 81 82 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:1 1282 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:106 83 83 msgid "Number of videos" 84 84 msgstr "Nombre de vidéos" 85 85 86 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:11 786 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:111 87 87 msgid "Max video width" 88 88 msgstr "Largeur max de la vidéo" 89 89 90 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:1 2290 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall-widget.class.php:116 91 91 msgid "Max video height" 92 92 msgstr "Hauteur max de la vidéo" 93 93 94 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall.class.php: 6194 #: wp-content\plugins\fw-vimeo-videowall/fw-vimeo-videowall.class.php:81 95 95 msgid "No video" 96 96 msgstr "Aucune vidéo" -
fw-vimeo-videowall/trunk/readme.txt
r198637 r201420 54 54 == Screenshots == 55 55 1. Here are the different ways to use the plugin. 56 2. If number of views is greater than 20, the plugin uses pagination 56 57 57 58 == Changelog == 59 = 1.2 = 60 * Corrected W3C issues with id attributes 61 * Added pagination feature when number of videos is greater than 20. This is limited by the Vimeo API (Issue reported by weremoose). 58 62 = 1.1 = 59 63 * Added an option to display a list of clickable titles instead of thumbnails or videos (as requested by Tim Johnson)
Note: See TracChangeset
for help on using the changeset viewer.