source: extensions/lightbox/get_content.php @ 3417

Revision 3298, 1.0 KB checked in by patdenice, 11 years ago (diff)

New extension added:
Lightbox (2.0.c)

Line 
1<?php
2
3define('PHPWG_ROOT_PATH','../../');
4include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
5include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php');
6
7check_status(ACCESS_GUEST);
8
9if (!isset($_GET['imgid']) or !is_numeric($_GET['imgid']))
10{
11  die;
12}
13
14$image_id = mysql_real_escape_string($_GET['imgid']);
15
16$query = '
17SELECT *
18  FROM '.IMAGES_TABLE.' INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON id=image_id
19  WHERE id='.$image_id
20        . get_sql_condition_FandF(
21            array('forbidden_categories' => 'category_id'),
22            " AND"
23          ).'
24  LIMIT 1';
25
26$picture['current'] = mysql_fetch_assoc( pwg_query($query) );
27
28if (empty($picture['current']))
29{
30  die;
31}
32
33// PY Gvideo
34if (!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}
41
42?>
Note: See TracBrowser for help on using the repository browser.