diff options
Diffstat (limited to '')
-rw-r--r-- | include/functions.inc.php | 7 | ||||
-rw-r--r-- | include/functions_html.inc.php | 18 |
2 files changed, 15 insertions, 10 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php index ae5f46415..0c4e462e9 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -354,15 +354,18 @@ function pwg_log( $file, $category, $picture = '' ) if ($conf['log']) { + $login = ($user['id'] == $conf['guest_id']) + ? 'guest' : addslashes($user['username']); + $query = ' INSERT INTO '.HISTORY_TABLE.' (date,login,IP,file,category,picture) VALUES (NOW(), - \''.(($user['id'] == 2) ? 'guest' : addslashes($user['username'])).'\', + \''.$login.'\', \''.$_SERVER['REMOTE_ADDR'].'\', \''.addslashes($file).'\', - \''.addslashes($category).'\', + \''.addslashes(strip_tags($category)).'\', \''.addslashes($picture).'\') ;'; pwg_query($query); diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php index ae5d5ef47..b49533db4 100644 --- a/include/functions_html.inc.php +++ b/include/functions_html.inc.php @@ -339,21 +339,26 @@ function get_html_menu_category($categories) global $page, $lang; $ref_level = 0; - $menu = ' - <ul class="menu">'; + $menu = ''; foreach ($categories as $category) { - $level = substr_count($category['global_rank'], '.'); + $level = substr_count($category['global_rank'], '.') + 1; if ($level > $ref_level) { $menu.= ' - <ul class="menu">'; + <ul>'; + } + else if ($level == $ref_level) + { + $menu.= ' + </li>'; } else if ($level < $ref_level) { // we may have to close more than one level at the same time... $menu.= str_repeat("\n</ul>",($ref_level-$level)); + $menu.= "\n</li>"; } $ref_level = $level; @@ -382,12 +387,9 @@ function get_html_menu_category($categories) $menu.= '</span>'; $menu.= get_icon($category['date_last']); } - - $menu.= ' - </li>'; } - $menu.= ' + $menu.= '</li> </ul>'; return $menu; |