Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- }
- function group_tags($query)
- {
- if ( !$query )
- return false;
- global $conn;
- $list = '';
- $rs = $conn->execute($query);
- if ( $conn->Affected_Rows() ) {
- while(!$rs->EOF) {
- $tarray = explode(' ', $rs->fields['keyword']);
- $count = count($tarray);
- for ($i=0; $i<$count; $i++) {
- if ( isset($tarray[$i]) && $tarray[$i] != '' ) {
- if ( $list == '' ) {
- $list .= $tarray[$i]. ' ';
- } else {
- if(stristr($list,$tarray[$i]) === FALSE) {
- $list .= $tarray[$i]. " ";
- }
- }
- }
- }
- $rs->movenext();
- }
- }
- $list = trim($list);
- $taglist = explode(' ', $list);
- if ( $list != '' ) {
- return $taglist;
- }
- }
- //END
- function cloudTags($cloudquery)
- {
- global $config;
- $tags = array();
- $cloud = array();
- $keyword = array();
- $query = mysql_query($cloudquery);
- while($t = mysql_fetch_array($query)) {
- $db = explode(' ', $t['0']);
- while(list($key, $value) = each($db)) {
- if ( isset($keyword[$value]) ) {
- $keyword[$value] += 1;
- } else {
- $keyword[$value] = 0;
- }
- }
- }
- if ( is_array($keyword) && $keyword ) {
- $minFont=11;
- $maxFont=22;
- $min = min(array_values($keyword));
- $max = max(array_values($keyword));
- $fix = ($max - $min == 0) ? 1 : $max - $min;
- // Display the tags
- foreach ($keyword as $tag => $count) {
- $url = seo_url( 'tags/' .$tag, 'search_result.php?search_id=' .$tag);
- $size = $minFont + ($count - $min) * ($maxFont - $minFont) / $fix;
- $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>';
- }
- $shown = join("\n", $cloud) . "\n";
- return $shown;
- }
- }
- function video_rating($vid,$urate)
- {
- global $config,$conn;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement