Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Advertising

Paste Description for Forum topic 139295

Here is the code from the plugin. It gets it's tags from the postmeta table. I'd have to adjust it to get it from the new table structure for tagging.

Forum topic 139295
Wednesday, October 24th, 2007 at 1:20:56pm MDT 

  1. function get_TagsBit()
  2. {
  3. global $wpdb;
  4. $bon_TechnoTaggingOptions = bon_technoratiTaggingLoadOptions();
  5. if ($technoTag_tagbitlink == '')
  6. {
  7. $technoTag_tagbitlink = $bon_TechnoTaggingOptions['technoTag_link'];
  8. }
  9. $where = '';
  10. $limit = '';
  11. if ($bon_TechnoTaggingOptions['technoTag_tagbit_numdays'] > 0)
  12. {
  13. $where = " AND post_date >= '" . date('Y-m-d H:i:00', time() - ($bon_TechnoTaggingOptions['technoTag_tagbit_numdays'] * 86400)) . "'";
  14. }
  15. if ($bon_TechnoTaggingOptions['technoTag_tagbit_numposts'] > 0)
  16. {
  17. $limit = ' LIMIT ' . $bon_TechnoTaggingOptions['technoTag_tagbit_numposts'];
  18. }
  19.  
  20. // load the tags
  21. $tagData = implode(",", $wpdb->get_col("SELECT meta_value FROM $wpdb->posts LEFT JOIN $wpdb->postmeta ON $wpdb->posts.ID=$wpdb->postmeta.post_id WHERE (meta_key='ttaglist' OR meta_key='technorati') AND post_status='publish'$where ORDER BY post_date DESC$limit"));
  22. $tagArray = preg_split("/[,]+/", $tagData);
  23. $tagsFreqData = array();
  24.  
  25. // work out the frequency of each of the tags
  26. foreach ($tagArray as $tag)
  27. {
  28. $tag = trim(strtolower($tag));
  29. if ($tag != '')
  30. {
  31. if (!isset($tagsFreqData[$tag]))
  32. $tagsFreqData[$tag] = 1;
  33. else
  34. $tagsFreqData[$tag]++;
  35. }
  36. }
  37.  
  38. // sort into order
  39. arsort($tagsFreqData, SORT_NUMERIC);
  40.  
  41. // get the min/max frequency
  42. $freqMin = end($tagsFreqData);
  43. $freqMax = reset($tagsFreqData);
  44.  
  45. // make sure we have the right number of tags
  46. if ($bon_TechnoTaggingOptions['technoTag_tagbits_count'] > 0)
  47. {
  48. if (count($tagsFreqData) > $bon_TechnoTaggingOptions['technoTag_tagbits_count'])
  49. $tagsFreqData = array_slice($tagsFreqData, 0, $bon_TechnoTaggingOptions['technoTag_tagbits_count']);
  50. }
  51.  
  52. // get the names of the tags in alphabetical order, used to output
  53. // the list in alphabetical order.
  54. $tagNames = array_keys($tagsFreqData);
  55. sort($tagNames);
  56. $tagDoneData = array();
  57. foreach ($tagNames as $tag)
  58. {
  59. $size = bon_technoratiTagging_get_tagbit_fontsize($tagsFreqData[$tag], $freqMax, $freqMin);
  60. $colour = bon_technoratiTagging_get_tagbit_color($tagsFreqData[$tag], $freqMax, $freqMin);
  61.  
  62. $tagFixed = bon_technorati_fixTag($tag);
  63.  
  64. $tagDoneData[] = ' ' . $tag . ' ';
  65. }
  66. echo '<div style="text-align: center; font-family: arial, sans-serif; line-height: ' . $bon_TechnoTaggingOptions['technoTag_largest_fontsize'] . 'px;">' . implode('', $tagDoneData) . '</div>';
  67. }

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

worth-right