Changeset 18455 for trunk/include/functions_tag.inc.php
- Timestamp:
- Oct 4, 2012, 6:15:28 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_tag.inc.php
r12922 r18455 65 65 while ($row = pwg_db_fetch_assoc($result)) 66 66 { 67 $counter = @$tag_counters[ $row['id'] ];67 $counter = intval(@$tag_counters[ $row['id'] ]); 68 68 if ( $counter ) 69 69 { 70 70 $row['counter'] = $counter; 71 71 $row['name'] = trigger_event('render_tag_name', $row['name']); 72 array_push($tags, $row);72 $tags[] = $row; 73 73 } 74 74 } … … 92 92 { 93 93 $row['name'] = trigger_event('render_tag_name', $row['name']); 94 array_push($tags, $row);94 $tags[] = $row; 95 95 } 96 96 … … 139 139 140 140 // display sorted tags 141 foreach ( array_keys($tags) as $k)142 { 143 $tag s[$k]['level'] = 1;141 foreach ($tags as &$tag) 142 { 143 $tag['level'] = 1; 144 144 145 145 // based on threshold, determine current tag level 146 146 for ($i = $conf['tags_levels'] - 1; $i >= 1; $i--) 147 147 { 148 if ($tag s[$k]['counter'] > $threshold_of_level[$i])148 if ($tag['counter'] > $threshold_of_level[$i]) 149 149 { 150 $tag s[$k]['level'] = $i + 1;150 $tag['level'] = $i + 1; 151 151 break; 152 152 } 153 153 } 154 154 } 155 unset($tag); 155 156 156 157 return $tags; … … 255 256 { 256 257 $row['name'] = trigger_event('render_tag_name', $row['name']); 257 array_push($tags, $row);258 $tags[] = $row; 258 259 } 259 260 usort($tags, 'tag_alpha_compare');
Note: See TracChangeset
for help on using the changeset viewer.