Changeset 297

Show
Ignore:
Timestamp:
01/27/10 09:49:46 (2 years ago)
Author:
Nafania
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • browse.php

    r295 r297  
    400400} 
    401401 
     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); 
     410if ( $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 
    402449$where = ( sizeof($wherea) ? 'WHERE ' . implode(' AND ', $wherea) : '' ); 
    403450 
     
    495542        'BACK_LINK' => $back_link, 
    496543 
     544        'SHOW_TAGS_CLOUD' => $show_tags_cloud, 
    497545)); 
    498546 
  • db_updater.php

    r293 r297  
    444444        $db->sql_query('ALTER TABLE ' . TORRENTS_TABLE . ' DROP save_as'); 
    445445 
     446        set_config('load_db_lastread', '0'); 
     447        set_config('load_anon_lastread', '1'); 
     448        set_config('load_db_track', '0'); 
    446449 
    447450        $message .= 'Database updated sucefully. Now you must delete this file!'; 
  • getrss.php

    r255 r297  
    2626     } 
    2727 
    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); 
    3230        } 
    33         else { 
    34                 trigger_error($lang['you_must_select_category']); 
    35      } 
     31 
    3632        if ( $login_type == 'passkey' ) { 
    3733                $query[] = 'passkey=' . $userdata['torrent_pass']; 
  • include/bbcode/Xbb/Tags/Spoiler.php

    r276 r297  
    3131                if ( !empty($this->attrib['spoiler']) ) { 
    3232                        $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); 
    3434                } 
    3535                else { 
  • include/bbcode/Xbb/Tags/youtube.php

    r296 r297  
    3232        } 
    3333 
    34         preg_match("/v(=|\/)([0-9A-Za-z]+)(&|$|\n)/", $href, $matches); 
     34        preg_match("/v(=|\/)([0-9A-Za-z-]+)(&|$|\n)/", $href, $matches); 
    3535        if ( isset($matches[2]) ) { 
    3636                $movie_id = $matches[2]; 
  • include/bbcode/bbcode.lib.php

    r296 r297  
    994994                global $smilies, $cache, $config, $root_path; 
    995995                static $repl_smilies; 
    996  
    997                 $text = htmlspecialchars($text); 
    998996 
    999997                if ( !isset($smilies) || !isset($repl_smilies) ) 
     
    11201118        foreach ($elems as $elem) { 
    11211119            if ('text' == $elem['type']) { 
    1122                 $elem['str'] = $this -> insert_smiles($elem['str']); 
     1120                $elem['str'] = $this -> insert_smiles(htmlspecialchars($elem['str'])); 
    11231121                for ($i=0; $i < $rbr; ++$i) { 
    11241122                    $elem['str'] = ltrim($elem['str']); 
     
    11471145                $tag->mnemonics = $this->mnemonics; 
    11481146                $tag->tag = $elem['name']; 
    1149                 $tag->attrib = $elem['attrib']
     1147                $tag->attrib = array_map('htmlspecialchars', $elem['attrib'])
    11501148                $tag->tree = $elem['val']; 
    11511149                $result .= $tag -> get_html(); 
     
    11561154        );*/ 
    11571155        $this->stat['time_html'] = $this->_getmicrotime() - $time_start; 
     1156 
    11581157        return $result; 
    11591158    } 
  • rss.php

    r283 r297  
    8383 
    8484$cats_arr = $cache->obtain_cats(); 
    85  
    86 $template->set_filenames(array( 
    87         'rss_tpl' => 'rss.html' 
    88 )); 
    8985 
    9086$base_url = generate_base_url(); 
     
    126122                AND t.moderated = 1 
    127123                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); 
    130126 
    131127        $bb_code = new bbcode(); 
     
    150146                // www.phpBB-SEO.com SEO TOOLKIT END 
    151147 
    152                 $bb_code->parse($row['descr']); 
     148                $description = $row['descr']; 
     149 
     150                $bb_code->parse($description); 
    153151             $description = $bb_code->get_html(); 
    154152             $description = censor_text($description); 
     
    204202        header('Etag: ' . $ETag); 
    205203 
     204        $template->set_filenames(array( 
     205                'rss_tpl' => 'rss.html' 
     206        )); 
     207 
    206208        $template->display('rss_tpl'); 
    207209