Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. }
  2.  
  3.  
  4. function group_tags($query)
  5. {
  6. if ( !$query )
  7. return false;
  8.  
  9. global $conn;
  10.  
  11. $list = '';
  12. $rs = $conn->execute($query);
  13. if ( $conn->Affected_Rows() ) {
  14. while(!$rs->EOF) {
  15. $tarray = explode(' ', $rs->fields['keyword']);
  16. $count = count($tarray);
  17. for ($i=0; $i<$count; $i++) {
  18. if ( isset($tarray[$i]) && $tarray[$i] != '' ) {
  19. if ( $list == '' ) {
  20. $list .= $tarray[$i]. ' ';
  21. } else {
  22. if(stristr($list,$tarray[$i]) === FALSE) {
  23. $list .= $tarray[$i]. " ";
  24. }
  25. }
  26. }
  27. }
  28.  
  29. $rs->movenext();
  30. }
  31. }
  32.  
  33. $list = trim($list);
  34. $taglist = explode(' ', $list);
  35. if ( $list != '' ) {
  36. return $taglist;
  37. }
  38. }
  39. //END
  40.  
  41.  
  42. function cloudTags($cloudquery)
  43. {
  44. global $config;
  45. $tags = array();
  46. $cloud = array();
  47. $keyword = array();
  48.  
  49. $query = mysql_query($cloudquery);
  50. while($t = mysql_fetch_array($query)) {
  51. $db = explode(' ', $t['0']);
  52. while(list($key, $value) = each($db)) {
  53. if ( isset($keyword[$value]) ) {
  54. $keyword[$value] += 1;
  55. } else {
  56. $keyword[$value] = 0;
  57. }
  58. }
  59. }
  60.  
  61. if ( is_array($keyword) && $keyword ) {
  62. $minFont=11;
  63. $maxFont=22;
  64. $min = min(array_values($keyword));
  65. $max = max(array_values($keyword));
  66. $fix = ($max - $min == 0) ? 1 : $max - $min;
  67.  
  68. // Display the tags
  69. foreach ($keyword as $tag => $count) {
  70. $url = seo_url( 'tags/' .$tag, 'search_result.php?search_id=' .$tag);
  71. $size = $minFont + ($count - $min) * ($maxFont - $minFont) / $fix;
  72. $cloud[] = '<a class="cloudtags" style="font-size: '. floor($size) .'px;" href="' .$url. '" title="Tags: '. ucfirst($tag) .' was used '. $count .' times"><span>'. htmlspecialchars(stripslashes(ucfirst($tag))) . '</span></a>';
  73. }
  74.  
  75. $shown = join("\n", $cloud) . "\n";
  76. return $shown;
  77. }
  78. }
  79.  
  80.  
  81. function video_rating($vid,$urate)
  82. {
  83. global $config,$conn;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement