source: extensions/lightbox/get_content.php @ 20461

Last change on this file since 20461 was 20207, checked in by mistic100, 11 years ago

replace mysql functions by pwg_db

File size: 873 bytes
Line 
1<?php
2// Embedded Videos
3
4define('PHPWG_ROOT_PATH','../../');
5include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
6include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php');
7
8check_status(ACCESS_GUEST);
9
10if (!isset($_GET['imgid']) or !is_numeric($_GET['imgid']))
11{
12  exit;
13}
14
15if (empty($pwg_loaded_plugins['gvideo']) or !function_exists('gvideo_element_content'))
16{
17  exit;
18}
19
20$image_id = pwg_db_real_escape_string($_GET['imgid']);
21
22$query = '
23SELECT *
24  FROM '.IMAGES_TABLE.'
25    INNER JOIN '.IMAGE_CATEGORY_TABLE.'
26    ON id=image_id
27  WHERE id='.$image_id
28        . get_sql_condition_FandF(
29            array('forbidden_categories' => 'category_id'),
30            " AND"
31          ).'
32  LIMIT 1';
33
34$picture = mysql_fetch_assoc( pwg_query($query) );
35
36if (empty($picture) or !$picture['is_gvideo'])
37{
38  exit;
39}
40
41echo gvideo_element_content(null, $picture);
42
43?>
Note: See TracBrowser for help on using the repository browser.