Changeset 17487


Ignore:
Timestamp:
Aug 9, 2012, 2:12:07 PM (12 years ago)
Author:
mistic100
Message:

compatibility with Embedded Videos

Location:
extensions/lightbox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/lightbox/functions.inc.php

    r17139 r17487  
    44function get_lightbox_url($picture)
    55{
    6   global $conf, $py_addext;
    7 
     6  global $conf, $pwg_loaded_plugins;
     7 
    88  $ext = get_extension($picture['file']);
    9   if (in_array($ext, $conf['picture_ext']))
     9  if (!empty($pwg_loaded_plugins['gvideo']) and $picture['is_gvideo'])
     10  {
     11    return get_root_url().'plugins/lightbox/get_content.php?imgid='.$picture['id'];
     12  }
     13  else if (in_array($ext, $conf['picture_ext']))
    1014  {
    1115    return DerivativeImage::url(IMG_LARGE, new SrcImage($picture));
    1216  }
    13   elseif (isset($py_addext) and in_array($ext, $py_addext))
    14   {
    15     return get_root_url().'plugins/lightbox/get_content.php?imgid='.$picture['id'];
    16   }
     17 
    1718  return false;
    1819}
  • extensions/lightbox/get_content.php

    r3609 r17487  
    11<?php
     2// Embedded Videos
    23
    34define('PHPWG_ROOT_PATH','../../');
     
    910if (!isset($_GET['imgid']) or !is_numeric($_GET['imgid']))
    1011{
    11   die;
     12  exit;
     13}
     14
     15if (empty($pwg_loaded_plugins['gvideo']) or !function_exists('gvideo_element_content'))
     16{
     17  exit;
    1218}
    1319
     
    1622$query = '
    1723SELECT *
    18   FROM '.IMAGES_TABLE.' INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON id=image_id
     24  FROM '.IMAGES_TABLE.'
     25    INNER JOIN '.IMAGE_CATEGORY_TABLE.'
     26    ON id=image_id
    1927  WHERE id='.$image_id
    2028        . get_sql_condition_FandF(
     
    2432  LIMIT 1';
    2533
    26 $picture['current'] = mysql_fetch_assoc( pwg_query($query) );
     34$picture = mysql_fetch_assoc( pwg_query($query) );
    2735
    28 if (empty($picture['current']))
     36if (empty($picture) or !$picture['is_gvideo'])
    2937{
    30   die;
     38  exit;
    3139}
    3240
    33 // PY Gvideo
    34 if (!empty($py_addext) and in_array(get_extension($picture['current']['path']), $py_addext))
    35 {
    36   $extension = strtolower(get_extension($picture['current']['path']));
    37   $picture['current']['path'] = get_element_url($picture['current']);
    38   include(GVIDEO_PATH.'gvideo.php');
    39   echo $content; 
    40 }
     41echo gvideo_element_content(null, $picture);
    4142
    4243?>
Note: See TracChangeset for help on using the changeset viewer.