Ignore:
Timestamp:
Oct 19, 2010, 11:57:57 PM (14 years ago)
Author:
plg
Message:

feature 1941: make PY Gvideo plugin compatible with virtual categories (and remote sites as well)

File:
1 edited

Legend:

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

    r3609 r7284  
    112112{
    113113  $video['thumb_url'] = str_replace('&', '&', $video['thumb_url']);
    114   if (($path = mkget_thumbnail_dir($catpath[$cat], $error)) == false)
     114  if (($thumb_dir = mkget_thumbnail_dir(dirname($file_path), $error)) == false)
    115115  {
    116116    array_push($page['errors'], l10n('py_error9'));
     
    118118  else
    119119  {
    120     $path .= '/' . $conf['prefix_thumbnail'] . $video['name'] . '.jpg';
    121     if (file_exists($path))
     120    $thumb_path = file_path_for_type($file_path, 'thumb');
     121    if (file_exists($thumb_path))
    122122    {
    123123      array_push($page['errors'], sprintf(l10n('py_error11'), $path), l10n('py_error9'));
     
    125125    else
    126126    {
    127       if (Py_RatioResizeImg($video['thumb_url'], $path, $_POST['thumb_width'], $_POST['thumb_hight']))
     127      if (Py_RatioResizeImg($video['thumb_url'], $thumb_path, $_POST['thumb_width'], $_POST['thumb_hight']))
    128128      {
    129129        array_push($page['infos'], l10n('py_info2'));
    130         $thumb_extension = '"jpg"';
     130        $thumb_extension = 'jpg';
    131131      }
    132132      else
     
    148148  {
    149149    $ext = get_extension($_FILES['picture']['name']);
    150     if (($path = mkget_thumbnail_dir($catpath[$cat], $error)) == false)
     150    if (($thumb_dir = mkget_thumbnail_dir(dirname($file_path), $error)) == false)
    151151    {
    152152      array_push($page['errors'], l10n('py_error9'));
     
    154154    else
    155155    {
    156       $path .= '/' . $conf['prefix_thumbnail'] . $video['name'] . '.' . $ext;
    157       if (file_exists($path))
     156      $thumb_path = get_filename_wo_extension(file_path_for_type($file_path, 'thumb')).'.'.$ext;
     157      if (file_exists($thumb_path))
    158158      {
    159         array_push($page['errors'], sprintf(l10n('py_error11'), $path), l10n('py_error9'));
     159        array_push($page['errors'], sprintf(l10n('py_error11'), $thumb_path), l10n('py_error9'));
    160160      }
    161161      else
    162162      {
    163         if (Py_RatioResizeImg($_FILES['picture']['tmp_name'], $path, $_POST['thumb_width'], $_POST['thumb_hight']))
     163        if (Py_RatioResizeImg($_FILES['picture']['tmp_name'], $thumb_path, $_POST['thumb_width'], $_POST['thumb_hight']))
    164164        {
    165           $thumb_extension = "\"$ext\"";
     165          $thumb_extension = $ext;
    166166          array_push($page['infos'], l10n('py_info2'));
    167167        }
Note: See TracChangeset for help on using the changeset viewer.