Ignore:
Timestamp:
Nov 17, 2012, 5:05:32 PM (11 years ago)
Author:
mistic100
Message:

allow to add private dailymotion videos, remove videobb support, add tags support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/gvideo/admin/photo.php

    r17687 r19056  
    7070    array_push($page['errors'], l10n('Please fill the video URL'));
    7171  }
    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;
    7582  }
    7683 
     
    8289    {
    8390      // 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']);
    8592      $thumb_source = $conf['data_location'].$thumb_name;
    8693      if (download_remote_file($video['thumbnail'], $thumb_source) !== true)
     
    95102      $updates = array(
    96103        'name' => pwg_db_real_escape_string($video['title']),
    97         'comment' => pwg_db_real_escape_string($video['description']),
    98104        'author' => pwg_db_real_escape_string($video['author']),
    99105        'is_gvideo' => 1,
    100106        );
     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      }
    101120     
    102121      single_update(
     
    126145      'url' => $video['url'],
    127146      'type' => $video['type'],
    128       'video_id' => $video['id'],
     147      'video_id' => $video['video_id'],
    129148      'width' => $_POST['width'],
    130149      'height' => $_POST['height'],
     
    199218  $gvideo['autoplay_common'] = 'true';
    200219}
     220$gvideo['sync_description'] = $conf['gvideo']['sync_description'];
     221$gvideo['sync_tags'] = $conf['gvideo']['sync_tags'];
    201222
    202223if (function_exists('imagecreatetruecolor'))
Note: See TracChangeset for help on using the changeset viewer.