source: extensions/lightbox/get_content.php @ 4914

Last change on this file since 4914 was 3609, checked in by patdenice, 15 years ago

Convert all php and tpl files in Unix format for my plugins.

File size: 998 bytes
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.