source: extensions/rv_autocomplete/admin/exclude.php @ 22201

Revision 22201, 1.2 KB checked in by rvelices, 7 years ago (diff)

rv autocomplete svn first commit

Line 
1<?php 
2defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
3
4$rvac_conf = rvac_get_conf();
5
6if (!empty($_POST))
7{
8  foreach( array('excluded_albums','excluded_tags') as $k)
9  {
10    if (!empty($_POST[$k]))
11      $rvac_conf[$k] = $_POST[$k];
12    else
13      $rvac_conf[$k] = array();
14  }
15  rvac_save_conf($rvac_conf);
16  rvac_invalidate_cache();
17}
18
19$query = 'SELECT id, name, uppercats, global_rank, COUNT(image_id) AS counter
20  FROM '.CATEGORIES_TABLE.' LEFT JOIN '.IMAGE_CATEGORY_TABLE.'
21  ON id = category_id
22  GROUP BY id
23  ORDER BY global_rank';
24$albums = array_from_query($query);
25usort($albums, 'global_rank_compare');
26
27display_select_categories($albums, (array)$rvac_conf['excluded_albums'], 'albums', false );
28
29
30$query = 'SELECT id, name, COUNT(image_id) AS counter
31  FROM '.TAGS_TABLE.' LEFT JOIN '.IMAGE_TAG_TABLE.'
32  ON id = tag_id
33  GROUP BY id
34  ORDER BY url_name';
35$tags = array_from_query($query);
36$tags_select = array();
37foreach($tags as $tag)
38  $tags_select[ $tag['id'] ] = trigger_event('render_tag_name', $tag['name']) . ' '.$tag['counter'];
39
40$template->assign( array(
41  'U_FORM' => $my_base_url,
42  'tags' => $tags_select,
43  'tags_selected' => (array)$rvac_conf['excluded_tags'],
44) );
45?>
Note: See TracBrowser for help on using the repository browser.