Your Ad Here

Posted By

stuartlamour on 07/24/08


Tagged


Versions (?)

emerge code


 / Published in: PHP
 

  1. function make_cloud($tagcloud, $search){
  2. $countarray = array_count_values($tagcloud);
  3.  
  4. echo '<div id="tagcloud">';
  5. echo '<h1>Tags</h1>';
  6. echo '<ul class="tagcloud">';
  7.  
  8. arsort ($countarray);
  9. foreach($countarray as $key => $value) {
  10.  
  11. // set the size and colour for display
  12. if ($value >= 9){
  13. $size_color = 9;
  14. }
  15. else {
  16. $size_color = $value;
  17. }
  18. //the tag is the same as our search term and should not be displayed
  19. if ($key == $search){
  20. //do nothing, it should not be in our list
  21. }
  22. else{
  23. echo '<li class="jisc_tags"><span class="count"> ('.$value.') </span> <a target="_blank" href="http://del.icio.us/tag/%27.$search.%27+%27.$key.%27" title="Used by '.$value. ' JISC emerge users" style="">'.$key. '</a></li>';
  24. }
  25. }
  26.  
  27. echo '</ul>';
  28.  
  29.  
  30. echo '</div>';
  31. }

Report this snippet  

You need to login to post a comment.