Changeset 17687 for extensions/gvideo/admin
- Timestamp:
- Sep 2, 2012, 6:06:10 PM (12 years ago)
- Location:
- extensions/gvideo/admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/gvideo/admin/photo.php
r17626 r17687 24 24 if(!defined("PHPWG_ROOT_PATH")) die ("Hacking attempt!"); 25 25 26 include_once(GVIDEO_PATH.'include/functions.inc.php'); 27 26 28 27 29 // +-----------------------------------------------------------------------+ … … 75 77 if (count($page['errors']) == 0) 76 78 { 77 include_once(GVIDEO_PATH.'include/functions.inc.php');78 79 include_once(PHPWG_ROOT_PATH . 'admin/include/functions_upload.inc.php'); 79 80 80 // download thumbnail 81 $thumb_name = $video['type'].'-'.$video['id'].'-'.uniqid().'.'.get_extension($video['thumbnail']); 82 $thumb_source = $conf['data_location'].$thumb_name; 83 if (download_remote_file($video['thumbnail'], $thumb_source) !== true) 84 { 85 $thumb_source = $conf['data_location'].get_filename_wo_extension($thumb_name).'.jpg'; 86 copy(GVIDEO_PATH.'mimetypes/'.$video['type'].'.jpg', $thumb_source); 87 } 88 89 // add image and update infos 90 $image_id = add_uploaded_file($thumb_source, $thumb_name, null, null, $_GET['image_id']); 91 92 $updates = array( 93 'name' => pwg_db_real_escape_string($video['title']), 94 'comment' => pwg_db_real_escape_string($video['description']), 95 'author' => pwg_db_real_escape_string($video['author']), 96 'is_gvideo' => 1, 97 ); 98 99 single_update( 100 IMAGES_TABLE, 101 $updates, 102 array('id' => $_GET['image_id']), 103 true 104 ); 81 if ( $gvideo['url'] != $video['url'] ) 82 { 83 // download thumbnail 84 $thumb_name = $video['type'].'-'.$video['id'].'-'.uniqid().'.'.get_extension($video['thumbnail']); 85 $thumb_source = $conf['data_location'].$thumb_name; 86 if (download_remote_file($video['thumbnail'], $thumb_source) !== true) 87 { 88 $thumb_source = $conf['data_location'].get_filename_wo_extension($thumb_name).'.jpg'; 89 copy(GVIDEO_PATH.'mimetypes/'.$video['type'].'.jpg', $thumb_source); 90 } 91 92 // add image and update infos 93 $image_id = add_uploaded_file($thumb_source, $thumb_name, null, null, $_GET['image_id']); 94 95 $updates = array( 96 'name' => pwg_db_real_escape_string($video['title']), 97 'comment' => pwg_db_real_escape_string($video['description']), 98 'author' => pwg_db_real_escape_string($video['author']), 99 'is_gvideo' => 1, 100 ); 101 102 single_update( 103 IMAGES_TABLE, 104 $updates, 105 array('id' => $_GET['image_id']), 106 true 107 ); 108 } 105 109 106 110 // register video 107 111 if ($_POST['size_common'] == 'true') 108 112 { 113 $_POST['width'] = $_POST['height'] = ''; 114 } 115 else if ( !preg_match('#^([0-9]+)$#', $_POST['width']) or !preg_match('#^([0-9]+)$#', $_POST['height']) ) 116 { 117 array_push($page['errors'], l10n('Width and height must be integers')); 109 118 $_POST['width'] = $_POST['height'] = ''; 110 119 } … … 131 140 132 141 array_push($page['infos'], l10n('Video successfully updated')); 133 unset($_POST);142 $gvideo = array_merge($gvideo, $updates); 134 143 } 135 144 } -
extensions/gvideo/admin/template/photo.tpl
r17626 r17687 68 68 <label><input type="radio" name="size_common" value="false" {if $GVIDEO.size_common != 'true'}checked="checked"{/if} data-toggle="size"> {'Change'|@translate}</label> 69 69 70 <span {if $GVIDEO.size_common == 'true'}style="display:none;"{/if}id="size">70 <span style="display:{if $GVIDEO.size_common == 'true'}none{else}block{/if};" id="size"> 71 71 <input type="text" name="width" value="{$GVIDEO.width}" size="4"> × 72 72 <input type="text" name="height" value="{$GVIDEO.height}" size="4"> px … … 79 79 <label><input type="radio" name="autoplay_common" value="false" {if $GVIDEO.autoplay_common != 'true'}checked="checked"{/if} data-toggle="autoplay"> {'Change'|@translate}</label> 80 80 81 <span {if $GVIDEO.autoplay_common == 'true'}style="display:none;"{/if}id="autoplay">81 <span style="display:{if $GVIDEO.autoplay_common == 'true'}none{else}block{/if};" id="autoplay"> 82 82 <label><input type="radio" name="autoplay" value="0" {if $GVIDEO.autoplay == '0'}checked="checked"{/if}> {'No'|@translate}</label> 83 83 <label><input type="radio" name="autoplay" value="1" {if $GVIDEO.autoplay == '1'}checked="checked"{/if}> {'Yes'|@translate}</label>
Note: See TracChangeset
for help on using the changeset viewer.