[3609] | 1 | <?php |
---|
| 2 | |
---|
| 3 | load_language('plugin.lang', HASHIGH_PATH); |
---|
| 4 | |
---|
| 5 | global $template, $page, $conf, $prefixeTable; |
---|
| 6 | |
---|
| 7 | $forbidden = get_sql_condition_FandF ( |
---|
| 8 | array ('forbidden_categories' => 'ic.category_id', |
---|
| 9 | 'visible_categories' => 'ic.category_id', |
---|
| 10 | 'visible_images' => 'i.id'), 'WHERE', true); |
---|
| 11 | |
---|
| 12 | $page['section'] = 'has_high'; |
---|
| 13 | |
---|
| 14 | if (get_db_plugins('active','HDavecPrefixe')) |
---|
| 15 | { |
---|
| 16 | $query = 'SELECT DISTINCT (i.id) |
---|
| 17 | FROM ' . IMAGES_TABLE . ' AS i |
---|
| 18 | INNER JOIN ' . IMAGE_CATEGORY_TABLE . ' AS ic |
---|
| 19 | ON i.id = ic.image_id |
---|
| 20 | INNER JOIN '.$prefixeTable.'hdavecprefixe AS hd |
---|
| 21 | ON i.id = hd.id_image |
---|
| 22 | ' . $forbidden . ' |
---|
| 23 | ' . $conf['order_by'] . ';'; |
---|
| 24 | } |
---|
| 25 | else |
---|
| 26 | { |
---|
| 27 | $query = 'SELECT DISTINCT (i.id) |
---|
| 28 | FROM ' . IMAGES_TABLE . ' AS i |
---|
| 29 | INNER JOIN ' . IMAGE_CATEGORY_TABLE . ' AS ic |
---|
| 30 | ON i.id = ic.image_id |
---|
| 31 | AND i.has_high = "true" |
---|
| 32 | ' . $forbidden . ' |
---|
| 33 | ' . $conf['order_by'] . ';'; |
---|
| 34 | } |
---|
| 35 | |
---|
| 36 | $page = array_merge($page, array( |
---|
| 37 | 'title' => '<a href="' . duplicate_index_url(array('start'=>0)).'">'.l10n('has_high_cat').'</a>', |
---|
| 38 | 'items' => array_from_query($query, 'id') |
---|
| 39 | )); |
---|
| 40 | |
---|
[3297] | 41 | ?> |
---|