Changeset 300

Show
Ignore:
Timestamp:
02/17/10 15:41:40 (2 years ago)
Author:
Nafania
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • admin/admin_user_ban.php

    r212 r300  
    180180 
    181181        $sql = "SELECT * 
    182                 FROM " . BANLIST_TABLE; 
     182                FROM " . BANLIST_TABLE . " 
     183                WHERE ban_type = " . BAN_GLOBAL; 
    183184        $result = $db->sql_query($sql); 
    184185 
     
    202203                        $kill_session_sql .= ( ( $kill_session_sql != '' ) ? ' OR ' : '' ) . "session_user_id = " . $user_list[$i]; 
    203204 
    204                         $sql = "INSERT INTO " . BANLIST_TABLE . " (ban_userid, ban_added
    205                                 VALUES (" . $user_list[$i] . ", " . time() . ")"; 
     205                        $sql = "INSERT INTO " . BANLIST_TABLE . " (ban_userid, ban_added, ban_type
     206                                VALUES (" . $user_list[$i] . ", " . time() . ", " . BAN_GLOBAL . ")"; 
    206207                        $db->sql_query($sql); 
    207208                } 
     
    225226                        $kill_session_sql .= ( ( $kill_session_sql != '' ) ? ' OR ' : '' ) . $kill_ip_sql; 
    226227 
    227                         $sql = "INSERT INTO " . BANLIST_TABLE . " (ban_ip, ban_added
    228                                 VALUES ('" . $banlist_ary[$i] . "', " . time() . ")"; 
     228                        $sql = "INSERT INTO " . BANLIST_TABLE . " (ban_ip, ban_added, ban_type
     229                                VALUES ('" . $banlist_ary[$i] . "', " . time() . ", " . BAN_GLOBAL . ")"; 
    229230                        $db->sql_query($sql); 
    230231                } 
     
    256257                if ( !$in_banlist ) 
    257258                { 
    258                         $sql = "INSERT INTO " . BANLIST_TABLE . " (ban_email, ban_added
    259                                 VALUES ('" . str_replace("\'", "''", $email_list[$i]) . "', " . time() . ")"; 
     259                        $sql = "INSERT INTO " . BANLIST_TABLE . " (ban_email, ban_added, ban_type
     260                                VALUES ('" . str_replace("\'", "''", $email_list[$i]) . "', " . time() . ", " . BAN_GLOBAL . ")"; 
    260261                        $db->sql_query($sql); 
    261262                } 
     
    342343                        AND b.ban_userid <> 0 
    343344                        AND u.uid <> " . ANONYMOUS . " 
     345                        AND b.ban_type = " . BAN_GLOBAL . " 
    344346                ORDER BY u.uid ASC"; 
    345347        $result = $db->sql_query($sql); 
     
    363365 
    364366        $sql = "SELECT ban_id, ban_ip, ban_email 
    365                 FROM " . BANLIST_TABLE; 
     367                FROM " . BANLIST_TABLE . " 
     368                         WHERE ban_type = " . BAN_GLOBAL; 
    366369        $result = $db->sql_query($sql); 
    367370 
  • ajax.php

    r269 r300  
    209209                $name = ( !empty($name) ? censor_text($name) : $lang['preview'] ); 
    210210 
    211                 $message = censor_text($message); 
    212211                $bb_code = new bbcode($message); 
    213212                $message = $bb_code->get_html(); 
     213                $message = censor_text($message); 
    214214 
    215215                $template->set_filenames(array( 
  • announce.php

    r293 r300  
    324324                        'uploaded'      => $uploaded, 
    325325                        'downloaded'    => $downloaded, 
    326                         'port'          => $port, 
    327326                        'last_action'   => $current_time, 
    328327                        'completedat' => $completedat, 
     
    330329                ' ON DUPLICATE KEY UPDATE 
    331330                last_action = VALUES(last_action), 
    332                 port = VALUES(port), 
    333331                uploaded = uploaded + VALUES(uploaded), 
    334332                downloaded = downloaded + VALUES(downloaded), 
     
    416414        $upd_sql =  ( $upthis ? 'uploaded = uploaded + ' .  $upthis . ',' : '' ); 
    417415        $upd_sql .= ( $downthis ? 'downloaded = downloaded + ' . $downthis . ',' : '' ); 
    418         $upd_sql .= ( $port <> $self['port'] ? 'port = ' . $port . ',' : '' ); 
    419416        $upd_sql .= ( $completedat ? 'completedat = ' . $completedat . ',' : '' ); 
    420417        $sql = 'UPDATE' . $sql_priority . ' ' . SNATCHED_TABLE . ' SET ' . $upd_sql . ' last_action = ' . $current_time . ' WHERE torrentid = ' . $torrentdata['fid'] . ' AND userid = ' . $userdata['uid']; 
  • browse.php

    r297 r300  
    454454        $count = ( $row = $db->sql_fetchrow($result) ) ? $row['count'] : 0; 
    455455} 
    456  
    457 $torrentsperpage = ( $userdata['torrentsperpage'] ? $userdata['torrentsperpage'] : 30 ); 
     456$torrentsperpage = ( $userdata['torrentsperpage'] ? $userdata['torrentsperpage'] : 40 ); 
    458457 
    459458if ( $count ) { 
  • faq.php

    r280 r300  
    4545     break; 
    4646 
     47     case 'tags': 
     48             $lang_file = 'lang_faq_bbcode.php'; 
     49 
     50             function parse_faq_lang ( &$faq ) { 
     51                     global $root_path, $lang; 
     52                     static $bb_code; 
     53 
     54                     require ($root_path . 'include/bbcode/config/tags.php'); 
     55                     require ($root_path . 'include/bbcode/bbcode.lib.php'); 
     56 
     57                     $faq_tags = array(); 
     58                     $tags = array_keys($tags); 
     59 
     60                        if ( !isset($bb_code) ) { 
     61                                $bb_code = new bbcode(); 
     62                        } 
     63 
     64                     for($i = 0, $count = sizeof($faq); $i < $count; $i++) { 
     65                             if ( $faq[$i][0] != '--' ) { 
     66                                     list($name, $tag, $descr, $explain) = $faq[$i]; 
     67 
     68                                        $parsed = $explain; 
     69 
     70                            $bb_code->parse($parsed); 
     71                            $parsed = $bb_code->get_html(); 
     72 
     73                                     $faq_text = $lang['tag'] . ': [' . $tag . ']<br />'; 
     74                                     $faq_text .= $lang['description'] . ': ' . $descr . '<br />'; 
     75                                     $faq_text .= '<div class="codetitle"><b>' . $lang['example'] . ':</b></div><div class="codecontent">' . $explain . '</div>'; 
     76                                     $faq_text .= '<div class="codetitle"><b>' . $lang['result'] . ':</b></div><div class="codecontent">' . $parsed . '</div>'; 
     77 
     78                                     $faq[$i] = array( 
     79                                                0 => '[' . $tag . '] ' . $name, 
     80                                                1 => $faq_text, 
     81                                     ); 
     82 
     83                                     $faq_tags[] = $tag; 
     84                                } 
     85                     } 
     86 
     87                     $tags_diff = array_diff($tags, $faq_tags); 
     88 
     89                     if ( sizeof($tags_diff) ) { 
     90                             $faq[$i] = array( 
     91                                     0 => $lang['other_tags'], 
     92                                     1 => implode(', ', $tags_diff), 
     93                             ); 
     94                     } 
     95             } 
     96     break; 
     97 
    4798     default: 
    4899             $lang_file = 'lang_faq.php'; 
     
    53104require_once ($root_path . 'languages/lang_' . ( $userdata['session_logged_in'] ? $userdata['language'] : $config['default_lang']) . '/' . $lang_file); 
    54105 
     106if ( function_exists('parse_faq_lang') ) { 
     107        parse_faq_lang($faq); 
     108} 
     109 
    55110$j = 0; 
    56111$counter = 0; 
     
    59114$faq_block_titles = array(); 
    60115 
    61 for($i = 0; $i < sizeof($faq); $i++) 
     116for($i = 0, $count = sizeof($faq); $i < $count; $i++) 
    62117{ 
    63118        if ( !empty($faq[$i][0]) ) { 
     
    80135} 
    81136 
    82 for($i = 0; $i < sizeof($faq_block); $i++) { 
     137for($i = 0, $count = sizeof($faq_block); $i < $count; $i++) { 
    83138        if( sizeof($faq_block[$i]) ) { 
    84139                $template->assign_block_vars('faq_block', array( 
     
    96151 
    97152 
    98 for($i = 0; $i < sizeof($faq_block); $i++) { 
     153for($i = 0, $count = sizeof($faq_block); $i < $count; $i++) { 
    99154        if( sizeof($faq_block[$i]) ) { 
    100155                $template->assign_block_vars('answers_block', array( 
  • include/acp/config/email_settings.php

    r226 r300  
    1818        'smtp_host'     => array('lang' => 'smtp_server',               'validate' => 'string', 'type' => 'text:40:255', 'explain' => false), 
    1919        'smtp_port'     => array('lang' => 'smtp_port',         'validate' => 'string', 'type' => 'text:40:255', 'explain' => false), 
     20        'smtp_auth_method'              => array('lang' => 'smtp_auth_method',          'validate' => 'string', 'type' => 'select', 'function' => 'mail_auth_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => true), 
    2021        'smtp_username'         => array('lang' => 'smtp_username',     'validate' => 'string', 'type' => 'text:40:255', 'explain' => true), 
    2122        'smtp_password'         => array('lang' => 'smtp_password',     'validate' => 'string', 'type' => 'password:40:255', 'explain' => true), 
     
    2324        'board_email_sig'               => array('lang' => 'email_sig',         'validate' => 'string', 'type' => 'textarea:5:40', 'explain' => true), 
    2425)); 
     26 
     27if ( !isset($load_modules) ) { 
     28 
     29 
     30        function mail_auth_select($selected_method, $key = '') 
     31        { 
     32                global $lang; 
     33 
     34                $auth_methods = array('PLAIN', 'LOGIN', 'CRAM-MD5', 'DIGEST-MD5', 'POP-BEFORE-SMTP'); 
     35                $s_smtp_auth_options = '<select name="config[smtp_auth_method]">'; 
     36 
     37                foreach ($auth_methods as $method) 
     38                { 
     39                        $s_smtp_auth_options .= '<option value="' . $method . '"' . (($selected_method == $method) ? ' selected="selected"' : '') . '>' . $lang['smtp_' . strtolower(str_replace('-', '_', $method))] . '</option>'; 
     40                } 
     41 
     42                $s_smtp_auth_options .= '</select>'; 
     43 
     44                return $s_smtp_auth_options; 
     45        } 
     46} 
    2547?> 
  • include/bbcode/Xbb/Tags/youtube.php

    r297 r300  
    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/config/tags.php

    r274 r300  
    8888    'mod'          => 'Xbb_Tags_Mod' , 
    8989    'offtop'       => 'Xbb_Tags_Offtop' , 
     90    'youtube'           => 'Xbb_Tags_youtube'   , 
     91    'gametrailers'              => 'Xbb_Tags_gametrailers'   , 
    9092 
    9193    // ��� �� �� ����������Hi) 
  • include/class.cache.php

    r266 r300  
    173173                        while ($row = $db->sql_fetchrow($result)) 
    174174                        { 
    175                                 $smilies[$row['smilies_id']]['code'] = str_replace("'", "\\'", str_replace('\\', '\\\\', $row['code'])); 
    176                                 $smilies[$row['smilies_id']]['smile_url'] = $row['smile_url']; 
    177                                 $smilies[$row['smilies_id']]['emoticon'] = $row['emoticon']; 
     175                                $smilies[$row['smilies_id']] = $row; 
    178176                        } 
    179177                        $db->sql_freeresult($result); 
  • include/constants.php

    r293 r300  
    160160 
    161161define('XBTT_TORRENT_MODIFIED', 9); 
     162 
     163define('BAN_GLOBAL', 0); 
     164define('BAN_CHAT', 1); 
    162165 
    163166// Table names 
  • include/details/viewnfo.php

    r280 r300  
    11<?php 
    22 
    3 $sql = 'SELECT name, nfo FROM ' . TORRENTS_TABLE . ' WHERE fid = ' . $id; 
     3$sql = 'SELECT name, nfo, category FROM ' . TORRENTS_TABLE . ' WHERE fid = ' . $id; 
    44$result = $db->sql_query( $sql ); 
    55$nfo = ( $row = $db->sql_fetchrow( $result ) ) ? $row['nfo'] : ''; 
     
    77        trigger_error( sprintf( $lang['invalid_id'], $id ) ); 
    88} 
     9 
     10$cats = $cache->obtain_cats(); 
     11$torrent_name = censor_text($row['name']); 
     12 
     13if ( isset($cats[$cats[$row['category']]['cat_parent']]['cat_name']) ) { 
     14        $cat_parent = $cats[$cats[$row['category']]['cat_parent']]; 
     15 
     16        // www.phpBB-SEO.com SEO TOOLKIT BEGIN 
     17        $seo->set_url($cat_parent['cat_name'], $cat_parent['cat_id'], $seo->seo_static['browse']); 
     18        $seo->set_parent($cats[$row['category']]['cat_id'], $seo->seo_static['browse'], $cat_parent['cat_id'], $seo->seo_static['browse']); 
     19        // www.phpBB-SEO.com SEO TOOLKIT END 
     20} 
     21 
     22// www.phpBB-SEO.com SEO TOOLKIT BEGIN 
     23$seo->set_url($cats[$row['category']]['cat_name'], $cats[$row['category']]['cat_id'], $seo->seo_static['browse']); 
     24$seo->set_parent($id, $seo->seo_static['details'], $cats[$row['category']]['cat_id'], $seo->seo_static['browse']); 
     25$seo->set_url($torrent_name, $id, $seo->seo_static['details']); 
     26// www.phpBB-SEO.com SEO TOOLKIT END 
    927 
    1028switch ( $do ) { 
     
    4664                } 
    4765 
    48                 $torrent_name = censor_text($row['name']); 
    49  
    50                 // www.phpBB-SEO.com SEO TOOLKIT BEGIN 
    51                 $seo->seo_url['details'][$id] = $seo->set_url($torrent_name, $id, $seo->seo_static['details']); 
    52                 // www.phpBB-SEO.com SEO TOOLKIT END 
    53  
    54                 $template->assign_vars( array( 'NFO_FOR' => sprintf( $lang['view_nfo_for'], $torrent_name), 
     66                $template->assign_vars( array( 
     67                                'NFO_FOR' => sprintf( $lang['view_nfo_for'], $torrent_name), 
    5568                                'NAME' => $row['name'], 
    5669                                'U_DOWNLOAD_NFO' => append_sid($root_path . 'details.php?id=' . $id . '&amp;action=viewnfo&amp;do=save'), 
  • include/functions.php

    r293 r300  
    17201720 
    17211721                $sql = "SELECT f.*,  t.topic_title, t.topic_id 
    1722                     FROM " . FORUMS_TABLE . " f 
    1723                     LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id 
     1722                    FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p 
    17241723                    LEFT JOIN " . TOPICS_TABLE . " t ON t.topic_id = p.topic_id 
     1724                    WHERE f.forum_last_post_id = p.post_id 
    17251725                    ORDER BY t.topic_last_post_id DESC"; 
    17261726          $result = $db->sql_query($sql, 10 * 60); 
  • include/functions_admin.php

    r259 r300  
    142142                        $total_topics = ( $row = $db->sql_fetchrow($result) ) ? ( ( $row['total'] ) ? $row['total'] : 0 ) : 0; 
    143143 
     144                        $sql = 'SELECT post_time FROM ' . POSTS_TABLE . ' WHERE post_id = ' . $last_post; 
     145                        $result = $db->sql_query($sql); 
     146                        $last_post_time = ( $subrow = $db->sql_fetchrow($result) ) ? $subrow['post_time'] : 0; 
     147 
    144148                        $sql = "UPDATE " . FORUMS_TABLE . " 
    145                                 SET forum_last_post_id = $last_post, forum_posts = $total_posts, forum_topics = $total_topics 
     149                                SET forum_last_post_id = $last_post, forum_posts = $total_posts, forum_topics = $total_topics, forum_last_post_time = $last_post_time 
    146150                                WHERE forum_id = $id"; 
    147151                        $db->sql_query($sql); 
     
    149153 
    150154                case 'topic': 
    151                         $sql = "SELECT MAX(post_id) AS last_post, MIN(post_id) AS first_post, COUNT(post_id) AS total_posts 
    152                                 FROM " . POSTS_TABLE . " 
    153                                 WHERE topic_id = $id"; 
     155                        $sql = "SELECT MAX(p.post_id) AS last_post, MIN(p.post_id) AS first_post, COUNT(p.post_id) AS total_posts 
     156                                FROM " . POSTS_TABLE . " p 
     157                                WHERE p.topic_id = $id"; 
    154158                        $result = $db->sql_query($sql); 
    155159 
    156160                        if ( $row = $db->sql_fetchrow($result) ) 
    157161                        { 
     162 
     163                                $sql = 'SELECT post_time FROM ' . POSTS_TABLE . ' WHERE post_id = ' . $row['last_post']; 
     164                                $result = $db->sql_query($sql); 
     165                                $last_post_time = ( $subrow = $db->sql_fetchrow($result) ) ? $subrow['post_time'] : 0; 
     166 
    158167                                if ($row['total_posts']) 
    159168                                { 
    160169                                        // Correct the details of this topic 
    161170                                        $sql = 'UPDATE ' . TOPICS_TABLE . ' 
    162                                                 SET topic_replies = ' . ($row['total_posts'] - 1) . ', topic_first_post_id = ' . $row['first_post'] . ', topic_last_post_id = ' . $row['last_post'] . " 
     171                                                SET topic_replies = ' . ($row['total_posts'] - 1) . ', 
     172                                                topic_first_post_id = ' . $row['first_post'] . ', 
     173                                                topic_last_post_id = ' . $row['last_post'] . ", 
     174                                                topic_last_post_time = " . $last_post_time . " 
    163175                                                WHERE topic_id = $id"; 
    164176 
  • include/functions_check.php

    r293 r300  
    6969                { 
    7070                        $sql = 'SELECT ban_email 
    71                                 FROM ' . BANLIST_TABLE; 
     71                                FROM ' . BANLIST_TABLE . ' 
     72                                WHERE ban_type = ' . BAN_GLOBAL; 
    7273                        if ($result = $db->sql_query($sql)) 
    7374                        { 
     
    346347                $base_announce = $site_url . '/announce.php'; 
    347348        } 
    348          
     349 
    349350        $torrent->announce(array($base_announce)); 
    350351 
  • include/functions_post.php

    r286 r300  
    105105                       //now we delete imgs if config allow_sig == 2 
    106106                    $user_sig = ( $config['allow_sig'] == 2 ) ? preg_replace('#((\r)+?(\n)+?)*(\[url?(.*)\])?\[img.*?\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img.*?\](\[/url\])?#i', '', $row['user_sig']) : $row['user_sig']; 
    107                     // Replace naughty words 
    108                     $user_sig = censor_text($user_sig); 
    109107                    //and now we format sig 
    110108                    $bb_code->parse($user_sig); 
    111109                    $user_sig = $bb_code->get_html(); 
     110                    $user_sig = censor_text($user_sig); 
    112111                    //last preparation :) 
    113112                    $user_sig = ( $user_sig != '' ? '<br />_________________<br />' . $user_sig : '' ); 
     
    138137          } 
    139138 
    140           $bb_code->parse($row['comment_text']); 
    141           $text = $bb_code->get_html(); 
    142           $text = censor_text($text); 
     139               $bb_code->parse($row['comment_text']); 
     140               $text = $bb_code->get_html(); 
     141               $text = censor_text($text); 
    143142 
    144143          $post_time = create_date($row['comment_added']); 
     
    443442 
    444443function textbbcode( $content = '' ) { 
    445         global $lang, $template, $userdata, $db, $config
     444        global $lang, $template, $userdata, $db, $config, $root_path
    446445 
    447446        $template->set_filenames(array( 
     
    452451                'EDITOR_NAME' => $userdata['name'], 
    453452                'CONTENT' => $content, 
    454                 'U_TAGS' => append_sid('tags.php') 
     453                'U_TAGS' => append_sid($root_path . 'faq.php?mode=tags') 
    455454        )); 
    456455 
  • include/modtask/mass_torrent_actions.php

    r291 r300  
    55$ids = request_var('torrent_id', array(0=>0)); 
    66 
    7 $back_url = 'browse.php' . ( $back_link ? '?' . base64_decode($back_link) : '' ); 
     7$back_url = 'browse.php' . ( $back_link ? '?' . urldecode(base64_decode($back_link)) : '' ); 
    88$back_url = append_sid($root_path . $back_url); 
    99 
  • include/modtask/new_comments.php

    r269 r300  
    4444                               $user_sig = ( $config['allow_sig'] == 2 ) ? preg_replace('#((\r)+?(\n)+?)*(\[url(.*)\])?\[img.*?\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img.*?\](\[/url\])?#i', '', $user_sig) : $user_sig; 
    4545                               // Replace naughty words 
    46                                $user_sig = censor_text($user_sig); 
    4746                            $bb_code->parse($user_sig); 
    4847                            $user_sig = $bb_code->get_html(); 
     48                            $user_sig = censor_text($user_sig); 
    4949                               //last preparation :) 
    5050                               $user_sig = ( $user_sig != '' ? '<br />_________________<br />' . $user_sig : '' ); 
  • include/sessions.php

    r295 r300  
    11271127// Create date/time from format and timezone 
    11281128// 
    1129 function create_date($gmepoch, $format = ''
     1129function create_date( $gmepoch, $format = ''
    11301130{ 
    11311131        global $config, $lang, $userdata; 
    1132         static $translate; 
    1133  
    1134         if ( !$format ) { 
    1135                 $format = $config['default_dateformat']; 
    1136         } 
    1137  
    1138         $tz = $userdata['tzoffset']; 
     1132        static $midnight; 
     1133        static $date_cache; 
     1134 
     1135        $format = (!$format) ? $config['default_dateformat'] : $format; 
     1136        $now = time(); 
     1137        $delta = $now - $gmepoch; 
     1138 
     1139        $zone_offset = $userdata['tzoffset']; 
    11391140        // [start] DST 
    11401141        if ( ($userdata['uid'] != ANONYMOUS && $userdata['user_dst']) || ( $userdata['uid'] == ANONYMOUS && $config['board_dst'] ) ) { 
    1141                 $tz += date('I', $gmepoch); 
    1142         } 
     1142                $zone_offset += date('I', $gmepoch); 
     1143        } 
     1144        $zone_offset *= 3600; 
    11431145        // [end] DST 
    11441146 
    1145      if ( empty($translate) && $config['default_lang'] != 'english' ) { 
    1146              @reset($lang['datetime']); 
    1147              foreach ( $lang['datetime'] AS $match => $replace ) { 
    1148                   $translate[$match] = $replace; 
    1149           } 
    1150      } 
    1151  
    1152      return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $tz)), $translate) : @gmdate($format, $gmepoch + (3600 * $tz)); 
     1147        if (!isset($date_cache[$format])) 
     1148        { 
     1149                // Is the user requesting a friendly date format (i.e. 'Today 12:42')? 
     1150                $date_cache[$format] = array( 
     1151                        'is_short'              => strpos($format, '|'), 
     1152                        'format_short'  => substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1), 
     1153                        'format_long'   => str_replace('|', '', $format), 
     1154                        'lang'                  => $lang['datetime'], 
     1155                ); 
     1156 
     1157                // Short representation of month in format? Some languages use different terms for the long and short format of May 
     1158                if ((strpos($format, '\M') === false && strpos($format, 'M') !== false) || (strpos($format, '\r') === false && strpos($format, 'r') !== false)) 
     1159                { 
     1160                        $date_cache[$format]['lang']['may'] = $lang['datetime']['may_short']; 
     1161                } 
     1162        } 
     1163 
     1164        // Show date <= 1 hour ago as 'xx min ago' 
     1165        // A small tolerence is given for times in the future but in the same minute are displayed as '< than a minute ago' 
     1166        if ($delta <= 3600 && ($delta >= -5 || (($now / 60) % 60) == (($gmepoch / 60) % 60)) && $date_cache[$format]['is_short'] !== false && isset($lang['datetime']['ago'])) 
     1167        { 
     1168                $_null = max(0, (int) floor($delta / 60)); 
     1169                $numbers = array_keys($lang['datetime']['ago']); 
     1170 
     1171                foreach ($numbers as $num) 
     1172                { 
     1173                        if ($num > $_null) 
     1174                        { 
     1175                                break; 
     1176                        } 
     1177                        $key_found = $num; 
     1178                } 
     1179                return sprintf($lang['datetime']['ago'][$key_found], $_null); 
     1180                //return $this->lang(array('datetime', 'AGO'), max(0, (int) floor($delta / 60))); 
     1181        } 
     1182 
     1183        if (!$midnight) 
     1184        { 
     1185                list($d, $m, $y) = explode(' ', gmdate('j n Y', time() + $zone_offset)); 
     1186                $midnight = gmmktime(0, 0, 0, $m, $d, $y) - $zone_offset; 
     1187        } 
     1188 
     1189        if ($date_cache[$format]['is_short'] !== false && !($gmepoch < $midnight - 86400 || $gmepoch > $midnight + 172800)) 
     1190        { 
     1191                $day = false; 
     1192 
     1193                if ($gmepoch > $midnight + 86400) 
     1194                { 
     1195                        $day = 'tomorrow'; 
     1196                } 
     1197                else if ($gmepoch > $midnight) 
     1198                { 
     1199                        $day = 'today'; 
     1200                } 
     1201                else if ($gmepoch > $midnight - 86400) 
     1202                { 
     1203                        $day = 'yesterday'; 
     1204                } 
     1205 
     1206                if ($day !== false) 
     1207                { 
     1208                        return str_replace('||', $lang['datetime'][$day], strtr(@gmdate($date_cache[$format]['format_short'], $gmepoch + $zone_offset), $date_cache[$format]['lang'])); 
     1209                } 
     1210        } 
     1211 
     1212        return strtr(@gmdate($date_cache[$format]['format_long'], $gmepoch + $zone_offset), $date_cache[$format]['lang']); 
    11531213} 
    11541214 
  • index.php

    r299 r300  
    196196                        else { 
    197197                                $template->assign_block_vars("poll.no_voted", array( 
    198                                         'S_FORM_ACTION' => append_sid('index.php') 
     198                                        'S_FORM_ACTION' => append_sid($root_path . 'index.php') 
    199199                                )); 
    200200 
     
    329329                // www.phpBB-SEO.com SEO TOOLKIT END 
    330330 
    331                 $description = censor_text($row['description']); 
    332                 $bb_code->parse($description); 
     331                $bb_code->parse($row['description']); 
    333332             $description = $bb_code->get_html(); 
     333             $description = censor_text($description); 
    334334 
    335335                $template->assign_block_vars('releases.releases_row', array( 
  • languages/lang_english/lang_admin.php

    r269 r300  
    979979        'template_preview' => 'Template preview', 
    980980        'template_edit' => 'Template editing', 
    981            'template_edit_help' => 'Здесь РІС‹ можете создать шаблон для категории. Р В РІР‚в„ўР РЋРІР‚в„– можете использовать любой bb-РєРѕРґ. Для использования значений РёР· полей формы используйте название поля Р С‘ слово value, например как Обложка.value. Для полей типа select РІС‹ можете использовать переменную value2, Р Р† этом случае будет использовано значение используемое меж тегов option, Р В Р’В° Р Р…Р Вµ value тега option. Для создания тега select Р РЋР С“ разными значениями Р Р† value option Р С‘ меж option используйте конструкцию РІРёРґР° "Да [YES]; Нет [NO]", то есть Р Р† квадратных скобках указывайте текст, который должен быть меж тегов option.', 
    982         'name_help' => 'Название поля так, как РѕРЅРѕ будет показано Р Р† шаблоне', 
     981           'template_edit_help' => 'Здесь РІС‹ можете создать шаблон для категории. Р В РІР‚в„ўР РЋРІР‚в„– можете использовать любой bb-РєРѕРґ. Для использования значений РёР· полей формы используйте название поля Р С‘ слово value, например как Обложка.value. Для полей типа select РІС‹ можете использовать переменную value2, Р Р† этом случае будет использовано значение используемое меж тегов option, Р В Р’В° Р Р…Р Вµ value тега option. Для создания тега select Р РЋР С“ разными значениями Р Р† value option Р С‘ меж option используйте конструкцию РІРёРґР° "Да [YES]; Нет [NO]", то есть Р Р† квадратных скобках указывайте текст, который должен быть меж тегов option.', 
     982        'name_help' => 'Название поля так, как РѕРЅРѕ будет показано Р Р† шаблоне', 
    983983           'default_value' => 'Default value', 
    984         'default_value_help' => 'Это значение будет Р С—Р С• умолчанию Р Р† поле шаблона. Для поля типа select укажите РІСЃРµ значения, разделяя РёС… ;', 
    985         'note_help' => 'Этот текст будет показ около поля', 
     984        'default_value_help' => 'Это значение будет Р С—Р С• умолчанию Р Р† поле шаблона. Для поля типа select укажите РІСЃРµ значения, разделяя РёС… ;', 
     985        'note_help' => 'Этот текст будет показ около поля', 
    986986        'must_be_filled' => 'Required', 
    987         'must_be_filled_help' => 'Если РІС‹ поставите здесь галочку, то пользователь будет обязан заполнить это поле', 
     987        'must_be_filled_help' => 'Если РІС‹ поставите здесь галочку, то пользователь будет обязан заполнить это поле', 
    988988        'add_new_field' => 'Add new field', 
    989989        'show_at' => 'Show at', 
     
    11081108 
    11091109 
    1110         'tags_settings' => 'Настройки тегов', 
    1111         'tags_max_allow' => 'Максимальное количество тегов', 
    1112         'tags_max_allow_explain' => 'Максимальное количество тегов, которое может поставить один пользователь для одной раздачи', 
    1113         'tags_max_length' => 'Максимальная длинна тега', 
    1114         'tags_max_length_explain' => 'Максимальная длинна тега (в символах)', 
    1115         'tags_min_length' => 'Минимальная длинна тега', 
    1116         'tags_min_length_explain' => 'Минимальная длинна тега (в символах). Не ставьте значение менее 3 символов, они все равно не будут работать в поиске.', 
     1110        'tags_settings' => 'Настройки тегов', 
     1111        'tags_max_allow' => 'Максимальное количество тегов', 
     1112        'tags_max_allow_explain' => 'Максимальное количество тегов, которое может поставить РѕРґРёРЅ пользователь для РѕРґРЅРѕР№ раздачи', 
     1113        'tags_max_length' => 'Максимальная длинна тега', 
     1114        'tags_max_length_explain' => 'Максимальная длинна тега (РІ символах)', 
     1115        'tags_min_length' => 'Минимальная длинна тега', 
     1116        'tags_min_length_explain' => 'Минимальная длинна тега (РІ символах). РќРµ ставьте значение менее 3 символов, РѕРЅРё РІСЃРµ равно РЅРµ Р±СѓРґСѓС‚ работать РІ РїРѕРёСЃРєРµ.', 
     1117 
     1118 
     1119        'smtp_auth_method'                              => 'Метод аутентификации для SMTP', 
     1120        'smtp_auth_method_explain'              => 'Используется только в случае, если заданы имя/пароль. Спросите у своего провайдера, если не уверены, какой метод аутентификации использовать.', 
     1121        'smtp_cram_md5'                                 => 'CRAM-MD5', 
     1122        'smtp_digest_md5'                               => 'DIGEST-MD5', 
     1123        'smtp_login'                                    => 'LOGIN', 
     1124        'smtp_plain'                                    => 'PLAIN', 
     1125        'smtp_pop_before_smtp'                  => 'POP-BEFORE-SMTP', 
    11171126 
    11181127)); 
  • languages/lang_english/lang_faq.php

    r245 r300  
    137137        ), 
    138138        array( 
     139                0 => 'Что такое bbcode (бибикод) и какие есть теги на сайте?', 
     140                1 => 'BBcode это специальный язык разметки для форматирования сообщений. Список поодерживаемых тегов вы можете узнать, пройдя по этой ссылке - <a href="' . append_sid($root_path . 'faq.php?mode=tags') . '">Полный список тегов</a>', 
     141        ), 
     142        array( 
    139143                0 => '--', 
    140144                1 => 'Statistics' 
     
    191195        array( 
    192196                0 => 'For those that are interested (&quot;the anatomy&quot; of a torrent session)', 
    193                 1 => 'Some information about &quot;the anatomy&quot; torrent session&quot; you can find <a href="?mode=anatomy">here</a>.' 
     197                1 => 'Some information about &quot;the anatomy&quot; torrent session&quot; you can find <a href="' . append_sid($root_path . 'faq.php?mode=anatomy') . '">here</a>.' 
    194198        ), 
    195199 
     
    224228        array( 
    225229                0 => 'What do I do with files donwloaded form the tracker?', 
    226                 1 => 'You will probably find the answer <a href="?mode=formats">here</a>.' 
     230                1 => 'You will probably find the answer <a href="' . append_sid($root_path . 'faq.php?mode=formats') . '">here</a>.' 
    227231        ), 
    228232        array( 
    229233                0 => 'You want to download a movie, but don\'t know what CAMRip, TS, TC, DVDScr in the description of the torrent mean?', 
    230                 1 => 'You should go <a href="?mode=videoformats">here</a>.' 
     234                1 => 'You should go <a href="' . append_sid($root_path . 'faq.php?mode=videoformats') . '">here</a>.' 
    231235        ), 
    232236        array( 
    233237                0 => 'Why did the torrent that was just active all of a sudden dissapear?!', 
    234238                1 => 'There could be several reasons: :<br /> 
    235                       1) the torrent didn\'t comply with the <a href="' . append_sid('rules.php') . '">rules</a>.<br /> 
     239                      1) the torrent didn\'t comply with the <a href="' . append_sid($root_path . 'rules.php') . '">rules</a>.<br /> 
    236240                      2) the uploader deleted it because the release was of a low quality. It is possible that it will be substituted with a differet release later.<br /> 
    237241                      3) torrents are automatically deleted after TTL (Time to Live).' 
  • languages/lang_english/lang_main.php

    r299 r300  
    397397        'refresh' => 'Refresh', 
    398398        'description' => 'Description', 
    399         'html_not_allowed' => 'HTML isn\'t allowed. Click <a href="tags.php">here</a> to see allowed tags', 
     399        'html_not_allowed' => 'HTML isn\'t allowed. Click <a href="' . append_sid($root_path . 'faq.php?mode=tags') . '">here</a> to see allowed tags', 
    400400        'visible' => 'Visible', 
    401401        'visible_on_main_page' => 'Visible on main page', 
     
    12611261        'show_only_my_cats' => 'Показывать только мои категории', 
    12621262 
     1263 
     1264        'show_profile' => 'Показать профиль', 
     1265        'search_torrents' => 'Поиск торрентов', 
     1266        'kick_user' => 'Кикнуть пользователя', 
     1267        'ban_user' => 'Забанить пользователя', 
     1268        'invalid_receiver_name' => 'неверное имя получателя', 
     1269        'private_message_for' => 'приватное сообщение для', 
     1270        'private_message_from' => 'приватное сообщение от', 
     1271        'you_have_been_kicked' => 'вы были кикнуты', 
     1272        'user_kicked' => 'Пользователь %s кикнут', 
     1273        'user_banned' => 'Пользователь %s забанен', 
     1274        'banned_users_in_chat' => 'Забанненные пользователи в чате', 
     1275        'user_banned_until' => 'Пользователь %s забанен до %s', 
     1276        'you_have_been_kicked' => 'вы были кикнуты', 
     1277        'you_have_been_banned_in_chat' => 'Вы забанены в чате', 
     1278        'you_have_been_banned_in_chat_until' => 'Вы забанены в чате до %s', 
     1279 
     1280        'tag' => 'Тэг', 
     1281        'other_tags' => 'Другие теги', 
     1282 
    12631283        'translated_by' => 'Translation to english made by %s', 
    12641284)); 
  • languages/lang_russian/lang_admin.php

    r269 r300  
    10971097        'tags_min_length_explain' => 'Минимальная длинна тега (в символах). Не ставьте значение менее 3 символов, они все равно не будут работать в поиске.', 
    10981098 
     1099        'smtp_auth_method'                              => 'Метод аутентификации для SMTP', 
     1100        'smtp_auth_method_explain'              => 'Используется только в случае, если заданы имя/пароль. Спросите у своего провайдера, если не уверены, какой метод аутентификации использовать.', 
     1101        'smtp_cram_md5'                                 => 'CRAM-MD5', 
     1102        'smtp_digest_md5'                               => 'DIGEST-MD5', 
     1103        'smtp_login'                                    => 'LOGIN', 
     1104        'smtp_plain'                                    => 'PLAIN', 
     1105        'smtp_pop_before_smtp'                  => 'POP-BEFORE-SMTP', 
     1106 
    10991107)); 
    11001108?> 
  • languages/lang_russian/lang_faq.php

    r280 r300  
    150150        ), 
    151151        array( 
     152                0 => 'Что такое bbcode (бибикод) и какие есть теги на сайте?', 
     153                1 => 'BBcode это специальный язык разметки для форматирования сообщений. Список поодерживаемых тегов вы можете узнать, пройдя по этой ссылке - <a href="' . append_sid($root_path . 'faq.php?mode=tags') . '">Полный список тегов</a>', 
     154        ), 
     155        array( 
    152156                0 => '--', 
    153157                1 => 'Статистика' 
     
    213217        array( 
    214218                0 => 'Для интересующихся (&quot;анатомия&quot; торрент-сессии)', 
    215                 1 => 'Некоторую информацию об &quot;анатомии&quot; торрент-сессии вы можете найти <a href="' . append_sid('faq.php?mode=anatomy') . '">здесь</a>.' 
     219                1 => 'Некоторую информацию об &quot;анатомии&quot; торрент-сессии вы можете найти <a href="' . append_sid($root_path . 'faq.php?mode=anatomy') . '">здесь</a>.' 
    216220        ), 
    217221 
     
    250254        array( 
    251255                0 => 'Что мне делать с закаченными с трекера файлами?', 
    252                 1 => 'Скорее всего, ответ вы найдёте <a href="' . append_sid('faq.php?mode=formats') . '">здесь</a>.' 
     256                1 => 'Скорее всего, ответ вы найдёте <a href="' . append_sid($root_path . 'faq.php?mode=formats') . '">здесь</a>.' 
    253257        ), 
    254258        array( 
    255259                0 => 'Вы хотите скачать фильм, но не понимаете значение терминов CAMRip, TS, TC, DVDScr в описании торрента?', 
    256                 1 => 'Вам <a href="' . append_sid('faq.php?mode=videoformats') . '">сюда</a>.' 
     260                1 => 'Вам <a href="' . append_sid($root_path . 'faq.php?mode=videoformats') . '">сюда</a>.' 
    257261        ), 
    258262        array( 
    259263                0 => 'Почему торрент, только что бывший активным, вдруг исчез!?', 
    260264                1 => 'На это может быть несколько причин:<br /> 
    261                       1) торрент не соответствовал <a href="' . append_sid('rules.php') . '">правилам</a>.<br /> 
     265                      1) торрент не соответствовал <a href="' . append_sid($root_path . 'rules.php') . '">правилам</a>.<br /> 
    262266                      2) Аплодер удалил его, т.к. релиз оказался некачественным. Возможно, он будет заменён другим релизом немного позже.<br /> 
    263267                      3) торренты автоматически удаляются по истечении TTL (англ. Time to Live - время жизни).' 
  • languages/lang_russian/lang_main.php

    r299 r300  
    404404        'refresh' => 'Обновить', 
    405405        'description' => 'Описание', 
    406         'html_not_allowed' => 'HTML запрещен. Кликните <a href="tags.php">здесь</a> чтобы увидеть разрешенные теги', 
     406        'html_not_allowed' => 'HTML запрещен. Кликните <a href="' . append_sid($root_path . 'faq.php?mode=tags') . '">здесь</a> чтобы увидеть разрешенные теги', 
    407407        'visible' => 'Видимый', 
    408408        'visible_on_main_page' => 'Виден на главной странице', 
     
    12851285        'show_profile' => 'Показать профиль', 
    12861286        'search_torrents' => 'Поиск торрентов', 
     1287        'kick_user' => 'Кикнуть пользователя', 
     1288        'ban_user' => 'Забанить пользователя', 
     1289        'invalid_receiver_name' => 'неверное имя получателя', 
     1290        'private_message_for' => 'приватное сообщение для', 
     1291        'private_message_from' => 'приватное сообщение от', 
     1292        'you_have_been_kicked' => 'вы были кикнуты', 
     1293        'user_kicked' => 'Пользователь %s кикнут', 
     1294        'user_banned' => 'Пользователь %s забанен', 
     1295        'banned_users_in_chat' => 'Забанненные пользователи в чате', 
     1296        'user_banned_until' => 'Пользователь %s забанен до %s', 
     1297        'you_have_been_kicked' => 'вы были кикнуты', 
     1298        'you_have_been_banned_in_chat' => 'Вы забанены в чате', 
     1299        'you_have_been_banned_in_chat_until' => 'Вы забанены в чате до %s', 
     1300 
     1301        'tag' => 'Тэг', 
     1302        'other_tags' => 'Другие теги', 
    12871303 
    12881304        'translated_by' => 'На русский язык перевел %s', 
  • message.php

    r269 r300  
    117117                     } 
    118118             } 
    119              $body = censor_text($message['msg']); 
    120                 $bb_code->parse($body); 
     119 
     120                $bb_code->parse($message['msg']); 
    121121             $body = $bb_code->get_html(); 
     122             $body = censor_text($body); 
    122123 
    123124             $added = create_date($message['added']); 
     
    316317                                foreach ( $reply_msg AS $msg_id => $ary ) { 
    317318                                        $added = create_date($ary['added']); 
    318                                         $msg = censor_text($ary['msg']); 
    319                                         $bb_code->parse($msg); 
     319                                        $bb_code->parse($ary['msg']); 
    320320                                     $msg = $bb_code->get_html(); 
     321                                     $msg = censor_text($msg); 
    321322 
    322323                                        $template->assign_block_vars('reply_to.reply_to_row', array( 
     
    465466 
    466467                  $body = sprintf($lang['pm_message_separator'],  $orig2['name'], $message['msg']); 
    467                         $body = censor_text($body); 
    468468                        $bb_code->parse($body); 
    469469                        $body = $bb_code->get_html(); 
     470                        $body = censor_text($body); 
    470471 
    471472                  $template->assign_vars(array( 
  • offers.php

    r280 r300  
    317317                } 
    318318 
    319                 $description = censor_text($row['descr']); 
    320                 $bb_code = new bbcode($description); 
     319                $bb_code = new bbcode($row['descr']); 
    321320                $description = $bb_code->get_html(); 
     321                $description = censor_text($description); 
    322322 
    323323                $template->assign_vars(array( 
  • phpBB2/viewtopic.php

    r299 r300  
    12771277        if ($user_sig != '') 
    12781278        { 
    1279                         $user_sig = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@censor_text('\\0')", '>' . $user_sig . '<'), 1, -1)); 
     1279                        $user_sig = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#s', "\\0", '>' . $user_sig . '<'), 1, -1)); 
    12801280 
    12811281                $bb_code->parse($user_sig); 
    12821282                $user_sig = $bb_code->get_html(); 
    1283         } 
    1284  
    1285         $message = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@censor_text('\\0')", '>' . $message . '<'), 1, -1)); 
     1283                $user_sig = censor_text($user_sig); 
     1284        } 
     1285 
     1286        $message = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#s', "\\0", '>' . $message . '<'), 1, -1)); 
    12861287 
    12871288        if ( $postrow[$i]['enable_bbcode'] ) { 
    12881289                $bb_code->parse($message); 
    12891290                $message = $bb_code->get_html(); 
     1291                $message = censor_text($message); 
    12901292        } 
    12911293 
  • reports.php

    r280 r300  
    173173                                case 2: 
    174174                                        // www.phpBB-SEO.com SEO TOOLKIT BEGIN 
    175                                         if ( empty($seo->seo_url['details'][$id]) ) { 
    176                                                 $seo->seo_url['details'][$id] = $seo->set_url(censor_text($row['name']), $id, $seo->seo_static['details']); 
    177                                         } 
     175                                        $seo->set_url(censor_text($row['name']), $id, $seo->seo_static['details']); 
    178176                                        // www.phpBB-SEO.com SEO TOOLKIT END 
    179177                                break; 
  • requests.php

    r280 r300  
    320320                } 
    321321 
    322                 $description = censor_text($row['descr']); 
    323                 $bb_code = new bbcode($description); 
     322                $bb_code = new bbcode($row['descr']); 
    324323                $description = $bb_code->get_html(); 
     324                $description = censor_text($description); 
    325325 
    326326                $template->assign_vars(array( 
  • upload.php

    r293 r300  
    310310        } 
    311311 
    312         $descr = censor_text($descr); 
    313312        $bb_code = new bbcode($descr); 
    314313        $descr = $bb_code->get_html(); 
     314        $descr = censor_text($descr); 
    315315 
    316316        $template->assign_block_vars('uploading_preview', array( 
  • userdetails.php

    r291 r300  
    394394                        } 
    395395 
    396                         $comment_text = censor_text($row['comment_text']); 
    397                         $bb_code->parse($comment_text); 
     396                        $bb_code->parse($row['comment_text']); 
    398397                        $comment_text = $bb_code->get_html(); 
     398                        $comment_text = censor_text($comment_text); 
    399399 
    400400                        $template->assign_block_vars( 'viewcomm_row', array(