Changeset 297
- Timestamp:
- 01/27/10 09:49:46 (2 years ago)
- Files:
-
- browse.php (modified) (2 diffs)
- db_updater.php (modified) (1 diff)
- getrss.php (modified) (1 diff)
- include/bbcode/Xbb/Tags/Spoiler.php (modified) (1 diff)
- include/bbcode/Xbb/Tags/youtube.php (modified) (1 diff)
- include/bbcode/bbcode.lib.php (modified) (4 diffs)
- include/bbcode/index.php (deleted)
- rss.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
browse.php
r295 r297 400 400 } 401 401 402 //begin tags 403 $show_tags_cloud = false; 404 405 $sql = 'SELECT tag_name, SUM(tag_count) AS tag_count 406 FROM ' . TAGS_TABLE . ' 407 GROUP BY tag_name 408 ORDER BY tag_count DESC'; 409 $result = $db->sql_query_limit($sql, 30, 0, 3600); 410 if ( $subrow = $db->sql_fetchrow($result) ) { 411 $show_tags_cloud = true; 412 $tags = array(); 413 $max_qty = $min_qty = 0; 414 do { 415 $tags[] = $subrow; 416 $max_qty = max($max_qty, $subrow['tag_count']); 417 $min_qty = min($min_qty, $subrow['tag_count']); 418 } 419 while ( $subrow = $db->sql_fetchrow($result) ); 420 421 //simple tag cloud find here http://www.bytemycode.com/snippets/snippet/415/ 422 //$max_qty = max(array_values($tags)); 423 //$min_qty = min(array_values($tags)); 424 425 $spread = $max_qty - $min_qty; 426 $spread = ( $spread == 0 ? 1 : $spread ); 427 428 $step = ( $config['max_tag_size'] - $config['min_tag_size'] ) / $spread; 429 430 shuffle($tags); 431 432 foreach ( $tags AS $_null => $tag_ary ) { 433 $size = round($config['min_tag_size'] + (($tag_ary['tag_count'] - $min_qty) * $step)); 434 435 $enc_tag_name = undo_htmlspecialchars($tag_ary['tag_name']); 436 $enc_tag_name = urlencode($enc_tag_name); 437 438 $template->assign_block_vars('tags_cloud', array( 439 'TAG_NAME' => $tag_ary['tag_name'], 440 'TAG_SIZE' => $size, 441 442 'U_TAG' => append_sid($root_path . 'browse.php?search_in=3&search=' . $enc_tag_name), 443 )); 444 } 445 } 446 447 //end tags 448 402 449 $where = ( sizeof($wherea) ? 'WHERE ' . implode(' AND ', $wherea) : '' ); 403 450 … … 495 542 'BACK_LINK' => $back_link, 496 543 544 'SHOW_TAGS_CLOUD' => $show_tags_cloud, 497 545 )); 498 546 db_updater.php
r293 r297 444 444 $db->sql_query('ALTER TABLE ' . TORRENTS_TABLE . ' DROP save_as'); 445 445 446 set_config('load_db_lastread', '0'); 447 set_config('load_anon_lastread', '1'); 448 set_config('load_db_track', '0'); 446 449 447 450 $message .= 'Database updated sucefully. Now you must delete this file!'; getrss.php
r255 r297 26 26 } 27 27 28 if ( $sizeof_cat = sizeof($cat) ) { 29 if ( $sizeof_cat != sizeof($cats) ) { 30 $query[] = 'cat=' . implode(',', $cat); 31 } 28 if ( sizeof($cat) != sizeof($cats) && sizeof($cat) ) { 29 $query[] = 'cat=' . implode(',', $cat); 32 30 } 33 else { 34 trigger_error($lang['you_must_select_category']); 35 } 31 36 32 if ( $login_type == 'passkey' ) { 37 33 $query[] = 'passkey=' . $userdata['torrent_pass']; include/bbcode/Xbb/Tags/Spoiler.php
r276 r297 31 31 if ( !empty($this->attrib['spoiler']) ) { 32 32 $str = $this->bb_tpl['spoiler_header_open']; 33 $str = str_replace('{TEXT}', htmlspecialchars($this->attrib['spoiler']), $str);33 $str = str_replace('{TEXT}', $this->attrib['spoiler'], $str); 34 34 } 35 35 else { include/bbcode/Xbb/Tags/youtube.php
r296 r297 32 32 } 33 33 34 preg_match("/v(=|\/)([0-9A-Za-z ]+)(&|$|\n)/", $href, $matches);34 preg_match("/v(=|\/)([0-9A-Za-z-]+)(&|$|\n)/", $href, $matches); 35 35 if ( isset($matches[2]) ) { 36 36 $movie_id = $matches[2]; include/bbcode/bbcode.lib.php
r296 r297 994 994 global $smilies, $cache, $config, $root_path; 995 995 static $repl_smilies; 996 997 $text = htmlspecialchars($text);998 996 999 997 if ( !isset($smilies) || !isset($repl_smilies) ) … … 1120 1118 foreach ($elems as $elem) { 1121 1119 if ('text' == $elem['type']) { 1122 $elem['str'] = $this -> insert_smiles( $elem['str']);1120 $elem['str'] = $this -> insert_smiles(htmlspecialchars($elem['str'])); 1123 1121 for ($i=0; $i < $rbr; ++$i) { 1124 1122 $elem['str'] = ltrim($elem['str']); … … 1147 1145 $tag->mnemonics = $this->mnemonics; 1148 1146 $tag->tag = $elem['name']; 1149 $tag->attrib = $elem['attrib'];1147 $tag->attrib = array_map('htmlspecialchars', $elem['attrib']); 1150 1148 $tag->tree = $elem['val']; 1151 1149 $result .= $tag -> get_html(); … … 1156 1154 );*/ 1157 1155 $this->stat['time_html'] = $this->_getmicrotime() - $time_start; 1156 1158 1157 return $result; 1159 1158 } rss.php
r283 r297 83 83 84 84 $cats_arr = $cache->obtain_cats(); 85 86 $template->set_filenames(array(87 'rss_tpl' => 'rss.html'88 ));89 85 90 86 $base_url = generate_base_url(); … … 126 122 AND t.moderated = 1 127 123 AND t.owner = u.uid 128 " . ( $s_modified ? ' AND t.ctime > ' . $s_modified . ' ORDER BY t.ctime DESC' : 'ORDER BY t.ctime DESC LIMIT 100' );129 $result = $db->sql_query ($sql, 30 * 60);124 " . ( $s_modified ? ' AND t.ctime > ' . $s_modified : '' ) . ' ORDER BY t.ctime DESC'; 125 $result = $db->sql_query_limit($sql, 100); 130 126 131 127 $bb_code = new bbcode(); … … 150 146 // www.phpBB-SEO.com SEO TOOLKIT END 151 147 152 $bb_code->parse($row['descr']); 148 $description = $row['descr']; 149 150 $bb_code->parse($description); 153 151 $description = $bb_code->get_html(); 154 152 $description = censor_text($description); … … 204 202 header('Etag: ' . $ETag); 205 203 204 $template->set_filenames(array( 205 'rss_tpl' => 'rss.html' 206 )); 207 206 208 $template->display('rss_tpl'); 207 209
