Ignore:
Timestamp:
Nov 21, 2013, 9:13:41 PM (10 years ago)
Author:
mistic100
Message:
  • add "Add photos" link for albums
  • fix empty username if viewing as "guest"
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/AdminTools/include/events.inc.php

    r25619 r25629  
    1111  }
    1212
    13   global $template, $page;
     13  global $template, $page, $user;
    1414
    1515  $url_root = get_root_url();
     
    2020    'U_SELF' => $MultiView->get_clean_url(true),
    2121    'USER' => $MultiView->get_user(),
     22    'CURRENT_USERNAME' => $user['id']==$conf['guest_id'] ? l10n('guest') : $user['username'],
    2223    );
    2324
     
    3738      ));
    3839
     40    $query = 'SELECT element_id FROM ' . CADDIE_TABLE . '
     41      WHERE element_id = ' . $page['image_id'] .';';
     42    $tpl_vars['IS_IN_CADDIE'] = pwg_db_num_rows(pwg_query($query)) > 0;
     43
    3944    if (isset($page['category']))
    4045    {
     46      $tpl_vars['CATEGORY_ID'] = $page['category']['id'];
     47
    4148      $tpl_vars['U_SET_REPRESENTATIVE'] = add_url_params(
    4249        $url_self,
    4350        array('action'=>'set_as_representative')
    4451        );
    45       $tpl_vars['CATEGORY_ID'] = $page['category']['id'];
     52
     53      $query = 'SELECT id FROM ' . CATEGORIES_TABLE.'
     54        WHERE id = ' . $page['category']['id'] .'
     55        AND representative_picture_id = ' . $page['image_id'] .';';
     56      $tpl_vars['IS_REPRESENTATIVE'] = pwg_db_num_rows(pwg_query($query)) > 0;
    4657    }
    4758
Note: See TracChangeset for help on using the changeset viewer.