Changeset 99
- Timestamp:
- 04/29/2005 06:49:29 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bb-admin/upgrade-schema.php
r81 r99 67 67 tag varchar(30) NOT NULL default '', 68 68 raw_tag varchar(50) NOT NULL default '', 69 tag_count bigint(20) unsigned NOT NULL default '0', 69 70 PRIMARY KEY (`tag_id`) 70 71 ); -
trunk/bb-includes/functions.php
r90 r99 614 614 VALUES 615 615 ( '$tag_id', '$current_user->user_id', '$topic_id', '$now')"); 616 $bbdb->query("UPDATE $bbdb->tags SET tag_count = tag_count + 1"); 616 617 return true; 617 618 } -
trunk/bb-includes/template-functions.php
r95 r99 499 499 } 500 500 501 function tag_heat_map($smallest=10, $largest=48, $unit="pt") { 502 $cats = list_cats(1, 'all', 'name', 'asc', '', 0, 0, 1, 1, 0, 1, 1, 0, 1, '', '', $exclude, 0); 503 504 $cats = explode("\n", $cats); 505 foreach ($cats as $cat) 506 { 507 eregi("a href=\"(.+)\" ", $cat, $regs); 508 $catlink = $regs[1]; 509 $cat = trim(strip_tags($cat)); 510 eregi("(.*) \(([0-9]+)\)$", $cat, $regs); 511 $catname = $regs[1]; $count = $regs[2]; 512 $counts{$catname} = $count; 513 $catlinks{$catname} = $catlink; 514 } 515 $spread = max($counts) - min($counts); 516 if ($spread <= 0) { $spread = 1; }; 517 $fontspread = $largest - $smallest; 518 $fontstep = $spread / $fontspread; 519 if ($fontspread <= 0) { $fontspread = 1; } 520 foreach ($counts as $catname => $count) 521 { 522 $catlink = $catlinks{$catname}; 523 print "<a href=\"$catlink\" title=\"$count entries\" style=\"font-size: ". 524 ($smallest + ($count/$fontstep))."$unit;\">$catname</a> \n"; 525 } 526 } 527 501 528 ?>
Note: See TracChangeset
for help on using the changeset viewer.