Changeset 19056 for extensions/gvideo/admin
- Timestamp:
- Nov 17, 2012, 5:05:32 PM (11 years ago)
- Location:
- extensions/gvideo/admin
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/gvideo/admin/add.php
r17488 r19056 20 20 { 21 21 // download thumbnail 22 $thumb_name = $video['type'].'-'.$video[' id'].'-'.uniqid().'.'.get_extension($video['thumbnail']);22 $thumb_name = $video['type'].'-'.$video['video_id'].'-'.uniqid().'.'.get_extension($video['thumbnail']); 23 23 $thumb_source = $conf['data_location'].$thumb_name; 24 24 if (download_remote_file($video['thumbnail'], $thumb_source) !== true) … … 38 38 $updates = array( 39 39 'name' => pwg_db_real_escape_string($video['title']), 40 'comment' => pwg_db_real_escape_string($video['description']),41 40 'author' => pwg_db_real_escape_string($video['author']), 42 41 'is_gvideo' => 1, 43 42 ); 43 44 if ( $_POST['sync_description'] and !empty($video['description']) ) 45 { 46 $updates['comment'] = pwg_db_real_escape_string($video['description']); 47 } 48 if ( $_POST['sync_tags'] and !empty($video['tags']) ) 49 { 50 set_tags(get_tag_ids(implode(',', $video['tags'])), $image_id); 51 } 44 52 45 53 single_update( … … 55 63 $_POST['width'] = $_POST['height'] = ''; 56 64 } 65 else if ( !preg_match('#^([0-9]+)$#', $_POST['width']) or !preg_match('#^([0-9]+)$#', $_POST['height']) ) 66 { 67 array_push($page['errors'], l10n('Width and height must be integers')); 68 $_POST['width'] = $_POST['height'] = ''; 69 } 57 70 if ($_POST['autoplay_common'] == 'true') 58 71 { … … 64 77 'url' => $video['url'], 65 78 'type' => $video['type'], 66 'video_id' => $video[' id'],79 'video_id' => $video['video_id'], 67 80 'width' => $_POST['width'], 68 81 'height' => $_POST['height'], -
extensions/gvideo/admin/config.php
r17307 r19056 5 5 { 6 6 $conf['gvideo'] = array( 7 'autoplay' => $_POST['autoplay'], 8 'width' => $_POST['width'], 9 'height' => $_POST['height'], 7 'autoplay' => (int)$_POST['autoplay'], 8 'width' => (int)$_POST['width'], 9 'height' => (int)$_POST['height'], 10 'sync_description' => (int)$_POST['sync_description'], 11 'sync_tags' => (int)$_POST['sync_tags'], 10 12 'vimeo' => array( 11 13 'title' => (int)isset($_POST['vimeo']['title']), … … 24 26 'videobb' => array(), 25 27 ); 26 28 27 29 conf_update_param('gvideo', serialize($conf['gvideo'])); 28 30 array_push($page['infos'], l10n('Information data registered in database')); -
extensions/gvideo/admin/photo.php
r17687 r19056 70 70 array_push($page['errors'], l10n('Please fill the video URL')); 71 71 } 72 if ( !empty($_POST['url']) and ($video = parse_video_url($_POST['url'])) === false ) 73 { 74 array_push($page['errors'], l10n('Unable to contact host server')); 72 else if ($gvideo['url']!=$_POST['url']) 73 { 74 if( ($video = parse_video_url($_POST['url'])) === false ) 75 { 76 array_push($page['errors'], l10n('Unable to contact host server')); 77 } 78 } 79 else 80 { 81 $video = $gvideo; 75 82 } 76 83 … … 82 89 { 83 90 // download thumbnail 84 $thumb_name = $video['type'].'-'.$video[' id'].'-'.uniqid().'.'.get_extension($video['thumbnail']);91 $thumb_name = $video['type'].'-'.$video['video_id'].'-'.uniqid().'.'.get_extension($video['thumbnail']); 85 92 $thumb_source = $conf['data_location'].$thumb_name; 86 93 if (download_remote_file($video['thumbnail'], $thumb_source) !== true) … … 95 102 $updates = array( 96 103 'name' => pwg_db_real_escape_string($video['title']), 97 'comment' => pwg_db_real_escape_string($video['description']),98 104 'author' => pwg_db_real_escape_string($video['author']), 99 105 'is_gvideo' => 1, 100 106 ); 107 108 if ( $_POST['sync_description'] and !empty($video['description']) ) 109 { 110 $updates['comment'] = pwg_db_real_escape_string($video['description']); 111 } 112 else 113 { 114 $updates['comment'] = null; 115 } 116 if ( $_POST['sync_tags'] and !empty($video['tags']) ) 117 { 118 set_tags(get_tag_ids(implode(',', $video['tags'])), $image_id); 119 } 101 120 102 121 single_update( … … 126 145 'url' => $video['url'], 127 146 'type' => $video['type'], 128 'video_id' => $video[' id'],147 'video_id' => $video['video_id'], 129 148 'width' => $_POST['width'], 130 149 'height' => $_POST['height'], … … 199 218 $gvideo['autoplay_common'] = 'true'; 200 219 } 220 $gvideo['sync_description'] = $conf['gvideo']['sync_description']; 221 $gvideo['sync_tags'] = $conf['gvideo']['sync_tags']; 201 222 202 223 if (function_exists('imagecreatetruecolor')) -
extensions/gvideo/admin/template/add.tpl
r17626 r19056 74 74 <label><input type="radio" name="autoplay" value="1" {if $POST.autoplay == '1'}checked="checked"{/if}> {'Yes'|@translate}</label> 75 75 </li> 76 <li> 77 <span class="property">{'Get video description'|@translate}</span> 78 <label><input type="radio" name="sync_description" value="1" {if $gvideo.sync_description}checked="checked"{/if}> {'Yes'|@translate}</label> 79 <label><input type="radio" name="sync_description" value="0" {if not $gvideo.sync_description}checked="checked"{/if}> {'No'|@translate}</label> 80 </li> 81 <li> 82 <span class="property">{'Get video tags'|@translate}</span> 83 <label><input type="radio" name="sync_tags" value="1" {if $gvideo.sync_tags}checked="checked"{/if}> {'Yes'|@translate}</label> 84 <label><input type="radio" name="sync_tags" value="0" {if not $gvideo.sync_tags}checked="checked"{/if}> {'No'|@translate}</label> 85 </li> 76 86 </ul> 77 87 </fieldset> … … 104 114 <a href="http://www.wideo.fr" target="_blank">Wideo</a> 105 115 </li> 106 <li>107 <img class="icon" src="{$GVIDEO_PATH}admin/template/icons/videobb.png">108 <a href="http://www.videobb.com" target="_blank">videobb</a>109 </li>110 116 </ul> 111 117 </fieldset> -
extensions/gvideo/admin/template/config.tpl
r17307 r19056 18 18 <ul> 19 19 <li> 20 <label> 21 <span class="property">{'Video size'|@translate}</span> 22 <input type="text" name="width" value="{$gvideo.width}" size="4"> × 23 <input type="text" name="height" value="{$gvideo.height}" size="4"> px 24 </label> 20 <span class="property">{'Video size'|@translate}</span> 21 <input type="text" name="width" value="{$gvideo.width}" size="4"> × 22 <input type="text" name="height" value="{$gvideo.height}" size="4"> px 25 23 </li> 26 24 <li> 27 <label> 28 <span class="property">{'Autoplay'|@translate}</span> 29 <label><input type="radio" name="autoplay" value="0" {if not $gvideo.autoplay}checked="checked"{/if}> {'No'|@translate}</label> 30 <label><input type="radio" name="autoplay" value="1" {if $gvideo.autoplay}checked="checked"{/if}> {'Yes'|@translate}</label> 31 </label> 25 <span class="property">{'Autoplay'|@translate}</span> 26 <label><input type="radio" name="autoplay" value="1" {if $gvideo.autoplay}checked="checked"{/if}> {'Yes'|@translate}</label> 27 <label><input type="radio" name="autoplay" value="0" {if not $gvideo.autoplay}checked="checked"{/if}> {'No'|@translate}</label> 28 </li> 29 <li> 30 <span class="property">{'Get video description'|@translate}</span> 31 <label><input type="radio" name="sync_description" value="1" {if $gvideo.sync_description}checked="checked"{/if}> {'Yes'|@translate}</label> 32 <label><input type="radio" name="sync_description" value="0" {if not $gvideo.sync_description}checked="checked"{/if}> {'No'|@translate}</label> 33 </li> 34 <li> 35 <span class="property">{'Get video tags'|@translate}</span> 36 <label><input type="radio" name="sync_tags" value="1" {if $gvideo.sync_tags}checked="checked"{/if}> {'Yes'|@translate}</label> 37 <label><input type="radio" name="sync_tags" value="0" {if not $gvideo.sync_tags}checked="checked"{/if}> {'No'|@translate}</label> 32 38 </li> 33 39 </ul> … … 35 41 36 42 <div class="left"><fieldset> 37 <legend><img class="icon" src="{$GVIDEO_PATH}admin/template/icons/vimeo.png"> {'Vimeo '|@translate}</legend>43 <legend><img class="icon" src="{$GVIDEO_PATH}admin/template/icons/vimeo.png"> {'Vimeo player'|@translate}</legend> 38 44 39 45 <ul> … … 45 51 </li> 46 52 <li> 47 <label> 48 <span class="property">{'Display'|@translate}</span> 49 <label><input type="checkbox" name="vimeo[title]" value="1" {if $gvideo.vimeo.title}checked="checked"{/if}> {'Title'|@translate}</label> 50 <label><input type="checkbox" name="vimeo[portrait]" value="1" {if $gvideo.vimeo.portrait}checked="checked"{/if}> {'Author portrait'|@translate}</label> 51 <label><input type="checkbox" name="vimeo[byline]" value="1" {if $gvideo.vimeo.byline}checked="checked"{/if}> {'Author name'|@translate}</label> 52 </label> 53 <span class="property">{'Display'|@translate}</span> 54 <label><input type="checkbox" name="vimeo[title]" value="1" {if $gvideo.vimeo.title}checked="checked"{/if}> {'Title'|@translate}</label> 55 <label><input type="checkbox" name="vimeo[portrait]" value="1" {if $gvideo.vimeo.portrait}checked="checked"{/if}> {'Author portrait'|@translate}</label> 56 <label><input type="checkbox" name="vimeo[byline]" value="1" {if $gvideo.vimeo.byline}checked="checked"{/if}> {'Author name'|@translate}</label> 53 57 </li> 54 58 </ul> … … 56 60 57 61 <div class="right"><fieldset> 58 <legend><img class="icon" src="{$GVIDEO_PATH}admin/template/icons/dailymotion.png"> {'Dailymotion '|@translate}</legend>62 <legend><img class="icon" src="{$GVIDEO_PATH}admin/template/icons/dailymotion.png"> {'Dailymotion player'|@translate}</legend> 59 63 60 64 <ul> … … 66 70 </li> 67 71 <li> 68 <label> 69 <span class="property">{'Display'|@translate}</span> 70 <label><input type="checkbox" name="dailymotion[logo]" value="1" {if $gvideo.dailymotion.logo}checked="checked"{/if}> {'Logo'|@translate}</label> 71 <label><input type="checkbox" name="dailymotion[title]" value="1" {if $gvideo.dailymotion.title}checked="checked"{/if}> {'Title'|@translate}</label> 72 </label> 72 <span class="property">{'Display'|@translate}</span> 73 <label><input type="checkbox" name="dailymotion[logo]" value="1" {if $gvideo.dailymotion.logo}checked="checked"{/if}> {'Logo'|@translate}</label> 74 <label><input type="checkbox" name="dailymotion[title]" value="1" {if $gvideo.dailymotion.title}checked="checked"{/if}> {'Title'|@translate}</label> 73 75 </li> 74 76 </ul> -
extensions/gvideo/admin/template/photo.tpl
r17687 r19056 17 17 if ($(this).val() != "{$GVIDEO.url}") {ldelim} 18 18 $(this).css('border', '1px solid #c00'); 19 $(" #change_warning").show();19 $(".video_update").show(); 20 20 } else {ldelim} 21 21 $(this).css('border', border); 22 $(" #change_warning").hide();22 $(".video_update").hide(); 23 23 } 24 24 }); … … 60 60 <b>{'Video URL'|@translate}</b> 61 61 <input type="text" name="url" value="{$GVIDEO.url}" style="width:400px;"> 62 <span id="change_warning" style="display:none;">{'Changing the url will reset video description, name and thumbnail'|@translate}</span>62 <span class="video_update warning" style="display:none;"> {'Changing the url will reset video description, name and thumbnail'|@translate}</span> 63 63 </p> 64 64 65 <p class="video_update"> 66 <b>{'Get video description'|@translate}</b> 67 <label><input type="radio" name="sync_description" value="1" {if $GVIDEO.sync_description}checked="checked"{/if}> {'Yes'|@translate}</label> 68 <label><input type="radio" name="sync_description" value="0" {if not $GVIDEO.sync_description}checked="checked"{/if}> {'No'|@translate}</label> 69 </p> 70 71 <p class="video_update"> 72 <b>{'Get video tags'|@translate}</b> 73 <label><input type="radio" name="sync_tags" value="1" {if $GVIDEO.sync_tags}checked="checked"{/if}> {'Yes'|@translate}</label> 74 <label><input type="radio" name="sync_tags" value="0" {if not $GVIDEO.sync_tags}checked="checked"{/if}> {'No'|@translate}</label> 75 </p> 76 65 77 <p> 66 78 <b>{'Video size'|@translate}</b> -
extensions/gvideo/admin/template/style.css
r17626 r19056 9 9 10 10 FORM.properties SPAN.property { 11 width:1 50px;11 width:180px; 12 12 } 13 13 … … 58 58 } 59 59 60 #change_warning { 60 .video_update { 61 display:none; 62 } 63 .video_update.warning { 61 64 display:block; 62 65 color:#c00;
Note: See TracChangeset
for help on using the changeset viewer.