source: extensions/PWG_Stuffs/trunk/modules/FeaturedPhotos/main.inc.php @ 12450

Last change on this file since 12450 was 12450, checked in by patdenice, 12 years ago

Use category_default.inc.php to generate template output for thumbnalis blocks.

File size: 1.2 KB
Line 
1<?php
2
3if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
4
5global $page, $user, $conf, $template;
6
7$page_save = $page;
8$tpl_save = $template->get_template_vars('THUMBNAILS');
9
10$forbidden = get_sql_condition_FandF
11  (
12    array
13      (
14        'forbidden_categories' => 'ic.category_id',
15        'visible_categories' => 'ic.category_id',
16        'visible_images' => 'i.id'
17      ),
18    'AND'
19  );
20 
21$query ='
22SELECT DISTINCT(i.id)
23  FROM '.IMAGES_TABLE.' AS i
24    INNER JOIN '.FAVORITES_TABLE.' AS f       ON f.image_id = i.id
25    INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON i.id = ic.image_id
26    INNER JOIN '.CATEGORIES_TABLE.' AS c      ON ic.category_id = c.id
27      WHERE f.user_id = '.$conf['webmaster_id'].'
28       '.$forbidden.';';
29
30$page['items'] = array_from_query($query, 'id');
31$page['start'] = 0;
32$page['nb_image_page'] = $datas['nb_images'];
33$page['section'] = 'category';
34
35include(PHPWG_ROOT_PATH.'include/category_default.inc.php');
36
37if (!empty($tpl_thumbnails_var))
38{
39  $block['thumbnails'] = $tpl_thumbnails_var;
40  $block['TEMPLATE'] = 'stuffs_thumbnails.tpl';
41}
42
43$page = $page_save;
44$template->assign('THUMBNAILS', $tpl_save);
45
46?>
Note: See TracBrowser for help on using the repository browser.