Changeset 269

Show
Ignore:
Timestamp:
09/28/09 13:23:52 (3 years ago)
Author:
Nafania
Message:

Большое обновление всякого разного.
Новые запросы к базе начинаются с 390-393 строк.
Новая система bbcode, добавлены теги раздач (настройки в админке).
Чуть изменен режим работы заливки.
Подходим к вопросу об использовании xbtt.
Итд итп.

Files:

Legend:

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

    r245 r269  
    8787                        $file = substr($file, 0, strpos($file, '.php')); 
    8888                        $valid_modes[] = $file; 
     89                        @include($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_admin_' . $file . '.php'); 
    8990                        require($include_dir . $file . '.php'); 
    9091                } 
     
    101102} 
    102103else { 
     104        @include($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_admin_' . $mode . '.php'); 
    103105        require($include_dir . $mode . '.php'); 
    104106} 
     
    145147                        $new_config['email_function_name'] = (empty($new_config['email_function_name']) || !function_exists($new_config['email_function_name'])) ? 'mail' : $new_config['email_function_name']; 
    146148                        $config_value = $new_config['email_function_name']; 
    147                 break; 
    148  
    149                 case 'torrent_dir': 
    150                         $new_config['torrent_dir'] = ( empty($new_config['torrent_dir']) || $new_config['torrent_dir'] == '/' ? '/torrents' : $new_config['torrent_dir'] ); 
    151                         $config_value = $new_config['torrent_dir']; 
    152149                break; 
    153150 
  • admin/admin_categories.php

    r266 r269  
    7979 
    8080        case 'edit_template': 
    81                 @require($root_path . 'include/functions_post.php'); 
     81                require ($root_path . 'include/bbcode/bbcode.lib.php'); 
     82 
    8283                $cats = $cache->obtain_cats(); 
    8384 
     
    241242                $cat_parent_name = ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_name']) ? $cats[$cats[$cat_id]['cat_parent']]['cat_name'] . ' -> ' : '' ); 
    242243 
     244                $template_edit_content = $preview_view; 
     245 
     246                $bb_code = new bbcode($preview_view); 
     247                $preview_view = $bb_code->get_html(); 
     248 
    243249                $template->assign_vars(array( 
    244                                 'PREVIEW_VIEW' => format_comment($preview_view)
    245                                 'TEMPLATE_EDIT_CONTENT' => $preview_view
     250                                'PREVIEW_VIEW' => $preview_view
     251                                'TEMPLATE_EDIT_CONTENT' => $template_edit_content
    246252                                'CAT_ID' => $cat_id, 
    247253                                'S_TRACKER_CATEGORY_EDITING' => sprintf($lang['tracker_category_editing'], $cat_parent_name . $cats[$cat_id]['cat_name']), 
     
    671677                        $no_page_header = true; 
    672678 
    673                         @require($root_path . 'include/functions_post.php'); 
     679                        require ($root_path . 'include/bbcode/bbcode.lib.php'); 
    674680 
    675681                        $cat_id = request_var('cat_id', 0); 
     
    763769                        $name_content = str_replace($find, $replace, trim($name_content)); 
    764770 
     771                        $bb_code = new bbcode($preview_view); 
     772                        $preview_view = $bb_code->get_html(); 
     773 
    765774                        $template->assign_vars(array( 
    766                                         'PREVIEW_VIEW' => format_comment($preview_view)
     775                                        'PREVIEW_VIEW' => $preview_view
    767776                                        'TEMPLATE_EDIT_CONTENT' => $preview_view, 
    768777                                        'TEMPLATE_NAME_CREATOR_VALUE' => $name_content 
  • admin/admin_news.php

    r266 r269  
    1414require ($root_path . 'extension.inc'); 
    1515require ('./pagestart.' . $phpEx); 
    16 require ($root_path . 'include/functions_post.php'); 
     16require ($root_path . 'include/bbcode/bbcode.lib.php'); 
    1717 
    1818$action = request_var('action', ''); 
     
    190190                        } 
    191191 
    192                         $body = format_comment($row['body']); 
     192                        $bb_code = new bbcode($body); 
     193                        $body = $bb_code->get_html(); 
     194 
    193195               $body .= '<br /><i>' . sprintf($lang['news_view_by_classes'], $classes) . '</i>'; 
    194196               $added = create_date($row['added']); 
  • admin/admin_statistics.php

    r266 r269  
    213213                'PAGE_DETAILS' => $page_detail, 
    214214                'TIMESCALE' =>  ($_POST['timescale'] == 'daily' ? $lang['daily'] : ( $_POST['timescale'] == 'weekly' ? $lang['weekly'] : $lang['monthly'] ) ), 
    215                 'DATE_FROM' => create_date("Y M d", $from_time, 'Y M d'), 
     215                'DATE_FROM' => create_date($from_time, 'Y M d'), 
    216216                'DATE_TO' => create_date($to_time, 'Y M d') ) 
    217217        ); 
  • admin/admin_styles.php

    r247 r269  
    11<?php 
    22/*************************************************************************** 
    3  *                              admin_styles.php 
    4  *                            ------------------- 
    5  *   begin                : Thursday, Jul 12, 2001 
    6  *   copyright            : (C) 2001 The phpBB Group 
    7  *   email                : support@phpbb.com 
     3 *                           admin_styles.php 
     4 *                         ------------------- 
     5 *   begin             : Thursday, Jul 12, 2001 
     6 *   copyright     : (C) 2001 The phpBB Group 
     7 *   email             : support@phpbb.com 
    88 * 
    99 *   $Id: admin_styles.php,v 1.27.2.15 2005/10/04 21:45:02 grahamje Exp $ 
     
    2323if( !empty($setmodules) ) 
    2424{ 
    25         $file = basename(__FILE__); 
    26         $module['styles']['add_new'] = "$file?mode=addnew"; 
    27         $module['styles']['manage'] = $file; 
    28         $module['styles']['export'] = "$file?mode=export"; 
    29         return; 
     25       $file = basename(__FILE__); 
     26       $module['styles']['add_new'] = "$file?mode=addnew"; 
     27       $module['styles']['manage'] = $file; 
     28       $module['styles']['export'] = "$file?mode=export"; 
     29       return; 
    3030} 
    3131 
     
    4949if ($cancel) 
    5050{ 
    51         redirect('admin/' . append_sid("admin_styles.$phpEx")); 
     51       redirect('admin/' . append_sid("admin_styles.$phpEx")); 
    5252} 
    5353 
    5454if( isset($_GET['mode']) || isset($_POST['mode']) ) 
    5555{ 
    56         $mode = ( isset($_GET['mode']) ) ? $_GET['mode'] : $_POST['mode']; 
    57         $mode = htmlspecialchars($mode); 
     56       $mode = ( isset($_GET['mode']) ) ? $_GET['mode'] : $_POST['mode']; 
     57       $mode = htmlspecialchars($mode); 
    5858} 
    5959else 
    6060{ 
    61         $mode = ""; 
     61       $mode = ""; 
    6262} 
    6363 
    6464switch( $mode ) 
    6565{ 
    66         case "addnew": 
    67                 $install_to = ( isset($_GET['install_to']) ? urldecode($_GET['install_to']) : ( isset($_POST['install_to']) ? urldecode($_POST['install_to']) : '' ) ); 
    68                 $style_name = ( isset($_GET['style']) ? urldecode($_GET['style']) : ( isset($_POST['style']) ? urldecode($_POST['style']) : '' ) ); 
    69  
    70                 if( $install_to ) 
    71                 { 
    72  
    73                         @include($root_path. "templates/" . basename($install_to) . "/theme_info.cfg"); 
    74  
    75                         $template_name = $$install_to; 
    76  
    77                         if ( is_array($template_name) ) { 
    78                                 foreach ( $template_name AS $key => $val ) { 
    79                                         $db_data[$key] = $val; 
    80                                          } 
    81  
    82                                 $sql = "INSERT INTO " . THEMES_TABLE . " " . $db->sql_build_array('INSERT', $db_data); 
    83  
    84                                 $result = $db->sql_query($sql); 
    85  
    86                                 $message = $lang['theme_installed'] . "<br /><br />" . sprintf($lang['click_return_styleadmin'], "<a href=\"" . append_sid("admin_styles.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); 
    87                         } 
    88                         else { 
    89                                 $message = $lang['invalid_data'] . "<br /><br />" . sprintf($lang['click_return_styleadmin'], "<a href=\"" . append_sid("admin_styles.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); 
    90                         } 
    91  
    92                         trigger_error($message); 
    93                         return; 
    94                 } 
    95                 else 
    96                 { 
    97  
    98                         $installable_themes = array(); 
    99  
    100                         if( $dir = @opendir($root_path . "templates/") ) 
    101                         { 
    102                                 while( $sub_dir = @readdir($dir) ) 
    103                                 { 
    104                                         if( !is_file($root_path . 'templates/' .$sub_dir) && !is_link($root_path . 'templates/' .$sub_dir) && $sub_dir != "." && $sub_dir != ".." && $sub_dir != "CVS" && $sub_dir != "admin" && $sub_dir != "upload_templates" ) 
    105                                         { 
    106                                                 if( @file_exists($root_path. "templates/" . $sub_dir . "/theme_info.cfg") ) 
    107                                                 { 
    108                                                         @include($root_path. "templates/" . $sub_dir . "/theme_info.cfg"); 
    109                                                         for($i = 0; $i < sizeof($$sub_dir); $i++) 
    110                                                         { 
    111                                                                 $working_data = $$sub_dir; 
    112  
    113                                                                 $style_name = $working_data['style_name']; 
    114  
    115                                                                 $sql = "SELECT themes_id 
    116                                                                         FROM " . THEMES_TABLE . " 
    117                                                                         WHERE style_name = '" . $db->sql_escape($style_name) . "'"; 
    118                                                                 $result = $db->sql_query($sql); 
    119  
    120                                                                 if( !( $row = $db->sql_fetchrow($result))  ) 
    121                                                                 { 
    122                                                                         $installable_themes[$working_data['style_name']] = $working_data['template_name']; 
    123                                                                 } 
    124                                                         } 
    125                                                 } 
    126                                         } 
    127                                 } 
    128  
    129                                 $template->set_filenames(array( 
    130                                         "body" => "../admin/styles_addnew_body.tpl") 
    131                                 ); 
    132  
    133                                 $template->assign_vars(array( 
    134                                         "L_STYLES_TITLE" => $lang['styles_admin'], 
    135                                         "L_STYLES_ADD_TEXT" => $lang['styles_addnew_explain']) 
    136                                 ); 
    137  
    138                                 $i = 0; 
     66        case "addnew": 
     67                $install_to = ( isset($_GET['install_to']) ? urldecode($_GET['install_to']) : ( isset($_POST['install_to']) ? urldecode($_POST['install_to']) : '' ) ); 
     68                $style_name = ( isset($_GET['style']) ? urldecode($_GET['style']) : ( isset($_POST['style']) ? urldecode($_POST['style']) : '' ) ); 
     69 
     70                if( $install_to ) 
     71                { 
     72 
     73                        @include($root_path. "templates/" . basename($install_to) . "/theme_info.cfg"); 
     74 
     75                        $template_name = $$install_to; 
     76 
     77                        if ( is_array($template_name) ) { 
     78                                foreach ( $template_name AS $key => $val ) { 
     79                                        $db_data[$key] = $val; 
     80                                         } 
     81 
     82                                $sql = "INSERT INTO " . THEMES_TABLE . " " . $db->sql_build_array('INSERT', $db_data); 
     83 
     84                                $result = $db->sql_query($sql); 
     85 
     86                                $message = $lang['theme_installed'] . "<br /><br />" . sprintf($lang['click_return_styleadmin'], "<a href=\"" . append_sid("admin_styles.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); 
     87                        } 
     88                        else { 
     89                                $message = $lang['invalid_data'] . "<br /><br />" . sprintf($lang['click_return_styleadmin'], "<a href=\"" . append_sid("admin_styles.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); 
     90                        } 
     91 
     92                        trigger_error($message); 
     93                        return; 
     94                } 
     95                else 
     96                { 
     97 
     98                        $installable_themes = array(); 
     99 
     100                        if( $dir = @opendir($root_path . "templates/") ) 
     101                        { 
     102                                while( $sub_dir = @readdir($dir) ) 
     103                                { 
     104                                        if( !is_file($root_path . 'templates/' .$sub_dir) && !is_link($root_path . 'templates/' .$sub_dir) && $sub_dir != "." && $sub_dir != ".." && $sub_dir != "CVS" && $sub_dir != "admin" && $sub_dir != "upload_templates" ) 
     105                                        { 
     106                                                if( @file_exists($root_path. "templates/" . $sub_dir . "/theme_info.cfg") ) 
     107                                                { 
     108                                                        @include($root_path. "templates/" . $sub_dir . "/theme_info.cfg"); 
     109 
     110                                                        $working_data = $$sub_dir; 
     111 
     112                                                        $style_name = $working_data['style_name']; 
     113 
     114                                                        $sql = "SELECT themes_id 
     115                                                                        FROM " . THEMES_TABLE . " 
     116                                                                        WHERE style_name = '" . $db->sql_escape($style_name) . "'"; 
     117                                                        $result = $db->sql_query($sql); 
     118 
     119                                                        if( !$row = $db->sql_fetchrow($result) ) 
     120                                                        { 
     121                                                                $installable_themes[$style_name] = $working_data['template_name']; 
     122                                                        } 
     123                                                } 
     124                                        } 
     125                                } 
     126 
     127                                $template->set_filenames(array( 
     128                                        "body" => "../admin/styles_addnew_body.tpl") 
     129                                ); 
     130 
     131                                $template->assign_vars(array( 
     132                                        "L_STYLES_TITLE" => $lang['styles_admin'], 
     133                                        "L_STYLES_ADD_TEXT" => $lang['styles_addnew_explain']) 
     134                                ); 
     135 
     136                                $i = 0; 
    139137                                                  foreach ( $installable_themes AS $style_name => $template_name ) { 
    140138                                                          ++$i; 
    141                                         $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2']; 
    142                                         $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2']; 
    143  
    144                                         $template->assign_block_vars("styles", array( 
    145                                                 "ROW_CLASS" => $row_class, 
    146                                                 "ROW_COLOR" => "#" . $row_color, 
    147                                                 "STYLE_NAME" => $style_name, 
    148                                                 "TEMPLATE_NAME" => $template_name, 
    149  
    150                                                 "U_STYLES_INSTALL" => append_sid("admin_styles.$phpEx?mode=addnew&amp;style=" . urlencode($style_name) . "&amp;install_to=" . urlencode($template_name))) 
    151                                         ); 
    152  
    153                                
    154                                 $template->display("body"); 
    155  
    156                        
    157                         closedir($dir); 
    158                
    159                 break; 
    160  
    161         case "export"; 
    162                 if( isset($_POST['export_template']) ) 
    163                
    164                         $template_name = $_POST['export_template']; 
    165  
    166                         $sql = "SELECT * 
    167                                 FROM " . THEMES_TABLE . " 
    168                                 WHERE template_name = '" . $db->sql_escape($template_name) . "'"; 
    169                         $result = $db->sql_query($sql); 
    170  
    171                         if( $theme_rowset = $db->sql_fetchrow($result) ) { 
    172  
    173                                 $theme_data = '<?php'."\n\n"; 
    174                                 $theme_data .= "//\n// TB Dev SZ Edition auto-generated theme config file for $template_name\n// Do not change anything in this file!\n"; 
    175                                 $theme_data .= "// Creatation date: " . date('Y-m-d H:i:s') . "\n//\n\n"; 
     139                                       $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2']; 
     140                                       $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2']; 
     141 
     142                                       $template->assign_block_vars("styles", array( 
     143                                               "ROW_CLASS" => $row_class, 
     144                                               "ROW_COLOR" => "#" . $row_color, 
     145                                               "STYLE_NAME" => $style_name, 
     146                                               "TEMPLATE_NAME" => $template_name, 
     147 
     148                                               "U_STYLES_INSTALL" => append_sid("admin_styles.$phpEx?mode=addnew&amp;style=" . urlencode($style_name) . "&amp;install_to=" . urlencode($template_name))) 
     149                                       ); 
     150 
     151                               
     152                               $template->display("body"); 
     153 
     154                       
     155                       closedir($dir); 
     156               
     157               break; 
     158 
     159       case "export"; 
     160               if( isset($_POST['export_template']) ) 
     161               
     162                       $template_name = $_POST['export_template']; 
     163 
     164                       $sql = "SELECT * 
     165                               FROM " . THEMES_TABLE . " 
     166                               WHERE template_name = '" . $db->sql_escape($template_name) . "'"; 
     167                       $result = $db->sql_query($sql); 
     168 
     169                       if( $theme_rowset = $db->sql_fetchrow($result) ) { 
     170 
     171                               $theme_data = '<?php'."\n\n"; 
     172                               $theme_data .= "//\n// TB Dev SZ Edition auto-generated theme config file for $template_name\n// Do not change anything in this file!\n"; 
     173                               $theme_data .= "// Creatation date: " . date('Y-m-d H:i:s') . "\n//\n\n"; 
    176174 
    177175                                            do 
    178                                
     176                               
    179177                                                    foreach ( $theme_rowset AS $key => $val ) { 
    180178                                                            if(!intval($key) && $key != "0" && $key != "themes_id") { 
    181179                                                                    $theme_data .= '$' . $template_name . "['$key'] = \"" . addslashes($val) . "\";\n"; 
    182                                            } 
    183                                       } 
    184                                       $theme_data .= "\n"; 
    185                                
    186                                 while ( $theme_rowset = $db->sql_fetchrow($result) ) ; 
    187  
    188                                 $theme_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused! 
    189  
    190                                 @umask(0111); 
    191  
    192                                 $fp = @fopen($root_path . 'templates/' . basename($template_name) . '/theme_info.cfg', 'w'); 
    193                        
    194                         else { 
    195                                 trigger_error($lang['no_themes']); 
    196                                 return; 
    197                        
    198  
    199                         if( !$fp ) 
    200                        
    201                                 // 
    202                                 // Unable to open the file writeable do something here as an attempt 
    203                                 // to get around that... 
    204                                 // 
    205                                 $s_hidden_fields = '<input type="hidden" name="theme_info" value="' . htmlspecialchars($theme_data) . '" />'; 
    206                                 $s_hidden_fields .= '<input type="hidden" name="send_file" value="1" /><input type="hidden" name="mode" value="export" />'; 
    207  
    208                                 $download_form = '<form action="' . append_sid("admin_styles.$phpEx") . '" method="post"><input class="mainoption" type="submit" name="submit" value="' . $lang['download'] . '" />' . $s_hidden_fields; 
    209  
    210                                 $template->set_filenames(array( 
    211                                         "body" => "../admin/message_body.tpl") 
    212                                 ); 
    213  
    214                                 $template->assign_vars(array( 
    215                                         "MESSAGE_TITLE" => $lang['export_themes'], 
    216                                         "MESSAGE_TEXT" => $lang['download_theme_cfg'] . "<br /><br />" . $download_form) 
    217                                 ); 
    218  
    219                                 $template->display('body'); 
    220                                 exit(); 
    221                        
    222  
    223                         $result = @fputs($fp, $theme_data, strlen($theme_data)); 
    224                         fclose($fp); 
    225  
    226                         $message = $lang['theme_info_saved'] . "<br /><br />" . sprintf($lang['click_return_styleadmin'], "<a href=\"" . append_sid("admin_styles.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); 
    227  
    228                         trigger_error($message); 
    229                         return; 
    230  
    231                
    232                 else if( isset($_POST['send_file']) ) 
    233                
    234                         $theme_info = ( isset($_POST['theme_info']) ? trim(stripslashes($_POST['theme_info'])) : '' ); 
    235  
    236                         header("Content-Type: text/x-delimtext; name=\"theme_info.cfg\""); 
    237                         header("Content-disposition: attachment; filename=theme_info.cfg"); 
    238  
    239                         echo $theme_info; 
    240                         exit(); 
    241                
    242                 else 
    243                
    244                         $template->set_filenames(array( 
    245                                 "body" => "../admin/styles_exporter.tpl") 
    246                         ); 
    247  
    248                         if( $dir = @opendir($root_path . 'templates/') ) 
    249                        
    250                                 $s_template_select = '<select name="export_template">'; 
    251                                 while( $file = @readdir($dir) ) 
    252                                
    253                                         if( !is_file($root_path . 'templates/' . $file) && !is_link($root_path . 'templates/' .$file) && $file != "." && $file != ".." && $file != "CVS" && $file != "admin" && $file != "upload_templates" ) 
    254                                        
    255                                                 $s_template_select .= '<option value="' . $file . '">' . $file . "</option>\n"; 
    256                                        
    257                                
    258                                 $s_template_select .= '</select>'; 
    259                        
    260                         else 
    261                        
    262                                 trigger_error($lang['no_template_dir']); 
    263                                 return; 
    264                        
    265  
    266                         $template->assign_vars(array( 
    267                                 "S_EXPORTER_ACTION" => append_sid("admin_styles.$phpEx?mode=export"), 
    268                                 "S_TEMPLATE_SELECT" => $s_template_select) 
    269                         ); 
    270  
    271                         $template->display("body"); 
    272  
    273                
    274                 break; 
    275  
    276         case "delete": 
    277                 $style_id = ( isset($_GET['style_id']) ) ? intval($_GET['style_id']) : intval($_POST['style_id']); 
    278  
    279                 if( !$confirm ) 
    280                
    281                         if($style_id == $config['default_style']) 
    282                        
    283                                 trigger_error($lang['cannot_remove_style']); 
    284                                 return; 
    285                        
    286  
    287                         $hidden_fields = '<input type="hidden" name="mode" value="'.$mode.'" /><input type="hidden" name="style_id" value="'.$style_id.'" />'; 
    288  
    289                         // 
    290                         // Set template files 
    291                         // 
    292                         $template->set_filenames(array( 
    293                                 "confirm" => "../admin/confirm_body.tpl") 
    294                         ); 
    295  
    296                         $template->assign_vars(array( 
    297                                 "MESSAGE_TITLE" => $lang['confirm'], 
    298                                 "MESSAGE_TEXT" => $lang['confirm_delete_style'], 
    299  
    300                                 "S_CONFIRM_ACTION" => append_sid("admin_styles.$phpEx"), 
    301                                 "S_HIDDEN_FIELDS" => $hidden_fields) 
    302                         ); 
    303  
    304                         $template->display("confirm"); 
    305  
    306                
    307                 else 
    308                
    309                         // 
    310                         // The user has confirmed the delete. Remove the style, the style element 
    311                         // names and update any users who might be using this style 
    312                         // 
    313                         $sql = "DELETE FROM " . THEMES_TABLE . " 
    314                                 WHERE themes_id = $style_id"; 
    315                         $db->sql_query($sql); 
    316  
    317                         $sql = "UPDATE " . USERS_TABLE . " 
    318                                 SET user_style = " . $config['default_style'] . " 
    319                                 WHERE user_style = $style_id"; 
    320                         $db->sql_query($sql); 
    321  
    322                         $message = $lang['style_removed'] . "<br /><br />" . sprintf($lang['click_return_styleadmin'], "<a href=\"" . append_sid("admin_styles.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); 
    323  
    324                         trigger_error($message); 
    325                         return; 
    326                
    327                 break; 
    328  
    329         default: 
    330  
    331                 $sql = "SELECT themes_id, template_name, style_name 
    332                         FROM " . THEMES_TABLE . " 
    333                         ORDER BY template_name"; 
    334                 $result = $db->sql_query($sql); 
    335  
    336                 $template->set_filenames(array( 
    337                         "body" => "../admin/styles_list_body.tpl") 
    338                 ); 
     180                                          } 
     181                                     } 
     182                                     $theme_data .= "\n"; 
     183                               
     184                               while ( $theme_rowset = $db->sql_fetchrow($result) ) ; 
     185 
     186                               $theme_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused! 
     187 
     188                               @umask(0111); 
     189 
     190                               $fp = @fopen($root_path . 'templates/' . basename($template_name) . '/theme_info.cfg', 'w'); 
     191                       
     192                       else { 
     193                               trigger_error($lang['no_themes']); 
     194                               return; 
     195                       
     196 
     197                       if( !$fp ) 
     198                       
     199                               // 
     200                               // Unable to open the file writeable do something here as an attempt 
     201                               // to get around that... 
     202                               // 
     203                               $s_hidden_fields = '<input type="hidden" name="theme_info" value="' . htmlspecialchars($theme_data) . '" />'; 
     204                               $s_hidden_fields .= '<input type="hidden" name="send_file" value="1" /><input type="hidden" name="mode" value="export" />'; 
     205 
     206                               $download_form = '<form action="' . append_sid("admin_styles.$phpEx") . '" method="post"><input class="mainoption" type="submit" name="submit" value="' . $lang['download'] . '" />' . $s_hidden_fields; 
     207 
     208                               $template->set_filenames(array( 
     209                                       "body" => "../admin/message_body.tpl") 
     210                               ); 
     211 
     212                               $template->assign_vars(array( 
     213                                       "MESSAGE_TITLE" => $lang['export_themes'], 
     214                                       "MESSAGE_TEXT" => $lang['download_theme_cfg'] . "<br /><br />" . $download_form) 
     215                               ); 
     216 
     217                               $template->display('body'); 
     218                               exit(); 
     219                       
     220 
     221                       $result = @fputs($fp, $theme_data, strlen($theme_data)); 
     222                       fclose($fp); 
     223 
     224                       $message = $lang['theme_info_saved'] . "<br /><br />" . sprintf($lang['click_return_styleadmin'], "<a href=\"" . append_sid("admin_styles.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); 
     225 
     226                       trigger_error($message); 
     227                       return; 
     228 
     229               
     230               else if( isset($_POST['send_file']) ) 
     231               
     232                       $theme_info = ( isset($_POST['theme_info']) ? trim(stripslashes($_POST['theme_info'])) : '' ); 
     233 
     234                       header("Content-Type: text/x-delimtext; name=\"theme_info.cfg\""); 
     235                       header("Content-disposition: attachment; filename=theme_info.cfg"); 
     236 
     237                       echo $theme_info; 
     238                       exit(); 
     239               
     240               else 
     241               
     242                       $template->set_filenames(array( 
     243                               "body" => "../admin/styles_exporter.tpl") 
     244                       ); 
     245 
     246                       if( $dir = @opendir($root_path . 'templates/') ) 
     247                       
     248                               $s_template_select = '<select name="export_template">'; 
     249                               while( $file = @readdir($dir) ) 
     250                               
     251                                       if( !is_file($root_path . 'templates/' . $file) && !is_link($root_path . 'templates/' .$file) && $file != "." && $file != ".." && $file != "CVS" && $file != "admin" && $file != "upload_templates" ) 
     252                                       
     253                                               $s_template_select .= '<option value="' . $file . '">' . $file . "</option>\n"; 
     254                                       
     255                               
     256                               $s_template_select .= '</select>'; 
     257                       
     258                       else 
     259                       
     260                               trigger_error($lang['no_template_dir']); 
     261                               return; 
     262                       
     263 
     264                       $template->assign_vars(array( 
     265                               "S_EXPORTER_ACTION" => append_sid("admin_styles.$phpEx?mode=export"), 
     266                               "S_TEMPLATE_SELECT" => $s_template_select) 
     267                       ); 
     268 
     269                       $template->display("body"); 
     270 
     271               
     272               break; 
     273 
     274       case "delete": 
     275               $style_id = ( isset($_GET['style_id']) ) ? intval($_GET['style_id']) : intval($_POST['style_id']); 
     276 
     277               if( !$confirm ) 
     278               
     279                       if($style_id == $config['default_style']) 
     280                       
     281                               trigger_error($lang['cannot_remove_style']); 
     282                               return; 
     283                       
     284 
     285                       $hidden_fields = '<input type="hidden" name="mode" value="'.$mode.'" /><input type="hidden" name="style_id" value="'.$style_id.'" />'; 
     286 
     287                       // 
     288                       // Set template files 
     289                       // 
     290                       $template->set_filenames(array( 
     291                               "confirm" => "../admin/confirm_body.tpl") 
     292                       ); 
     293 
     294                       $template->assign_vars(array( 
     295                               "MESSAGE_TITLE" => $lang['confirm'], 
     296                               "MESSAGE_TEXT" => $lang['confirm_delete_style'], 
     297 
     298                               "S_CONFIRM_ACTION" => append_sid("admin_styles.$phpEx"), 
     299                               "S_HIDDEN_FIELDS" => $hidden_fields) 
     300                       ); 
     301 
     302                       $template->display("confirm"); 
     303 
     304               
     305               else 
     306               
     307                       // 
     308                       // The user has confirmed the delete. Remove the style, the style element 
     309                       // names and update any users who might be using this style 
     310                       // 
     311                       $sql = "DELETE FROM " . THEMES_TABLE . " 
     312                               WHERE themes_id = $style_id"; 
     313                       $db->sql_query($sql); 
     314 
     315                       $sql = "UPDATE " . USERS_TABLE . " 
     316                               SET user_style = " . $config['default_style'] . " 
     317                               WHERE user_style = $style_id"; 
     318                       $db->sql_query($sql); 
     319 
     320                       $message = $lang['style_removed'] . "<br /><br />" . sprintf($lang['click_return_styleadmin'], "<a href=\"" . append_sid("admin_styles.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); 
     321 
     322                       trigger_error($message); 
     323                       return; 
     324               
     325               break; 
     326 
     327       default: 
     328 
     329               $sql = "SELECT themes_id, template_name, style_name 
     330                       FROM " . THEMES_TABLE . " 
     331                       ORDER BY template_name"; 
     332               $result = $db->sql_query($sql); 
     333 
     334               $template->set_filenames(array( 
     335                       "body" => "../admin/styles_list_body.tpl") 
     336               ); 
    339337 
    340338                        $i = 0; 
    341                 while ( $row = $db->sql_fetchrow($result) ) 
    342                
    343                               ++$i; 
    344                         $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2']; 
    345                         $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2']; 
    346  
    347                         $template->assign_block_vars("styles", array( 
    348                                 "ROW_CLASS" => $row_class, 
    349                                 "ROW_COLOR" => $row_color, 
    350                                 "STYLE_NAME" => $row['style_name'], 
    351                                 "TEMPLATE_NAME" => $row['template_name'], 
    352  
    353                                 "U_STYLES_EDIT" => append_sid("admin_styles.$phpEx?mode=edit&amp;style_id=" . $row['themes_id']), 
    354                                 "U_STYLES_DELETE" => append_sid("admin_styles.$phpEx?mode=delete&amp;style_id=" . $row['themes_id'])) 
    355                         ); 
    356                
    357  
    358                 $template->display("body"); 
    359                 break; 
     339               while ( $row = $db->sql_fetchrow($result) ) 
     340               
     341                              ++$i; 
     342                       $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2']; 
     343                       $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2']; 
     344 
     345                       $template->assign_block_vars("styles", array( 
     346                               "ROW_CLASS" => $row_class, 
     347                               "ROW_COLOR" => $row_color, 
     348                               "STYLE_NAME" => $row['style_name'], 
     349                               "TEMPLATE_NAME" => $row['template_name'], 
     350 
     351                               "U_STYLES_EDIT" => append_sid("admin_styles.$phpEx?mode=edit&amp;style_id=" . $row['themes_id']), 
     352                               "U_STYLES_DELETE" => append_sid("admin_styles.$phpEx?mode=delete&amp;style_id=" . $row['themes_id'])) 
     353                       ); 
     354               
     355 
     356               $template->display("body"); 
     357               break; 
    360358} 
    361359 
    362360if (empty($_POST['send_file'])) 
    363361{ 
    364         include('./page_footer_admin.'.$phpEx); 
     362       include('./page_footer_admin.'.$phpEx); 
    365363} 
    366364 
  • admin/admin_users.php

    r266 r269  
    199199                                $sig_length_check = preg_replace('/(\[.*?)(=.*?)\]/is', '\\1]', $signature); 
    200200 
    201                                 // Only create a new bbcode_uid when there was no uid yet. 
    202                                 if ( $signature_bbcode_uid == '' ) 
    203                                 { 
    204                                         $signature_bbcode_uid = ( $config['allow_bbcode'] ) ? make_bbcode_uid() : ''; 
    205                                 } 
    206                                 $signature = prepare_message($signature, $config['allow_html'], $config['allow_bbcode'], $config['allow_smilies'], $signature_bbcode_uid); 
     201                                $signature = prepare_message($signature, $config['allow_html'], $config['allow_bbcode'], $config['allow_smilies']); 
    207202 
    208203                                if ( strlen($sig_length_check) > $config['max_sig_chars'] ) 
     
    396391                        $user_avatar = $this_userdata['avatar']; 
    397392 
    398                         $signature = ($this_userdata['user_sig_bbcode_uid'] != '') ? preg_replace('#:' . $this_userdata['user_sig_bbcode_uid'] . '#si', '', $this_userdata['user_sig']) : $this_userdata['user_sig']; 
     393                        $signature = $this_userdata['user_sig']; 
    399394                        $signature = preg_replace($html_entities_match, $html_entities_replace, $signature); 
    400395 
  • admin/admin_voting.php

    r222 r269  
    3636require('./pagestart.' . $phpEx); 
    3737include($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_admin_voting.' . $phpEx); 
    38 include($root_path . 'include/functions_post.' . $phpEx); 
    3938 
    4039if ( isset($_GET['action']) && $_GET['action'] == 'show_voted_users' ) { 
     
    410409                $topic_row_color = (($i % 2) == 0) ? $theme['td_class1'] : $theme['td_class2']; 
    411410                $vote_id = $row['vote_id']; 
    412                 $vote_text = ( $row['topic_id'] ? $row['vote_text'] : '<b>' . format_comment($row['vote_text']) . '</b>' ); 
     411                $vote_text = ( $row['topic_id'] ? $row['vote_text'] : '<b>' . $row['vote_text'] . '</b>' ); 
    413412                $topic_id = $row['topic_id']; 
    414413                $vote_start = $row['vote_start']; 
     
    470469 
    471470                                $template->assign_block_vars("viewresult.votes.detail", array( 
    472                                         'OPTION' => censor_text(format_comment($option_text)), 
     471                                        'OPTION' => censor_text($option_text), 
    473472                                        'RESULT' => $option_result, 
    474473                                        'USER' => $user ) 
  • ajax.php

    r266 r269  
    199199        case 'preview': 
    200200 
    201                 require_once ($root_path . 'include/functions_post.php'); 
     201                require_once ($root_path . 'include/bbcode/bbcode.lib.php'); 
    202202 
    203203                $name = request_var('name', ''); 
     
    208208 
    209209                $name = ( !empty($name) ? censor_text($name) : $lang['preview'] ); 
    210                 $message = format_comment(censor_text($message)); 
     210 
     211                $message = censor_text($message); 
     212                $bb_code = new bbcode($message); 
     213                $message = $bb_code->get_html(); 
    211214 
    212215                $template->set_filenames(array( 
     
    227230        case 'edit_template_preview': 
    228231 
    229                 require_once ($root_path . 'include/functions_post.php'); 
     232                require_once ($root_path . 'include/bbcode/bbcode.lib.php'); 
    230233 
    231234                $template_prev = request_var('template', ''); 
     
    235238                ); 
    236239 
     240                $bb_code = new bbcode($template_prev); 
     241                $template_prev = $bb_code->get_html(); 
     242 
    237243                $template->assign_vars(array( 
    238                                 'PREVIEW_VIEW' => format_comment($template_prev)
     244                                'PREVIEW_VIEW' => $template_prev
    239245                ); 
    240246 
     
    243249                return $_RESULT = array( 'tpl' => $tpl ); 
    244250 
     251        break; 
     252 
     253        case 'update_tag': 
     254                $name = request_var('tag_name', ''); 
     255                $tag_type = request_var('tag_type', TYPE_TORRENT); 
     256                $id = request_var('id', 0); 
     257                $type = request_var('type', ''); 
     258 
     259                if ( !$name ) { 
     260                        return; 
     261                } 
     262 
     263                if ( strpos($name, ',') !== false ) { 
     264                        $name = explode(',', $name); 
     265                } 
     266                else { 
     267                        $name = array($name); 
     268                } 
     269 
     270                if ( $config['tags_max_allow'] ) { 
     271                        $sql = 'SELECT COUNT(*) AS count FROM ' . TAGS_USERS_TABLE . ' WHERE tag_users_uid = ' . $userdata['uid'] . ' AND tag_users_for_id = ' . $id . ' AND tag_users_type = ' . $tag_type; 
     272                        $result = $db->sql_query($sql); 
     273                        $count = ( $row = $db->sql_fetchrow($result) ) ? $row['count'] : 0; 
     274 
     275                        if ( $count >= $config['tags_max_allow'] || ( ( sizeof($name) + $count ) >= $config['tags_max_allow'] ) ) { 
     276                                return $_RESULT = array( 'message' => sprintf($lang['no_more_tags_allowed'], $config['tags_max_allow']) ); 
     277                        } 
     278                } 
     279 
     280                $message = ''; 
     281                $tags = ''; 
     282 
     283                foreach ( $name AS $_null => $tag_name ) { 
     284                        $tag_name = trim($tag_name); 
     285                        $tag_name = preg_replace('/[\.,:\^]/', '', $tag_name); 
     286                        $tag_length = utf_strlen($tag_name); 
     287 
     288                        if ( $config['tags_max_length'] && $tag_length > $config['tags_max_length'] ) { 
     289                                $message .= sprintf($lang['tag_is_too_short_or_long'], $tag_name, $config['tags_min_length'], $config['tags_max_length']); 
     290                                continue; 
     291                        } 
     292 
     293                        if ( $config['tags_min_length'] && $tag_length < $config['tags_min_length'] ) { 
     294                                $message .= sprintf($lang['tag_is_too_short_or_long'], $tag_name, $config['tags_min_length'], $config['tags_max_length']); 
     295                                continue; 
     296                        } 
     297 
     298                        //get info for this tag and user from db -> mb user already voted for this tag? 
     299 
     300                        $sql = 'SELECT * 
     301                                        FROM ' . TAGS_USERS_TABLE . ' 
     302                                        WHERE tag_users_uid = ' . $userdata['uid'] . ' 
     303                                        AND tag_users_for_id = ' . $id . ' 
     304                                        AND tag_users_type = ' . $tag_type . ' 
     305                                        AND tag_users_name = \'' . $db->sql_escape($tag_name) . '\''; 
     306                        $result = $db->sql_query($sql); 
     307 
     308                        if ( $row = $db->sql_fetchrow($result) ) { 
     309                                $message = $lang['dupe_vote']; 
     310                        } 
     311                        else { 
     312                                if ( $type == 'down' ) { 
     313                                        $sql = 'SELECT tag_count 
     314                                                        FROM ' . TAGS_TABLE . ' 
     315                                                        WHERE tag_name = \'' . $db->sql_escape($tag_name) . '\' 
     316                                                        AND tag_type = ' . $tag_type . ' 
     317                                                        AND tag_for_id = ' . $id; 
     318                                        $result = $db->sql_query($sql); 
     319                                        $tag_count = ( $row = $db->sql_fetchrow($result) ) ? $row['tag_count'] : false; 
     320 
     321                                        if ( $tag_count <= 1 && $tag_count !== false ) { 
     322                                                $sql = 'DELETE 
     323                                                                FROM ' . TAGS_TABLE . ' 
     324                                                                WHERE tag_name = \'' . $db->sql_escape($tag_name) . '\' 
     325                                                                AND tag_type = ' . $tag_type . ' 
     326                                                                AND tag_for_id = ' . $id; 
     327                                                $lets_insert = false; 
     328                                        } 
     329                                        else { 
     330                                                $sql = 'UPDATE ' . TAGS_TABLE . ' 
     331                                                                SET tag_count = tag_count - 1 
     332                                                                WHERE tag_name = \'' . $db->sql_escape($tag_name) . '\' 
     333                                                                AND tag_type = ' . $tag_type . ' 
     334                                                                AND tag_for_id = ' . $id; 
     335                                                $lets_insert = true; 
     336                                        } 
     337 
     338                                        $db->sql_query($sql); 
     339                                } 
     340                                else { 
     341                                        $sql = 'UPDATE ' . TAGS_TABLE . ' 
     342                                                        SET tag_count = tag_count + 1 
     343                                                        WHERE tag_name = \'' . $db->sql_escape($tag_name) . '\' 
     344                                                        AND tag_type = ' . $tag_type . ' 
     345                                                        AND tag_for_id = ' . $id; 
     346                                        $db->sql_query($sql); 
     347                                        $lets_insert = true; 
     348                                } 
     349 
     350                                //we using LOWER function in mysql, not in php - it's not a mistake! 
     351                                // new tag, let's insert 
     352                                if ( !$db->sql_affectedrows() && $lets_insert ) { 
     353                                        $sql = 'INSERT INTO ' . TAGS_TABLE . ' VALUES (LOWER(\'' . $db->sql_escape($tag_name) . '\'), ' . $tag_type . ', ' . $id . ', 1)'; 
     354                                        $db->sql_query($sql); 
     355 
     356                                        $tags .= ' <a href="' . append_sid($root_path . 'browse.php?search_in=3&amp;search=' . $tag_name) . '">' . $tag_name . '</a>'; 
     357                                } 
     358 
     359                                $sql = 'INSERT INTO ' . TAGS_USERS_TABLE . ' VALUES (' . $userdata['uid'] . ', ' . $id . ', ' . $tag_type . ', LOWER(\'' . $db->sql_escape($tag_name) . '\'))'; 
     360                                $db->sql_query($sql); 
     361 
     362                                //$message .= sprintf($lang['tag_added'], $tag_name) . "\n"; 
     363                        } 
     364                } 
     365 
     366                return $_RESULT = array( 'message' => $message, 'tags' => $tags ); 
     367        break; 
     368 
     369        case 'autocomplete_tags': 
     370                $tag_name = request_var('q', ''); 
     371 
     372                $tag_length = utf_strlen($tag_name); 
     373 
     374                if ( $tag_length < $config['tags_min_length'] ) { 
     375                        return false; 
     376                } 
     377                else { 
     378                        $sql = 'SELECT SUM(tag_count) AS sum, tag_name 
     379                                        FROM ' . TAGS_TABLE . ' 
     380                                        WHERE tag_name LIKE \'' . $db->sql_escape($tag_name) . '%\' 
     381                                        GROUP BY tag_name 
     382                                        ORDER BY sum DESC'; 
     383                        $result = $db->sql_query($sql); 
     384 
     385                        while ( $row = $db->sql_fetchrow($result) ) { 
     386                                echo $row['tag_name'] . "\n"; 
     387                        } 
     388                } 
    245389        break; 
    246390 
  • announce.php

    r241 r269  
    33$root_path = './'; 
    44require ($root_path . 'include/config.php'); 
    5 require ($root_path . 'include/benc.php'); 
     5require ($root_path . 'include/functions_announce.php'); 
    66require ($root_path . '/languages/lang_' . $config['default_lang'] . '/lang_announce.php'); 
    77 
  • bookmarks.php

    r266 r269  
    1515 
    1616if ( $tor_id ) { 
    17         $sql = 'SELECT name FROM ' . TORRENTS_TABLE . ' WHERE fid = ' . $tor_id; 
     17        $sql = 'SELECT name, category FROM ' . TORRENTS_TABLE . ' WHERE fid = ' . $tor_id; 
    1818        $result = $db->sql_query($sql); 
    1919 
     
    2121                trigger_error(sprintf($lang['invalid_id'],$tor_id)); 
    2222        } 
     23 
     24        $cats = $cache->obtain_cats(); 
     25        $cat_id = $row['category']; 
     26        $cat_parent_id = ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_id']) ? $cats[$cats[$cat_id]['cat_parent']]['cat_id'] : 0 ); 
    2327 
    2428 
     
    102106list($pagertop, $pagerbottom, $limit) = pager($torrentsperpage, $count, 'bookmarks.php?'); 
    103107 
    104 $sql = 'SELECT b.id AS bookmarkid, u.name AS username, u.uid AS owner, u.privacy, t.fid, t.category, t.leechers, t.seeders, t.name, t.completed, t.free, t.size, t.ctime, t.comments, t.numfiles, t.filename, t.owner, t.hidden, t.numratings, t.ratingsum, t.save_as, t.numfiles, t.filename, t.size, t.completed, t.category, t.hidden, t.moderated, t.banned 
     108$sql = 'SELECT b.id AS bookmarkid, u.name AS username, u.uid AS owner, u.privacy, t.fid, t.category, t.leechers, t.seeders, t.name, t.completed, t.free, t.size, t.ctime, t.comments, t.numfiles, t.filename, t.owner, t.hidden, t.numratings, t.ratingsum, t.save_as, t.numfiles, t.filename, t.size, t.completed, t.category, t.moderated, t.banned 
    105109        FROM ' . BOOKMARKS_TABLE . ' b, ' . TORRENTS_TABLE . ' t, ' . USERS_TABLE . ' u 
    106110        WHERE b.userid = ' . $userdata['uid'] . ' AND b.torrentid = t.fid AND t.owner = u.uid ' . $orderby . ' ' . $limit; 
  • browse.php

    r266 r269  
    278278} 
    279279 
    280  
    281  
    282280if ( isset($cleansearchstr) || $search_id ) { 
    283281 
     
    302300     if ( !$search_id ) { 
    303301             switch ( $search_in ) { 
     302                     case 3: 
     303                             $where_search = 'tg.tag_name'; 
     304                             $sql = 'SELECT t.fid AS id FROM ' . TORRENTS_TABLE . ' t LEFT JOIN ' . TAGS_TABLE . ' tg ON (t.fid = tg.tag_for_id)'; 
     305                             $cats_sql[] = 'tg.tag_type = ' . TYPE_TORRENT; 
     306                             $strict = true; 
     307                     break; 
     308 
    304309                     case 2: 
    305310                             $where_search = 't.descr'; 
     311                             $sql = 'SELECT t.fid AS id FROM ' . TORRENTS_TABLE . ' t'; 
     312                             $strict = false; 
    306313                     break; 
    307314 
    308315                     default: 
    309316                             $where_search = 't.name'; 
     317                             $sql = 'SELECT t.fid AS id FROM ' . TORRENTS_TABLE . ' t'; 
     318                             $strict = false; 
    310319                     break; 
    311320             } 
    312              $search_ids = search_text_in_db($searchstr, 'SELECT t.fid AS id FROM ' . TORRENTS_TABLE . ' t', $where_search, $cats_sql); 
     321 
     322             $search_ids = search_text_in_db($searchstr, $sql, $where_search, $cats_sql, $strict); 
    313323 
    314324                if ( sizeof($search_ids) ) { 
     
    413423$incldead_select .= '</select>'; 
    414424 
     425$search_in_ary = array(1 => $lang['name'], 2 => $lang['description'], 3 => $lang['tags']); 
     426$search_in_select  = '<select name="search_in">'; 
     427foreach ( $search_in_ary AS $_key => $_val ) { 
     428        $search_in_select .= '<option value="' . $_key . '"' . ( $search_in === $_key ? ' selected="selected"' : '' ) . '>' . $_val . '</option>'; 
     429} 
     430$search_in_select .= '</select>'; 
     431 
    415432if ( $page ) { 
    416433        $back_url[] = 'page=' . $page; 
     
    434451        'S_BROWSE_ACTION' => append_sid($root_path . 'browse.php'), 
    435452        'U_SHOW_ALL' => append_sid($root_path . 'browse.php?all=1'), 
    436         'L_JS_SEARCH_EXPLAIN' => str_replace("'", "\'", $lang['search_explain']), 
    437453        'INCLDEAD_SELECT' => $incldead_select, 
    438         'SEARCH_IN_CHECKED_1' => ($search_in == 1 ? ' selected="selected"' : ''), 
    439         'SEARCH_IN_CHECKED_2' => ($search_in == 2 ? ' selected="selected"' : ''), 
     454        'SEARCH_IN_SELECT' => $search_in_select, 
    440455        'SEARCH_STRING' => $searchstr, 
    441456        'CAT_DROP_DOWN' => $catdropdown, 
  • chat/index.php

    r218 r269  
    99 
    1010// Show all errors: 
    11 error_reporting(E_ALL); 
     11//error_reporting(E_ALL); 
    1212 
    1313// Path to the chat directory: 
  • comment.php

    r266 r269  
    22$root_path = './'; 
    33require ($root_path . 'include/config.php'); 
     4require ($root_path . 'include/bbcode/bbcode.lib.php'); 
    45require ($root_path . 'include/functions_post.php'); 
    56 
     
    340341                } 
    341342 
    342                 $sql = 'SELECT comment_for_id FROM ' . COMMENTS_TABLE . ' WHERE comment_id = ' . $id; 
     343                $sql = 'SELECT c.comment_for_id, ' . $field . ' 
     344                                FROM ' . COMMENTS_TABLE . ' c, ' . $sql_table . ' 
     345                                WHERE c.comment_for_id = ' . $where . ' 
     346                                AND comment_id = ' . $id; 
    343347                $result = $db->sql_query($sql); 
    344348                if ( !($arr = $db->sql_fetchrow($result)) ) { 
     
    409413             $username = ( $arr['uid'] == ANONYMOUS ? $lang['unknown'] : $arr['username'] ); 
    410414 
    411              $quoted_text = '[quote=' . $username . ']' . $arr['comment_text'] . '[/quote]'; 
     415             $quoted_text = '[quote="' . $username . '"]' . $arr['comment_text'] . '[/quote]'; 
    412416 
    413417             $tpl = textbbcode(trim($quoted_text)); 
     
    439443 
    440444                if ( $row = $db->sql_fetchrow($result) ) { 
    441  
    442445                        $sql = 'SELECT COUNT(*) AS count FROM ' . COMMENTS_TABLE . ' WHERE comment_type = ' . $row['comment_type'] . ' AND comment_for_id = ' . $row['comment_for_id'] . ' AND comment_id < ' . $id; 
    443446                        $result = $db->sql_query( $sql ); 
  • db_updater.php

    r268 r269  
    393393        $db->sql_query('ALTER TABLE ' . THEMES_TABLE . ' DROP `bbcode_bitfield`'); 
    394394 
     395        $db->sql_query('UPDATE ' . POSTS_TEXT_TABLE . ' SET post_text = REPLACE( post_text, CONCAT( \':\', bbcode_uid ) , \'\' )'); 
     396        $db->sql_query('ALTER TABLE ' . POSTS_TEXT_TABLE . ' DROP bbcode_uid'); 
     397        $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_sig = REPLACE( user_sig, CONCAT( \':\', user_sig_bbcode_uid ) , \'\' )'); 
     398        $db->sql_query('ALTER TABLE ' . USERS_TABLE . ' DROP user_sig_bbcode_uid'); 
     399 
     400        $db->sql_query('UPDATE ' . POSTS_TEXT_TABLE . ' SET post_text = REPLACE( post_text, \'[color=green][size=9]\' , \'[color=green][size=1]\' )'); 
     401        $db->sql_query('UPDATE ' . COMMENTS_TABLE . ' SET comment_text = REPLACE( comment_text, \'[color=green][size=9]\' , \'[color=green][size=1]\' )'); 
     402 
     403        $sql = 'SELECT post_text, post_id FROM ' . POSTS_TEXT_TABLE . ' WHERE post_text LIKE \'%[img:%\''; 
     404        $result = $db->sql_query($sql); 
     405        while ( $row = $db->sql_fetchrow($result) ) { 
     406                $post_text = preg_replace('/\[img:([0-9]+):([0-9]+)\]/si', '[img]', $row['post_text']); 
     407                $db->sql_query('UPDATE ' . POSTS_TEXT_TABLE . ' SET post_text = \'' . $db->sql_escape($post_text) . '\' WHERE post_id = ' . $row['post_id']); 
     408        } 
     409 
     410        set_config('tags_max_allow', 10); 
     411        set_config('tags_max_length', 50); 
     412        set_config('tags_min_length', 3); 
     413 
     414        $db->sql_query('CREATE TABLE IF NOT EXISTS tags ( 
     415                  tag_name varchar(255) NOT NULL, 
     416                  tag_type tinyint(1) NOT NULL, 
     417                  tag_for_id int(10) NOT NULL, 
     418                  tag_count int(10) NOT NULL DEFAULT \'0\', 
     419                  KEY tag_type (tag_type), 
     420                  KEY tag_for_id (tag_for_id) 
     421                ) ENGINE=MyISAM DEFAULT CHARSET=utf8;'); 
     422 
     423        $db->sql_query('CREATE TABLE IF NOT EXISTS tags_users ( 
     424                  tag_users_uid int(10) NOT NULL, 
     425                  tag_users_for_id int(10) NOT NULL, 
     426                  tag_users_type tinyint(1) NOT NULL, 
     427                  tag_users_name varchar(255) NOT NULL, 
     428                  KEY tag_users_type (tag_users_type), 
     429                  KEY tag_users_for_id (tag_users_for_id), 
     430                  KEY tag_users_uid (tag_users_uid) 
     431                ) ENGINE=MyISAM DEFAULT CHARSET=utf8;'); 
     432 
     433        $db->sql_query('ALTER TABLE ' . FILES_TABLE . ' CHANGE `filename` `filename` TEXT NULL DEFAULT \'\''); 
     434        $db->sql_query('ALTER TABLE ' . FILES_TABLE . ' DROP id'); 
     435 
    395436 
    396437        $message .= 'Database updated sucefully. Now you must delete this file!'; 
  • details.php

    r266 r269  
    11<?php 
    22$root_path = './'; 
    3 require ( $root_path . 'include/config.php'); 
    4 require ( $root_path . 'include/functions_post.php'); 
    5 require ( $root_path . 'include/benc.php'); 
     3require ($root_path . 'include/config.php'); 
    64 
    75$userdata = session_pagestart( $user_ip ); 
     
    1311function dltable( $left_name, $name, $arr, $aname ) 
    1412{ 
    15         global $userdata, $template, $lang, $theme
     13        global $userdata, $template, $lang, $theme, $root_path
    1614 
    1715        $count = sizeof( $arr ); 
     
    5856                } 
    5957                else { 
    60                         $u_userdetails = append_sid('userdetails.php?id=' . $arr[$i]['uid']); 
     58                        $u_userdetails = append_sid($root_path . 'userdetails.php?id=' . $arr[$i]['uid']); 
    6159                        $username_color = get_user_class_color( $arr[$i]['class'], $arr[$i]['name'] ); 
    6260                        $username = $arr[$i]['name']; 
     
    275273                                        'USERID' => $row['userid'], 
    276274                                        'USERNAME' => get_user_class_color( $row['class'], $row['name'] ) . get_user_icons( $row ), 
    277                                         'U_USERDETAILS' => append_sid( 'userdetails.php?id=' . $row['userid'] ), 
     275                                        'U_USERDETAILS' => append_sid($root_path . 'userdetails.php?id=' . $row['userid'] ), 
    278276                                        'U_SEND_PM' => append_sid( 'message.php?action=send&amp;receiver=' . $row['userid'] ), 
    279277                                        'TOR_UPLOADED' => $uploaded, 
     
    300298                } 
    301299                break; 
     300 
     301                case 'thanks': 
     302                        $sql = 'SELECT t.userid, u.name 
     303                                        FROM ' . THANKS_TABLE . ' t, ' . USERS_TABLE . ' u 
     304                                        WHERE t.torrentid = ' . $id . ' AND t.userid = u.uid'; 
     305                        $result = $db->sql_query( $sql ); 
     306 
     307                        if ( $subrow = $db->sql_fetchrow( $result ) ) { 
     308                                $thanksby = ''; 
     309                                $thanks_userid = ''; 
     310                                do { 
     311                                        $thanksby .= ( $thanks_userid ? ', ' : '' ); 
     312                                        $thanks_userid = $subrow['userid']; 
     313                                        // www.phpBB-SEO.com SEO TOOLKIT START 
     314                                        $seo->set_user_url($subrow['name'], $thanks_userid); 
     315                                        // www.phpBB-SEO.com SEO TOOLKIT END 
     316                                        $thanksby .= '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $thanks_userid) . '">' . $subrow['name'] . '</a>'; 
     317                                } 
     318                                while ( $subrow = $db->sql_fetchrow( $result ) ); 
     319                                $db->sql_freeresult( $result ); 
     320                        } 
     321                        else { 
     322                                $thanksby = ''; 
     323                        } 
     324 
     325                        return $_RESULT = array( 'tpl' => $thanksby ); 
     326                break; 
    302327        } 
    303328} 
     
    315340 
    316341        if ( in_array($action, $files) ) { 
    317                 require_once($root_path . 'include/details/' . $action . '.php'); 
     342                require($root_path . 'include/details/' . $action . '.php'); 
    318343        } 
    319344        else { 
     
    322347} 
    323348else { 
     349        require ($root_path . 'include/bbcode/bbcode.lib.php'); 
     350        require ($root_path . 'include/functions_post.php'); 
     351 
    324352        $view = request_var('view', ''); 
    325353        $highlight = request_var('highlight', ''); 
    326354        $cats = $cache->obtain_cats(); 
     355 
    327356        if ( !$id ) { 
    328357                trigger_error( sprintf( $lang['invalid_id'], $id ) ); 
     
    350379 
    351380                $template->assign_vars( array( 
    352                         'ID' => $id, 
    353                         'L_ADD_TO_BOOKMARKS' => ( $userdata['session_logged_in'] ? $lang['add_to_bookmarks'] : '' ), 
     381                        'ID' => $id 
    354382                )); 
    355383 
     384                if ( isset($cats[$cats[$row['category']]['cat_parent']]['cat_name']) ) { 
     385                        $cat_parent = $cats[$cats[$row['category']]['cat_parent']]; 
     386 
     387                        $cat_parent_name = '<a href="' . append_sid($root_path . 'browse.php?cat=' . $cat_parent['cat_id']) . '">' . $cat_parent['cat_name'] . '</a> -> '; 
     388                } 
     389                else { 
     390                        $cat_parent_name = ''; 
     391                } 
     392 
    356393                if ( $view <> 'comments' ) { 
    357                         $template->assign_block_vars( 'torrent_details', array() ); 
    358394 
    359395                        $message1 = ''; 
     
    400436                                                $rating_options .= '<option value="' . $k . '">' . $k . ' - ' . $v . '</option>'; 
    401437                                        } 
    402                                         $template->assign_block_vars( 'torrent_details.switch_rating_form', array( 
     438                                        $template->assign_block_vars( 'switch_rating_form', array( 
    403439                                                'RATING_OPTIONS' => $rating_options 
    404440                                        )); 
     
    416452                        $owner = ( $row['owner'] ? ( $row['privacy'] == PRIVACY_LEVEL_HIGH && $userdata['class'] < UC_MODERATOR && $row['owner'] <> $userdata['uid'] ? '<i>' . $lang['anonymous'] . '</i>' : $row['owner'] ) : '<i>' . $lang['unknown'] . '</i>' ); 
    417453                        $last_activity = ( $row['mtime'] == $row['ctime'] ? $lang['none'] : sprintf( $lang['last_activity'], mkprettytime( time() - $row['mtime'] ) ) . ' (' . create_date($row['mtime']) . ')' ); 
    418                         $description = censor_text( format_comment($row['descr']) ); 
     454                        $description = censor_text($row['descr']); 
     455 
     456                        $bb_code = new bbcode($description); 
     457                        $description = $bb_code->get_html(); 
     458 
     459 
    419460                        if ( $highlight ) { 
    420461                                $description = highlight_text($highlight, $description); 
    421462                        } 
    422                         $cat_parent_name = ( isset($cats[$cats[$row['category']]['cat_parent']]['cat_name']) ? $cats[$cats[$row['category']]['cat_parent']]['cat_name'] . ' -> ' : '' ); 
     463 
     464                        $cat_name = '<a href="' . append_sid($root_path . 'browse.php?cat=' . $cats[$row['category']]['cat_id']) . '">' . $cats[$row['category']]['cat_name'] . '</a>'; 
    423465 
    424466                        $template->assign_vars( array( 
    425467                                'MESSAGE1' => $message1, 
    426468                                'MESSAGE2' => $message2, 
    427                                 'U_DETAILS' => append_sid($root_path . 'details.php?id=' . $id ), 
     469                                'U_DETAILS' => append_sid($root_path . 'details.php?id=' . $id), 
    428470                                'U_DOWNLOAD' => append_sid($root_path . 'details.php?id=' . $id . '&amp;action=download'), 
    429                                 'U_DOWNLOAD_AS_GZIP' =>  append_sid($root_path . 'details.php?id=' . $id . '&amp;action=download&amp;type=gzip' ), 
    430                                 'U_ADD_TO_BOOKMARKS' => append_sid( 'bookmarks.php?torrent=' . $id ), 
     471                                'U_DOWNLOAD_AS_GZIP' =>  append_sid($root_path . 'details.php?id=' . $id . '&amp;action=download&amp;type=gzip'), 
     472                                'U_ADD_TO_BOOKMARKS' => append_sid('bookmarks.php?torrent=' . $id ), 
    431473                                'U_VIEW_NFO' => append_sid($root_path . 'details.php?id=' . $id . '&amp;action=viewnfo'), 
    432                                 'U_VIEW_SNATCHEDLIST' => append_sid($root_path . 'details.php?id=' . $id . '&amp;view=snatchedlist' ), 
    433                                 'U_VIEW_PEERLIST' => append_sid($root_path . 'details.php?id=' . $id . '&amp;view=peerlist' ), 
    434                                 'U_VIEW_FILELIST' => append_sid($root_path . 'details.php?id=' . $id . '&amp;view=filelist' ), 
     474                                'U_VIEW_SNATCHEDLIST' => append_sid($root_path . 'details.php?id=' . $id . '&amp;view=snatchedlist'), 
     475                                'U_VIEW_PEERLIST' => append_sid($root_path . 'details.php?id=' . $id . '&amp;view=peerlist'), 
     476                                'U_VIEW_FILELIST' => append_sid($root_path . 'details.php?id=' . $id . '&amp;view=filelist'), 
    435477                                'S_EDIT_ACTION' => append_sid($root_path . 'details.php?id=' . $id . '&amp;action=edit'), 
    436478                                'SPACER' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', 
     
    439481                                'IMG_FREE' => $images['freedownload'], 
    440482                                'TORRENT_FILENAME' => htmlspecialchars( $row['filename'] ), 
    441                                 'INFO_HASH' => preg_replace_callback( '/./s', 'hex_esc', hash_pad( $row['info_hash'] ) ), 
     483                                'INFO_HASH' => preg_replace_callback('/./s', create_function('$matches','return sprintf(\'%02x\', ord($matches[0]));'), str_pad($row['info_hash'], 20) ), 
    442484                                'DESCRIPTION' => $description, 
    443485                                'BANNED' => ( $row['banned'] ? $lang['yes'] : $lang['no'] ), 
    444                                 'TYPE' => $cat_parent_name . $cats[$row['category']]['cat_name']
     486                                'TYPE' => $cat_parent_name . $cat_name
    445487                                'LAST_ACTIVITY' => $last_activity, 
    446488                                'SIZE' => mksize( $row['size'] ) . ' (' . number_format( $row['size'] ) . ' ' . $lang['bytes'] . ')', 
     
    450492                                'HITS' => $row['hits'], 
    451493                                'HIDDEN' => ( $row['hidden'] ? $lang['yes'] : $lang['no'] ), 
    452                                 'USER_UPLOADED' => ( is_numeric($owner) ? ( '<a href="' . append_sid( 'userdetails.php?id=' . $owner ) . '"><b>' . $row['username'] . '</b></a>' ) : $owner ), 
     494                                'USER_UPLOADED' => ( is_numeric($owner) ? ( '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $owner ) . '"><b>' . $row['username'] . '</b></a>' ) : $owner ), 
    453495                                'NUM_FILES' => sprintf( $lang['num_files'], $row['numfiles'] ), 
    454496                                'PEERS_COUNT' => sprintf( $lang['peers_count'], $row['seeders'], $row['leechers'], ( $row['seeders'] + $row['leechers'] ) ), 
    455497                                'REPORT' => sprintf( $lang['report_descr'], append_sid( 'reports.php?action=send_report&amp;type=torrent&amp;id=' . $id ) ), 
    456                                 'OWNER_ID' => ( is_numeric($owner) ? $owner : 0 ) 
     498                                'OWNER_ID' => ( is_numeric($owner) ? $owner : 0 ), 
     499 
     500                                'TAG_TYPE' => TYPE_TORRENT 
    457501                        )); 
    458502 
    459503                        if ( $userdata['session_logged_in'] && $userdata['class'] >= UC_ADMINISTRATOR ) { 
    460                                 $template->assign_block_vars( 'torrent_details.switch_add_to_index', array( 
     504                                $template->assign_block_vars( 'switch_add_to_index', array( 
    461505                                        'U_ADD_TO_INDEX' => append_sid( 'releases.php?action=autoadd&amp;id=' . $id ) 
    462506                                )); 
    463507                        } 
    464                         if ( trim( $row['nfo'] ) ) { 
    465                                 $template->assign_block_vars( 'torrent_details.switch_nfo_section', array() ); 
    466                         } 
    467                         if ( $userdata['class'] >= UC_MODERATOR ) { 
    468                                 $template->assign_block_vars( 'torrent_details.switch_banned_section', array() ); 
     508                        if ( $row['nfo'] ) { 
     509                                $template->assign_block_vars( 'switch_nfo_section', array() ); 
    469510                        } 
    470511                        if ( $userdata['session_logged_in'] && ( $userdata['hiddentorrents'] || $userdata['class'] >= UC_MODERATOR ) ) { 
    471                                 $template->assign_block_vars( 'torrent_details.switch_hidden_section', array() ); 
     512                                $template->assign_block_vars( 'switch_hidden_section', array() ); 
    472513                        } 
    473514 
    474515                        if ( $row['completed'] ) { 
    475                                 $template->assign_block_vars( 'torrent_details.switch_simple_snatched', array( 
     516                                $template->assign_block_vars( 'switch_simple_snatched', array( 
    476517                                        'SIMPLE_SNATCHED_COUNT' => sprintf( $lang['snatched_times'], $row['completed'] ) 
    477518                                )); 
    478519                        } 
    479520                        if ( $userdata['uid'] == $row['owner'] || $userdata['class'] >= UC_MODERATOR ) { 
    480                                 $template->assign_block_vars( 'torrent_details.switch_owner_section', array() ); 
     521                                $template->assign_block_vars( 'switch_owner_section', array() ); 
    481522                        } 
    482523 
     
    488529                                $peer_count = ( $sos_row = $db->sql_fetchrow( $result ) ) ? intval( $sos_row['peers_count'] ) : 0; 
    489530                                if ( $peer_count ) { 
    490                                         $template->assign_block_vars( 'torrent_details.switch_sos_section', array() ); 
    491                                 } 
    492                         } 
    493  
    494                         $sql = 'SELECT t.userid, u.name 
    495                                         FROM ' . THANKS_TABLE . ' t, ' . USERS_TABLE . ' u 
    496                                         WHERE t.torrentid = ' . $id . ' AND t.userid = u.uid'; 
    497                         $result = $db->sql_query( $sql ); 
    498  
    499                         if ( $subrow = $db->sql_fetchrow( $result ) ) { 
    500                                 $thanksby = ''; 
    501                                 $disabled = 'disabled="disabled"'; 
    502                                 $thanks_userid = ''; 
    503                                 $user_thanked = 0; 
     531                                        $template->assign_block_vars( 'switch_sos_section', array() ); 
     532                                } 
     533                        } 
     534 
     535                        /* start tags */ 
     536 
     537                        $sql = 'SELECT tag_name, tag_count 
     538                                        FROM ' . TAGS_TABLE . ' 
     539                                        WHERE tag_type = ' . TYPE_TORRENT . ' 
     540                                        AND tag_for_id = ' . $id; 
     541                        $result = $db->sql_query($sql); 
     542                        if ( $subrow = $db->sql_fetchrow($result) ) { 
     543                                $template->assign_vars(array( 
     544                                        'TAGS' => '' 
     545                                )); 
     546 
     547                                $tags = array(); 
    504548                                do { 
    505                                         $thanksby .= ( $thanks_userid ? ', ' : '' ); 
    506                                         $thanks_userid = $subrow['userid']; 
    507                                         if ( $userdata['session_logged_in'] && ( $userdata['uid'] == $thanks_userid ) ) { 
    508                                                 $user_thanked = 1; 
    509                                         } 
    510                                         $thanksby .= '<a href="' . append_sid( 'userdetails.php?id=' . $thanks_userid ) . '">' . $subrow['name'] . '</a>'; 
    511                                 } 
    512                                 while ( $subrow = $db->sql_fetchrow( $result ) ); 
    513                                 $db->sql_freeresult( $result ); 
    514                                 if ( !$user_thanked && $userdata['uid'] != $row['owner'] && $userdata['session_logged_in'] ) { 
    515                                         $disabled = ''; 
    516                                 } 
    517                                 $template->assign_block_vars( 'torrent_details.switch_thanks', array( 
    518                                         'THANKS_USERS' => $thanksby, 
    519                                         'DISABLED' => $disabled 
     549                                        $tags[$subrow['tag_name']] = $subrow['tag_count']; 
     550                                } 
     551                                while ( $subrow = $db->sql_fetchrow($result) ); 
     552 
     553                                //simple tag cloud find here http://www.bytemycode.com/snippets/snippet/415/ 
     554 
     555                                $max_qty = max(array_values($tags)); 
     556                                $min_qty = min(array_values($tags)); 
     557 
     558                                $spread = $max_qty - $min_qty; 
     559                                $spread = ( $spread == 0 ? 1 : $spread ); 
     560 
     561                                $step = ( $config['max_tag_size'] - $config['min_tag_size'] ) / $spread; 
     562 
     563                                foreach ( $tags AS $tag_name => $tag_count ) { 
     564                                        $size = round($config['min_tag_size'] + (($tag_count - $min_qty) * $step)); 
     565 
     566                                        $template->assign_block_vars('tags_row', array( 
     567                                                'TAG_NAME' => $tag_name, 
     568                                                'TAG_SIZE' => $size, 
     569 
     570                                                'U_TAG' => append_sid($root_path . 'browse.php?search_in=3&amp;search=' . $tag_name), 
     571 
     572                                                'U_TAG_USERS' => append_sid($root_path . 'modtask.php?action=tags&amp;do=view_users&amp;tag_name=' . $tag_name . '&amp;tag_type=' . TYPE_TORRENT . '&amp;tag_for_id=' . $id), 
     573                                        )); 
     574                                } 
     575                        } 
     576                        else { 
     577                                $template->assign_vars(array( 
     578                                        'TAGS' => $lang['no_tags'] 
    520579                                )); 
    521580                        } 
    522                         elseif ( !$userdata['session_logged_in'] || $userdata['uid'] == $row['owner'] ) { 
    523                                 $template->assign_block_vars( 'torrent_details.switch_thanks', array( 
    524                                         'DISABLED' => 'disabled="disabled"' 
    525                                 )); 
    526                         } 
    527                         else { 
    528                                 $template->assign_block_vars( 'torrent_details.switch_thanks', array( 
    529                                         'DISABLED' => '' 
    530                                 )); 
    531                         } 
     581                        /* end tags */ 
     582 
     583                        $include_header = false; 
     584 
     585                        $body = 'details.html'; 
     586 
    532587                        stdhead( sprintf( $lang['torrent_details'], $torrent_name ), false ); 
    533588                } 
    534589                else { 
    535590                        stdhead( sprintf( $lang['comments_for'], $torrent_name ) ); 
    536                         $template->assign_block_vars( 'switch_comments_details_head', array( 
    537                                 'COMMENTS_FOR' => sprintf( $lang['comments_for'], '<a href="' . append_sid( $root_path . 'details.php?id=' . $id ) . '">' . $torrent_name . '</a>' ) 
     591                        $template->assign_vars(array( 
     592                                'COMMENTS_FOR' => sprintf( $lang['comments_for'], '<a href="' . append_sid($root_path . 'details.php?id=' . $id) . '">' . $torrent_name . '</a>' ) 
    538593                        )); 
     594 
     595                        $include_header = true; 
     596 
     597                        $body = 'details_comments.html'; 
    539598                } 
    540599                if ( $userdata['session_logged_in'] ) { 
     
    549608                                        $db->sql_query($sql); 
    550609                                } 
    551                                 $check_action = 'comment.php?type=' . TYPE_TORRENT . '&amp;action=checkoff&amp;tid=' . $id
     610                                $check_action = append_sid($root_path . 'comment.php?type=' . TYPE_TORRENT . '&amp;action=checkoff&amp;tid=' . $id)
    552611                                $check_title = $lang['checkcomm_off']; 
    553612                        } 
    554613                        else { 
    555                                 $check_action = 'comment.php?type=' . TYPE_TORRENT . '&amp;action=check&amp;tid=' . $id
     614                                $check_action = append_sid($root_path . 'comment.php?type=' . TYPE_TORRENT . '&amp;action=check&amp;tid=' . $id)
    556615                                $check_title = $lang['checkcomm_on']; 
    557616                        } 
     
    575634                        set_cookie('d', serialize( $tracking_details )); 
    576635                } 
    577                 if ( !$row['comments'] && !isset( $_GET['page'] ) ) { 
    578                         $template->assign_block_vars( 'switch_no_comments_details', array( 
    579                                 'U_ADD_COMMENT' => append_sid($root_path . 'comment.php?type=' . TYPE_TORRENT . '&amp;action=add&amp;tid=' . $id ), 
    580                                 'U_CHECK' => ( isset( $check_action ) ? append_sid($root_path . $check_action ) : '' ), 
    581                                 'CHECK_TITLE' => ( isset( $check_title ) ? $check_title : '' ), 
    582                                 'L_ADD_NEW_COMMENT' => ( $userdata['session_logged_in'] ? $lang['add_new_comment'] : '' ), 
    583                                 'DISABLE_COMMENTS' => $row['disable_comments'] 
    584                         )); 
    585                 } 
    586636                else { 
    587                         list( $pagertop, $pagerbottom, $limit ) = pager( $config['posts_per_page'], $row['comments'], 'details.php?id=' . $id . '&amp;' . ( isset( $_GET['view'] ) ? 'view=comments&amp;' : '' ) ); 
    588  
     637                        $check_action = ''; 
     638                        $check_title = ''; 
     639                } 
     640 
     641                if ( $row['comments'] ) { 
     642                        list($pagertop, $pagerbottom, $limit) = pager($config['posts_per_page'], $row['comments'], 'details.php?id=' . $id . '&amp;' . ( isset( $_GET['view'] ) ? 'view=comments&amp;' : '' )); 
    589643                        commenttable(TYPE_TORRENT, $id, $limit); 
    590  
    591                         $template->assign_block_vars( 'switch_comments_details', array( 
    592                                 'U_ADD_COMMENT' => append_sid($root_path . 'comment.php?type=' . TYPE_TORRENT . '&amp;action=add&amp;tid=' . $id ), 
    593                                 'U_CHECK' => ( isset( $check_action ) ? append_sid( $check_action ) : '' ), 
    594                                 'CHECK_TITLE' => ( isset( $check_title ) ? $check_title : '' ), 
    595                                 'L_ADD_NEW_COMMENT' => ( $userdata['session_logged_in'] ? $lang['add_new_comment'] : '' ), 
    596                                 'DISABLE_COMMENTS' => $row['disable_comments'], 
    597                                 'COMMENTBAR' => ( isset( $commentbar ) ? $commentbar : '' ), 
    598                                 'PAGERTOP' => $pagertop, 
    599                                 'PAGERBOTTOM' => $pagerbottom 
    600                         )); 
    601                 } 
     644                } 
     645                else { 
     646                        $pagertop = ''; 
     647                        $pagerbottom = ''; 
     648                } 
     649 
     650                $template->assign_vars(array( 
     651                        'U_ADD_COMMENT' => append_sid($root_path . 'comment.php?type=' . TYPE_TORRENT . '&amp;action=add&amp;tid=' . $id ), 
     652                        'U_CHECK' => $check_action, 
     653                        'CHECK_TITLE' => $check_title, 
     654                        'DISABLE_COMMENTS' => $row['disable_comments'], 
     655 
     656                        'COMMENTS_COUNT' => $row['comments'], 
     657 
     658                        'INCLUDE_HEADER' => $include_header, 
     659 
     660                        'PAGERTOP' => $pagertop, 
     661 
     662                        'PAGERBOTTOM' => $pagerbottom, 
     663                )); 
    602664        } 
    603665        $template->set_filenames( array( 
    604                 'body' => 'details.html' 
     666                'body' => $body 
    605667        )); 
    606668        stdfoot(); 
  • include/acp/config/upload_settings.php

    r226 r269  
    1212 
    1313        'max_torrent_size'      => array('lang' => 'max_torrent_size',          'validate' => 'int',    'type' => 'text:20:255', 'explain' => true), 
    14         'torrent_dir'   => array('lang' => 'torrent_dir',               'validate' => 'script_path',  'type' => 'text:50:255', 'explain' => true), 
     14        'torrent_dir'   => array('lang' => 'torrent_dir',               'validate' => 'wpath',        'type' => 'text:50:255', 'explain' => true), 
    1515 
    1616        'demote_uploader_days'  => array('lang' => 'demote_uploaders',          'validate' => 'int',    'type' => 'text:20:255', 'explain' => true), 
  • include/ajax.php

    r221 r269  
    2525    var $LOADER = null; 
    2626    var $ID = null; 
     27    var $RESULT = null; 
    2728 
    2829    // Internal; uniq value. 
    2930    var $_uniqHash; 
     31    // Magic number for display_error checking. 
     32    var $_magic = 14623; 
     33    // Previous display_errors value. 
     34    var $_prevDisplayErrors = null; 
    3035    // Internal: response content-type depending on loader type. 
    3136    var $_contentTypes = array( 
     
    4146    // Which Unicode conversion function is available? 
    4247    var $_unicodeConvMethod = null; 
     48    // Emergency memory buffer to be freed on memory_limit error. 
     49    var $_emergBuffer = null; 
    4350 
    4451 
     
    4956     * to script output buffer. As a result - script will always return 
    5057     * correct JavaScript code, even in case of fatal errors. 
     58     * 
     59     * QUERY_STRING is in form of: PHPSESSID=<sid>&a=aaa&b=bbb&JsHttpRequest=<id>-<loader> 
     60     * where <id> is a request ID, <loader> is a loader name, <sid> - a session ID (if present), 
     61     * PHPSESSID - session parameter name (by default = "PHPSESSID"). 
     62     * 
     63     * If an object is created WITHOUT an active AJAX query, it is simply marked as 
     64     * non-active. Use statuc method isActive() to check. 
    5165     */ 
    5266    function JsHttpRequest($enc = 'utf-8') 
    5367    { 
    54         // QUERY_STRING is in form of: PHPSESSID=<sid>&a=aaa&b=bbb&JsHttpRequest=<id>-<loader> 
    55         // where <id> is a request ID, <loader> is a loader name, <sid> - a session ID (if present), 
    56         // PHPSESSID - session parameter name (by default = "PHPSESSID"). 
     68        global $JsHttpRequest_Active; 
     69 
     70        // To be on a safe side - do not allow to drop reference counter on ob processing. 
     71        $GLOBALS['_RESULT'] =& $this->RESULT; 
    5772 
    5873        // Parse QUERY_STRING. 
     
    6883                $_REQUEST[session_name()] 
    6984            ); 
     85            // Detect Unicode conversion method. 
     86            $this->_unicodeConvMethod = function_exists('mb_convert_encoding')? 'mb' : (function_exists('iconv')? 'iconv' : null); 
     87 
     88            // Fill an emergency buffer. We erase it at the first line of OB processor 
     89            // to free some memory. This memory may be used on memory_limit error. 
     90            $this->_emergBuffer = str_repeat('a', 1024 * 200); 
     91 
     92            // Intercept fatal errors via display_errors (seems it is the only way). 
     93            $this->_uniqHash = md5('JsHttpRequest' . microtime() . getmypid()); 
     94            $this->_prevDisplayErrors = ini_get('display_errors'); 
     95            ini_set('display_errors', $this->_magic); // 
     96            ini_set('error_prepend_string', $this->_uniqHash . ini_get('error_prepend_string')); 
     97            ini_set('error_append_string',  ini_get('error_append_string') . $this->_uniqHash); 
     98            if (function_exists('xdebug_disable')) xdebug_disable(); // else Fatal errors are not catched 
     99 
     100            // Start OB handling early. 
     101            ob_start(array(&$this, "_obHandler")); 
     102            $JsHttpRequest_Active = true; 
     103 
     104            // Set up the encoding. 
     105            $this->setEncoding($enc); 
     106 
     107            // Check if headers are already sent (see Content-Type library usage). 
     108            // If true - generate a debug message and exit. 
     109            $file = $line = null; 
     110            $headersSent = version_compare(PHP_VERSION, "4.3.0") < 0? headers_sent() : headers_sent($file, $line); 
     111            if ($headersSent) { 
     112                trigger_error( 
     113                    "HTTP headers are already sent" . ($line !== null? " in $file on line $line" : " somewhere in the script") . ". " 
     114                    . "Possibly you have an extra space (or a newline) before the first line of the script or any library. " 
     115                    . "Please note that JsHttpRequest uses its own Content-Type header and fails if " 
     116                    . "this header cannot be set. See header() function documentation for more details", 
     117                    E_USER_ERROR 
     118                ); 
     119                exit(); 
     120            } 
    70121        } else { 
    71122            $this->ID = 0; 
    72123            $this->LOADER = 'unknown'; 
    73         } 
    74  
    75         // Detect Unicode conversion method. 
    76         $this->_unicodeConvMethod = function_exists('mb_convert_encoding')? 'mb' : (function_exists('iconv')? 'iconv' : null); 
    77  
    78         // Start OB handling early. 
    79         $this->_uniqHash = md5(microtime() . getmypid()); 
    80         ini_set('error_prepend_string', ini_get('error_prepend_string') . $this->_uniqHash); 
    81         ini_set('error_append_string',  ini_get('error_append_string') . $this->_uniqHash); 
    82         ob_start(array(&$this, "_obHandler")); 
    83  
    84         // Set up the encoding. 
    85         $this->setEncoding($enc); 
    86  
    87         // Check if headers are already sent (see Content-Type library usage). 
    88         // If true - generate a debug message and exit. 
    89         $file = $line = null; 
    90         if (headers_sent($file, $line)) { 
    91             trigger_error( 
    92                 "HTTP headers are already sent" . ($line !== null? " in $file on line $line" : "") . ". " 
    93                 . "Possibly you have an extra space (or a newline) before the first line of the script or any library. " 
    94                 . "Please note that JsHttpRequest uses its own Content-Type header and fails if " 
    95                 . "this header cannot be set. See header() function documentation for more details", 
    96                 E_USER_ERROR 
    97             ); 
    98             exit(); 
    99         } 
     124            $JsHttpRequest_Active = false; 
     125        } 
     126    } 
     127 
     128 
     129    /** 
     130     * Static function. 
     131     * Returns true if JsHttpRequest output processor is currently active. 
     132     * 
     133     * @return boolean    True if the library is active, false otherwise. 
     134     */ 
     135    function isActive() 
     136    { 
     137        return !empty($GLOBALS['JsHttpRequest_Active']); 
    100138    } 
    101139 
     
    108146    function getJsCode() 
    109147    { 
    110         return file_get_contents(dirname(__FILE__).'/JsHttpRequest.js'); 
     148        return file_get_contents(dirname(__FILE__) . '/JsHttpRequest.js'); 
    111149    } 
    112150 
     
    205243 
    206244 
    207  
    208245    /** 
    209246     * Internal methods. 
     
    222259        // is NOT default "application/x-www-form-urlencoded"!!! 
    223260        // Library frontend sets "application/octet-stream" for that purpose, 
    224         // see JavaScript code. 
     261        // see JavaScript code. In PHP 5.2.2.HTTP_RAW_POST_DATA is not set sometimes; 
     262        // in such cases - read the POST data manually from the STDIN stream. 
     263        $rawPost = strcasecmp($_SERVER['REQUEST_METHOD'], 'POST') == 0? (isset($GLOBALS['HTTP_RAW_POST_DATA'])? $GLOBALS['HTTP_RAW_POST_DATA'] : @file_get_contents("php://input")) : null; 
    225264        $source = array( 
    226265            '_GET' => !empty($_SERVER['QUERY_STRING'])? $_SERVER['QUERY_STRING'] : null, 
    227             '_POST'=> !empty($GLOBALS['HTTP_RAW_POST_DATA'])? $GLOBALS['HTTP_RAW_POST_DATA'] : null 
     266            '_POST'=> $rawPost, 
    228267        ); 
    229268        foreach ($source as $dst=>$src) { 
     
    252291    function _obHandler($text) 
    253292    { 
    254         // Check for error. 
    255         if (preg_match('{'.$this->_uniqHash.'(.*?)'.$this->_uniqHash.'}sx', $text)) { 
    256             $text = str_replace($this->_uniqHash, '', $text); 
    257         } 
    258  
    259         // Make a resulting hash. 
    260         if (!isset($this->RESULT)) { 
    261             $this->RESULT = isset($GLOBALS['_RESULT'])? $GLOBALS['_RESULT'] : null; 
    262         } 
    263         $encoding = $this->SCRIPT_ENCODING; 
     293        unset($this->_emergBuffer); // free a piece of memory for memory_limit error 
     294        unset($GLOBALS['JsHttpRequest_Active']); 
     295 
     296        // Check for error & fetch a resulting data. 
     297        $wasFatalError = false; 
     298        if (preg_match_all("/{$this->_uniqHash}(.*?){$this->_uniqHash}/sx", $text, $m)) { 
     299            // Display_errors: 
     300            // 1. disabled manually after the library initialization, or 
     301            // 2. was initially disabled and is not changed 
     302            $needRemoveErrorMessages = !ini_get('display_errors') || (!$this->_prevDisplayErrors && ini_get('display_errors') == $this->_magic); 
     303            foreach ($m[0] as $error) { 
     304                if (preg_match('/\bFatal error(<.*?>)?:/i', $error)) { 
     305                    $wasFatalError = true; 
     306                } 
     307                if ($needRemoveErrorMessages) { 
     308                    $text = str_replace($error, '', $text); // strip the whole error message 
     309                } else { 
     310                    $text = str_replace($this->_uniqHash, '', $text); 
     311                } 
     312            } 
     313        } 
     314        if ($wasFatalError) { 
     315            // On fatal errors - force "null" result. This is needed, because $_RESULT 
     316            // may not be fully completed at the moment of the error. 
     317            $this->RESULT = null; 
     318        } else { 
     319            // Read the result from globals if not set directly. 
     320            if (!isset($this->RESULT)) { 
     321                global $_RESULT; 
     322                $this->RESULT = $_RESULT; 
     323            } 
     324            // Avoid manual NULLs in the result (very important!). 
     325            if ($this->RESULT === null) { 
     326                $this->RESULT = false; 
     327            } 
     328        } 
     329 
     330        // Note that 500 error is generated when a PHP error occurred. 
     331        $status = $this->RESULT === null? 500 : 200; 
    264332        $result = array( 
    265333            'id'   => $this->ID, 
    266             'js'   => $this->RESULT, 
    267             'text' => $text, 
     334            'js'   => $this->RESULT,  // null always means a fatal error... 
     335            'text' => $text,          // ...independent on $text!!! 
    268336        ); 
     337        $encoding = $this->SCRIPT_ENCODING; 
     338        $text = null; // to be on a safe side 
     339 
     340        // Try to use very fast json_encode: 3-4 times faster than a manual encoding. 
    269341        if (function_exists('array_walk_recursive') && function_exists('json_encode') && $this->_unicodeConvMethod) { 
    270             $encoding = "UTF-8"; 
    271342            $this->_nonAsciiChars = join("", array_map('chr', range(128, 255))); 
    272343            $this->_toUtfFailed = false; 
    273             array_walk_recursive($result, array(&$this, '_toUtf8_callback'), $this->SCRIPT_ENCODING); 
     344            $resultUtf8 = $result; 
     345            array_walk_recursive($resultUtf8, array(&$this, '_toUtf8_callback'), $this->SCRIPT_ENCODING); 
    274346            if (!$this->_toUtfFailed) { 
    275347                // If some key contains non-ASCII character, convert everything manually. 
    276                 $text = json_encode($result); 
    277             } else { 
    278                 $text = $this->php2js($result); 
    279             } 
    280         } else { 
     348                $text = json_encode($resultUtf8); 
     349                $encoding = "UTF-8"; 
     350            } 
     351        } 
     352 
     353        // On failure, use manual encoding. 
     354        if ($text === null) { 
    281355            $text = $this->php2js($result); 
    282356        } 
    283  
    284         // Content-type header. 
    285         // In XMLHttpRequest mode we must return text/plain - damned stupid Opera 8.0. :( 
    286         $ctype = !empty($this->_contentTypes[$this->LOADER])? $this->_contentTypes[$this->LOADER] : $this->_contentTypes['']; 
    287         header("Content-type: $ctype; charset=$encoding"); 
    288357 
    289358        if ($this->LOADER != "xml") { 
     
    298367                $text = '<script type="text/javascript" language="JavaScript"><!--' . "\n$text" . '//--></script>'; 
    299368            } 
    300         } 
     369 
     370            // Always return 200 code in non-XML mode (else SCRIPT does not work in FF). 
     371            // For XML mode, 500 code is okay. 
     372            $status = 200; 
     373        } 
     374 
     375        // Status header. To be safe, display it only in error mode. In case of success 
     376        // termination, do not modify the status (""HTTP/1.1 ..." header seems to be not 
     377        // too cross-platform). 
     378        if ($this->RESULT === null) { 
     379            if (php_sapi_name() == "cgi") { 
     380                header("Status: $status"); 
     381            } else { 
     382                header("HTTP/1.1 $status"); 
     383            } 
     384        } 
     385 
     386        // In XMLHttpRequest mode we must return text/plain - damned stupid Opera 8.0. :( 
     387        $ctype = !empty($this->_contentTypes[$this->LOADER])? $this->_contentTypes[$this->LOADER] : $this->_contentTypes['']; 
     388        header("Content-type: $ctype; charset=$encoding"); 
    301389 
    302390        return $text; 
     
    311399    function _toUtf8_callback(&$v, $k, $fromEnc) 
    312400    { 
    313         if ($this->_toUtfFailed || strpbrk($k, $this->_nonAsciiChars) !== false) { 
     401        if ($v === null || is_bool($v)) return; 
     402        if ($this->_toUtfFailed || !is_scalar($v) || strpbrk($k, $this->_nonAsciiChars) !== false) { 
    314403            $this->_toUtfFailed = true; 
    315404        } else { 
     
    383472 
    384473 
    385  
    386     /** 
    387      * If there is no ICONV, try to decode 1-byte characters manually 
     474    /** 
     475     * If there is no ICONV, try to decode 1-byte characters and UTF-8 manually 
    388476     * (for most popular charsets only). 
    389477     */ 
     
    394482    function _decUcs2Decode($code, $toEnc) 
    395483    { 
     484        // Little speedup by using array_flip($this->_encTables) and later hash access. 
     485        static $flippedTable = null; 
    396486        if ($code < 128) return chr($code); 
     487 
    397488        if (isset($this->_encTables[$toEnc])) { 
    398             // TODO: possible speedup by using array_flip($this->_encTables) and later hash access in the constructor. 
    399             $p = array_search($code, $this->_encTables[$toEnc]); 
    400             if ($p !== false) return chr(128 + $p); 
    401         } 
     489            if (!$flippedTable) $flippedTable = array_flip($this->_encTables[$toEnc]); 
     490            if (isset($flippedTable[$code])) return chr(128 + $flippedTable[$code]); 
     491        } else if ($toEnc == 'utf-8' || $toEnc == 'utf8') { 
     492            // UTF-8 conversion rules: http://www.cl.cam.ac.uk/~mgk25/unicode.html 
     493            if ($code < 0x800) { 
     494                return chr(0xC0 + ($code >> 6)) . 
     495                       chr(0x80 + ($code & 0x3F)); 
     496            } else { // if ($code <= 0xFFFF) -- it is almost always so for UCS2-BE 
     497                return chr(0xE0 + ($code >> 12)) . 
     498                       chr(0x80 + (0x3F & ($code >> 6))) . 
     499                       chr(0x80 + ($code & 0x3F)); 
     500            } 
     501        } 
     502 
    402503        return ""; 
    403504    } 
     
    446547    ); 
    447548} 
    448 ?> 
  • include/constants.php

    r247 r269  
    207207define('SNATCHED_TABLE',         'snatched'); 
    208208define('SOS_TABLE',              'sos'); 
     209define('TAGS_TABLE',             'tags'); 
     210define('TAGS_USERS_TABLE',       'tags_users'); 
    209211define('THANKS_TABLE',           'thanks'); 
    210212define('THEMES_TABLE',           'themes'); 
  • include/details/download.php

    r213 r269  
    11<?php 
     2loggedinorreturn(); 
     3require($root_path . '/include/class.bencode.php'); 
    24 
    3 loggedinorreturn(); 
    45$type = request_var('type', ''); 
    56 
     
    2526$torrent_dir = $root_path . ( !empty($config['torrent_dir']) ? $config['torrent_dir'] : 'torrents'); 
    2627$fn = $torrent_dir . '/' . $id . '.torrent'; 
    27 if ( !is_file( $fn ) || !is_readable( $fn ) ) { 
     28if ( !is_file($fn) || !is_readable($fn) ) { 
    2829        trigger_error( $lang['error_reading_torrent_file'] ); 
    2930} 
    3031 
    3132$sql = 'UPDATE ' . TORRENTS_TABLE . ' SET hits = hits + 1 WHERE fid = ' . $id; 
    32 $db->sql_query( $sql ); 
     33$db->sql_query($sql); 
    3334 
    34 $dict = bdec_file( $fn, filesize( $fn ) ); 
    35 $dict['value']['announce']['value'] = generate_base_url() . '/announce.php?passkey=' . $userdata['torrent_pass']; 
    36 $dict['value']['announce']['string'] = benc_str( $dict['value']['announce']['value'] ); 
    37 $dict['value']['announce']['strlen'] = strlen( $dict['value']['announce']['string'] ); 
     35$torrent = new Torrent($fn); 
    3836 
    39 $file = benc( $dict ); 
     37$base_url = generate_base_url(); 
     38if ( defined('USE_XBTT') ) { 
     39        $announce = $base_url . ':' . $config['xbt_listen_port'] . '/' . $userdata['torrent_pass'] . '/announce/'; 
     40
     41else { 
     42        $announce = $base_url . '/announce.php?passkey=' . $userdata['torrent_pass']; 
     43
     44 
     45$torrent->announce(array($announce)); 
    4046 
    4147if ( $type == 'gzip' ) { 
    4248        $length = strlen( $file ); 
    4349        //next code founded at http://php.net/manual/ru/function.gzcompress.php#50692 
    44         $comp_data = pack("C1C1C1C1VC1C1", 0x1f, 0x8b, 8, 8, time(), 2, 0xFF) . $row['filename'] . "\0" . gzdeflate($file, 9) . pack("VV", crc32($file), $length); 
     50        $comp_data = pack("C1C1C1C1VC1C1", 0x1f, 0x8b, 8, 8, time(), 2, 0xFF) . $row['filename'] . "\0" . gzdeflate($torrent, 9) . pack("VV", crc32($torrent), $length); 
    4551        header( 'Content-Type: application/x-gzip' ); 
    4652        header( 'Content-disposition: attachment; filename="' . str_replace('.torrent', '.gz', $row['filename']) . '"' ); 
     
    5056} 
    5157else { 
    52         header( 'Content-Type: application/x-bittorrent' ); 
    53         header( 'Content-disposition: attachment; filename="' . $row['filename'] . '"' ); 
    54         header( 'Content-transfer-encoding: binary' ); 
    55         header( 'Content-length: ' . strlen( $file ) ); 
    56         echo( $file ); 
     58        $torrent->send($row['filename']); 
    5759} 
    5860?> 
  • include/details/edit.php

    r255 r269  
    11<?php 
     2 
     3loggedinorreturn(); 
    24 
    35$sql = 'SELECT t.*, user_reputation, user_reputation_level, user_rank_id, uid 
     
    57                WHERE u.uid = t.owner 
    68                AND fid = ' . $id; 
    7 $result = $db->sql_query( $sql ); 
    8 if ( !( $row = $db->sql_fetchrow( $result ) ) ) { 
    9         trigger_error( sprintf( $lang['invlalid_id'], $id ) ); 
     9$result = $db->sql_query($sql); 
     10if ( !$row = $db->sql_fetchrow($result) ) { 
     11        trigger_error( sprintf( $lang['invalid_id'], $id ) ); 
    1012} 
    1113if ( $userdata['uid'] != $row['owner'] && $userdata['class'] < UC_MODERATOR ) { 
     
    1315} 
    1416 
     17$cats = $cache->obtain_cats(); 
     18 
     19$cat_id = $row['category']; 
     20$cat_parent_id = ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_id']) ? $cats[$cats[$cat_id]['cat_parent']]['cat_id'] : 0 ); 
     21 
    1522 
    1623if ( isset($_POST['submit']) ) { 
    1724        loggedinorreturn(); 
    18         require_once ( $root_path . 'languages/lang_' . $config['default_lang'] . '/lang_modcomment_log.php' ); 
    19         require_once ( $root_path . 'include/functions_check.php' ); 
     25        require_once ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_modcomment_log.php'); 
     26        require_once ($root_path . 'include/functions_check.php'); 
    2027 
    2128        $name = request_var('name', ''); 
     
    95102 
    96103        if ( $tor_action == 'update' ) { 
    97                 list( $tmpname, $infohash, $fname, $totallen, $filelist, $dname, $dict ) = check_torrent( $_FILES['file'] ); 
     104                list($infohash, $fname, $totallen, $filelist, $dname, $filename) = check_torrent( $_FILES['file'] ); 
     105 
     106                $updateset[] = 'filename = ' . "'" . $db->sql_escape( $fname ) . "'"; 
     107                $updateset[] = 'size = ' . "'" . $db->sql_escape( $totallen ) . "'"; 
     108                $updateset[] = 'numfiles = ' . "'" . $db->sql_escape( sizeof( $filelist ) ) . "'"; 
     109                $updateset[] = 'save_as = ' . "'" . $db->sql_escape( $dname ) . "'"; 
     110                $updateset[] = 'info_hash = ' . "'" . $db->sql_escape( $infohash ) . "'"; 
     111 
     112                $sql = 'DELETE FROM ' . FILES_TABLE . ' WHERE torrent = ' . $id; 
     113                $db->sql_query( $sql ); 
     114                foreach ( $filelist as $file ) { 
     115                        $sql = 'INSERT INTO ' . FILES_TABLE . ' (torrent, filename, size) VALUES (' . $id . ', ' . "'" . $db->sql_escape( $file[0] ) . "'" . ', ' . $file[1] . ')'; 
     116                        $db->sql_query( $sql ); 
     117                } 
     118                if ( $row['info_hash'] != $infohash ) { 
     119                        $sql = 'DELETE FROM ' . PEERS_TABLE . ' WHERE fid = ' . $id; 
     120                        $db->sql_query( $sql ); 
     121                        $updateset[] = 'seeders = 0'; 
     122                        $updateset[] = 'leechers = 0'; 
     123                } 
    98124 
    99125                $torrent_dir = $root_path . ( !empty($config['torrent_dir']) ? $config['torrent_dir'] : 'torrents'); 
    100  
    101                 if ( @move_uploaded_file( $tmpname, $torrent_dir . DIRECTORY_SEPARATOR . $id . '.torrent' ) !== false ) { 
    102                         if ( $fp = @fopen( $torrent_dir . DIRECTORY_SEPARATOR . $id . '.torrent', 'w' ) ) { 
    103                                 $updateset[] = 'filename = ' . "'" . $db->sql_escape( $fname ) . "'"; 
    104                                 $updateset[] = 'size = ' . "'" . $db->sql_escape( $totallen ) . "'"; 
    105                                 $updateset[] = 'numfiles = ' . "'" . $db->sql_escape( sizeof( $filelist ) ) . "'"; 
    106                                 $updateset[] = 'save_as = ' . "'" . $db->sql_escape( $dname ) . "'"; 
    107                                 $updateset[] = 'info_hash = ' . "'" . $db->sql_escape( $infohash ) . "'"; 
    108  
    109                                 fwrite( $fp, benc( $dict ), strlen( benc( $dict ) ) ); 
    110                                 fclose( $fp ); 
    111                                 $sql = 'DELETE FROM ' . FILES_TABLE . ' WHERE torrent = ' . $id; 
    112                                 $db->sql_query( $sql ); 
    113                                 foreach ( $filelist as $file ) { 
    114                                         $sql = 'INSERT INTO ' . FILES_TABLE . ' (torrent, filename, size) VALUES (' . $id . ', ' . "'" . $db->sql_escape( $file[0] ) . "'" . ', ' . $file[1] . ')'; 
    115                                         $db->sql_query( $sql ); 
    116                                 } 
    117                                 if ( $row['info_hash'] != $infohash ) { 
    118                                         $sql = 'DELETE FROM ' . PEERS_TABLE . ' WHERE fid = ' . $id; 
    119                                         $db->sql_query( $sql ); 
    120                                         $updateset[] = 'seeders = 0'; 
    121                                         $updateset[] = 'leechers = 0'; 
    122                                 } 
    123                         } 
    124                         else { 
    125                                 trigger_error( $lang['file_cannot_be_uploaded'] ); 
    126                         } 
    127                 } 
    128                 elseif ( !file_exists( $torrent_dir ) || !is_writable( $torrent_dir . DIRECTORY_SEPARATOR ) ) { 
    129                         trigger_error( $lang['dir_not_exist_or_not_writable'] ); 
    130                 } 
    131                 else { 
    132                         trigger_error( $lang['file_cannot_be_uploaded'] ); 
    133                 } 
     126                @unlink($torrent_dir . DIRECTORY_SEPARATOR . $id . '.torrent'); 
     127                @rename($torrent_dir . DIRECTORY_SEPARATOR . $filename . '.torrent', $torrent_dir . DIRECTORY_SEPARATOR . $id . '.torrent'); 
    134128        } 
    135129        $sql = 'UPDATE ' . TORRENTS_TABLE . ' SET ' . implode( ',', $updateset ) . ' WHERE fid = ' . $id; 
     
    137131        $cache->destroy( 'sql', INDEXRELEASES_TABLE ); 
    138132 
    139         write_log( sprintf( $lang['log_torrent_edited'], 'details_' . $id, $name, $userdata['name'] ) ); 
     133        write_log( sprintf( $lang['log_torrent_edited'], $id, $name, $userdata['uid'], $userdata['name']) ); 
     134 
    140135 
    141136        redirect( append_sid($root_path . 'details.php?id=' . $id . '&edited=1') ); 
    142137} 
    143138else { 
    144  
    145         loggedinorreturn(); 
    146139        require_once ( $root_path . 'include/functions_selects.php' ); 
    147140 
  • include/functions.php

    r266 r269  
    12791279function stdhead($title = '', $right_menu = true) { 
    12801280        global $userdata, $config, $template, $lang, $db, $images, $root_path, $theme, $cache; 
     1281        global $bb_code; 
    12811282        static $ranks; 
    12821283 
     
    14251426                'CURUSER_ID' => $userdata['uid'], 
    14261427                'S_USER_LOGGED_IN' => $userdata['session_logged_in'], 
     1428 
     1429                'S_USER_IS_MOD' => ( $userdata['class'] >= UC_MODERATOR ) ? 1 : 0, 
     1430 
    14271431                'CURRENT_USER_POINTS_LEVEL' => $userdata['user_reputation_level'], 
    14281432                'CURRENT_USER_POINTS' => $userdata['user_reputation'], 
     
    14891493 
    14901494                                if ( $show_news ) { 
    1491                                         require_once($root_path . 'include/functions_post.php'); 
     1495 
     1496                                        if ( !isset($bb_code) ) { 
     1497                                                require_once($root_path . 'include/bbcode/bbcode.lib.php'); 
     1498                                                $bb_code = new bbcode; 
     1499                                        } 
    14921500 
    14931501                                        $template->assign_block_vars('news_annoucment', array()); 
    14941502 
    14951503                                        foreach ( $news_ary AS $key => $ary ) { 
     1504 
     1505                                                $body = $ary['body']; 
     1506                                    $bb_code->parse($body); 
     1507                                    $body = $bb_code->get_html(); 
     1508 
    14961509                                                $template->assign_block_vars('news_annoucment.news_annoucment_row', array( 
    14971510                                                        'NEWS_ID' => $ary['id'], 
    14981511                                                        'NEWS_ADDED' => create_date($ary['added'], 'M d'), 
    14991512                                                        'NEWS_TITLE' => $ary['title'], 
    1500                                                         'NEWS_BODY' =>  format_comment($ary['body'])
     1513                                                        'NEWS_BODY' =>  $body
    15011514                                                        'U_ADD_COMMENT' => append_sid($root_path . 'comment.php', 'type=' . TYPE_NEWS . '&amp;action=add&amp;tid=' . $ary['id']), 
    15021515                                                        'COMMENTS_COUNT' => $ary['news_comments'], 
     
    15071520                        } 
    15081521                } 
     1522 
     1523 
     1524                $uped = mksize($userdata['uploaded']); 
     1525                $downed = mksize($userdata['downloaded']); 
     1526                $ratio = get_ratio ($userdata['uploaded'], $userdata['downloaded']); 
     1527                $color = get_ratio_color($ratio); 
     1528                $ratio = '<span style="color:' . $color . ';">' . $ratio . '</span>'; 
     1529                $avatar_prefix = ( ( strpos($userdata['avatar'], 'user_avatar_' . $userdata['uid']) === false && strpos($userdata['avatar'], '/') !== false ) || !$userdata['avatar'] ? '' : generate_base_url() . '/' . $config['avatar_path'] . '/' ); 
     1530                $avatar = ( !$userdata['avatar'] ? $images['default_avatar'] : $avatar_prefix . $userdata['avatar'] ); 
     1531                $title = get_user_class_name($userdata['class']); 
    15091532 
    15101533                $template->assign_vars(array( 
     
    15191542                        'HELPDESC_NUM' => $config['count_helpdesk_not_solved'], 
    15201543                        'REPORTS_NUM' => $config['count_reports_not_solved'], 
    1521                         'CANDIDATES_NUM' => $config['count_candidates_waiting'] 
    1522                 )); 
    1523  
    1524                 $uped = mksize($userdata['uploaded']); 
    1525                 $downed = mksize($userdata['downloaded']); 
    1526                 $ratio = get_ratio ($userdata['uploaded'], $userdata['downloaded']); 
    1527                 $color = get_ratio_color($ratio); 
    1528                 $ratio = '<span style="color:' . $color . ';">' . $ratio . '</span>'; 
    1529                 $avatar_prefix = ( ( strpos($userdata['avatar'], 'user_avatar_' . $userdata['uid']) === false && strpos($userdata['avatar'], '/') !== false ) || !$userdata['avatar'] ? '' : generate_base_url() . '/' . $config['avatar_path'] . '/' ); 
    1530                 $avatar = ( !$userdata['avatar'] ? $images['default_avatar'] : $avatar_prefix . $userdata['avatar'] ); 
    1531                 $title = get_user_class_name($userdata['class']); 
    1532  
    1533                 $template->assign_block_vars('user_panel', array( 
     1544                        'CANDIDATES_NUM' => $config['count_candidates_waiting'], 
    15341545                        'PM_TITLE' =>( $userdata['user_unread_pms'] ? $lang['new_inbox_pms'] : $lang['no_new_inbox_pms'] ), 
    15351546                        'INBOX_PM_PIC' => ( $userdata['user_unread_pms'] ? $images['inboxnew'] : $images['inbox'] ), 
    15361547                        'SENTBOX_PIC' => $images['sentbox'], 
    15371548                        'BUDDYLIST_PIC' => $images['buddylist'], 
    1538                         'RATIO' => $ratio, 
    1539                         'UPED' => $uped, 
    1540                         'DOWNED' => $downed, 
    1541                         'WARN_PANEL' => ($userdata['class'] < UC_MODERATOR? $lang['warns'] . ': ' . warn_panel($userdata['warn']) : ''), 
    1542                         'CURUSER_NAME' => get_user_class_color($userdata['class'], $userdata['name']), 
    1543                         'CURUSER_ICONS' => get_user_icons($userdata), 
     1549 
     1550                        'CURRENT_USER_RATIO' => $ratio, 
     1551                        'CURRENT_USER_UPED' => $uped, 
     1552                        'CURRENT_USER_DOWNED' => $downed, 
     1553                        'CURRENT_USER_WARN_PANEL' => ( $userdata['class'] < UC_MODERATOR ? $lang['warns'] . ': ' . warn_panel($userdata['warn']) : '' ), 
     1554                        'CURRENT_USER_NAME' => get_user_class_color($userdata['class'], $userdata['name']), 
     1555                        'CURRENT_USER_ICONS' => get_user_icons($userdata), 
    15441556                        'S_CURRENT_TIME' => sprintf($lang['current_time'], '<span id="clock">&nbsp;</span>'), 
    15451557                        'CURRENT_USER_AVATAR' => $avatar, 
     
    15541566                } 
    15551567 
    1556                 if ( $userdata['class'] >= UC_MODERATOR ) { 
    1557                         $template->assign_block_vars('switch_moderator_view', array()); 
    1558                 } 
    15591568                if ( $userdata['class'] >= UC_ADMINISTRATOR ) { 
    15601569                        $template->assign_block_vars('switch_admin_view', array()); 
     
    15681577                        )); 
    15691578                } 
    1570                 $template->assign_block_vars('switch_curuser_view', array()); 
    1571         } 
    1572         else { 
    1573                 $template->assign_block_vars('switch_non_curuser_view', array()); 
    15741579        } 
    15751580 
  • include/functions_check.php

    r265 r269  
    304304 
    305305function check_torrent ( $torrent_file ) { 
    306         global $lang, $config; 
    307  
    308         $errors = $error_in_filenames = array(); 
    309         $private = 0; 
     306        global $lang, $config, $root_path; 
     307 
     308        require ($root_path . 'include/class.bencode.php'); 
     309 
     310        $errors = array(); 
     311 
     312        $torrent_dir = $root_path . ( !empty($config['torrent_dir']) ? $config['torrent_dir'] : 'torrents'); 
    310313 
    311314        if ( !check_filename($torrent_file['name']) || empty($torrent_file['name']) ) { 
     
    329332        } 
    330333 
    331         $dict = bdec_file($torrent_file['tmp_name'], $config['max_torrent_size']); 
    332      if ( !isset($dict) ) { 
    333           $errors[] = $lang['you_upload_not_torrent_file']; 
    334      } 
    335  
    336      list($ann, $info) = dict_check($dict, 'announce(string):info'); 
    337      list($dname, $plen, $pieces) = dict_check($info, 'name(string):piece length(integer):pieces(string)'); 
    338  
    339      if ( !preg_match("/^[a-zA-Z0-9_~!@$^()\[\]{}&'`%,.-\s]+$/", $dname) ) { 
    340           $errors[] = sprintf($lang['invalid_name_in_files'], $dname); 
    341      } 
    342  
    343      if ( $ann != generate_base_url() . '/announce.php' ) { 
    344           $errors[] = sprintf($lang['invalid_announce'], generate_base_url() . '/announce.php'); 
    345      } 
    346  
    347      if ( strlen($pieces) % 20 != 0 ) { 
    348           $errors[] = $lang['invalid_pieces']; 
    349      } 
    350      $filelist = array(); 
    351      $totallen = dict_get($info, 'length', 'integer'); 
    352  
    353         if ( isset($totallen) ) { 
    354           $filelist[] = array($dname, $totallen); 
    355      } 
    356      else { 
    357           $flist = dict_get($info, 'files', 'list'); 
    358           if (!isset($flist)) { 
    359                $errors[] = $lang['no_filesize']; 
    360           } 
    361           if (!sizeof($flist)) { 
    362                $errors[] = $lang['no_files']; 
    363           } 
    364           $totallen = 0; 
    365           for ( $i = 0; $i < sizeof($flist); ++$i ) { 
    366                list($ll, $ff) = dict_check($flist[$i], 'length(integer):path(list)'); 
    367                $totallen += $ll; 
    368                $ffa = array(); 
    369                for ( $j = 0; $j < sizeof($ff); ++$j ) { 
    370                     if (!preg_match("/^[a-zA-Z0-9_~!@$^()&'\[\]{}`%,.-\s]+$/", $ff[$j]['value'])) { 
    371                                         $error_in_filenames[] = $ff[$j]['value']; 
    372                     } 
    373                     if ( $ff[$j]['type'] != 'string' ) { 
    374                          $errors[] = $lang['invalid_filename']; 
    375                     } 
    376                     $ffa[] = $ff[$j]['value']; 
    377                } 
    378                if ( !sizeof($ffa) ) { 
    379                     $errors[] = $lang['invalid_filename']; 
    380                } 
    381                $ff[$j] = implode('/', $ffa); 
    382                $filelist[] = array($ff[$j], $ll); 
    383           } 
    384      } 
    385      if ( sizeof($error_in_filenames) ) { 
    386              $errors[] = sprintf($lang['invalid_name_in_files'], '<br />' . implode('<br />', $error_in_filenames) ); 
    387      } 
    388  
    389      //private tracker start 
    390      $private = dict_get($info, 'private', 'integer'); 
    391      if ( !$private ) { 
    392           $info['value']['source']['type'] = 'string'; 
    393           $info['value']['source']['value'] = $config['server_name']; 
    394           $info['value']['source']['strlen'] = strlen($info['value']['source']['value']); 
    395           $info['value']['private']['type'] = 'integer'; 
    396           $info['value']['private']['value'] = 1; 
    397           $dict['value']['info'] = $info; 
    398           $dict = benc($dict); 
    399           $dict = bdec($dict); 
    400           list($ann, $info) = dict_check($dict, 'announce(string):info'); 
    401      } 
    402      //private tracker end 
    403      $infohash = pack('H*', sha1($info['string'])); 
    404  
    405      if ( sizeof($errors) ) { 
    406              trigger_error($lang['next_errors_occured'] . '<br />' . implode('<br />', $errors) ); 
    407      } 
     334        $torrent = new Torrent($torrent_file['tmp_name']); 
     335 
     336    if ( !$torrent->is_torrent($torrent_file['tmp_name']) ) { 
     337        $errors[] = $lang['you_upload_not_torrent_file']; 
     338    } 
     339         
     340        $site_url = generate_base_url(); 
     341 
     342        if ( defined('USE_XBTT') ) { 
     343                $base_announce = $site_url . ':' . $config['xbt_listen_port'] . '/announce/'; 
     344        } 
    408345        else { 
    409              return array($torrent_file['tmp_name'], $infohash, $torrent_file['name'], $totallen, $filelist, $dname, $dict, $private ); 
    410         } 
     346                $base_announce = $site_url . '/announce.php'; 
     347        } 
     348 
     349        $torrent->announce(array($base_announce)); 
     350 
     351        $dname = $torrent->name(); 
     352        $plen = $torrent->piece_length(); 
     353 
     354        $flist = $torrent->content(); 
     355 
     356        if (!sizeof($flist)) { 
     357                $errors[] = $lang['no_files']; 
     358        } 
     359 
     360        $totallen = 0; 
     361        $filelist = array(); 
     362 
     363     foreach ( $flist AS $file => $size ) { 
     364             $filelist[] = array($file, $size); 
     365             $totallen += $size; 
     366     } 
     367 
     368        if ( !$torrent->is_private() ) { 
     369                $torrent->is_private(true); 
     370        } 
     371 
     372        if ( sizeof($errors) ) { 
     373                trigger_error($lang['next_errors_occured'] . '<br />' . implode('<br />', $errors) ); 
     374        } 
     375 
     376    $infohash = $torrent->hash_info(); 
     377 
     378    $filename = md5($infohash . time()); 
     379 
     380    if ( sizeof($errors) ) { 
     381            trigger_error($lang['next_errors_occured'] . '<br />' . implode('<br />', $errors) ); 
     382    } 
     383 
     384        if ( @move_uploaded_file($torrent_file['tmp_name'], $torrent_dir . DIRECTORY_SEPARATOR . $filename . '.torrent') === false ) { 
     385                trigger_error($lang['file_cannot_be_uploaded']); 
     386        } 
     387 
     388        $torrent->save($torrent_dir . DIRECTORY_SEPARATOR . $filename . '.torrent'); 
     389 
     390        return array($infohash, $torrent_file['name'], $totallen, $filelist, $dname, $filename); 
    411391} 
    412392 
  • include/functions_post.php

    r266 r269  
    33        global $db, $userdata, $lang, $template, $config, $images, $cache, $root_path; 
    44        global $tor_comment_last_read, $req_comment_last_read, $off_comment_last_read; 
     5        global $bb_code; 
    56        static $ranks; 
    67 
    78        if ( !isset($ranks) ) { 
    89                $ranks = $cache->obtain_ranks(); 
     10        } 
     11        if ( !isset($bb_code) ) { 
     12                $bb_code = new bbcode(); 
    913        } 
    1014 
     
    3337     } 
    3438 
    35         $sql = 'SELECT c.comment_id, c.comment_text, c.comment_user, c.comment_added, c.comment_editedby, c.comment_editedat, c.comment_reputation, u.avatar, u.warneduntil, u.parked, u.name, u.title, u.class, u.donor, u.downloaded, u.uploaded, u.enabled, u2.name AS edited_by_username, u.birthday, u.gender, u.user_session_time, u.user_sig_bbcode_uid, u.user_sig, u.privacy, u.user_reputation_level, u.user_rank_id 
     39        $sql = 'SELECT c.comment_id, c.comment_text, c.comment_user, c.comment_added, c.comment_editedby, c.comment_editedat, c.comment_reputation, u.avatar, u.warneduntil, u.parked, u.name, u.title, u.class, u.donor, u.downloaded, u.uploaded, u.enabled, u2.name AS edited_by_username, u.birthday, u.gender, u.user_session_time, u.user_sig, u.privacy, u.user_reputation_level, u.user_rank_id 
    3640                        FROM ' . COMMENTS_TABLE . ' c 
    3741                        LEFT JOIN ' . USERS_TABLE . ' u2 ON c.comment_editedby = u2.uid, 
     
    6367               } 
    6468 
    65                $username = $row['name'] . get_user_icons($row)
     69               $username = $row['name']
    6670 
    6771               if ( $row['comment_user'] != $userdata['uid'] && $userdata['session_logged_in'] ) { 
     
    99103                        if ( $row['user_sig'] && $config['allow_sig'] ) { 
    100104                       //now we delete imgs if config allow_sig == 2 
    101                     $user_sig = ( $config['allow_sig'] == 2 ) ? preg_replace('#((\r)+?(\n)+?)*(\[url(:'.$row['user_sig_bbcode_uid'].')?(.*)\])?\[img.*?:'.$row['user_sig_bbcode_uid'].'\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img.*?:'.$row['user_sig_bbcode_uid'].'\](\[/url(:'.$row['user_sig_bbcode_uid'].')?\])?#i', '', $row['user_sig']) : $row['user_sig']; 
    102                     //now we remove bbcode from sig, because bbcode uses only at forum 
    103                     $user_sig = preg_replace('#:' . $row['user_sig_bbcode_uid'] . '#', '', $user_sig); 
     105                    $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']; 
    104106                    // Replace naughty words 
    105107                    $user_sig = censor_text($user_sig); 
    106108                    //and now we format sig 
    107                     $user_sig = preg_replace('/\[img(.*?)\]/', '[img]', $user_sig); 
    108                     $user_sig = format_comment($user_sig); 
     109                    $bb_code->parse($user_sig); 
     110                    $user_sig = $bb_code->get_html(); 
    109111                    //last preparation :) 
    110112                    $user_sig = ( $user_sig != '' ? '<br />_________________<br />' . $user_sig : '' ); 
     
    136138 
    137139          $text = censor_text($row['comment_text']); 
    138           $text = format_comment($text); 
     140          $bb_code->parse($text); 
     141          $text = $bb_code->get_html(); 
    139142 
    140143          $post_time = create_date($row['comment_added']); 
     
    142145          if ( $row['comment_editedby'] ) { 
    143146                  if ( $row['edited_by_username'] ) { 
    144                           $u_edited_by = append_sid('userdetails.php?id=' . $row['comment_editedby']); 
     147                          $u_edited_by = append_sid($root_path . 'userdetails.php?id=' . $row['comment_editedby']); 
    145148                          $edited_by_username = $row['edited_by_username']; 
    146149                        } 
     
    198201 
    199202          $comments[] = array( 
    200                   'U_USERDETAILS' => append_sid('userdetails.php?id=' . $row['comment_user']), 
     203                  'U_USERDETAILS' => append_sid($root_path . 'userdetails.php?id=' . $row['comment_user']), 
    201204               'U_COMMENT'     => append_sid($root_path . 'comment.php?cid=' . $row['comment_id']), 
    202205               'COMM_ID' => $row['comment_id'], 
    203206               'USER_ID' => $row['comment_user'], 
    204                'USERNAME' => $username
     207               'USERNAME' => $username . get_user_icons($row)
    205208               'TITLE' => $title, 
    206209               'AVATAR' => $avatar, 
     
    262265                        $userslist .= ( $userslist ? ', ' : '' ); 
    263266 
    264                         $userslist .= '<a href="' . append_sid('userdetails.php?id=') . $users['uid'] . '"><span class="' . ( $users['simpaty'] ? 'usergoodResp' : 'userbadResp' ) . '">' . $users['name'] . '</span></a>'; 
     267                        $userslist .= '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $users['uid']) . '"><span class="' . ( $users['simpaty'] ? 'usergoodResp' : 'userbadResp' ) . '">' . $users['name'] . '</span></a>'; 
    265268                } 
    266269 
     
    317320function preview_commentable ( $type = TYPE_TORRENT, $id ) { 
    318321        global $userdata, $lang, $template, $config, $images, $db, $cache, $root_path; 
     322        global $bb_code; 
    319323        static $ranks; 
    320324 
    321325        if ( !isset($ranks) ) { 
    322326                $ranks = $cache->obtain_ranks(); 
     327        } 
     328        if ( !isset($bb_code) ) { 
     329                $bb_code = new bbcode(); 
    323330        } 
    324331 
     
    338345 
    339346                        if ( $row['user'] <> ANONYMOUS ) { 
    340                                 $username = $row['name'] . get_user_icons($row)
     347                                $username = $row['name']
    341348                                $avatar_prefix = ( ( strpos($row['avatar'], 'user_avatar_' . $row['user']) === false && strpos($row['avatar'], '/') !== false ) || !$row['avatar'] ? '' : generate_base_url() . '/' . $config['avatar_path'] . '/' ); 
    342349                                $avatar = ($userdata['avatars'] ? ( !$row['avatar'] ? $images['default_avatar'] : $avatar_prefix . $row['avatar'] ) : $images['default_avatar']); 
     
    344351                                if ( $user_sig ) { 
    345352                                        //now we delete imgs if config allow_sig == 2 
    346                                         $user_sig = ( $config['allow_sig'] == 2 ) ? preg_replace('#((\r)+?(\n)+?)*(\[url(:'.$row['user_sig_bbcode_uid'].')?(.*)\])?\[img.*?:'.$row['user_sig_bbcode_uid'].'\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img.*?:'.$row['user_sig_bbcode_uid'].'\](\[/url(:'.$row['user_sig_bbcode_uid'].')?\])?#i', '', $user_sig) : $user_sig; 
    347                                         //now we remove bbcode from sig, because bbcode uses only at forum 
    348                                         $user_sig = preg_replace('#:' . $row['user_sig_bbcode_uid'] . '#', '', $user_sig); 
     353                                        $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; 
    349354                                        // Replace naughty words 
    350355                                        $user_sig = censor_text($user_sig); 
    351356                                        //and now we format sig 
    352                                        $user_sig = preg_replace('/\[img(.*?)\]/', '[img]', $user_sig); 
    353                                        $user_sig = format_comment($user_sig); 
     357                            $bb_code->parse($user_sig); 
     358                            $user_sig = $bb_code->get_html(); 
    354359                                        //last preparation :) 
    355360                                        $user_sig = ( $user_sig != '' ? '<br />_________________<br />' . $user_sig : '' ); 
     
    368373 
    369374                        $text = censor_text($row['comment_text']); 
    370                         $text = format_comment($text); 
    371                         $edited_by_link = ( $row['edited_by_username'] ? '<a href="' . append_sid('userdetails.php?id=' . $row['comment_editedby']) . '"><b>' . $row['edited_by_username'] . '</b></a>' : '<i>' . $lang['unknown'] . '</i>'); 
     375                  $bb_code->parse($text); 
     376                  $text = $bb_code->get_html(); 
     377 
     378 
     379                        $edited_by_link = ( $row['edited_by_username'] ? '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $row['comment_editedby']) . '"><b>' . $row['edited_by_username'] . '</b></a>' : '<i>' . $lang['unknown'] . '</i>'); 
    372380                        $edited_by = ( $row['comment_editedby'] ? sprintf($lang['edited_by'], $edited_by_link, create_date($row['comment_editedat'])):''); 
    373381                        $post_time = create_date($row['comment_added']); 
     
    385393 
    386394                        $template->assign_block_vars('comments_table_row', array( 
    387                                 'U_USERDETAILS' => append_sid('userdetails.php?id=' . $row['user']), 
     395                                'U_USERDETAILS' => append_sid($root_path . 'userdetails.php?id=' . $row['user']), 
    388396                                'U_COMMENT'     => append_sid($root_path . 'comment.php?cid=' . $row['comment_id']), 
    389397                                'COMM_ID' => $row['comment_id'], 
    390398                                'USER_ID' => $row['user'], 
    391                                 'USERNAME' => $username
     399                                'USERNAME' => $username . get_user_icons($row)
    392400                                'TITLE' => $title, 
    393401                                'AVATAR' => $avatar, 
     
    522530        } 
    523531} 
    524  
    525 function _strlastpos ($haystack, $needle, $offset = 0) { 
    526         if ( function_exists('strripos') ) { 
    527                 $endPos = strripos($haystack, $needle, $offset); 
    528                 return ($endPos >= 0) ? $endPos : false; 
    529         } 
    530         $addLen = strlen ($needle); 
    531         $endPos = $offset - $addLen; 
    532         while (true) 
    533         { 
    534                 if (($newPos = strpos ($haystack, $needle, $endPos + $addLen)) === false) { 
    535                         break; 
    536                 } 
    537                 $endPos = $newPos; 
    538         } 
    539         return ($endPos >= 0) ? $endPos : false; 
    540 } 
    541  
    542 function format_quote_like_tags ( $text, $tag_name ) { 
    543         global $lang, $bb_tpl; 
    544  
    545         $old_text = ''; 
    546         $tag_size = strlen($tag_name) + 3; 
    547  
    548         $tpl = $bb_tpl[$tag_name . '_open'] . '\\1' . $bb_tpl[$tag_name . '_close']; 
    549  
    550         if ( isset($bb_tpl[$tag_name . '_header_open']) && isset($bb_tpl[$tag_name . '_close']) ) { 
    551                 $tpl_header = $bb_tpl[$tag_name . '_header_open'] . '\\2' . $bb_tpl[$tag_name . '_close']; 
    552         } 
    553         else { 
    554                 $tpl_header = ''; 
    555         } 
    556  
    557         while ( $old_text != $text ) { 
    558                 $old_text = $text; 
    559                 //find first occurrence of [/quote] 
    560                 $close = strpos($text, '[/' . $tag_name . ']'); 
    561  
    562                 if ($close === false) { 
    563                         return $text; 
    564                 } 
    565                 //find last [quote] before first [/quote] 
    566                 //note that there is no check for correct syntax 
    567                 if ( function_exists('strripos') ) { 
    568                         $open = strripos(substr($text, 0, $close), '[' . $tag_name); 
    569                 } 
    570                 else { 
    571                         $open = _strlastpos(substr($text, 0, $close), '[' . $tag_name); 
    572                 } 
    573                 if ( $open === false ) { 
    574                         return $text; 
    575                 } 
    576                 $tag = substr($text, $open, $close - $open + $tag_size); 
    577                 //[quote]Text[/quote] 
    578                 $tag = preg_replace("/\[" . $tag_name . "\]\s*((\s|.)+?)\s*\[\/" . $tag_name . "\]\s*/i", $tpl, $tag); 
    579  
    580                 //[quote=Author]Text[/quote] 
    581                 if ( $tpl_header ) { 
    582                         $tag = preg_replace("/\[" . $tag_name . "=(.+?)\]\s*((\s|.)+?)\s*\[\/" . $tag_name . "\]\s*/i", $tpl_header, $tag); 
    583                 } 
    584  
    585                 $text = substr($text, 0, $open) . $tag . substr($text, $close + $tag_size); 
    586         } 
    587         return $text; 
    588 } 
    589  
    590 function format_comment($text) { 
    591         global $db, $template, $lang, $bb_tpl, $template_path; 
    592  
    593         if (!defined('BB_TPL_READY')) 
    594         { 
    595                 $tpl = @file_get_contents($template_path . '/bbcode.html'); 
    596  
    597                 // replace \ with \\ and then ' with \'. 
    598                 $tpl = str_replace('\\', '\\\\', $tpl); 
    599                 $tpl  = str_replace('\'', '\\\'', $tpl); 
    600  
    601                 // strip newlines. 
    602                 $tpl  = str_replace("\n", '', $tpl); 
    603  
    604                 // Turn template blocks into PHP assignment statements for the values of $bb_tpls.. 
    605                 $tpl = preg_replace('#<!-- BEGIN (.*?) -->(.*?)<!-- END (.*?) -->#', "\n" . '$bb_tpl[\'\\1\'] = \'\\2\';', $tpl); 
    606  
    607                 $bb_tpl = array(); 
    608  
    609                 eval($tpl); 
    610  
    611                 $bb_tpl['olist_open'] = str_replace('{LIST_TYPE}', '\\1', $bb_tpl['olist_open']); 
    612  
    613                 $bb_tpl['color_open'] = str_replace('{COLOR}', '\\1', $bb_tpl['color_open']); 
    614  
    615                 $bb_tpl['size_open'] = str_replace('{SIZE}', '\\1', $bb_tpl['size_open']); 
    616  
    617                 $bb_tpl['quote_open'] = str_replace('{L_QUOTE}', $lang['quote'], $bb_tpl['quote_open']); 
    618  
    619                 $bb_tpl['quote_header_open'] = str_replace('{L_QUOTE}', $lang['quote'], $bb_tpl['quote_username_open']); 
    620                 $bb_tpl['quote_header_open'] = str_replace('{L_POSTED}', $lang['posted'], $bb_tpl['quote_header_open']); 
    621                 $bb_tpl['quote_header_open'] = str_replace('{USERNAME}', '\\1', $bb_tpl['quote_header_open']); 
    622                 // BEGIN Moderator Tags 
    623                 $bb_tpl['mod_header_open'] = str_replace('{USERNAME}', '\\1', $bb_tpl['mod_username_open']); 
    624                 // END Moderator Tags 
    625  
    626                 // We do URLs in several different ways.. 
    627                 $bb_tpl['url1'] = str_replace('{URL}', '\\1', $bb_tpl['url']); 
    628                 $bb_tpl['url1'] = str_replace('{DESCRIPTION}', '\\1', $bb_tpl['url1']); 
    629  
    630                 $bb_tpl['url2'] = str_replace('{URL}', 'http://\\1', $bb_tpl['url']); 
    631                 $bb_tpl['url2'] = str_replace('{DESCRIPTION}', '\\1', $bb_tpl['url2']); 
    632  
    633                 $bb_tpl['url3'] = str_replace('{URL}', '\\1', $bb_tpl['url']); 
    634                 $bb_tpl['url3'] = str_replace('{DESCRIPTION}', '\\2', $bb_tpl['url3']); 
    635  
    636                 $bb_tpl['url4'] = str_replace('{URL}', 'http://\\1', $bb_tpl['url']); 
    637                 $bb_tpl['url4'] = str_replace('{DESCRIPTION}', '\\3', $bb_tpl['url4']); 
    638  
    639                 $bb_tpl['url5'] = str_replace('{URL}', '\\2', $bb_tpl['url']); 
    640                 $bb_tpl['url5'] = str_replace('{DESCRIPTION}', '\\2', $bb_tpl['url5']); 
    641  
    642                 $bb_tpl['url6'] = str_replace('{URL}', 'http://\\2', $bb_tpl['url']); 
    643                 $bb_tpl['url6'] = str_replace('{DESCRIPTION}', '\\2', $bb_tpl['url6']); 
    644  
    645                 $bb_tpl['email1'] = str_replace('{EMAIL}', '\\1', $bb_tpl['email']); 
    646                 $bb_tpl['email1'] = str_replace('{DESCRIPTION}', '\\1', $bb_tpl['email1']); 
    647                 $bb_tpl['email2'] = str_replace('{EMAIL}', '\\2@\\3', $bb_tpl['email']); 
    648                 $bb_tpl['email2'] = str_replace('{DESCRIPTION}', '\\2@\\3', $bb_tpl['email2']); 
    649  
    650                 $bb_tpl['font'] = str_replace('{FONT_FAMILY}', '\\1', $bb_tpl['font']); 
    651                 $bb_tpl['font'] = str_replace('{CONTENT}', '\\2', $bb_tpl['font']); 
    652  
    653                 define('BB_TPL_READY', true); 
    654         } 
    655  
    656         $text = format_quote_like_tags($text, 'quote'); 
    657         $text = format_quote_like_tags($text, 'mod'); 
    658  
    659         $pattern = $tags = array(); 
    660  
    661         //strip some bad words ;) 
    662         $pattern[] = "#(script|about|applet|activex|chrome):#is"; 
    663         $tags[] = "\\1&#058;"; 
    664  
    665         // [font=Arial]example[/font] becomes <span style="font: Arial">example</span> 
    666         $pattern[] = "/\[font=([a-zA-Z ,]+)\]((\s|.)+?)\[\/font\]/i"; 
    667         $tags[] = $bb_tpl['font']; 
    668  
    669         // matches a [url]xxxx://www.example.com[/url] code.. 
    670         $pattern[] = "#\[url\]([\w]+?://([\w\#$%&~/.\-;:=,?@\]+]+|\[(?!url=))*?)\[/url\]#is"; 
    671         $tags[] = $bb_tpl['url1']; 
    672  
    673         // [url]www.example.com[/url] code.. (no xxxx:// prefix). 
    674         $pattern[] = "#\[url\]((www|ftp)\.([\w\#$%&~/.\-;:=,?@\]+]+|\[(?!url=))*?)\[/url\]#is"; 
    675         $tags[] = $bb_tpl['url2']; 
    676  
    677         // [url=xxxx://www.example.com]example[/url] code.. 
    678         $pattern[] = "#\[url=([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*?)\]([^?\n\r\t].*?)\[/url\]#is"; 
    679         $tags[] = $bb_tpl['url3']; 
    680  
    681         // [url=www.example.com]example[/url] code.. (no xxxx:// prefix). 
    682         $pattern[] = "#\[url=((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*?)\]([^?\n\r\t].*?)\[/url\]#is"; 
    683         $tags[] = $bb_tpl['url4']; 
    684  
    685         $pattern[] = "#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]|+]*)#is"; 
    686         $tags[] = '\\1' . $bb_tpl['url5']; 
    687  
    688         $pattern[] = "#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]|+]*)#is"; 
    689         $tags[] = '\\1' . $bb_tpl['url6']; 
    690  
    691         $pattern[] = "#\[email\]([a-z0-9&\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)\[/email\]#si"; 
    692         $tags[] = $bb_tpl['email1']; 
    693  
    694         $pattern[] = "#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i"; 
    695         $tags[] = '\\1' . $bb_tpl['email2']; 
    696  
    697         $text = preg_replace($pattern, $tags, $text); 
    698  
    699         // [img]example_img[/img] becomes <img src="example_img" /> 
    700         preg_match_all( "#\[(img)\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/(img)\]#sie", $text, $matches ); 
    701         foreach ( $matches[0] as $i => $m ) { 
    702                 $tag_open = $matches[1][$i]; 
    703                 $tag_close = $matches[7][$i]; 
    704                 $url1 = $matches[2][$i]; 
    705                 $url2 = $matches[4][$i]; 
    706                 $img_tag = str_replace('{URL}', $url1 . $url2, $bb_tpl['img']); 
    707                 $text = str_replace('[' . $tag_open . ']' . $url1 . $url2 . '[/' . $tag_close . ']', $img_tag, $text); 
    708         } 
    709  
    710         $text = preg_replace("/\[color=(\#[0-9A-F]{6}|[a-z]+)\]/si", $bb_tpl['color_open'], $text); 
    711         $text = str_replace("[/color]", $bb_tpl['color_close'], $text); 
    712  
    713         $text = preg_replace("/\[size=([1-2]?[0-9])\]/si", $bb_tpl['size_open'], $text); 
    714         $text = str_replace("[/size]", $bb_tpl['size_close'], $text); 
    715  
    716         // [b] and [/b] for bolding text. 
    717         $text = str_replace("[b]", $bb_tpl['b_open'], $text); 
    718         $text = str_replace("[/b]", $bb_tpl['b_close'], $text); 
    719  
    720         // [u] and [/u] for underlining text. 
    721         $text = str_replace("[u]", $bb_tpl['u_open'], $text); 
    722         $text = str_replace("[/u]", $bb_tpl['u_close'], $text); 
    723  
    724         // [i] and [/i] for italicizing text. 
    725         $text = str_replace("[i]", $bb_tpl['i_open'], $text); 
    726         $text = str_replace("[/i]", $bb_tpl['i_close'], $text); 
    727  
    728         $text = str_replace("[*]", $bb_tpl['listitem'], $text); 
    729  
    730         preg_match_all( "/\[(pre)\](.*?)\[\/(pre)\]/si", $text, $matches ); 
    731         foreach ( $matches[0] as $i => $m ) { 
    732                 $tag_open = $matches[1][$i]; 
    733                 $tag_close = $matches[3][$i]; 
    734                 $pre_content = str_replace("  ", " &nbsp;", $matches[2][$i]); 
    735                 $pre_tag = str_replace('{CONTENT}', $pre_content, $bb_tpl['pre']); 
    736                 $text = str_replace('[' . $tag_open . ']' . $matches[2][$i] . '[/' . $tag_close . ']', $pre_tag, $text); 
    737         } 
    738  
    739         $text = str_replace("\n", "\n<br />\n", $text); 
    740  
    741         $text = smilies_pass($text); 
    742  
    743         return $text; 
    744 } 
    745  
    746 function smilies_pass($text) 
    747 { 
    748         global $smilies, $cache, $config, $root_path; 
    749         static $orig_smilies, $repl_smilies; 
    750  
    751         if (!isset($smilies)) 
    752         { 
    753                 $smilies = $cache->obtain_smilies(); 
    754  
    755                 foreach ( $smilies AS $smiley_id => $row ) 
    756                 { 
    757                         $code = str_replace('"', '\"', $row['code']); 
    758                         $orig_smilies[] = "/(?<=.\W|\W.|^\W)" . preg_quote(str_replace("\\'", "'", str_replace('\\\\', '\\', $row['code'])), "/") . "(?=.\W|\W.|\W$)/"; 
    759                         $repl_smilies[] = '<img src="'. $root_path .  $config['smilies_path'] . '/' . $row['smile_url'] . '" alt="' . $code . '" border="0" />'; 
    760                 } 
    761         } 
    762  
    763         if (sizeof($orig_smilies)) 
    764         { 
    765                 $text = preg_replace($orig_smilies, $repl_smilies, ' ' . $text . ' '); 
    766                 $text = substr($text, 1, -1); 
    767         } 
    768  
    769         return $text; 
    770 } 
    771532?> 
  • include/functions_search.php

    r264 r269  
    2828} 
    2929 
    30 function search_text_in_db ( $searchstr, $base_sql, $where_search, $add_where = array() ) { 
     30function search_text_in_db ( $searchstr, $base_sql, $where_search, $add_where = array(), $strict = false ) { 
    3131        global $db, $config; 
    3232 
     
    4141        $lower_searchstr = utf_strtolower($searchstr); 
    4242 
    43         $split_search = split_words($cleansearchstr); 
     43        if ( $strict ) { 
     44                $split_search = array($lower_searchstr); 
     45        } 
     46        else { 
    4447 
    45         if ( $lower_searchstr <> $searchstr ) { 
    46                 $search_full_string = true; 
    47                 foreach ( $match_types  AS $_null => $match_type ) { 
    48                         if ( strpos($lower_searchstr, $match_type) !== false ) { 
    49                                 $search_full_string = false; 
     48                $split_search = split_words($cleansearchstr); 
     49 
     50                if ( $lower_searchstr <> $searchstr ) { 
     51                        $search_full_string = true; 
     52                        foreach ( $match_types  AS $_null => $match_type ) { 
     53                                if ( strpos($lower_searchstr, $match_type) !== false ) { 
     54                                        $search_full_string = false; 
     55                                } 
    5056                        } 
    51                 } 
    52                 if ( $search_full_string ) { 
    53                         $split_search[] = $lower_searchstr; 
     57                       if ( $search_full_string ) { 
     58                               $split_search[] = $lower_searchstr; 
     59                        } 
    5460                } 
    5561        } 
     
    8995 
    9096                                $match_word = str_replace('*', '%', $split_search[$i]); 
    91                                 $search = $where_search . ' LIKE \'%' . $db->sql_escape($match_word) . '%\'' . $add_where; 
     97                                if ( $strict ) { 
     98                                        $search = $where_search . ' = \'' . $db->sql_escape($match_word) . '\'' . $add_where; 
     99                                } 
     100                                else { 
     101                                        $search = $where_search . ' LIKE \'%' . $db->sql_escape($match_word) . '%\'' . $add_where; 
     102                                } 
    92103 
    93104                                $sql = $base_sql . ' WHERE ' . $search; 
  • include/functions_torrenttable.php

    r266 r269  
    142142                $id = $ary[$i]['fid']; 
    143143                $dispname = $ary[$i]['name']; 
    144                 $dispname = ( $highlight ? highlight_text($search, $dispname) : $dispname ); 
    145144                $dispname = censor_text($dispname); 
    146145                $hidden_color = ( $ary[$i]['hidden'] ? 'bgcolor="#' . $theme['hidden_torrent_color'] . '" ':''); 
     146 
     147                $dispname = ( $highlight ? highlight_text($search, $dispname) : $dispname ); 
    147148 
    148149                if ( $ary[$i]['numratings'] < $config['minvotes'] ) { 
  • include/modtask/mass_torrent_actions.php

    r266 r269  
    112112                        deletetorrent( $delete_arr ); 
    113113 
    114                         $cache->destroy( 'sql', INDEXRELEASES_TABLE ); 
     114                        $cache->destroy('sql', INDEXRELEASES_TABLE ); 
    115115                } 
    116116 
     
    146146                                $db->sql_query($sql); 
    147147 
    148                                 write_log( sprintf( $lang['log_torrent_edited'], 'details_' . $ary['fid'], $ary['name'], $userdata['name'] ) ); 
    149  
    150                         } 
    151  
    152                         meta_refresh(3, append_sid('browse.php')); 
     148                                write_log(sprintf($lang['log_torrent_edited'], $ary['fid'], $ary['name'], $userdata['uid'], $userdata['name'])); 
     149 
     150                        } 
     151 
     152                        meta_refresh(3, append_sid($root_path . 'browse.php')); 
    153153                        trigger_error($lang['succefully_edited']); 
    154154                } 
     
    197197                        $db->sql_query($sql); 
    198198 
    199                         write_log( sprintf( $lang['log_torrent_edited'], 'details_' . $ary['fid'], $ary['name'], $userdata['name'] ) ); 
     199                        write_log( sprintf( $lang['log_torrent_edited'], $ary['fid'], $ary['name'], $userdata['uid'], $userdata['name']) ); 
    200200 
    201201                } 
  • include/modtask/new_comments.php

    r266 r269  
    1212        )); 
    1313 
    14         $sql = 'SELECT c.*, u.name, u.class, u.avatar, u.enabled, u.warneduntil, u.parked, u.donor, u.title, u.user_sig_bbcode_uid, u.user_sig, u2.name AS edited_by_username, t.fid, r.id AS req_id, o.id AS off_id 
     14        $sql = 'SELECT c.*, u.name, u.class, u.avatar, u.enabled, u.warneduntil, u.parked, u.donor, u.title, u.user_sig, u2.name AS edited_by_username, t.fid, r.id AS req_id, o.id AS off_id 
    1515                        FROM ' . COMMENTS_TABLE . ' c 
    1616                        LEFT JOIN ' . TORRENTS_TABLE . ' t ON c.comment_for_id = t.fid 
     
    2525        $result = $db->sql_query($sql); 
    2626        if ( $row = $db->sql_fetchrow($result) ) { 
     27 
     28                $bb_code = new bbcode; 
    2729 
    2830                $tracking_details = ( isset($_COOKIE[$config['cookie_name'] . '_d']) ) ? unserialize($_COOKIE[$config['cookie_name'] . '_d']) : array(); 
     
    4042                       if ( $user_sig ) { 
    4143                               //now we delete imgs if config allow_sig == 2 
    42                                $user_sig = ( $config['allow_sig'] == 2 ) ? preg_replace('#((\r)+?(\n)+?)*(\[url(:'.$row['user_sig_bbcode_uid'].')?(.*)\])?\[img.*?:'.$row['user_sig_bbcode_uid'].'\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img.*?:'.$row['user_sig_bbcode_uid'].'\](\[/url(:'.$row['user_sig_bbcode_uid'].')?\])?#i', '', $user_sig) : $user_sig; 
    43                                //now we remove bbcode from sig, because bbcode uses only at forum 
    44                                $user_sig = preg_replace('#:' . $row['user_sig_bbcode_uid'] . '#', '', $user_sig); 
     44                               $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 
    4646                               $user_sig = censor_text($user_sig); 
    47                                //and now we format sig 
    48                                $user_sig = preg_replace('/\[img(.*?)\]/', '[img]', $user_sig); 
    49                                $user_sig = format_comment($user_sig); 
     47                            $bb_code->parse($user_sig); 
     48                            $user_sig = $bb_code->get_html(); 
    5049                               //last preparation :) 
    5150                               $user_sig = ( $user_sig != '' ? '<br />_________________<br />' . $user_sig : '' ); 
     
    8584                        } 
    8685 
     86                  $bb_code->parse($row['comment_text']); 
     87                  $row['comment_text'] = $bb_code->get_html(); 
     88 
    8789                        $template->assign_block_vars('comments_row', array( 
    8890                    'USER_ID' => $user_id, 
     
    9597                                'SIGNATURE' => $user_sig, 
    9698                                'EDITED_BY' => $edited_by, 
    97                                 'TEXT' => format_comment($row['comment_text'])
     99                                'TEXT' => $row['comment_text']
    98100                        'MINI_POST_IMG' => $mini_post_img, 
    99101                        'MINI_POST_ALT' => $mini_post_alt 
  • include/sessions.php

    r266 r269  
    518518{ 
    519519        global $config, $theme, $images; 
    520         global $template, $lang, $phpEx, $root_path, $db; 
     520        global $template, $lang, $lang_js, $phpEx, $root_path, $db; 
    521521 
    522522        if ( $userdata['uid'] != ANONYMOUS ) 
     
    603603 
    604604        include($root_path . 'languages/lang_' . $default_lang . '/lang_main.php'); 
     605        include($root_path . 'languages/lang_' . $default_lang . '/lang_js.php'); 
     606 
     607        //$lang = array_merge($lang, $lang_js); 
    605608 
    606609        if ( defined('IN_PHPBB') ) 
     
    634637 
    635638function setup_style($style) { 
    636         global $db, $config, $template, $root_path, $lang, $images, $template_path, $userdata
     639        global $db, $config, $template, $root_path, $lang, $images, $template_path, $userdata, $lang_js
    637640 
    638641        require_once ($root_path . 'include/class.template.php'); 
     
    640643        $sql = 'SELECT * FROM ' . THEMES_TABLE . ' WHERE themes_id = ' . $style; 
    641644     $result = $db->sql_query($sql, 31536000); 
    642      if ( !($row = $db->sql_fetchrow($result)) ) { 
     645     if ( !$row = $db->sql_fetchrow($result) ) { 
    643646                $db->sql_freeresult($result); 
    644647 
     
    686689                } 
    687690                $userdata['template_path'] = $template_path; 
    688         //      $userdata['theme_bitfield'] = $row['bbcode_bitfield']; 
    689691 
    690692                $template->assign_vars(array( 
    691693                        'TEMPLATE_PATH' => $template_path 
    692694                )); 
     695 
     696                foreach ( $lang_js AS $key => $value ) { 
     697                        $template->assign_block_vars('javascript_lang', array( 
     698                                'KEY' => 'L_' . strtoupper($key), 
     699                                'VALUE' => str_replace("'", "\'", $value) 
     700                        )); 
     701                } 
    693702        } 
    694703        else { 
     
    11291138     } 
    11301139 
    1131      return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $userdata['tzoffset'])), $translate) : @gmdate($format, $gmepoch + (3600 * $userdata['tzoffset'])); 
     1140     return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $tz)), $translate) : @gmdate($format, $gmepoch + (3600 * $tz)); 
    11321141} 
    11331142 
  • include/ucp/bonus.php

    r245 r269  
    1515        $title = request_var('title', ''); 
    1616        $reputation_count = request_var('reputation_count', 0); 
     17        $reputation_count = ( $reputation_count < 0 ? 0 : $reputation_count ); 
    1718 
    1819        if ( isset($my_bonus_settings[$choice]) ) { 
  • include/ucp/checkcomm.php

    r266 r269  
    1111else { 
    1212        list($pagertop, $pagerbottom, $limit) = pager($config['posts_per_page'], $count, 'my.php?type=' . $type . '&amp;'); 
    13         $sql = 'SELECT cn.checkcomm_for_id, cn.checkcomm_type, t.name AS torrent_name, r.request AS request_name, o.name AS offer_name, n.title AS news_name, c.comment_added, c.comment_id, u.name, u.uid, u.class 
     13        $sql = 'SELECT cn.checkcomm_for_id, cn.checkcomm_type, t.name AS torrent_name, t.category AS torrent_category, r.request AS request_name, r.cat AS request_category, o.name AS offer_name, o.category AS offer_category, n.title AS news_name, NULL AS news_category, c.comment_added, c.comment_id, u.name, u.uid, u.class 
    1414                        FROM ' . COMMENTS_NOTIFY_TABLE . ' cn 
    1515                        LEFT JOIN ' . TORRENTS_TABLE . ' t ON cn.checkcomm_for_id = t.fid 
     
    3333 
    3434        $i = 0; 
     35 
     36        $cats = $cache->obtain_cats(); 
    3537 
    3638        while ( $row = $db->sql_fetchrow($result) ) { 
     
    6264                } 
    6365 
     66                $cat_id = $row[$table . '_category']; 
    6467                if ( $row['uid'] <> ANONYMOUS ) { 
    6568                        $u_last_poster = append_sid('userdetails.php?id=' . $row['uid']); 
  • index.php

    r266 r269  
    22$root_path = './'; 
    33require ($root_path . 'include/config.php'); 
    4 require ($root_path . 'include/functions_post.php'); 
     4require ($root_path . 'include/bbcode/bbcode.lib.php'); 
    55 
    66$userdata = session_pagestart($user_ip); 
    77init_userprefs($userdata); 
     8 
     9$bb_code = new bbcode(); 
    810 
    911$sql = 'SELECT uid, name FROM ' . USERS_TABLE . ' WHERE status = 1 AND uid <> ' . ANONYMOUS . ' ORDER BY uid DESC'; 
    1012$result = $db->sql_query_limit($sql, 1, 0, 20 * 60); 
    1113if ($row = $db->sql_fetchrow($result)) { 
    12         $latestuser = ( $userdata['session_logged_in'] ? '<a href="' . append_sid('userdetails.php?id=' . $row['uid']) . '"><b>' . $row['name'] . '</b></a>' : '<b>' . $row['name'] . '</b>' ); 
     14 
     15        $latestuser = ( $userdata['session_logged_in'] ? '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $row['uid']) . '"><b>' . $row['name'] . '</b></a>' : '<b>' . $row['name'] . '</b>' ); 
    1316} 
    1417$db->sql_freeresult($result); 
     
    2427        if ( $birthday_arr = $db->sql_fetchrow($result) ) { 
    2528                do { 
     29 
    2630               $age = get_age($birthday_arr['birthday']); 
    27                     $birthday_arr['name'] = get_user_class_color($birthday_arr['class'], $birthday_arr['name']); 
    28                     $birthday_users .= ( $birthday_users ? ', ' : '' ) . '<a href="' . append_sid('userdetails.php?id=' . $birthday_arr['uid']) . '">' . $birthday_arr['name'] . '</a> (' . $age . ')' . get_user_icons($birthday_arr); 
    29  
    30                
    31                 while ($birthday_arr = $db->sql_fetchrow($result)); 
     31               $birthday_arr['name'] = get_user_class_color($birthday_arr['class'], $birthday_arr['name']); 
     32               $birthday_users .= ( $birthday_users ? ', ' : '' ) . '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $birthday_arr['uid']) . '">' . $birthday_arr['name'] . '</a> (' . $age . ')' . get_user_icons($birthday_arr); 
     33 
     34               
     35          while ($birthday_arr = $db->sql_fetchrow($result)); 
    3236        } 
    3337        $db->sql_freeresult($result); 
     
    147151                                        $vote_graphic = ($vote_graphic < $vote_graphic_max - 1) ? $vote_graphic + 1 : 0; 
    148152 
    149  
    150                                         $vote_info[$i]['vote_option_text'] = censor_text(format_comment($vote_info[$i]['vote_option_text'])); 
     153                                        $vote_option_text = $vote_info[$i]['vote_option_text']; 
     154                                        $bb_code->parse($vote_option_text); 
     155                            $vote_option_text = $bb_code->get_html(); 
     156 
     157 
     158                                        $vote_info[$i]['vote_option_text'] = $vote_option_text; 
    151159 
    152160                                        $template->assign_block_vars("poll.voted.voted_row", array( 
     
    169177 
    170178                                for($i = 0; $i < $vote_options; $i++) { 
    171                                         $vote_info[$i]['vote_option_text'] = censor_text($vote_info[$i]['vote_option_text']); 
     179                                        $vote_option_text = $vote_info[$i]['vote_option_text']; 
     180                                        $bb_code->parse($vote_option_text); 
     181                            $vote_option_text = $bb_code->get_html(); 
    172182 
    173183                                        $template->assign_block_vars("poll.no_voted.novoted_row", array( 
    174184                                                'POLL_OPTION_ID' => $vote_info[$i]['vote_option_id'], 
    175                                                 'POLL_OPTION_CAPTION' => format_comment($vote_info[$i]['vote_option_text']) 
     185                                                'POLL_OPTION_CAPTION' => $vote_option_text 
    176186                                        )); 
    177187                                } 
     
    181191                        $expire_time = ( $vote_info[0]['vote_length'] ? create_date($vote_info[0]['vote_start'] + $vote_info[0]['vote_length']) : 0 ); 
    182192 
     193                        $bb_code->parse($vote_title); 
     194                  $vote_title = $bb_code->get_html(); 
     195 
    183196                        $template->assign_vars(array( 
    184                                 'POLL_QUESTION' => format_comment($vote_title)
     197                                'POLL_QUESTION' => $vote_title
    185198                                'S_THIS_POLL_WILL_EXPIRE_AT' => ( $expire_time ? ( $poll_expired ? sprintf($lang['this_poll_expired_at'], $expire_time ) : sprintf($lang['this_poll_will_expire_at'], $expire_time ) ) : '') ) 
    186199                        ); 
     
    234247             $template->assign_block_vars('news', array()); 
    235248             foreach ( $news_ary AS $key => $ary ) { 
     249 
     250                        $bb_code->parse($ary['body']); 
     251                  $ary['body'] = $bb_code->get_html(); 
     252 
    236253                        $template->assign_block_vars('news.news_row', array( 
    237254                                'ID' => $ary['id'], 
     
    240257                                'PIC' => $root_path . 'pic/' . ( $i ? 'plus.gif' : 'minus.gif' ), 
    241258                                'TITLE' => $ary['title'], 
    242                                 'BODY' =>  format_comment($ary['body'])
     259                                'BODY' =>  $ary['body']
    243260                                'U_ADD_COMMENT' => append_sid($root_path . 'comment.php', 'type=' . TYPE_NEWS . '&amp;action=add&amp;tid=' . $ary['id']), 
    244261                                'COMMENTS_COUNT' => $ary['news_comments'], 
     
    274291        do { 
    275292                $name = $row['name'] ? $row['name'] : $row['torrent_name']; 
     293 
     294                $cat_id = $row['category']; 
     295                $cat_parent_id = ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_id']) ? $cats[$cats[$cat_id]['cat_parent']]['cat_id'] : 0 ); 
     296 
     297 
     298                $description = censor_text($row['description']); 
     299                $bb_code->parse($description); 
     300             $description = $bb_code->get_html(); 
     301 
    276302                $template->assign_block_vars('releases.releases_row', array( 
    277303                        'NAME'     => $name, 
     
    285311               'CATEGORY_IMAGE' => $root_path . 'pic/categories/' . $row['category_image'], 
    286312               'CATEGORY_NAME'  => $row['category_name'], 
    287                'DESCRIPTION'    => format_comment(censor_text($row['description']))
     313               'DESCRIPTION'    => $description
    288314               'IMDB_LINK'      => ( $row['imdb_link'] ? '  [<a href="redir.php?url=' . $row['imdb_link'] . '" target="_blank">IMDB</a>]' : '' ), 
    289315               'FORUM_LINK'     => ( $row['forum_link'] ? '  [<a href="' . append_sid($root_path . 'phpbb2.php?page=viewtopic&amp;t=' . $row['forum_link']) . '" target="_blank">' . $lang['talk_at_forum'] . '</a>]' : '' ) 
  • js/ajax_common.js

    r239 r269  
    2323                        if (req.responseJS) { 
    2424                                document.getElementById('thanks_button').disabled = true; 
    25                                 if (req.responseJS.thanks_users) { 
    26                                         document.getElementById('thanks_users').innerHTML = ( show ?  document.getElementById('thanks_users').innerHTML + ', ' : '' ) + req.responseJS.thanks_users; 
    27                                 } 
    2825                                alert(req.responseJS.text); 
    2926                        } 
     
    259256} 
    260257 
     258function show_prompt (tag_type, id) { 
     259        var txt = L_JS_ENTER_TAGS + '<input type="text" id="tag_name" name="tag_name" size="50" \/>'; 
     260 
     261        $.prompt(txt, { 
     262                loaded: function () { 
     263                        $("#tag_name").autocomplete(TRACKER_URL + 'ajax.php?action=autocomplete_tags&sid=' + SID, { 
     264                                delay:10, 
     265                                matchSubset:1, 
     266                                autoFill:true, 
     267                                matchContains:1, 
     268                                cacheLength:10, 
     269                                selectFirst:true, 
     270                                multiple: true 
     271                        }); 
     272                }, 
     273                submit: function (v, m, f) { 
     274                        var tag_name = f.tag_name; 
     275                        if ( !tag_name ) { 
     276                                return false; 
     277                        } 
     278                        update_tag(tag_name, tag_type, id, 'up'); 
     279                } 
     280        }); 
     281 
     282        return false; 
     283} 
     284 
     285function update_tag (tag_name, tag_type, id, type) { 
     286        var req = new JsHttpRequest(); 
     287        req.onreadystatechange = function() { 
     288                if ( req.readyState == 4 ) { 
     289                        if ( req.responseJS ) { 
     290                                if ( req.responseJS.tags ) { 
     291                                        $('#details_tags').append(' ' + req.responseJS.tags); 
     292                                } 
     293                                if ( req.responseJS.message ) { 
     294                                        alert(req.responseJS.message); 
     295                                } 
     296                        } 
     297                } 
     298        } 
     299        req.caching = true; 
     300        req.open('POST', TRACKER_URL + 'ajax.php?action=update_tag&sid=' + SID, true); 
     301        req.send({ tag_name: tag_name, tag_type: tag_type, id: id, type: type }); 
     302} 
     303 
     304function delete_tag (tag_name, tag_type, id) { 
     305 
     306        if ( !confirm(L_JS_ARE_YOU_SURE_DELETE_TAG + ' "' + tag_name + '"?') ) { 
     307                return; 
     308        } 
     309        $.ajax({ 
     310                url: TRACKER_URL + 'modtask.php?action=tags&do=delete_tag&sid=' + SID, 
     311                global: false, 
     312                type: "POST", 
     313                data: ({tag_name: tag_name, tag_type: tag_type, id: id}), 
     314                dataType: "html", 
     315                success: function(msg){ 
     316                        $('#tag_' + tag_name).remove(); 
     317                        alert(msg); 
     318                } 
     319        }).responseText; 
     320} 
     321 
  • languages/lang_english/lang_admin.php

    r246 r269  
    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', 
     
    11071107        'simpaty_thanks_to_upload' => 'Points 1 thanks from user to uploaded torrent', 
    11081108 
     1109 
     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 
    11091118)); 
    11101119?> 
  • languages/lang_english/lang_bbcode.php

    r184 r269  
    4545                2 => '[size=<i>n</i>]<i>Text</i>[/size]', 
    4646                3 => '[size=11]Text size is 11[/size]', 
    47                 4 => '<i>n</i> must be integer from 1 (min) to 29 (max). Standard 11
     47                4 => '<i>n</i> must be integer from 1 (min) to 7 (max)
    4848        ), 
    4949        array( 
     
    8585                0 => 'Quote (2)', 
    8686                1 => 'Inserts quotes', 
    87                 2 => '[quote=<i>Author</i>]<i>Text for quoting</i>[/quote]', 
    88                 3 => '[quote=' . $userdata['name'] . ']Quote example[/quote]', 
     87                2 => '[quote="<i>Author</i>"]<i>Text for quoting</i>[/quote]', 
     88                3 => '[quote="' . $userdata['name'] . '"]Quote example[/quote]', 
    8989                4 => '' 
    9090        ), 
     
    9797        ), 
    9898        array( 
    99                 0 => 'Preformatted text (tracker only)', 
     99                0 => 'Preformatted text', 
    100100                1 => 'Preformatted (monospace) text. All text formatting will be saved', 
    101101                2 => '[pre]<i>Text</i>[/pre]', 
    102102                3 => '[pre]This is preformatted text.[/pre]', 
    103                 4 => 'On forum use tag [code][/code] to obtain preformatted text.
     103                4 => '
    104104        ) 
    105105); 
  • languages/lang_english/lang_forum.php

    r164 r269  
    4848        'post' =>  'Post', 
    4949        'posts' =>  'Posts', 
    50         'posted' =>  'Posted', 
    5150        'username' =>  'Username', 
    5251        'password' =>  'Password', 
     
    368367        'color_black' =>  'Black', 
    369368 
    370         'font_size' =>  'Font size', 
    371         'font_tiny' =>  'Tiny', 
    372         'font_small' =>  'Small', 
    373         'font_normal' =>  'Normal', 
    374         'font_large' =>  'Large', 
    375         'font_huge' =>  'Huge', 
    376  
    377369        'close_tags' =>  'Close Tags', 
    378370        'styles_tip' =>  'Tip: Styles can be applied quickly to selected text.', 
  • languages/lang_english/lang_main.php

    r248 r269  
    245245        'new' => 'New', 
    246246        'new_at_forum' => 'New at forum', 
     247        'popular_at_forum' => 'Popular at forum', 
    247248        'active_torrents' => 'Active torrents', 
    248249        'popular_torrents' => 'Popular torrents', 
     
    265266        'list' => 'List', 
    266267        'quote' => 'Quote', 
     268        'spoiler' => 'Spoiler', 
    267269        'code' => 'Code', 
    268270        'all_tags' => 'All tags', 
     
    282284        'violet' => 'Violet', 
    283285        'white' => 'White', 
    284         'text_size' => 'Font size', 
    285         'small' => 'Small', 
    286         'standart' => 'Standart', 
    287         'big' => 'Big', 
    288         'very_big' => 'Huge', 
     286 
     287        'font_size' =>  'Font size', 
     288        'font_tiny' =>  'Tiny', 
     289        'font_small' =>  'Small', 
     290        'font_normal' =>  'Normal', 
     291        'font_large' =>  'Large', 
     292        'font_huge' =>  'Huge', 
     293 
    289294        'close_all_tags' => 'Close tags', 
    290295        'smilies' => 'Smilies', 
     
    416421        'succefully_uploaded' => 'Uploaded successfully!', 
    417422        'succefully_uploaded_descr' => 'Now you can seed. <b>Attention</b> torrent will be invisible, until any seeders are avalaible!', 
     423        'you_must_download_your_torrent_from_here' => 'Your torrent has been changed and your must download it from here and seed downloaded torrent', 
    418424        'succefully_edited' => 'Successfully edited!', 
    419425        'rating_added' => 'Rating added!', 
     
    12051211        'reputation' => 'Reputation', 
    12061212 
     1213        'no_tags' => 'No tags', 
     1214        'add_tag' => 'Add tag', 
     1215        'enter_tags' => 'Enter one tag or either comma-separated', 
     1216        'are_you_sure_delete_tag' => 'Are you sure you want to delete tag', 
     1217        'no_more_tags_allowed' => 'You want to add too more tags, more then %d you canno\'t add', 
     1218        'tag_is_too_short_or_long' => 'Tag "%s" is shorter then %d symbols or longer then %d symbols. Please, edit tag', 
     1219        'tag_added' => 'Tag "%s" added', 
     1220 
    12071221        'translated_by' => 'Translation to english made by %s', 
    12081222)); 
  • languages/lang_english/lang_merge.php

    r9 r269  
    4949// 27 seconds. 
    5050 
    51         'merge_separator' =>  "\r\n\r\n[color=green][size=9]Posted after%s%s%s%s:[/size][/color]\r\n\r\n", 
     51        'merge_separator' =>  "\r\n\r\n[color=green][size=1]Posted after%s%s%s%s:[/size][/color]\r\n\r\n", 
    5252 
    5353// Subject of the added message 
  • languages/lang_english/lang_modcomment_log.php

    r245 r269  
    1919        'modcomment_account_enabled_disabled' => '%s - Account %s by user %s', 
    2020        'modcomment_one_warning_deleted' => '%s - 1 warning remited by user %s', 
    21         'log_torrent_uploaded' => 'Torrent <a href="%s">%s</a> was uploaded by %s', 
    22         'log_torrent_edited' => 'Torrent <a href="%s">%s</a> was edited by %s', 
     21        'log_torrent_uploaded' => 'Torrent <!--S-->TORRENT_%d_%s<!--E--> was uploaded by <!--S-->USER_%d_%s<!--E-->', 
     22        'log_torrent_edited' => 'Torrent <!--S-->TORRENT_%d_%s<!--E--> was edited by <!--S-->USER_%d_%s<!--E-->', 
    2323        'log_torrent_deleted_by_user' => 'Torrent %d (%s) was deleted by user %s (Reason: %s)', 
    2424        'modcomment_uploadapp' => '%s - Request for promotion: %s (Yes = %d, No = %d (%01.2f %%))', //два символа %% это не описка 
  • languages/lang_english/lang_pms.php

    r9 r269  
    1414        'pm_helpdesc_answer_body' => "%s==[Tech. Support]==%s\n%s\n\n%s wrote \n%s", 
    1515        'pm_offer_filled_subject' => 'Offer has been uploaded', 
    16         'pm_offer_filled_body' => 'You have voted for the offer [url=%s/offers.php?id=%d]%s[/url] and your offer have been uploaded by user [url=%s/userdetails.php?id=%d][b]%s[/b][/url]. You can download it, clicking here [url=%s/details.php?id=%d]%s[/url]. Please don\'t forget to say Thanks.', 
     16        'pm_offer_filled_body' => 'You have voted for the offer [url=%s]%s[/url] and your offer have been uploaded by user [url=%s][b]%s[/b][/url]. You can download it, clicking here [url=%s]%s[/url]. Please don\'t forget to say Thanks.', 
    1717        'pm_request_filled_subject' => 'Request has been uploaded', 
    18         'pm_request_filled_body' => 'You have voted for the request  [url=%s/requests.php?id=%d]%s[/url] and it has been filled by user [url=%s/userdetails.php?id=%d][b]%s[/b][/url]. You can download it, clicking here [url=%s/details.php?id=%d]%s[/url]. Please, don\'t forget to say Thanks.', 
     18        'pm_request_filled_body' => 'You have voted for the request  [url=%s]%s[/url] and it has been filled by user [url=%s][b]%s[/b][/url]. You can download it, clicking here [url=%s]%s[/url]. Please, don\'t forget to say Thanks.', 
    1919        'pm_class_changed_subject' => '%s in class', 
    2020        'pm_class_changed_body' => 'You were %s before class %s user %s', 
  • languages/lang_russian/lang_admin.php

    r246 r269  
    10891089        'simpaty_thanks_to_upload' => 'Очки за одно полученное спасибо для выложенного торрента', 
    10901090 
     1091        'tags_settings' => 'Настройки тегов', 
     1092        'tags_max_allow' => 'Максимальное количество тегов', 
     1093        'tags_max_allow_explain' => 'Максимальное количество тегов, которое может поставить один пользователь для одной раздачи', 
     1094        'tags_max_length' => 'Максимальная длинна тега', 
     1095        'tags_max_length_explain' => 'Максимальная длинна тега (в символах)', 
     1096        'tags_min_length' => 'Минимальная длинна тега', 
     1097        'tags_min_length_explain' => 'Минимальная длинна тега (в символах). Не ставьте значение менее 3 символов, они все равно не будут работать в поиске.', 
     1098 
    10911099)); 
    10921100?> 
  • languages/lang_russian/lang_bbcode.php

    r221 r269  
    4444                1 => 'Меняет размер текста в теге', 
    4545                2 => '[size=<i>n</i>]<i>Текст</i>[/size]', 
    46                 3 => '[size=11]Это размер 11[/size]', 
    47                 4 => '<i>n</i> должно быть целым числом от 1 (самый маленький) до 29 (Самый большой). Стандартный размер это 11
     46                3 => '[size=1]Это размер 1[/size]', 
     47                4 => '<i>n</i> должно быть целым числом от 1 (самый маленький) до 7 (Самый большой)
    4848        ), 
    4949        array( 
     
    8585                0 => 'Цитата (2)', 
    8686                1 => 'Вставляет цитату', 
    87                 2 => '[quote=<i>Автор</i>]<i>Текст для цитаты</i>[/quote]', 
    88                 3 => '[quote=' . $userdata['name'] . ']Пример для цитирования.[/quote]', 
     87                2 => '[quote="<i>Автор</i>"]<i>Текст для цитаты</i>[/quote]', 
     88                3 => '[quote="' . $userdata['name'] . '"]Пример для цитирования.[/quote]', 
    8989                4 => '' 
    9090        ), 
     
    9797        ), 
    9898        array( 
    99                 0 => 'Преформатированный (только для трекера)', 
     99                0 => 'Преформатированный', 
    100100                1 => 'Преформатированный (monospace) текст. Все форматирование внутри текста будет сохранено', 
    101101                2 => '[pre]<i>Текст</i>[/pre]', 
    102102                3 => '[pre]Это преформатированный текст.[/pre]', 
    103                 4 => 'На форуме используйте тег [code][/code] для получения преформатированного текста.
     103                4 => '
    104104        ) 
    105105); 
  • languages/lang_russian/lang_forum.php

    r221 r269  
    5353        'post' =>  'Сообщение',        // ??? 
    5454        'posts' =>  'Сообщения',       // ??? 
    55         'posted' =>  'Добавлено', 
    5655        'username' =>  'Имя', 
    5756        'password' =>  'Пароль', 
     
    372371        'color_black' =>  'Чёрный', 
    373372 
    374         'font_size' =>  'Размер шрифта', 
    375         'font_tiny' =>  'Очень маленький', 
    376         'font_small' =>  'Маленький', 
    377         'font_normal' =>  'Обычный', 
    378         'font_large' =>  'Большой', 
    379         'font_huge' =>  'Огромный', 
    380  
    381373        'close_tags' =>  'Закрыть теги', 
    382374        'styles_tip' =>  'Подсказка: Можно быстро применить стили к выделенному тексту', 
  • languages/lang_russian/lang_main.php

    r248 r269  
    253253        'new' => 'Новый', 
    254254        'new_at_forum' => 'Новое на форуме', 
     255        'popular_at_forum' => 'Популярное на форуме', 
    255256        'active_torrents' => 'Активные торренты', 
    256257        'popular_torrents' => 'Популярные торренты', 
     
    273274        'list' => 'Список', 
    274275        'quote' => 'Цитата', 
     276        'spoiler' => 'Спойлер', 
    275277        'code' => 'Код', 
    276278        'all_tags' => 'Все теги', 
     
    290292        'violet' => 'Фиолетовый', 
    291293        'white' => 'Белый', 
    292         'text_size' => 'Размер текста', 
    293         'small' => 'Маленький', 
    294         'standart' => 'Стандартный', 
    295         'big' => 'Большой', 
    296         'very_big' => 'Огромный', 
     294 
     295        'font_size' =>  'Размер шрифта', 
     296        'font_tiny' =>  'Очень маленький', 
     297        'font_small' =>  'Маленький', 
     298        'font_normal' =>  'Обычный', 
     299        'font_large' =>  'Большой', 
     300        'font_huge' =>  'Огромный', 
     301 
    297302        'close_all_tags' => 'Закрыть теги', 
    298303        'smilies' => 'Смайлы', 
     
    425430        'succefully_uploaded' => 'Успешно загружено!', 
    426431        'succefully_uploaded_descr' => 'Теперь вы можете сидировать. <b>Внимание</b> торрента не будет видно пока вы это не сделаете!', 
     432        'you_must_download_your_torrent_from_here' => 'Ваш торрент был изменен и вам надо скачать торрент из своей раздачи и сидировать его', 
    427433        'succefully_edited' => 'Успешно изменено!', 
    428434        'rating_added' => 'Рейтинг добавлен!', 
     
    12151221        'reputation' => 'Репутация', 
    12161222 
     1223        'no_tags' => 'Нет тегов', 
     1224        'add_tag' => 'Добавить тег', 
     1225        'enter_tags' => 'Введите один тег или несколько тегов через запятую', 
     1226        'are_you_sure_delete_tag' => 'Вы уверены, что хотите удалить тег', 
     1227        'no_more_tags_allowed' => 'Вы добавляете слишком много тегов, более %d добавлять нельзя', 
     1228        'tag_is_too_short_or_long' => 'Тег "%s" короче %d символов или длинее %d символов. Пожалуйста, измените тег', 
     1229        'tag_added' => 'Тег "%s" добавлен', 
     1230 
    12171231        'translated_by' => 'На русский язык перевел %s', 
    12181232)); 
  • languages/lang_russian/lang_merge.php

    r221 r269  
    5050// 27 seconds. 
    5151 
    52         'merge_separator' => "\r\n\r\n[color=green][size=9]Добавлено спустя%s%s%s%s:[/size][/color]\r\n\r\n", 
     52        'merge_separator' => "\r\n\r\n[color=green][size=1]Добавлено спустя%s%s%s%s:[/size][/color]\r\n\r\n", 
    5353 
    5454// Subject of the added message 
  • languages/lang_russian/lang_modcomment_log.php

    r245 r269  
    1919        'modcomment_account_enabled_disabled' => '%s - Аккаунт %s пользователем %s', 
    2020        'modcomment_one_warning_deleted' => '%s - 1 предупреждение удалено пользователем %s', 
    21         'log_torrent_uploaded' => 'Торрент <a href="%s">%s</a> загрузил %s', 
    22         'log_torrent_edited' => 'Торрент <a href="%s">%s</a> редактировал %s', 
     21        'log_torrent_uploaded' => 'Торрент <!--S-->TORRENT_%d_%s<!--E--> загрузил <!--S-->USER_%d_%s<!--E-->', 
     22        'log_torrent_edited' => 'Торрент <!--S-->TORRENT_%d_%s<!--E--> редактировал <!--S-->USER_%d_%s<!--E-->', 
    2323        'log_torrent_deleted_by_user' => 'Торрент %d (%s) удалил пользователь %s (Причина: %s)', 
    2424        'modcomment_uploadapp' => '%s - Запрос на повышение: %s (Да = %d, Нет = %d (%01.2f %%))', //два символа %% это не описка 
  • languages/lang_russian/lang_pms.php

    r221 r269  
    1414        'pm_helpdesc_answer_body' => "%s==[Тех. Поддержка]==%s\n%s\n\n%s писал(а) \n%s", 
    1515        'pm_offer_filled_subject' => 'Предложение выложено', 
    16         'pm_offer_filled_body' => 'Вы голосовали за предложение [url=%s/offers.php?id=%d]%s[/url] и оно было выложено пользователем [url=%s/userdetails.php?id=%d][b]%s[/b][/url]. Вы можете скачать его, кликнув по ссылке [url=%s/details.php?id=%d]%s[/url]. Пожалуйста, не забудьте сказать спасибо.', 
     16        'pm_offer_filled_body' => 'Вы голосовали за предложение [url=%s]%s[/url] и оно было выложено пользователем [url=%s][b]%s[/b][/url]. Вы можете скачать его, кликнув по ссылке [url=%s]%s[/url]. Пожалуйста, не забудьте сказать спасибо.', 
    1717        'pm_request_filled_subject' => 'Запрос выложен', 
    18         'pm_request_filled_body' => 'Вы голосовали за запрос [url=%s/requests.php?id=%d]%s[/url] и он был выполнен пользователем [url=%s/userdetails.php?id=%d][b]%s[/b][/url]. Вы можете скачать его, кликнув по ссылке [url=%s/details.php?id=%d]%s[/url]. Пожалуйста, не забудьте сказать спасибо.', 
     18        'pm_request_filled_body' => 'Вы голосовали за запрос [url=%s]%s[/url] и он был выполнен пользователем [url=%s][b]%s[/b][/url]. Вы можете скачать его, кликнув по ссылке [url=%s]%s[/url]. Пожалуйста, не забудьте сказать спасибо.', 
    1919        'pm_class_changed_subject' => '%s в классе', 
    2020        'pm_class_changed_body' => 'Вы были %s до класса %s пользователем %s', 
  • log.php

    r266 r269  
    55require ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_modcomment_log.php'); 
    66 
     7/* */ 
     8function search_id_from_string ( $string ) { 
     9 
     10        $ary = array(); 
     11 
     12        while ( true ) { 
     13                $first_pos = strpos($string, '<!--S-->'); 
     14 
     15                if ( $first_pos !== false ) { 
     16                        $last_pos = strpos($string, '<!--E-->'); 
     17                        $_pos = strpos($string, '_'); 
     18                        $_pos = strpos($string, '_', $_pos + 1); 
     19                        $substr = substr($string, $first_pos + 8, $_pos - $first_pos - 8); 
     20 
     21                        $_pos = strpos($substr, '_'); 
     22 
     23                        $id = substr($substr, $_pos + 1); 
     24                        $type = substr($substr, 0, $_pos); 
     25 
     26                        $string = preg_replace('/<!--S-->' . $type . '_' . $id . '_(.*?)<!--E-->/si', '', $string); 
     27 
     28                        $ary[$id] = $type; 
     29                } 
     30                else { 
     31                        break; 
     32                } 
     33        } 
     34 
     35        if ( sizeof($ary) ) { 
     36                return $ary; 
     37        } 
     38        else { 
     39                return false; 
     40        } 
     41} 
     42/* */ 
     43 
    744$userdata = session_pagestart($user_ip); 
    845init_userprefs($userdata); 
    946loggedinorreturn(); 
    1047 
    11 $log_level_view = ( isset($_REQUEST['log_level_view']) ? intval($_REQUEST['log_level_view']) : -1 ); 
    12 $nick_ary = array(); 
     48$log_level_view = request_var('log_level_view', -1); 
     49$query = request_var('query', ''); 
    1350 
    1451if ( $userdata['class'] == UC_MODERATOR ) { 
     
    5087 
    5188$template->assign_vars(array( 
    52         'S_FORM_ACTION' => append_sid('log.php') ) 
    53 ); 
    54  
    55 if ( isset($_REQUEST['query']) && !empty($_REQUEST['query']) ) { 
    56         $query = request_var('query', ''); 
     89        'S_FORM_ACTION' => append_sid('log.php') 
     90)); 
     91 
     92if ( $query ) { 
     93        $template->assign_vars(array( 
     94                'SEARCH_RESULTS' => sprintf($lang['search_results'], $query), 
     95                'SEARCH_VALUE' => $query 
     96        )); 
     97 
    5798        $query = searchfield($query); 
    58         $template->assign_vars(array( 
    59                 'SEARCH_RESULTS' => sprintf($lang['search_results'], htmlspecialchars($_REQUEST['query'])), 
    60                 'SEARCH_VALUE' => htmlspecialchars($_REQUEST['query']) ) 
    61         ); 
    6299} 
    63100// delete items older than 2 weeks 
     
    67104 
    68105$template->assign_vars(array( 
    69         'LOG_LEVEL_SELECT' => $log_level_select) 
    70 )
     106        'LOG_LEVEL_SELECT' => $log_level_select 
     107))
    71108 
    72109 
     
    74111                FROM ' . SITELOG_TABLE . ' 
    75112                WHERE ' . ( $log_level_view <> -1 ? 'log_view_level = ' . $log_level_view : 'log_view_level <= ' . $level ) . 
    76                 ( isset($query) ? ' AND txt LIKE ' . "'%" . $db->sql_escape($query) . "%'" : '' ); 
     113                ( $query ? ' AND txt LIKE ' . "'%" . $db->sql_escape($query) . "%'" : '' ); 
    77114$result = $db->sql_query($sql); 
    78115$count = ( $row = $db->sql_fetchrow($result) ) ? $row['count'] : 0; 
    79116 
    80117if ( $count ) { 
    81         list($pagertop, $pagerbottom, $limit) = pager(50, $count, 'log.php?' . ( !empty($query) ? 'query=' . $query . '&amp;' : '' ) . ( $log_level_view <> -1 ? 'log_level_view=' . $log_level_view . '&amp;' : '' ) ); 
     118        list($pagertop, $pagerbottom, $limit) = pager(50, $count, 'log.php?' . ( $query ? 'query=' . $query . '&amp;' : '' ) . ( $log_level_view <> -1 ? 'log_level_view=' . $log_level_view . '&amp;' : '' ) ); 
    82119        $template->assign_vars(array( 
    83                 'PAGERBOTTOM' => $pagerbottom ) 
    84         )
     120                'PAGERBOTTOM' => $pagerbottom 
     121        ))
    85122 
    86123        $sql = 'SELECT added, txt 
     
    90127        $result = $db->sql_query($sql); 
    91128 
    92         $str = str_replace('%s', '(.*)', $lang['log_torrent_uploaded']); 
    93         $str = str_replace(array('<', '/'), array('\<', '\/'), $str); 
     129        $tor_ary = array(); 
     130        $user_ary = array(); 
     131        $log_ary = array(); 
     132        $cats = $cache->obtain_cats(); 
    94133 
    95134        while ( $row = $db->sql_fetchrow($result) ) { 
    96                 preg_match('/' . $str . '/', $row['txt'], $matches); 
    97                 if ( isset($matches[3]) ) { 
    98                         $nick_ary[] = "'" . $db->sql_escape(trim($matches[3])) . "'"; 
    99                 } 
    100  
    101                 $ary[] = array($row['added'], $row['txt']); 
    102         } 
    103         if ( sizeof($nick_ary) ) { 
    104                 $sql = 'SELECT name, privacy FROM ' . USERS_TABLE . ' WHERE name IN (' . implode(',', $nick_ary)  . ')'; 
     135                if ( $search = search_id_from_string($row['txt']) ) { 
     136                        foreach ( $search AS $id => $type ) { 
     137                                switch ( $type ) { 
     138                                        case 'TORRENT': 
     139                                                $tor_ary[] = $id; 
     140                                        break; 
     141                                        case 'USER': 
     142                                                $user_ary[] = $id; 
     143                                        break; 
     144                                } 
     145                        } 
     146                } 
     147 
     148                $log_ary[] = $row; 
     149        } 
     150        if ( sizeof($user_ary) ) { 
     151                $user_ary = array_unique($user_ary); 
     152                $sql = 'SELECT name, privacy, uid FROM ' . USERS_TABLE . ' WHERE uid IN (' . implode(',', $user_ary)  . ')'; 
    105153                $result = $db->sql_query($sql); 
    106                 $nick_ary = array(); 
     154                $user_ary = array(); 
    107155                while ( $row = $db->sql_fetchrow($result) ) { 
    108                         $nick_ary[$row['name']] = $row['privacy']; 
    109                 } 
    110         } 
    111  
    112         for ( $i = 0; $i < sizeof($ary); ++$i ) { 
     156                        $user_ary[$row['uid']] = $row; 
     157                } 
     158        } 
     159        if ( sizeof($tor_ary) ) { 
     160                $tor_ary = array_unique($tor_ary); 
     161                $sql = 'SELECT name, fid, category FROM ' . TORRENTS_TABLE . ' WHERE fid IN (' . implode(',', $tor_ary)  . ')'; 
     162                $result = $db->sql_query($sql); 
     163                $tor_ary = array(); 
     164                while ( $row = $db->sql_fetchrow($result) ) { 
     165                        $tor_ary[$row['fid']] = $row; 
     166                } 
     167        } 
     168 
     169        foreach ( $log_ary AS $_null => $ary ) { 
     170 
     171                $date = create_date($ary['added']); 
     172                $text = $ary['txt']; 
     173                $continue = false; 
     174 
    113175                $log_color = ''; 
    114                 foreach ( $colors AS $text => $color ) { 
    115                         if ( strpos($ary[$i][1], $text) ) { 
     176                foreach ( $colors AS $txt => $color ) { 
     177                        if ( strpos($text, $txt) ) { 
    116178                                $log_color = $color; 
    117179                        } 
    118180                } 
    119                 $date = create_date($ary[$i][0]); 
    120                 $txt = $ary[$i][1]; 
    121  
    122                 preg_match('/' . $str . '/', $ary[$i][1], $matches); 
    123                 if ( isset($matches[3]) && $nick_ary[$matches[3]] == PRIVACY_LEVEL_HIGH && $userdata['class'] < UC_MODERATOR && $userdata['name'] <> $matches[3] ) { 
    124                         if ( isset($query) ) { 
    125                                 continue; 
     181 
     182                if ( $search = search_id_from_string($text) ) { 
     183                        foreach ( $search AS $id => $type ) { 
     184                                switch ( $type ) { 
     185                                        case 'TORRENT': 
     186                                                if ( isset($tor_ary[$id]['category']) ) { 
     187                                                        $cat_id = $tor_ary[$id]['category']; 
     188                                                        $cat_parent_id = ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_id']) ? $cats[$cats[$cat_id]['cat_parent']]['cat_id'] : 0 ); 
     189                                                        // www.phpBB-SEO.com SEO TOOLKIT BEGIN 
     190                                                        if ( $cat_parent_id ) { 
     191                                                                $seo->set_url($cats[$cat_parent_id]['cat_name'], $cat_parent_id, $seo->seo_static['browse']); 
     192                                                                $seo->set_parent($cat_id, $seo->seo_static['browse'], $cat_parent_id, $seo->seo_static['browse']); 
     193                                                        } 
     194 
     195                                                        $seo->set_url($cats[$cat_id]['cat_name'], $cat_id, $seo->seo_static['browse']); 
     196 
     197                                                        $seo->set_parent($id, $seo->seo_static['details'], $cat_id, $seo->seo_static['browse']); 
     198 
     199                                                        $seo->set_url($tor_ary[$id]['name'], $id, $seo->seo_static['details']); 
     200                                                        // www.phpBB-SEO.com SEO TOOLKIT END 
     201 
     202                                                        $text = preg_replace('/<!--S-->TORRENT_' . $id . '_(.*?)<!--E-->/', '<a href="' . append_sid($root_path . 'details.php?id=' . $id) . '">' . $tor_ary[$id]['name'] . '</a>', $text); 
     203                                                } 
     204                                                else { 
     205                                                        $text = preg_replace('/<!--S-->TORRENT_' . $id . '_(.*?)<!--E-->/', '\\1', $text); 
     206                                                } 
     207                                        break; 
     208                                        case 'USER': 
     209                                                if ( $user_ary[$id]['privacy'] == PRIVACY_LEVEL_HIGH && $userdata['class'] < UC_MODERATOR && $userdata['name'] <> $user_ary[$id]['name'] ) { 
     210                                                        if ( $query ) { 
     211                                                                $continue = true; 
     212                                                        } 
     213                                                        $text = preg_replace('/<!--S-->USER_' . $id . '_(.*?)<!--E-->/', $lang['anonymous'], $text); 
     214                                                } 
     215                                                else { 
     216                                                        // www.phpBB-SEO.com SEO TOOLKIT START 
     217                                                        $seo->set_user_url($user_ary[$id]['name'], $id); 
     218                                                        // www.phpBB-SEO.com SEO TOOLKIT END 
     219 
     220                                                        $text = preg_replace('/<!--S-->USER_' . $id . '_(.*?)<!--E-->/', '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $id) . '">' . $user_ary[$id]['name'] . '</a>', $text); 
     221                                                } 
     222                                        break; 
     223                                } 
    126224                        } 
    127                         $txt = preg_replace('/' . $str . '/e', "str_replace('\\3', '<i>' . \$lang['anonymous'] . '</i>', \"\\0\")", $txt); 
    128                 } 
    129                 if ( strpos($txt, 'userdetails_') !== false ) { 
    130                         $txt = preg_replace('/userdetails_([0-9]+)/e', "append_sid(\$root_path . 'userdetails.php?id=\\1')", $txt); 
    131                 } 
    132                 if ( strpos($txt, 'details_') !== false ) { 
    133                         preg_match('/<a href="details_([0-9]+)">(.*?)<\/a>/', $txt, $matches); 
    134                         $tor_id = $matches[1]; 
    135                         $torrent_name = $matches[2]; 
    136                         $txt = preg_replace('/details_([0-9]+)/e', "append_sid(\$root_path . 'details.php?id=\\1')", $txt); 
    137                 } 
     225                } 
     226 
     227                if ( $continue ) { 
     228                        continue; 
     229                } 
     230 
    138231                $template->assign_block_vars('log_row', array( 
    139232                        'COLOR' => $log_color, 
    140233                        'DATE' => $date, 
    141                         'ACTION' => $txt) 
    142                 ); 
    143         } 
     234                        'ACTION' => $text 
     235                )); 
     236        } 
     237 
    144238} 
    145239else { 
  • message.php

    r266 r269  
    22$root_path = './'; 
    33require ($root_path . 'include/config.php'); 
     4require ($root_path . 'include/bbcode/bbcode.lib.php'); 
     5require ($root_path . 'include/functions_check.php'); 
    46require ($root_path . 'include/functions_post.php'); 
    5 require ($root_path . 'include/functions_check.php'); 
    67require ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_pms.php'); 
    78 
     
    7980             } 
    8081 
     82             $bb_code = new bbcode(); 
     83 
    8184             if ( $message['sender'] == $userdata['uid'] ) { 
    8285                  $sender = '<a href="' . append_sid('userdetails.php?id=' . $message['receiver']) . '">' . $message['name'] . '</a>'; 
     
    114117                     } 
    115118             } 
    116              $body = format_comment($message['msg']); 
     119             $body = censor_text($message['msg']); 
     120                $bb_code->parse($body); 
     121             $body = $bb_code->get_html(); 
     122 
    117123             $added = create_date($message['added']); 
    118124             if ( $userdata['class'] >= UC_MODERATOR && $message['sender'] == $userdata['uid'] ) { 
     
    151157                        foreach ( $msg_history_ary AS $msg_id => $ary ) { 
    152158                                $added = create_date($ary['added']); 
     159 
     160                                $body = censor_text($ary['msg']); 
     161                                $bb_code->parse($body); 
     162                             $body = $bb_code->get_html(); 
     163 
    153164                                $template->assign_block_vars('messages_history.messages_history_row', array( 
    154165                                        'SUBJECT' => $ary['subject'], 
    155                                         'MESSAGE' => format_comment($ary['msg'])
     166                                        'MESSAGE' => $body
    156167                                        'ADDED' => $added, 
    157168                                        'USERNAME' => ( $ary['uid'] == ANONYMOUS ? $lang['system'] : $ary['name'] ) 
     
    296307                        $origmsg = $reply_to; 
    297308 
     309                        $bb_code = new bbcode(); 
     310 
    298311                        if ( $reply_to ) { 
    299312                                $template->assign_block_vars('reply_to', array()); 
     
    303316                                foreach ( $reply_msg AS $msg_id => $ary ) { 
    304317                                        $added = create_date($ary['added']); 
     318                                        $msg = censor_text($ary['msg']); 
     319                                        $bb_code->parse($msg); 
     320                                     $msg = $bb_code->get_html(); 
     321 
    305322                                        $template->assign_block_vars('reply_to.reply_to_row', array( 
    306323                                                'SUBJECT' => $ary['subject'], 
    307                                                 'MESSAGE' => format_comment($ary['msg'])
     324                                                'MESSAGE' => $msg
    308325                                                'ADDED' => $added, 
    309326                                                'USERNAME' => ( $ary['uid'] == ANONYMOUS ? $lang['system'] : $ary['name'] ) 
     
    445462                  } 
    446463 
     464                  $bb_code = new bbcode(); 
     465 
    447466                  $body = sprintf($lang['pm_message_separator'],  $orig2['name'], $message['msg']); 
     467                        $body = censor_text($body); 
     468                        $bb_code->parse($body); 
     469                        $body = $bb_code->get_html(); 
    448470 
    449471                  $template->assign_vars(array( 
     
    452474                       'PM_ID' => $pm_id, 
    453475                       'FROM_NAME' => $from_name, 
    454                        'BODY' => format_comment($body)
     476                       'BODY' => $body
    455477                       'SAVE_PM_CHECKED' => ( $userdata['savepms'] ? 'checked="checked"' : '' ), 
    456478                       'ORIG_NAME' => $orig_name 
  • modtask.php

    r241 r269  
    33require ($root_path . 'include/config.php'); 
    44require ($root_path . 'include/functions_selects.php'); 
    5 require ($root_path . 'include/functions_post.php'); 
     5require ($root_path . 'include/bbcode/bbcode.lib.php'); 
    66require ($root_path . 'include/functions_check.php'); 
    77require ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_modcomment_log.php'); 
  • my.php

    r267 r269  
    193193                        } 
    194194 
    195                         if ( $userdata['user_sig_bbcode_uid'] == '' ) { 
    196                                 $userdata['user_sig_bbcode_uid'] = make_bbcode_uid(); 
    197                                 $updateset['user_sig_bbcode_uid'] = $userdata['user_sig_bbcode_uid']; 
    198                         } 
    199                         $signature = prepare_message($signature, $config['allow_html'], $config['allow_bbcode'], $config['allow_smilies'], $userdata['user_sig_bbcode_uid']); 
     195                        $signature = prepare_message($signature, $config['allow_html'], $config['allow_bbcode'], $config['allow_smilies']); 
    200196                        $updateset['user_sig'] = $signature; 
    201197                } 
     
    285281                } 
    286282 
    287                 $user_sig_bbcode_uid = $userdata['user_sig_bbcode_uid']; 
     283 
    288284                $user_sig = $userdata['user_sig']; 
    289285                $template->assign_vars(array( 
     
    303299                                'USER_MSN' => $userdata['msn'], 
    304300                                'USER_YAHOO' => $userdata['yahoo'], 
    305                                 'USER_SIGNATURE' => ( $config['allow_sig'] ? '<textarea rows="4" cols="40" id="signature" name="signature">' . ( $user_sig != '' ? preg_replace("/:(([a-z0-9]+:)?)$user_sig_bbcode_uid(=|\])/si", '\\3', $user_sig) : $user_sig ) . '</textarea>' : '' ), 
     301                                'USER_SIGNATURE' => ( $config['allow_sig'] ? '<textarea rows="4" cols="40" id="signature" name="signature">' . $user_sig . '</textarea>' : '' ), 
    306302                                'GENDER_INPUT' => '<input type="radio" class="radio" id="gender" name="gender"' . ( !$userdata['gender'] ? ' checked="checked"' : '') . ' value="0" />' . $lang['gender_male'] . ' <input type="radio" class="radio" name="gender"' .  ($userdata['gender'] ? ' checked="checked"' : '') . ' value="1" />' . $lang['gender_female'], 
    307303                                'USER_AVATAR_LINK_INPUT' =>  ( $config['allow_avatar_remote'] ? '<input type="text" id="avatar" name="avatar_link" size="45" value="' . htmlspecialchars($userdata['avatar']) . '" />' : '' ), 
  • news.php

    r266 r269  
    22$root_path = './'; 
    33require ($root_path . 'include/config.php'); 
     4require ($root_path . 'include/bbcode/bbcode.lib.php'); 
    45require ($root_path . 'include/functions_post.php'); 
    56 
     
    2021                } 
    2122 
     23                $bb_code = new bbcode($row['body']); 
     24                $row['body'] = $bb_code->get_html(); 
     25 
    2226                $template->assign_vars(array( 
    2327                        'NEWS_TITLE' => $row['title'], 
    24                         'NEWS_TEXT' => format_comment($row['body'])
     28                        'NEWS_TEXT' => $row['body']
    2529                        'NEWS_ADDED' => create_date($row['added']), 
    2630                        'NEWS_AUTHOR' => $row['name'] 
  • offers.php

    r266 r269  
    33require ($root_path . 'include/config.php'); 
    44require ($root_path . 'include/functions_check.php'); 
    5 require ($root_path . 'include/functions_post.php'); 
    65require ($root_path . 'include/functions_selects.php'); 
    76 
     
    165164                $filled_torrent_id = $matches[1]; 
    166165 
    167                 $sql = 'SELECT name FROM ' . TORRENTS_TABLE . ' WHERE fid = ' . $filled_torrent_id; 
    168                 $result = $db->sql_query($sql); 
    169                 if ( !($row = $db->sql_fetchrow($result)) ) { 
     166                $sql = 'SELECT name, category FROM ' . TORRENTS_TABLE . ' WHERE fid = ' . $filled_torrent_id; 
     167                $result = $db->sql_query($sql); 
     168                if ( !$row = $db->sql_fetchrow($result) ) { 
    170169                        trigger_error($lang['invalid_url_for_uploaded_torrent']); 
    171170                } 
    172171                $torrent_name = censor_text($row['name']); 
     172                $cats = $cache->obtain_cats(); 
     173 
     174                $cat_id = $row['category']; 
     175                $cat_parent_id = ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_id']) ? $cats[$cats[$cat_id]['cat_parent']]['cat_id'] : 0 ); 
     176                if ( $config['mod_rewrite_enabled'] ) { 
     177                        $u_offer = append_sid($root_path . 'offers.php?id=' . $id, false, true, ''); 
     178                        $u_userdetails = append_sid($root_path . 'userdetails.php?id=' . $userdata['uid'], false, true, ''); 
     179                        $u_details = append_sid($root_path . 'details.php?id=' . $filled_torrent_id, false, true, ''); 
     180                } 
     181                else { 
     182                        $base_url = generate_base_url(); 
     183                        $u_offer = $base_url . '/offers.php?id=' . $id; 
     184                        $u_userdetails = $base_url . '/userdetails.php?id=' . $userdata['uid']; 
     185                        $u_details = $base_url . '/details.php?id=' . $filled_torrent_id; 
     186                } 
    173187 
    174188                $sql = 'SELECT o.userid, u.language, u.name, u.email, u.notifs, u.language, u.class 
     
    185199                                'sender' => 0, 
    186200                                'receiver' => $arr['userid'], 
    187                                 'msg' => sprintf($lang['pm_offer_filled_body'], generate_base_url() , $id, $offer_name, generate_base_url(), $userdata['uid'], $userdata['name'], generate_base_url() , $filled_torrent_id, $torrent_name), 
     201                                'msg' => sprintf($lang['pm_offer_filled_body'], $u_offer, $offer_name, $u_userdetails, $userdata['name'], $u_details, $torrent_name), 
    188202                                'subject' => $lang['pm_offer_filled_subject'], 
    189203                                'name' => $arr['name'], 
     
    262276                $result = $db->sql_query($sql); 
    263277 
    264                 if ( !($row = $db->sql_fetchrow($result)) ) { 
     278                if ( !$row = $db->sql_fetchrow($result) ) { 
    265279                        trigger_error (sprintf($lang['invalid_id'], $id)); 
    266280                } 
     281 
     282                /* */ 
     283                require ($root_path . 'include/bbcode/bbcode.lib.php'); 
     284                require ($root_path . 'include/functions_post.php'); 
     285                /* */ 
    267286 
    268287                if ( $row['userid'] <> ANONYMOUS ) { 
     
    278297                        $u_oferer = ''; 
    279298                } 
     299 
     300                $description = censor_text($row['descr']); 
     301                $bb_code = new bbcode($description); 
     302                $description = $bb_code->get_html(); 
    280303 
    281304                $template->assign_vars(array( 
     
    291314                                'OFFER_DETAILS' => sprintf($lang['offer_details'], $row['name']), 
    292315                                'OFFER_NAME' => censor_text($row['name']), 
    293                                 'DESCRIPTION' => format_comment(censor_text($row['descr']))
     316                                'DESCRIPTION' => $description
    294317                                'ADDED' => create_date($row['added']), 
    295318                                'TYPE' => $row['cat_name'], 
     
    476499                        list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, 'offers.php?' . $search_arr . 'sort=' . $sort . '&amp;' ); 
    477500 
    478                         $sql = 'SELECT u.name AS username, u.class, o.id, o.userid, o.name, o.added, o.votes, o.comments, o.filled, o.filledby, u2.name AS filledby_username, o.category, t.name AS torrent_name 
     501                        $sql = 'SELECT u.name AS username, u.class, o.id, o.userid, o.name, o.added, o.votes, o.comments, o.filled, o.filledby, u2.name AS filledby_username, o.category, t.name AS torrent_name, t.category AS t_category 
    479502                                        FROM ' . OFFERS_TABLE . ' o 
    480503                                        LEFT JOIN ' . USERS_TABLE . ' u2 ON o.filledby = u2.uid 
     
    520543                                        'U_CAT' => append_sid('offers.php?cat=' . $row['category']), 
    521544                                        'U_OFFER' => ( $filled ? $filled : append_sid('offers.php?id=' . $row['id']) ), 
    522                                         'U_OFFERER' => append_sid('userdetails.php?id=' . $row['userid']), 
     545                                        'U_OFFERER' => append_sid($root_path . 'userdetails.php?id=' . $row['userid']), 
    523546                                        'U_VOTES' => append_sid('offers.php?action=voteview&amp;offerid=' . $row['id']), 
    524547                                        'CAT_NAME_DISPLAY' => $cat_name_display, 
  • phpBB2/groupcp.php

    r266 r269  
    3636 
    3737        $from = ( !empty($row['user_from']) ) ? $row['user_from'] : '&nbsp;'; 
    38         $joined = create_date($row['added'], $date_format); 
     38        $joined = create_date($row['added']); 
    3939        $posts = ( $row['user_posts'] ) ? $row['user_posts'] : 0; 
    4040 
     
    5858        } 
    5959 
    60         $temp_url = append_sid("userdetails.php?id=" . $row['uid']); 
     60        $temp_url = append_sid($root_path . "userdetails.php?id=" . $row['uid']); 
    6161        $profile_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_profile'] . '" alt="' . $lang['read_profile'] . '" title="' . $lang['read_profile'] . '" border="0" /></a>'; 
    6262        $profile = '<a href="' . $temp_url . '">' . $lang['read_profile'] . '</a>'; 
    6363 
    64         $temp_url = append_sid("message.php?action=send&amp;receiver=" . $row['uid']); 
     64        $temp_url = append_sid($root_path . "message.php?action=send&amp;receiver=" . $row['uid']); 
    6565        $pm_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['send_private_message'] . '" title="' . $lang['send_private_message'] . '" border="0" /></a>'; 
    6666        $pm = '<a href="' . $temp_url . '">' . $lang['send_private_message'] . '</a>'; 
     
    8282        $aim = ( $row['aim'] ) ? '<a href="aim:goim?screenname=' . $row['aim'] . '&amp;message=Hello+Are+you+there?">' . $lang['aim'] . '</a>' : ''; 
    8383 
    84         $temp_url = append_sid("userdetails.php?id=" . $row['uid']); 
     84        $temp_url = append_sid($root_path . "userdetails.php?id=" . $row['uid']); 
    8585        $msn_img = ( $row['msn'] ) ? '<a href="' . $temp_url . '"><img src="' . $images['icon_msnm'] . '" alt="' . $lang['msnm'] . '" title="' . $lang['msnm'] . '" border="0" /></a>' : ''; 
    8686        $msn = ( $row['msn'] ) ? '<a href="' . $temp_url . '">' . $lang['msnm'] . '</a>' : ''; 
     
    9595        if ($row['user_session_time'] >= (time() - $config['online_time'])) 
    9696        { 
    97                 $online_status_img = '<a href="' . append_sid("index.php?viewonline=1") . '"><img src="' . $images['icon_online'] . '" alt="' . sprintf($lang['is_online'], $row['username']) . '" title="' . sprintf($lang['is_online'], $row['username']) . '" /></a>'; 
    98                 $online_status = '<strong><a href="' . append_sid("index.php?viewonline=1") . '" title="' . sprintf($lang['is_online'], $row['username']) . '"' . $online_color . '>' . $lang['online'] . '</a></strong>'; 
     97                $online_status_img = '<a href="' . append_sid($root_path . "index.php?viewonline=1") . '"><img src="' . $images['icon_online'] . '" alt="' . sprintf($lang['is_online'], $row['username']) . '" title="' . sprintf($lang['is_online'], $row['username']) . '" /></a>'; 
     98                $online_status = '<strong><a href="' . append_sid($root_path . "index.php?viewonline=1") . '" title="' . sprintf($lang['is_online'], $row['username']) . '"' . $online_color . '>' . $lang['online'] . '</a></strong>'; 
    9999        } 
    100100        else 
     
    611611        // Get moderator details for this group 
    612612        // 
    613         $sql = "SELECT u.name AS username, u.uid, u.user_posts, u.email, u.icq, u.aim, u.yahoo, u.msn, u.user_session_time, u.user_lastvisit 
     613        $sql = "SELECT u.name AS username, u.uid, u.user_posts, u.added, u.email, u.icq, u.aim, u.yahoo, u.msn, u.user_session_time, u.user_lastvisit, u.avatar 
    614614                FROM " . USERS_TABLE . " u 
    615615                WHERE u.uid = " . $group_info['group_moderator']; 
     
    621621        // Get user information for this group 
    622622        // 
    623         $sql = "SELECT u.name AS username, u.uid, u.user_posts, u.email, u.icq, u.aim, u.yahoo, u.msn, ug.user_pending, u.user_session_time, u.user_lastvisit 
     623        $sql = "SELECT u.name AS username, u.uid, u.user_posts, u.added, u.email, u.icq, u.aim, u.yahoo, u.msn, ug.user_pending, u.user_session_time, u.user_lastvisit, u.avatar 
    624624                FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug 
    625625                WHERE ug.group_id = $group_id 
     
    775775 
    776776                //'U_MOD_VIEWPROFILE' => append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=$user_id"), 
    777                 'U_MOD_VIEWPROFILE' => append_sid("userdetails.php?id=$user_id"), 
     777                'U_MOD_VIEWPROFILE' => append_sid($root_path . "userdetails.php?id=$user_id"), 
    778778                // FIXME: 
    779779                //'U_SEARCH_USER' => append_sid("search.$phpEx?mode=searchuser"), 
     
    787787                'S_GROUP_HIDDEN_CHECKED' => ( $group_info['group_type'] == GROUP_HIDDEN ) ? ' checked="checked"' : '', 
    788788                'S_HIDDEN_FIELDS' => $s_hidden_fields, 
    789                 'S_MODE_SELECT' => $select_sort_mode, 
    790                 'S_ORDER_SELECT' => $select_sort_order, 
    791789                //'S_GROUPCP_ACTION' => append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id")) 
    792790                'S_GROUPCP_ACTION' => append_sid($root_path . "phpbb2.php?page=groupcp&" . POST_GROUPS_URL . "=$group_id")) 
     
    842840 
    843841                                //'U_VIEWPROFILE' => append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=$user_id")) 
    844                                 'U_VIEWPROFILE' => append_sid("userdetails.php?id=$user_id")) 
     842                                'U_VIEWPROFILE' => append_sid($root_path . "userdetails.php?id=$user_id")) 
    845843                        ); 
    846844 
     
    933931 
    934932                                        //'U_VIEWPROFILE' => append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=$user_id")) 
    935                                         'U_VIEWPROFILE' => append_sid("userdetails.php?id=$user_id")) 
     933                                        'U_VIEWPROFILE' => append_sid($root_path . "userdetails.php?id=$user_id")) 
    936934                                ); 
    937935                        } 
  • phpBB2/includes/bbcode.php

    r8 r269  
    2525} 
    2626 
    27 define("BBCODE_UID_LEN", 10); 
    28  
    29 // global that holds loaded-and-prepared bbcode templates, so we only have to do 
    30 // that stuff once. 
    31  
    32 $bbcode_tpl = null; 
    33  
    34 // mod img size add 
    35 function makeimgsize ( $width, $height ) 
    36 { 
    37         global $config; 
    38  
    39         $size = ''; 
    40  
    41         // check for smallness 
    42         if ( $width < $config['postimg_width'] && $height < $config['postimg_height'] ) 
    43         { 
    44                 return 'SMALL'; 
    45         } 
    46         elseif ( $width > $height ) 
    47         { 
    48                 if ( $config['postimg_width'] < $width ) 
    49                 { 
    50                         $size = 'width="' . $config['postimg_width'] . '"'; 
    51                 } 
    52         }else 
    53         { 
    54                 if ( $config['postimg_height'] < $height ) 
    55                 { 
    56                         $size = 'height="' . $config['postimg_height'] . '"'; 
    57                 } 
    58         } 
    59  
    60         return $size; 
    61 } 
    62  
    63 function image_parse ( $post, $uid ) 
    64 { 
    65         global $config, $lang, $bbcode_tpl; 
    66  
    67         preg_match_all( "/\[img(.*?):$uid\](.*?)\[\/img:$uid\]/i", $post, $matches); 
    68         foreach ( $matches[0] as $i => $img ) 
    69         { 
    70                 $stuff = $matches[1][$i]; 
    71                 $stuff = explode( ':', $stuff ); 
    72                 if ( sizeof( $stuff ) != 4 ) 
    73                 { // old image or something 
    74                         $post = preg_replace( "#\[img:$uid\]([^?].*?)\[/img:$uid\]#i", $bbcode_tpl['img'], $post ); 
    75                 } 
    76                 switch($stuff[0]) 
    77                 { 
    78                         case '=right': 
    79                                 $align = $lang['right']; 
    80                                 break; 
    81                         case '=center': 
    82                                 $align = 'center'; 
    83                                 break; 
    84                         case '=left': 
    85                         default: 
    86                                 $align = $lang['left']; 
    87                         break; 
    88                 } 
    89                 $width = ( isset($stuff[1]) ? $stuff[1] : 0 ); 
    90                 $height = ( isset($stuff[2]) ? $stuff[2] : 0 ); 
    91                 $size = makeimgsize( $width, $height ); 
    92  
    93                 if ( $size != 'SMALL' ) 
    94                 { 
    95                         $replace = $bbcode_tpl['thmbimg']; 
    96                         $seek = array( '{IMAGE}', '{WIDTH}', '{HEIGHT}', '{SIZE}', '{NOTICE}', '{ALIGN}' ); 
    97                         $with = ( !empty( $size ) ) ? array( $matches[2][$i] , $width, $height, $size, $lang['postimg_clickme'], $align ) : array( $matches[2][$i] , $width, $height, $size, '', $align ); 
    98                         $replace = str_replace( $seek, $with, $replace ); 
    99                 } 
    100                 else 
    101                 { 
    102                         $replace = str_replace( '\1', $matches[2][$i], $bbcode_tpl['img'] ); 
    103                 } 
    104                 $post = str_replace( $img, $replace, $post ); 
    105         } 
    106  
    107         return $post; 
    108 } 
    109 // mod img size end 
    110  
    11127// MULTI BBCODE-begin 
    11228function Multi_BBCode() 
     
    12339        $EMBB_widths[] = '55'; 
    12440        $EMBB_values[] = $lang['offtop']; 
     41 
     42                $EMBB_widths[] = '60'; 
     43                $EMBB_values[] = $lang['spoiler']; 
     44 
    12545        if ( ($is_auth['auth_mod']) || ( ($userdata['user_level'] != USER) ) ) 
    12646        { 
     
    14565} 
    14666// MULTI BBCODE-end 
    147  
    148  
    149 /** 
    150  * Loads bbcode templates from the bbcode.tpl file of the current template set. 
    151  * Creates an array, keys are bbcode names like "b_open" or "url", values 
    152  * are the associated template. 
    153  * Probably pukes all over the place if there's something really screwed 
    154  * with the bbcode.tpl file. 
    155  * 
    156  * Nathan Codding, Sept 26 2001. 
    157  */ 
    158 function load_bbcode_template() 
    159 { 
    160         global $template, $template_path; 
    161  
    162         $tpl = file_get_contents($template_path . '/bbcode.html'); 
    163  
    164         // replace \ with \\ and then ' with \'. 
    165         $tpl = str_replace('\\', '\\\\', $tpl); 
    166         $tpl  = str_replace('\'', '\\\'', $tpl); 
    167  
    168         // strip newlines. 
    169         $tpl  = str_replace("\n", '', $tpl); 
    170  
    171         // Turn template blocks into PHP assignment statements for the values of $bbcode_tpls.. 
    172         $tpl = preg_replace('#<!-- BEGIN (.*?) -->(.*?)<!-- END (.*?) -->#', "\n" . '$bbcode_tpls[\'\\1\'] = \'\\2\';', $tpl); 
    173  
    174         $bbcode_tpls = array(); 
    175  
    176         eval($tpl); 
    177  
    178         return $bbcode_tpls; 
    179 } 
    180  
    181  
    182 /** 
    183  * Prepares the loaded bbcode templates for insertion into preg_replace() 
    184  * or str_replace() calls in the bbencode_second_pass functions. This 
    185  * means replacing template placeholders with the appropriate preg backrefs 
    186  * or with language vars. NOTE: If you change how the regexps work in 
    187  * bbencode_second_pass(), you MUST change this function. 
    188  * 
    189  * Nathan Codding, Sept 26 2001 
    190  * 
    191  */ 
    192 function prepare_bbcode_template($bbcode_tpl) 
    193 { 
    194         global $lang; 
    195  
    196         $bbcode_tpl['olist_open'] = str_replace('{LIST_TYPE}', '\\1', $bbcode_tpl['olist_open']); 
    197  
    198         $bbcode_tpl['color_open'] = str_replace('{COLOR}', '\\1', $bbcode_tpl['color_open']); 
    199  
    200         $bbcode_tpl['size_open'] = str_replace('{SIZE}', '\\1', $bbcode_tpl['size_open']); 
    201  
    202         $bbcode_tpl['quote_open'] = str_replace('{L_QUOTE}', $lang['quote'], $bbcode_tpl['quote_open']); 
    203  
    204         $bbcode_tpl['quote_username_open'] = str_replace('{L_QUOTE}', $lang['quote'], $bbcode_tpl['quote_username_open']); 
    205         $bbcode_tpl['quote_username_open'] = str_replace('{L_POSTED}', $lang['wrote'], $bbcode_tpl['quote_username_open']); 
    206         $bbcode_tpl['quote_username_open'] = str_replace('{USERNAME}', '\\1', $bbcode_tpl['quote_username_open']); 
    207         // BEGIN Moderator Tags 
    208         $bbcode_tpl['mod_open'] = str_replace('{MOD_WARN}', $lang['mod_warning'], $bbcode_tpl['mod_open']); 
    209         $bbcode_tpl['mod_username_open'] = str_replace('{MOD_WARN}', $lang['mod_warning'], $bbcode_tpl['mod_username_open']); 
    210         $bbcode_tpl['mod_username_open'] = str_replace('{USERNAME}', '\\1', $bbcode_tpl['mod_username_open']); 
    211         // END Moderator Tags 
    212  
    213         $bbcode_tpl['code_open'] = str_replace('{L_CODE}', $lang['code'], $bbcode_tpl['code_open']); 
    214         $bbcode_tpl['offtop_open'] = str_replace('{L_OFFTOP}', $lang['offtop'], $bbcode_tpl['offtop_open']); 
    215  
    216         $bbcode_tpl['img'] = str_replace('{URL}', '\\1', $bbcode_tpl['img']); 
    217  
    218         // We do URLs in several different ways.. 
    219         $bbcode_tpl['url1'] = str_replace('{URL}', '\\1', $bbcode_tpl['url']); 
    220         $bbcode_tpl['url1'] = str_replace('{DESCRIPTION}', '\\1', $bbcode_tpl['url1']); 
    221  
    222         $bbcode_tpl['url2'] = str_replace('{URL}', 'http://\\1', $bbcode_tpl['url']); 
    223         $bbcode_tpl['url2'] = str_replace('{DESCRIPTION}', '\\1', $bbcode_tpl['url2']); 
    224  
    225         $bbcode_tpl['url3'] = str_replace('{URL}', '\\1', $bbcode_tpl['url']); 
    226         $bbcode_tpl['url3'] = str_replace('{DESCRIPTION}', '\\2', $bbcode_tpl['url3']); 
    227  
    228         $bbcode_tpl['url4'] = str_replace('{URL}', 'http://\\1', $bbcode_tpl['url']); 
    229         $bbcode_tpl['url4'] = str_replace('{DESCRIPTION}', '\\3', $bbcode_tpl['url4']); 
    230  
    231         $bbcode_tpl['email'] = str_replace('{EMAIL}', '\\1', $bbcode_tpl['email']); 
    232  
    233         define("BBCODE_TPL_READY", true); 
    234  
    235         return $bbcode_tpl; 
    236 } 
    237  
    238  
    239 /** 
    240  * Does second-pass bbencoding. This should be used before displaying the message in 
    241  * a thread. Assumes the message is already first-pass encoded, and we are given the 
    242  * correct UID as used in first-pass encoding. 
    243  */ 
    244 function bbencode_second_pass($text, $uid) 
    245 { 
    246         global $lang, $bbcode_tpl; 
    247  
    248         $text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1&#058;", $text); 
    249  
    250         // pad it with a space so we can distinguish between FALSE and matching the 1st char (index 0). 
    251         // This is important; bbencode_quote(), bbencode_list(), and bbencode_code() all depend on it. 
    252         $text = " " . $text; 
    253  
    254         // First: If there isn't a "[" and a "]" in the message, don't bother. 
    255         if (! (strpos($text, "[") && strpos($text, "]")) ) 
    256         { 
    257                 // Remove padding, return. 
    258                 $text = substr($text, 1); 
    259                 return $text; 
    260         } 
    261  
    262         // Only load the templates ONCE.. 
    263         if (!defined("BBCODE_TPL_READY")) 
    264         { 
    265                 // load templates from file into array. 
    266                 $bbcode_tpl = load_bbcode_template(); 
    267  
    268                 // prepare array for use in regexps. 
    269                 $bbcode_tpl = prepare_bbcode_template($bbcode_tpl); 
    270         } 
    271  
    272         // [CODE] and [/CODE] for posting code (HTML, PHP, C etc etc) in your posts. 
    273         $text = bbencode_second_pass_code($text, $uid, $bbcode_tpl); 
    274  
    275         // [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff. 
    276         $text = str_replace("[quote:$uid]", $bbcode_tpl['quote_open'], $text); 
    277         $text = str_replace("[/quote:$uid]", $bbcode_tpl['quote_close'], $text); 
    278  
    279         // New one liner to deal with opening quotes with usernames... 
    280         // replaces the two line version that I had here before.. 
    281         $text = preg_replace("/\[quote:$uid=(.*?)\]/si", $bbcode_tpl['quote_username_open'], $text); 
    282  
    283         // [list] and [list=x] for (un)ordered lists. 
    284         // unordered lists 
    285         $text = str_replace("[list:$uid]", $bbcode_tpl['ulist_open'], $text); 
    286         // li tags 
    287         $text = str_replace("[*:$uid]", $bbcode_tpl['listitem'], $text); 
    288         // ending tags 
    289         $text = str_replace("[/list:u:$uid]", $bbcode_tpl['ulist_close'], $text); 
    290         $text = str_replace("[/list:o:$uid]", $bbcode_tpl['olist_close'], $text); 
    291         // Ordered lists 
    292         $text = preg_replace("/\[list=([a1]):$uid\]/si", $bbcode_tpl['olist_open'], $text); 
    293         // BEGIN Moderator Tags 
    294         // [mod] Moderator code [/mod] 
    295         $text = str_replace("[mod:$uid]", $bbcode_tpl['mod_open'], $text); 
    296         $text = str_replace("[/mod:$uid]", $bbcode_tpl['mod_close'], $text); 
    297         $text = preg_replace("/\[mod:$uid=(.*?)\]/si", $bbcode_tpl['mod_username_open'], $text); 
    298         // END Moderator Tags 
    299         $text = str_replace("[offtop:$uid]", $bbcode_tpl['offtop_open'], $text); 
    300         $text = str_replace("[/offtop:$uid]", $bbcode_tpl['offtop_close'], $text); 
    301         // colours 
    302         $text = preg_replace("/\[color=(\#[0-9A-F]{6}|[a-z]+):$uid\]/si", $bbcode_tpl['color_open'], $text); 
    303         $text = str_replace("[/color:$uid]", $bbcode_tpl['color_close'], $text); 
    304  
    305         // size 
    306         $text = preg_replace("/\[size=([1-2]?[0-9]):$uid\]/si", $bbcode_tpl['size_open'], $text); 
    307         $text = str_replace("[/size:$uid]", $bbcode_tpl['size_close'], $text); 
    308  
    309         // [b] and [/b] for bolding text. 
    310         $text = str_replace("[b:$uid]", $bbcode_tpl['b_open'], $text); 
    311         $text = str_replace("[/b:$uid]", $bbcode_tpl['b_close'], $text); 
    312  
    313         // [u] and [/u] for underlining text. 
    314         $text = str_replace("[u:$uid]", $bbcode_tpl['u_open'], $text); 
    315         $text = str_replace("[/u:$uid]", $bbcode_tpl['u_close'], $text); 
    316  
    317         // [i] and [/i] for italicizing text. 
    318         $text = str_replace("[i:$uid]", $bbcode_tpl['i_open'], $text); 
    319         $text = str_replace("[/i:$uid]", $bbcode_tpl['i_close'], $text); 
    320  
    321         // Patterns and replacements for URL and email tags.. 
    322         $patterns = array(); 
    323         $replacements = array(); 
    324  
    325         // mod img size replace with call to image parsing function 
    326         $text = image_parse ( $text, $uid ); 
    327  
    328         // [img]image_url_here[/img] code.. 
    329         // This one gets first-passed.. 
    330         $patterns[] = "#\[img:$uid\]([^?](?:[^\[]+|\[(?!url))*?)\[/img:$uid\]#i"; 
    331         $replacements[] = $bbcode_tpl['img']; 
    332  
    333         // matches a [url]xxxx://www.phpbb.com[/url] code.. 
    334         $patterns[] = "#\[url\]([\w]+?://([\w\#$%&~/.\-;:=,?@\]+]+|\[(?!url=))*?)\[/url\]#is"; 
    335         $replacements[] = $bbcode_tpl['url1']; 
    336  
    337         // [url]www.phpbb.com[/url] code.. (no xxxx:// prefix). 
    338         $patterns[] = "#\[url\]((www|ftp)\.([\w\#$%&~/.\-;:=,?@\]+]+|\[(?!url=))*?)\[/url\]#is"; 
    339         $replacements[] = $bbcode_tpl['url2']; 
    340  
    341         // [url=xxxx://www.phpbb.com]phpBB[/url] code.. 
    342         $patterns[] = "#\[url=([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*?)\]([^?\n\r\t].*?)\[/url\]#is"; 
    343         $replacements[] = $bbcode_tpl['url3']; 
    344  
    345         // [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix). 
    346         $patterns[] = "#\[url=((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*?)\]([^?\n\r\t].*?)\[/url\]#is"; 
    347         $replacements[] = $bbcode_tpl['url4']; 
    348  
    349  
    350         // [email]user@domain.tld[/email] code.. 
    351         $patterns[] = "#\[email\]([a-z0-9&\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)\[/email\]#si"; 
    352         $replacements[] = $bbcode_tpl['email']; 
    353  
    354         $text = preg_replace($patterns, $replacements, $text); 
    355  
    356         // Remove our padding from the string.. 
    357         $text = substr($text, 1); 
    358  
    359         return $text; 
    360  
    361 } // bbencode_second_pass() 
    362  
    363 // Need to initialize the random numbers only ONCE 
    364 mt_srand( (double) microtime() * 1000000); 
    365  
    366 function make_bbcode_uid() 
    367 { 
    368         // Unique ID for this message.. 
    369  
    370         $uid = md5(mt_rand()); 
    371         $uid = substr($uid, 0, BBCODE_UID_LEN); 
    372  
    373         return $uid; 
    374 } 
    375  
    376 function bbencode_first_pass($text, $uid) 
    377 { 
    378         // pad it with a space so we can distinguish between FALSE and matching the 1st char (index 0). 
    379         // This is important; bbencode_quote(), bbencode_list(), and bbencode_code() all depend on it. 
    380         $text = " " . $text; 
    381  
    382         // [CODE] and [/CODE] for posting code (HTML, PHP, C etc etc) in your posts. 
    383         $text = bbencode_first_pass_pda($text, $uid, '[code]', '[/code]', '', true, ''); 
    384  
    385         $text = bbencode_first_pass_pda($text, $uid, '[offtop]', '[/offtop]', '', false, ''); 
    386  
    387         // [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff. 
    388         $text = bbencode_first_pass_pda($text, $uid, '[quote]', '[/quote]', '', false, ''); 
    389         $text = bbencode_first_pass_pda($text, $uid, '/\[quote=(.*?)\]/is', '[/quote]', '', false, '', "[quote:$uid=\\1]"); 
    390  
    391         // [list] and [list=x] for (un)ordered lists. 
    392         $open_tag = array(); 
    393         $open_tag[0] = "[list]"; 
    394  
    395         // unordered.. 
    396         $text = bbencode_first_pass_pda($text, $uid, $open_tag, "[/list]", "[/list:u]", false, 'replace_listitems'); 
    397  
    398         $open_tag[0] = "[list=1]"; 
    399         $open_tag[1] = "[list=a]"; 
    400  
    401         // ordered. 
    402         $text = bbencode_first_pass_pda($text, $uid, $open_tag, "[/list]", "[/list:o]",  false, 'replace_listitems'); 
    403         // BEGIN Moderator Tags 
    404         $text = bbencode_first_pass_pda($text, $uid, '[mod]', '[/mod]', '', false, ''); 
    405         $text = bbencode_first_pass_pda($text, $uid, '/\[mod=(.*?)\]/is', '[/mod]', '', false, '', "[mod:$uid=\\1]"); 
    406         // END Moderator Tags 
    407         // [color] and [/color] for setting text color 
    408         $text = preg_replace("#\[color=(\#[0-9A-F]{6}|[a-z\-]+)\](.*?)\[/color\]#si", "[color=\\1:$uid]\\2[/color:$uid]", $text); 
    409  
    410         // [size] and [/size] for setting text size 
    411         $text = preg_replace("#\[size=([1-2]?[0-9])\](.*?)\[/size\]#si", "[size=\\1:$uid]\\2[/size:$uid]", $text); 
    412  
    413         // [b] and [/b] for bolding text. 
    414         $text = preg_replace("#\[b\](.*?)\[/b\]#si", "[b:$uid]\\1[/b:$uid]", $text); 
    415  
    416         // [u] and [/u] for underlining text. 
    417         $text = preg_replace("#\[u\](.*?)\[/u\]#si", "[u:$uid]\\1[/u:$uid]", $text); 
    418  
    419         // [i] and [/i] for italicizing text. 
    420         $text = preg_replace("#\[i\](.*?)\[/i\]#si", "[i:$uid]\\1[/i:$uid]", $text); 
    421  
    422         // mod max img size changed the first pass thingo 
    423         preg_match_all( "#\[(img.*?)\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", $text, $matches ); 
    424         // now we go through these matches and do what's needed 
    425         foreach ( $matches[0] as $i => $m ) 
    426         { 
    427                 // easier use 
    428                 $tag = $matches[1][$i]; 
    429                 $url1 = $matches[2][$i]; 
    430                 $url2 = $matches[4][$i]; 
    431  
    432                 // if we already tagged this one then we leave it be ;) 
    433                 preg_match( '#img.*?:(\d+):(\d+)#i', $tag, $match ); 
    434                 if ( empty( $match ) ) 
    435                 { 
    436                         // get the size so we can store it 
    437                         if ( !$size = @getimagesize( $url1 . $url2 ) ) 
    438                         { // image will not get resized 
    439                                 $width = ''; 
    440                                 $height = ''; 
    441                         } 
    442                         else 
    443                         { 
    444                                 $width = $size[0]; 
    445                                 $height = $size[1]; 
    446                         } 
    447                 } 
    448                 else 
    449                 { // we already have the size 
    450                         $width = $match[1]; 
    451                         $height = $match[2]; 
    452                 } 
    453                 $tag = explode( ':', $tag ); // remove any possible left over : stuff 
    454                 $tag = $tag[0]; 
    455                 // lastly we replace it within the text 
    456                 $text = str_replace( $m, '[' . $tag . ':' . $width . ':' . $height . ':' . $uid . ']' . $url1 . $url2 . '[/img:' . $uid . ']', $text ); 
    457         } 
    458  
    459         // [img]image_url_here[/img] code.. 
    460         //$text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text); 
    461         // end mod img size changes 
    462  
    463         // Remove our padding from the string.. 
    464         return substr($text, 1);; 
    465  
    466 } // bbencode_first_pass() 
    467  
    468 /** 
    469  * $text - The text to operate on. 
    470  * $uid - The UID to add to matching tags. 
    471  * $open_tag - The opening tag to match. Can be an array of opening tags. 
    472  * $close_tag - The closing tag to match. 
    473  * $close_tag_new - The closing tag to replace with. 
    474  * $mark_lowest_level - boolean - should we specially mark the tags that occur 
    475  *                                         at the lowest level of nesting? (useful for [code], because 
    476  *                                                we need to match these tags first and transform HTML tags 
    477  *                                                in their contents.. 
    478  * $func - This variable should contain a string that is the name of a function. 
    479  *                                That function will be called when a match is found, and passed 2 
    480  *                                parameters: ($text, $uid). The function should return a string. 
    481  *                                This is used when some transformation needs to be applied to the 
    482  *                                text INSIDE a pair of matching tags. If this variable is FALSE or the 
    483  *                                empty string, it will not be executed. 
    484  * If open_tag is an array, then the pda will try to match pairs consisting of 
    485  * any element of open_tag followed by close_tag. This allows us to match things 
    486  * like [list=A]...[/list] and [list=1]...[/list] in one pass of the PDA. 
    487  * 
    488  * NOTES:        - this function assumes the first character of $text is a space. 
    489  *                                - every opening tag and closing tag must be of the [...] format. 
    490  */ 
    491 function bbencode_first_pass_pda($text, $uid, $open_tag, $close_tag, $close_tag_new, $mark_lowest_level, $func, $open_regexp_replace = false) 
    492 { 
    493         $open_tag_count = 0; 
    494  
    495         if (!$close_tag_new || ($close_tag_new == '')) 
    496         { 
    497                 $close_tag_new = $close_tag; 
    498         } 
    499  
    500         $close_tag_length = strlen($close_tag); 
    501         $close_tag_new_length = strlen($close_tag_new); 
    502         $uid_length = strlen($uid); 
    503  
    504         $use_function_pointer = ($func && ($func != '')); 
    505  
    506         $stack = array(); 
    507  
    508         if (is_array($open_tag)) 
    509         { 
    510                 if (0 == count($open_tag)) 
    511                 { 
    512                         // No opening tags to match, so return. 
    513                         return $text; 
    514                 } 
    515                 $open_tag_count = count($open_tag); 
    516         } 
    517         else 
    518         { 
    519                 // only one opening tag. make it into a 1-element array. 
    520                 $open_tag_temp = $open_tag; 
    521                 $open_tag = array(); 
    522                 $open_tag[0] = $open_tag_temp; 
    523                 $open_tag_count = 1; 
    524         } 
    525  
    526         $open_is_regexp = false; 
    527  
    528         if ($open_regexp_replace) 
    529         { 
    530                 $open_is_regexp = true; 
    531                 if (!is_array($open_regexp_replace)) 
    532                 { 
    533                         $open_regexp_temp = $open_regexp_replace; 
    534                         $open_regexp_replace = array(); 
    535                         $open_regexp_replace[0] = $open_regexp_temp; 
    536                 } 
    537         } 
    538  
    539         if ($mark_lowest_level && $open_is_regexp) 
    540         { 
    541                 trigger_error("Unsupported operation for bbcode_first_pass_pda()."); 
    542                 return; 
    543         } 
    544  
    545         // Start at the 2nd char of the string, looking for opening tags. 
    546         $curr_pos = 1; 
    547         while ($curr_pos && ($curr_pos < strlen($text))) 
    548         { 
    549                 $curr_pos = strpos($text, "[", $curr_pos); 
    550  
    551                 // If not found, $curr_pos will be 0, and the loop will end. 
    552                 if ($curr_pos) 
    553                 { 
    554                         // We found a [. It starts at $curr_pos. 
    555                         // check if it's a starting or ending tag. 
    556                         $found_start = false; 
    557                         $which_start_tag = ""; 
    558                         $start_tag_index = -1; 
    559  
    560                         for ($i = 0; $i < $open_tag_count; $i++) 
    561                         { 
    562                                 // Grab everything until the first "]"... 
    563                                 $possible_start = substr($text, $curr_pos, strpos($text, ']', $curr_pos + 1) - $curr_pos + 1); 
    564  
    565                                 // 
    566                                 // We're going to try and catch usernames with "[' characters. 
    567                                 // 
    568                                 if( preg_match('#\[quote=#si', $possible_start, $match) && !preg_match('#\[quote=(.*?)\]#si', $possible_start) ) 
    569                                 { 
    570                                         // OK we are in a quote tag that probably contains a ] bracket. 
    571                                         // Grab a bit more of the string to hopefully get all of it.. 
    572                                         if ($close_pos = strpos($text, '&quot;]', $curr_pos + 14)) 
    573                                         { 
    574                                                 if (strpos(substr($text, $curr_pos + 14, $close_pos - ($curr_pos + 14)), '[quote') === false) 
    575                                                 { 
    576                                                         $possible_start = substr($text, $curr_pos, $close_pos - $curr_pos + 7); 
    577                                                 } 
    578                                         } 
    579                                 } 
    580  
    581                                 // BEGIN Moderator Tags 
    582                                 // 
    583                                 // We're going to try and catch usernames with "[' characters. 
    584                                 // 
    585                                 if( preg_match('#\[mod=#si', $possible_start, $match) && !preg_match('#\[mod=(.*?)\]#si', $possible_start) ) 
    586                                 { 
    587                                         // OK we are in a mod tag that probably contains a ] bracket. 
    588                                         // Grab a bit more of the string to hopefully get all of it.. 
    589                                         if ($close_pos = strpos($text, '&quot;]', $curr_pos + 14)) 
    590                                         { 
    591                                                 if (strpos(substr($text, $curr_pos + 14, $close_pos - ($curr_pos + 14)), '[mod') === false) 
    592                                                 { 
    593                                                         $possible_start = substr($text, $curr_pos, $close_pos - $curr_pos + 7); 
    594                                                 } 
    595                                         } 
    596                                 } 
    597                                 // END Moderator Tags 
    598                                 // Now compare, either using regexp or not. 
    599                                 if ($open_is_regexp) 
    600                                 { 
    601                                         $match_result = array(); 
    602                                         if (preg_match($open_tag[$i], $possible_start, $match_result)) 
    603                                         { 
    604                                                 $found_start = true; 
    605                                                 $which_start_tag = $match_result[0]; 
    606                                                 $start_tag_index = $i; 
    607                                                 break; 
    608                                         } 
    609                                 } 
    610                                 else 
    611                                 { 
    612                                         // straightforward string comparison. 
    613                                         if (0 == strcasecmp($open_tag[$i], $possible_start)) 
    614                                         { 
    615                                                 $found_start = true; 
    616                                                 $which_start_tag = $open_tag[$i]; 
    617                                                 $start_tag_index = $i; 
    618                                                 break; 
    619                                         } 
    620                                 } 
    621                         } 
    622  
    623                         if ($found_start) 
    624                         { 
    625                                 // We have an opening tag. 
    626                                 // Push its position, the text we matched, and its index in the open_tag array on to the stack, and then keep going to the right. 
    627                                 $match = array("pos" => $curr_pos, "tag" => $which_start_tag, "index" => $start_tag_index); 
    628                                 array_push($stack, $match); 
    629                                 // 
    630                                 // Rather than just increment $curr_pos 
    631                                 // Set it to the ending of the tag we just found 
    632                                 // Keeps error in nested tag from breaking out 
    633                                 // of table structure.. 
    634                                 // 
    635                                 $curr_pos += strlen($possible_start); 
    636                         } 
    637                         else 
    638                         { 
    639                                 // check for a closing tag.. 
    640                                 $possible_end = substr($text, $curr_pos, $close_tag_length); 
    641                                 if (0 == strcasecmp($close_tag, $possible_end)) 
    642                                 { 
    643                                         // We have an ending tag. 
    644                                         // Check if we've already found a matching starting tag. 
    645                                         if (sizeof($stack) > 0) 
    646                                         { 
    647                                                 // There exists a starting tag. 
    648                                                 $curr_nesting_depth = sizeof($stack); 
    649                                                 // We need to do 2 replacements now. 
    650                                                 $match = array_pop($stack); 
    651                                                 $start_index = $match['pos']; 
    652                                                 $start_tag = $match['tag']; 
    653                                                 $start_length = strlen($start_tag); 
    654                                                 $start_tag_index = $match['index']; 
    655  
    656                                                 if ($open_is_regexp) 
    657                                                 { 
    658                                                         $start_tag = preg_replace($open_tag[$start_tag_index], $open_regexp_replace[$start_tag_index], $start_tag); 
    659                                                 } 
    660  
    661                                                 // everything before the opening tag. 
    662                                                 $before_start_tag = substr($text, 0, $start_index); 
    663  
    664                                                 // everything after the opening tag, but before the closing tag. 
    665                                                 $between_tags = substr($text, $start_index + $start_length, $curr_pos - $start_index - $start_length); 
    666  
    667                                                 // Run the given function on the text between the tags.. 
    668                                                 if ($use_function_pointer) 
    669                                                 { 
    670                                                         $between_tags = $func($between_tags, $uid); 
    671                                                 } 
    672  
    673                                                 // everything after the closing tag. 
    674                                                 $after_end_tag = substr($text, $curr_pos + $close_tag_length); 
    675  
    676                                                 // Mark the lowest nesting level if needed. 
    677                                                 if ($mark_lowest_level && ($curr_nesting_depth == 1)) 
    678                                                 { 
    679                                                         if ($open_tag[0] == '[code]') 
    680                                                         { 
    681                                                                 $code_entities_match = array('#<#', '#>#', '#"#', '#:#', '#\[#', '#\]#', '#\(#', '#\)#', '#\{#', '#\}#'); 
    682                                                                 $code_entities_replace = array('&lt;', '&gt;', '&quot;', '&#58;', '&#91;', '&#93;', '&#40;', '&#41;', '&#123;', '&#125;'); 
    683                                                                 $between_tags = preg_replace($code_entities_match, $code_entities_replace, $between_tags); 
    684                                                         } 
    685                                                         $text = $before_start_tag . substr($start_tag, 0, $start_length - 1) . ":$curr_nesting_depth:$uid]"; 
    686                                                         $text .= $between_tags . substr($close_tag_new, 0, $close_tag_new_length - 1) . ":$curr_nesting_depth:$uid]"; 
    687                                                 } 
    688                                                 else 
    689                                                 { 
    690                                                         if ($open_tag[0] == '[code]') 
    691                                                         { 
    692                                                                 $text = $before_start_tag . '&#91;code&#93;'; 
    693                                                                 $text .= $between_tags . '&#91;/code&#93;'; 
    694                                                         } 
    695                                                         else 
    696                                                         { 
    697                                                                 if ($open_is_regexp) 
    698                                                                 { 
    699                                                                         $text = $before_start_tag . $start_tag; 
    700                                                                 } 
    701                                                                 else 
    702                                                                 { 
    703                                                                         $text = $before_start_tag . substr($start_tag, 0, $start_length - 1) . ":$uid]"; 
    704                                                                 } 
    705                                                                 $text .= $between_tags . substr($close_tag_new, 0, $close_tag_new_length - 1) . ":$uid]"; 
    706                                                         } 
    707                                                 } 
    708  
    709                                                 $text .= $after_end_tag; 
    710  
    711                                                 // Now.. we've screwed up the indices by changing the length of the string. 
    712                                                 // So, if there's anything in the stack, we want to resume searching just after it. 
    713                                                 // otherwise, we go back to the start. 
    714                                                 if (sizeof($stack) > 0) 
    715                                                 { 
    716                                                         $match = array_pop($stack); 
    717                                                         $curr_pos = $match['pos']; 
    718 //                                                        bbcode_array_push($stack, $match); 
    719 //                                                        ++$curr_pos; 
    720                                                 } 
    721                                                 else 
    722                                                 { 
    723                                                         $curr_pos = 1; 
    724                                                 } 
    725                                         } 
    726                                         else 
    727                                         { 
    728                                                 // No matching start tag found. Increment pos, keep going. 
    729                                                 ++$curr_pos; 
    730                                         } 
    731                                 } 
    732                                 else 
    733                                 { 
    734                                         // No starting tag or ending tag.. Increment pos, keep looping., 
    735                                         ++$curr_pos; 
    736                                 } 
    737                         } 
    738                 } 
    739         } // while 
    740  
    741         return $text; 
    742  
    743 } // bbencode_first_pass_pda() 
    744  
    745 /** 
    746  * Does second-pass bbencoding of the [code] tags. This includes 
    747  * running htmlspecialchars() over the text contained between 
    748  * any pair of [code] tags that are at the first level of 
    749  * nesting. Tags at the first level of nesting are indicated 
    750  * by this format: [code:1:$uid] ... [/code:1:$uid] 
    751  * Other tags are in this format: [code:$uid] ... [/code:$uid] 
    752  */ 
    753 function bbencode_second_pass_code($text, $uid, $bbcode_tpl) 
    754 { 
    755         global $lang; 
    756  
    757         $code_start_html = $bbcode_tpl['code_open']; 
    758         $code_end_html =  $bbcode_tpl['code_close']; 
    759  
    760         // First, do all the 1st-level matches. These need an htmlspecialchars() run, 
    761         // so they have to be handled differently. 
    762         $match_count = preg_match_all("#\[code:1:$uid\](.*?)\[/code:1:$uid\]#si", $text, $matches); 
    763  
    764         for ($i = 0; $i < $match_count; $i++) 
    765         { 
    766                 $before_replace = $matches[1][$i]; 
    767                 $after_replace = $matches[1][$i]; 
    768  
    769                 // Replace 2 spaces with "&nbsp; " so non-tabbed code indents without making huge long lines. 
    770                 $after_replace = str_replace("  ", "&nbsp; ", $after_replace); 
    771                 // now Replace 2 spaces with " &nbsp;" to catch odd #s of spaces. 
    772                 $after_replace = str_replace("  ", " &nbsp;", $after_replace); 
    773  
    774                 // Replace tabs with "&nbsp; &nbsp;" so tabbed code indents sorta right without making huge long lines. 
    775                 $after_replace = str_replace("\t", "&nbsp; &nbsp;", $after_replace); 
    776  
    777                 // now Replace space occurring at the beginning of a line 
    778                 $after_replace = preg_replace("/^ {1}/m", '&nbsp;', $after_replace); 
    779  
    780                 $str_to_match = "[code:1:$uid]" . $before_replace . "[/code:1:$uid]"; 
    781  
    782                 $replacement = $code_start_html; 
    783                 $replacement .= $after_replace; 
    784                 $replacement .= $code_end_html; 
    785  
    786                 $text = str_replace($str_to_match, $replacement, $text); 
    787         } 
    788  
    789         // Now, do all the non-first-level matches. These are simple. 
    790         $text = str_replace("[code:$uid]", $code_start_html, $text); 
    791         $text = str_replace("[/code:$uid]", $code_end_html, $text); 
    792  
    793         return $text; 
    794  
    795 } // bbencode_second_pass_code() 
    796  
    797 /** 
    798  * Rewritten by Nathan Codding - Feb 6, 2001. 
    799  * - Goes through the given string, and replaces xxxx://yyyy with an HTML <a> tag linking 
    800  *         to that URL 
    801  * - Goes through the given string, and replaces www.xxxx.yyyy[zzzz] with an HTML <a> tag linking 
    802  *         to http://www.xxxx.yyyy[/zzzz] 
    803  * - Goes through the given string, and replaces xxxx@yyyy with an HTML mailto: tag linking 
    804  *                to that email address 
    805  * - Only matches these 2 patterns either after a space, or at the beginning of a line 
    806  * 
    807  * Notes: the email one might get annoying - it's easy to make it more restrictive, though.. maybe 
    808  * have it require something like xxxx@yyyy.zzzz or such. We'll see. 
    809  */ 
    810 function make_clickable($text) 
    811 { 
    812         $text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1&#058;", $text); 
    813  
    814         // pad it with a space so we can match things at the start of the 1st line. 
    815         $ret = ' ' . $text; 
    816  
    817         // matches an "xxxx://yyyy" URL at the start of a line, or after a space. 
    818         // xxxx can only be alpha characters. 
    819         // yyyy is anything up to the first space, newline, comma, double quote or < 
    820         $ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]|+]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret); 
    821  
    822         // matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing 
    823         // Must contain at least 2 dots. xxxx contains either alphanum, or "-" 
    824         // zzzz is optional.. will contain everything up to the first space, newline, 
    825         // comma, double quote or <. 
    826         $ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]|+]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret); 
    827  
    828         // matches an email@domain type address at the start of a line, or after a space. 
    829         // Note: Only the followed chars are valid; alphanums, "-", "_" and or ".". 
    830         $ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret); 
    831  
    832         // Remove our padding.. 
    833         $ret = substr($ret, 1); 
    834  
    835         return($ret); 
    836 } 
    837  
    838 /** 
    839  * Nathan Codding - Feb 6, 2001 
    840  * Reverses the effects of make_clickable(), for use in editpost. 
    841  * - Does not distinguish between "www.xxxx.yyyy" and "http://aaaa.bbbb" type URLs. 
    842  * 
    843  */ 
    844 function undo_make_clickable($text) 
    845 { 
    846         $text = preg_replace("#<!-- BBCode auto-link start --><a href=\"(.*?)\" target=\"_blank\">.*?</a><!-- BBCode auto-link end -->#i", "\\1", $text); 
    847         $text = preg_replace("#<!-- BBcode auto-mailto start --><a href=\"mailto:(.*?)\">.*?</a><!-- BBCode auto-mailto end -->#i", "\\1", $text); 
    848  
    849         return $text; 
    850  
    851 } 
    852  
    853 /** 
    854  * This is used to change a [*] tag into a [*:$uid] tag as part 
    855  * of the first-pass bbencoding of [list] tags. It fits the 
    856  * standard required in order to be passed as a variable 
    857  * function into bbencode_first_pass_pda(). 
    858  */ 
    859 function replace_listitems($text, $uid) 
    860 { 
    861         $text = str_replace("[*]", "[*:$uid]", $text); 
    862  
    863         return $text; 
    864 } 
    865  
    866 /** 
    867  * Escapes the "/" character with "\/". This is useful when you need 
    868  * to stick a runtime string into a PREG regexp that is being delimited 
    869  * with slashes. 
    870  */ 
    871 function escape_slashes($input) 
    872 { 
    873         $output = str_replace('/', '\/', $input); 
    874         return $output; 
    875 } 
    876  
    877 /** 
    878  * This function does exactly what the PHP4 function array_push() does 
    879  * however, to keep phpBB compatable with PHP 3 we had to come up with our own 
    880  * method of doing it. 
    881  * This function was deprecated in phpBB 2.0.18 
    882  */ 
    883 function bbcode_array_push(&$stack, $value) 
    884 { 
    885    $stack[] = $value; 
    886    return(sizeof($stack)); 
    887 } 
    888  
    889 /** 
    890  * This function does exactly what the PHP4 function array_pop() does 
    891  * however, to keep phpBB compatable with PHP 3 we had to come up with our own 
    892  * method of doing it. 
    893  * This function was deprecated in phpBB 2.0.18 
    894  */ 
    895 function bbcode_array_pop(&$stack) 
    896 { 
    897    $arrSize = count($stack); 
    898    $x = 1; 
    899  
    900    while(list($key, $val) = each($stack)) 
    901    { 
    902       if($x < count($stack)) 
    903       { 
    904                          $tmpArr[] = $val; 
    905       } 
    906       else 
    907       { 
    908                          $return_val = $val; 
    909       } 
    910       $x++; 
    911    } 
    912    $stack = $tmpArr; 
    913  
    914    return($return_val); 
    915 } 
    916  
    91767?> 
  • phpBB2/includes/functions_post.php

    r258 r269  
    11<?php 
    22/*************************************************************************** 
    3  *                            functions_post.php 
    4  *                            ------------------- 
    5  *   begin                : Saturday, Feb 13, 2001 
    6  *   copyright            : (C) 2001 The phpBB Group 
    7  *   email                : support@phpbb.com 
     3 *                         functions_post.php 
     4 *                         ------------------- 
     5 *   begin             : Saturday, Feb 13, 2001 
     6 *   copyright     : (C) 2001 The phpBB Group 
     7 *   email             : support@phpbb.com 
    88 * 
    99 *   $Id: functions_post.php,v 1.9.2.39 2005/09/18 16:17:20 acydburn Exp $ 
     
    2323if (!defined('IN_PHPBB')) 
    2424{ 
    25         die('Hacking attempt'); 
     25       die('Hacking attempt'); 
    2626} 
    2727 
     
    3232$unhtml_specialchars_replace = array('>', '<', '"', '&'); 
    3333 
    34 function prepare_message($message, $html_on, $bbcode_on, $smile_on, $bbcode_uid = 0) 
    35 
    36         global $config, $html_entities_match, $html_entities_replace; 
    37  
    38         // 
    39         // Clean up the message 
    40         // 
    41  
    42         if ($html_on) 
    43         { 
    44                                 // If HTML is on, we try to make it safe 
    45                 // This approach is quite agressive and anything that does not look like a valid tag 
    46                 // is going to get converted to HTML entities 
    47                 $html_match = '#<[^\w<]*(\w+)((?:"[^"]*"|\'[^\']*\'|[^<>\'"])+)?>#'; 
    48                 $matches = array(); 
    49  
    50                 $message_split = preg_split($html_match, $message); 
    51                 preg_match_all($html_match, $message, $matches); 
    52  
    53                 $message = ''; 
    54  
    55                 foreach ($message_split as $part) 
    56                 { 
    57                         $tag = array(array_shift($matches[0]), array_shift($matches[1]), array_shift($matches[2])); 
    58                         $message .= preg_replace($html_entities_match, $html_entities_replace, $part) . clean_html($tag); 
    59                 } 
    60  
    61                 $message = str_replace('&quot;', '\&quot;', $message); 
    62         } 
    63         //else 
    64         //{ 
    65         //        $message = preg_replace($html_entities_match, $html_entities_replace, $message); 
    66         //} 
    67  
    68         if($bbcode_on && $bbcode_uid != '') 
    69         { 
    70                 $message = bbencode_first_pass($message, $bbcode_uid); 
    71         } 
    72  
    73         return $message; 
     34function prepare_message($message, $html_on, $bbcode_on, $smile_on) 
     35
     36        global $config, $html_entities_match, $html_entities_replace; 
     37 
     38        // 
     39        // Clean up the message 
     40        // 
     41 
     42        if ($html_on) 
     43        { 
     44                                // If HTML is on, we try to make it safe 
     45                // This approach is quite agressive and anything that does not look like a valid tag 
     46                // is going to get converted to HTML entities 
     47                $html_match = '#<[^\w<]*(\w+)((?:"[^"]*"|\'[^\']*\'|[^<>\'"])+)?>#'; 
     48                $matches = array(); 
     49 
     50                $message_split = preg_split($html_match, $message); 
     51                preg_match_all($html_match, $message, $matches); 
     52 
     53                $message = ''; 
     54 
     55                foreach ($message_split as $part) 
     56                { 
     57                        $tag = array(array_shift($matches[0]), array_shift($matches[1]), array_shift($matches[2])); 
     58                        $message .= preg_replace($html_entities_match, $html_entities_replace, $part) . clean_html($tag); 
     59                } 
     60 
     61                $message = str_replace('&quot;', '\&quot;', $message); 
     62        } 
     63        //else 
     64        //{ 
     65        //      $message = preg_replace($html_entities_match, $html_entities_replace, $message); 
     66        //} 
     67 
     68        return $message; 
    7469} 
    7570 
    7671function unprepare_message($message) 
    7772{ 
    78         global $unhtml_specialchars_match, $unhtml_specialchars_replace; 
    79  
    80         return preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, $message); 
     73       global $unhtml_specialchars_match, $unhtml_specialchars_replace; 
     74 
     75       return preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, $message); 
    8176} 
    8277// 
     
    8580function submit_merged_post($post_id, $forum_id, $subject, $message, &$return_message, &$return_meta) 
    8681{ 
    87         global $config, $db, $lang, $phpEx, $root_path; 
    88  
    89         include($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_merge.' . $phpEx); 
    90         include($root_path . 'phpBB2/includes/functions_search.'.$phpEx); 
    91  
    92         $current_time = time(); 
    93  
    94         // Check message 
    95         if ( empty($message) ) 
    96         { 
    97                 trigger_error($lang['empty_message']); 
    98                 return; 
    99         } 
    100  
    101         $sql = "SELECT p.post_created, p.post_time, p.enable_html, p.enable_bbcode, p.enable_smilies, pt.* 
    102                 FROM " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE ." pt 
    103                 WHERE p.post_id = $post_id 
    104                         AND pt.post_id = p.post_id"; 
    105         $result = $db->sql_query($sql); 
    106  
    107         $last_post_data = $db->sql_fetchrow($result); 
    108  
    109         // Flood control 
    110         if ( ($current_time - intval($last_post_data['post_time'])) < intval($config['merge_flood_interval']) ) 
    111         { 
    112                 trigger_error($lang['flood_error']); 
    113                 return; 
    114         } 
    115  
    116         $last_post_created = $last_post_data['post_created']; 
    117         $last_post_time = $last_post_data['post_time']; 
    118         $last_html = $last_post_data['enable_html']; 
    119         $last_bbcode = $last_post_data['enable_bbcode']; 
    120         $last_smilies = $last_post_data['enable_smilies']; 
    121         $last_bbcode_uid = $last_post_data['bbcode_uid']; 
    122         $last_subject = $last_post_data['post_subject']; 
    123         $last_message = $last_post_data['post_text']; 
    124  
    125         $db->sql_freeresult($result); 
    126  
    127         if ($last_bbcode_uid != '') 
    128         { 
    129                 $last_message = preg_replace('/\:(([a-z0-9]:)?)' . $last_bbcode_uid . '/s', '', $last_message); 
    130         } 
    131  
    132         $last_message = unprepare_message($last_message); 
    133  
    134         // Preparing separator 
    135         $merged_after = ($current_time - $last_post_time); 
    136         $merged_sec = $merged_after % 60; 
    137         $merged_min = ($merged_after/60) % 60; 
    138         $merged_hours = ($merged_after/3600) % 24 ; 
    139         $merged_days = ($merged_after/86400) % 31; 
    140  
    141         $s_st = ($merged_sec) ? seconds_st($merged_sec) : ''; 
    142         $m_st = ($merged_min) ? minutes_st($merged_min) : ''; 
    143         $h_st = ($merged_hours) ? hours_st($merged_hours) : ''; 
    144         $d_st = ($merged_days) ? days_st($merged_days) : ''; 
    145  
    146         $separator = sprintf($lang['merge_separator'],$d_st,$h_st,$m_st,$s_st); 
    147         $separator .= ( !empty($subject) && ($subject != $last_subject) ) ? sprintf($lang['merge_post_subject'], $subject) : ''; 
    148         $separator = str_replace("'", "''", $separator); 
    149  
    150         $message = ($message != $last_message) ? htmlspecialchars($last_message) . $separator . trim($message) : trim($message); 
    151         $message = prepare_message($message, $last_html, $last_bbcode, $last_smilies, $last_bbcode_uid); 
    152  
    153         // This replacement was borrowed from posting.php 
    154         $last_subject = str_replace("\'", "''", $last_subject); 
    155         $last_message = str_replace("\'", "''", $last_message); 
    156  
    157         $sql = "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '" . $db->sql_escape($message) . "' WHERE post_id = $post_id"; 
    158         $result = $db->sql_query($sql); 
    159  
    160         $sql = "UPDATE " . POSTS_TABLE . " SET post_time = $current_time WHERE post_id = $post_id"; 
    161         $result = $db->sql_query($sql); 
    162  
    163         $sql = "UPDATE " . FORUMS_TABLE . " SET forum_last_post_id = $post_id WHERE forum_id = $forum_id"; 
    164         $result = $db->sql_query($sql); 
    165  
    166         // Search routines 
    167         remove_search_post($post_id); 
    168         add_search_words('single', $post_id, $message, $subject); 
    169  
    170         // Meta & return message 
    171         $return_meta = '<meta http-equiv="refresh" content="3;url=' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">'; 
    172         $return_message = $lang['stored'] . '<br /><br />' . sprintf($lang['click_view_message'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">', '</a>') . '<br /><br />' . sprintf($lang['click_return_forum'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . "=$forum_id") . '">', '</a>'); 
     82        global $config, $db, $lang, $phpEx, $root_path; 
     83 
     84        include($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_merge.' . $phpEx); 
     85        include($root_path . 'phpBB2/includes/functions_search.'.$phpEx); 
     86 
     87        $current_time = time(); 
     88 
     89        // Check message 
     90        if ( empty($message) ) 
     91        { 
     92                trigger_error($lang['empty_message']); 
     93                return; 
     94        } 
     95 
     96        $sql = "SELECT p.post_created, p.post_time, p.enable_html, p.enable_bbcode, p.enable_smilies, pt.* 
     97                FROM " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE ." pt 
     98                WHERE p.post_id = $post_id 
     99                        AND pt.post_id = p.post_id"; 
     100        $result = $db->sql_query($sql); 
     101 
     102        $last_post_data = $db->sql_fetchrow($result); 
     103 
     104        // Flood control 
     105        if ( ($current_time - intval($last_post_data['post_time'])) < intval($config['merge_flood_interval']) ) 
     106        { 
     107                trigger_error($lang['flood_error']); 
     108                return; 
     109        } 
     110 
     111        $last_post_created = $last_post_data['post_created']; 
     112        $last_post_time = $last_post_data['post_time']; 
     113        $last_html = $last_post_data['enable_html']; 
     114        //$last_bbcode = $last_post_data['enable_bbcode']; 
     115        $last_smilies = $last_post_data['enable_smilies']; 
     116 
     117        $last_subject = $last_post_data['post_subject']; 
     118        $last_message = $last_post_data['post_text']; 
     119 
     120        $db->sql_freeresult($result); 
     121 
     122        $last_message = unprepare_message($last_message); 
     123 
     124        // Preparing separator 
     125        $merged_after = ($current_time - $last_post_time); 
     126        $merged_sec = $merged_after % 60; 
     127        $merged_min = ($merged_after/60) % 60; 
     128        $merged_hours = ($merged_after/3600) % 24 ; 
     129        $merged_days = ($merged_after/86400) % 31; 
     130 
     131        $s_st = ($merged_sec) ? seconds_st($merged_sec) : ''; 
     132        $m_st = ($merged_min) ? minutes_st($merged_min) : ''; 
     133        $h_st = ($merged_hours) ? hours_st($merged_hours) : ''; 
     134        $d_st = ($merged_days) ? days_st($merged_days) : ''; 
     135 
     136        $separator = sprintf($lang['merge_separator'],$d_st,$h_st,$m_st,$s_st); 
     137        $separator .= ( !empty($subject) && ($subject != $last_subject) ) ? sprintf($lang['merge_post_subject'], $subject) : ''; 
     138        $separator = str_replace("'", "''", $separator); 
     139 
     140        $message = ($message != $last_message) ? htmlspecialchars($last_message) . $separator . trim($message) : trim($message); 
     141        $message = prepare_message($message, $last_html, 0, $last_smilies); 
     142 
     143        // This replacement was borrowed from posting.php 
     144        $last_subject = str_replace("\'", "''", $last_subject); 
     145        $last_message = str_replace("\'", "''", $last_message); 
     146 
     147        $sql = "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '" . $db->sql_escape($message) . "' WHERE post_id = $post_id"; 
     148        $result = $db->sql_query($sql); 
     149 
     150        $sql = "UPDATE " . POSTS_TABLE . " SET post_time = $current_time WHERE post_id = $post_id"; 
     151        $result = $db->sql_query($sql); 
     152 
     153        $sql = "UPDATE " . FORUMS_TABLE . " SET forum_last_post_id = $post_id WHERE forum_id = $forum_id"; 
     154        $result = $db->sql_query($sql); 
     155 
     156        // Search routines 
     157        remove_search_post($post_id); 
     158        add_search_words('single', $post_id, $message, $subject); 
     159 
     160        // Meta & return message 
     161        $return_meta = '<meta http-equiv="refresh" content="3;url=' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">'; 
     162        $return_message = $lang['stored'] . '<br /><br />' . sprintf($lang['click_view_message'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">', '</a>') . '<br /><br />' . sprintf($lang['click_return_forum'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . "=$forum_id") . '">', '</a>'); 
    173163} 
    174164 
     
    176166// Prepare a message for posting 
    177167// 
    178 function prepare_post(&$mode, &$post_data, &$bbcode_on, &$html_on, &$smilies_on, &$error_msg, &$username, &$bbcode_uid, &$subject, &$message, &$poll_title, &$poll_options, &$poll_length) 
    179 { 
    180         global $config, $userdata, $lang, $phpEx, $root_path, $is_auth; 
    181  
    182         $error_msg = ''; 
     168function prepare_post(&$mode, &$post_data, &$bbcode_on, &$html_on, &$smilies_on, &$error_msg, &$username, &$subject, &$message, &$poll_title, &$poll_options, &$poll_length) 
     169{ 
     170       global $config, $userdata, $lang, $phpEx, $root_path, $is_auth; 
     171 
     172       $error_msg = ''; 
    183173                // Check username 
    184         if (!empty($username)) 
    185         { 
    186                 $username = phpbb_clean_username($username); 
    187  
    188                 if (!$userdata['session_logged_in'] || ($userdata['session_logged_in'] && $username != $userdata['name'])) 
    189                 { 
    190                         require($root_path . 'include/functions_check.'.$phpEx); 
    191  
    192                         $result = check_username($username); 
    193                         if ($result['error']) 
    194                         { 
    195                                 $error_msg .= (!empty($error_msg)) ? '<br />' . $result['error_msg'] : $result['error_msg']; 
    196                         } 
    197                 } 
    198                 else 
    199                 { 
    200                         $username = ''; 
    201                 } 
    202         } 
    203  
    204         // Check subject 
    205         if (!empty($subject)) 
    206         { 
    207                 $subject = trim($subject); 
    208         } 
    209         else if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post'])) 
    210         { 
    211                 $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['empty_subject'] : $lang['empty_subject']; 
    212         } 
    213  
    214         // Check message 
    215         if (!empty($message)) 
    216         { 
    217                 $bbcode_uid = ($bbcode_on) ? make_bbcode_uid() : ''; 
    218                 $message = prepare_message(trim($message), $html_on, $bbcode_on, $smilies_on, $bbcode_uid); 
    219                 // BEGIN Moderator Tags 
    220                 // Tags [mod] [/mod] are prohibited for everyone except moderators and administrators (post) 
    221                 if ( check_mod_tags($is_auth['auth_mod'], $message) ) 
    222                 { 
    223                         trigger_error($lang['mod_reserved']); 
    224                 } 
    225                 // END Moderator Tags 
    226  
    227         } 
    228         else if ($mode != 'delete' && $mode != 'poll_delete') 
    229         { 
    230                 $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['empty_message'] : $lang['empty_message']; 
    231         } 
    232  
    233         // 
    234         // Handle poll stuff 
    235         // 
    236         if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post'])) 
    237         { 
    238                 $poll_length = (isset($poll_length)) ? max(0, intval($poll_length)) : 0; 
    239  
    240                 if (!empty($poll_title)) 
    241                 { 
    242                         $poll_title = trim($poll_title); 
    243                 } 
    244  
    245                 if(!empty($poll_options)) 
    246                 { 
    247                         $temp_option_text = array(); 
    248                         while(list($option_id, $option_text) = @each($poll_options)) 
    249                         { 
    250                                 $option_text = trim($option_text); 
    251                                 if (!empty($option_text)) 
    252                                 { 
    253                                         $temp_option_text[intval($option_id)] = $option_text; 
    254                                 } 
    255                         } 
    256                         $option_text = $temp_option_text; 
    257  
    258                         if (sizeof($poll_options) < 2) 
    259                         { 
    260                                 $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['to_few_poll_options'] : $lang['to_few_poll_options']; 
    261                         } 
    262                         else if (sizeof($poll_options) > $config['max_poll_options']) 
    263                         { 
    264                                 $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['to_many_poll_options'] : $lang['to_many_poll_options']; 
    265                         } 
    266                         else if ($poll_title == '') 
    267                         { 
    268                                 $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['empty_poll_title'] : $lang['empty_poll_title']; 
    269                         } 
    270                 } 
    271         } 
    272  
    273         if ( !empty($error_msg) ) { 
    274                 trigger_error($error_msg); 
    275         } 
    276  
    277         return; 
     174        if (!empty($username)) 
     175        { 
     176                $username = phpbb_clean_username($username); 
     177 
     178                if (!$userdata['session_logged_in'] || ($userdata['session_logged_in'] && $username != $userdata['name'])) 
     179                { 
     180                        require($root_path . 'include/functions_check.'.$phpEx); 
     181 
     182                        $result = check_username($username); 
     183                        if ($result['error']) 
     184                        { 
     185                                $error_msg .= (!empty($error_msg)) ? '<br />' . $result['error_msg'] : $result['error_msg']; 
     186                        } 
     187                } 
     188                else 
     189                { 
     190                        $username = ''; 
     191                } 
     192        } 
     193 
     194        // Check subject 
     195        if (!empty($subject)) 
     196        { 
     197                $subject = trim($subject); 
     198        } 
     199        else if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post'])) 
     200        { 
     201                $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['empty_subject'] : $lang['empty_subject']; 
     202        } 
     203 
     204        // Check message 
     205        if (!empty($message)) 
     206        { 
     207                $message = prepare_message(trim($message), $html_on, $bbcode_on, $smilies_on); 
     208                // BEGIN Moderator Tags 
     209                // Tags [mod] [/mod] are prohibited for everyone except moderators and administrators (post) 
     210                if ( check_mod_tags($is_auth['auth_mod'], $message) ) 
     211                { 
     212                        trigger_error($lang['mod_reserved']); 
     213                } 
     214                // END Moderator Tags 
     215 
     216        } 
     217        else if ($mode != 'delete' && $mode != 'poll_delete') 
     218        { 
     219                $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['empty_message'] : $lang['empty_message']; 
     220        } 
     221 
     222        // 
     223        // Handle poll stuff 
     224        // 
     225        if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post'])) 
     226        { 
     227                $poll_length = (isset($poll_length)) ? max(0, intval($poll_length)) : 0; 
     228 
     229                if (!empty($poll_title)) 
     230                { 
     231                        $poll_title = trim($poll_title); 
     232                } 
     233 
     234                if(!empty($poll_options)) 
     235                { 
     236                        $temp_option_text = array(); 
     237                        while(list($option_id, $option_text) = @each($poll_options)) 
     238                        { 
     239                                $option_text = trim($option_text); 
     240                                if (!empty($option_text)) 
     241                                { 
     242                                        $temp_option_text[intval($option_id)] = $option_text; 
     243                                } 
     244                        } 
     245                        $option_text = $temp_option_text; 
     246 
     247                        if (sizeof($poll_options) < 2) 
     248                        { 
     249                                $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['to_few_poll_options'] : $lang['to_few_poll_options']; 
     250                        } 
     251                        else if (sizeof($poll_options) > $config['max_poll_options']) 
     252                        { 
     253                                $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['to_many_poll_options'] : $lang['to_many_poll_options']; 
     254                        } 
     255                        else if ($poll_title == '') 
     256                        { 
     257                                $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['empty_poll_title'] : $lang['empty_poll_title']; 
     258                        } 
     259                } 
     260        } 
     261 
     262        if ( !empty($error_msg) ) { 
     263                trigger_error($error_msg); 
     264        } 
     265 
     266        return; 
    278267} 
    279268 
     
    281270// Post a new topic/reply/poll or edit existing post/poll 
    282271// 
    283 function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length) 
    284 { 
    285         global $config, $lang, $db, $root_path, $phpEx; 
    286         global $userdata, $user_ip; 
    287  
    288         include($root_path . 'phpBB2/includes/functions_search.'.$phpEx); 
    289  
    290         $current_time = time(); 
    291  
    292         if ($mode == 'newtopic' || $mode == 'reply' || $mode == 'editpost') 
    293        
    294                 // 
    295                 // Flood control 
    296                 // 
    297                 $where_sql = ($userdata['uid'] == ANONYMOUS) ? "poster_ip = '$user_ip'" : 'poster_id = ' . $userdata['uid']; 
    298                 $sql = "SELECT MAX(post_time) AS last_post_time 
    299                         FROM " . POSTS_TABLE . " 
    300                         WHERE $where_sql"; 
    301                 if ($result = $db->sql_query($sql)) 
    302                
    303                         if ($row = $db->sql_fetchrow($result)) 
    304                        
    305                                 if (intval($row['last_post_time']) > 0 && ($current_time - intval($row['last_post_time'])) < intval($config['flood_interval'])) 
    306                                
    307                                         trigger_error($lang['flood_error']); 
    308                                         return; 
    309                                
    310                        
    311                
    312        
    313  
    314         if ($mode == 'editpost') 
    315        
    316                 remove_search_post($post_id); 
    317        
    318  
    319         if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post'])) 
    320        
    321                 $topic_vote = (!empty($poll_title) && count($poll_options) >= 2) ? 1 : 0; 
    322  
    323                 $sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('" . $db->sql_escape($post_subject) . "', " . $userdata['uid'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '" . $db->sql_escape($post_subject) . "', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id"; 
    324                 $db->sql_query($sql); 
    325  
    326                 if ($mode == 'newtopic') 
    327                
    328                         $topic_id = $db->sql_nextid(); 
    329                
    330        
    331  
    332         $edited_sql = ($mode == 'editpost' && !$post_data['last_post'] && $post_data['poster_post']) ? ", post_edit_time = $current_time, post_edit_count = post_edit_count + 1 " : ""; 
    333         $sql = ($mode != "editpost") ? "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, post_created, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, $forum_id, " . $userdata['uid'] . ", '" . $db->sql_escape($post_username) . "', $current_time, $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $attach_sig)" : "UPDATE " . POSTS_TABLE . " SET post_username = '$post_username', enable_bbcode = $bbcode_on, enable_html = $html_on, enable_smilies = $smilies_on, enable_sig = $attach_sig" . $edited_sql . " WHERE post_id = $post_id"; 
    334         $db->sql_query($sql); 
    335  
    336         if ($mode != 'editpost') 
    337        
    338                 $post_id = $db->sql_nextid(); 
    339        
    340  
    341         $sql = ($mode != 'editpost') ? "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, post_subject, bbcode_uid, post_text) VALUES ($post_id, '" . $db->sql_escape($post_subject) . "', '$bbcode_uid', '" . $db->sql_escape($post_message) . "')" : "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '" . $db->sql_escape($post_message) . "',  bbcode_uid = '$bbcode_uid', post_subject = '" . $db->sql_escape($post_subject) . "' WHERE post_id = $post_id"; 
    342         $db->sql_query($sql); 
    343  
    344         add_search_words('single', $post_id, $post_message, $post_subject); 
    345  
    346         // 
    347         // Add poll 
    348         // 
    349         if (($mode == 'newtopic' || ($mode == 'editpost' && $post_data['edit_poll'])) && !empty($poll_title) && count($poll_options) >= 2) 
    350        
    351                 $sql = (!$post_data['has_poll']) ? "INSERT INTO " . VOTE_DESC_TABLE . " (topic_id, vote_text, vote_start, vote_length) VALUES ($topic_id, '$poll_title', $current_time, " . ($poll_length * 86400) . ")" : "UPDATE " . VOTE_DESC_TABLE . " SET vote_text = '$poll_title', vote_length = " . ($poll_length * 86400) . " WHERE topic_id = $topic_id"; 
    352                 $db->sql_query($sql); 
    353  
    354                 $delete_option_sql = ''; 
    355                 $old_poll_result = array(); 
    356                 if ($mode == 'editpost' && $post_data['has_poll']) 
    357                
    358                         $sql = "SELECT vote_option_id, vote_result 
    359                                 FROM " . VOTE_RESULTS_TABLE . " 
    360                                 WHERE vote_id = $poll_id 
    361                                 ORDER BY vote_option_id ASC"; 
    362                         $result = $db->sql_query($sql); 
    363  
    364                         while ($row = $db->sql_fetchrow($result)) 
    365                        
    366                                 $old_poll_result[$row['vote_option_id']] = $row['vote_result']; 
    367  
    368                                 if (!isset($poll_options[$row['vote_option_id']])) 
    369                                
    370                                         $delete_option_sql .= ($delete_option_sql != '') ? ', ' . $row['vote_option_id'] : $row['vote_option_id']; 
    371                                
    372                        
    373                
    374                 else 
    375                
    376                         $poll_id = $db->sql_nextid(); 
    377                
    378  
    379                 @reset($poll_options); 
    380  
    381                 $poll_option_id = 1; 
    382                 while (list($option_id, $option_text) = each($poll_options)) 
    383                
    384                         if (!empty($option_text)) 
    385                        
    386                                 $option_text = str_replace("\'", "''", $option_text); 
    387                                 $poll_result = ($mode == "editpost" && isset($old_poll_result[$option_id])) ? $old_poll_result[$option_id] : 0; 
    388  
    389                                 $sql = ($mode != "editpost" || !isset($old_poll_result[$option_id])) ? "INSERT INTO " . VOTE_RESULTS_TABLE . " (vote_id, vote_option_id, vote_option_text, vote_result) VALUES ($poll_id, $poll_option_id, '$option_text', $poll_result)" : "UPDATE " . VOTE_RESULTS_TABLE . " SET vote_option_text = '$option_text', vote_result = $poll_result WHERE vote_option_id = $option_id AND vote_id = $poll_id"; 
    390                                 $db->sql_query($sql); 
    391                                 $poll_option_id++; 
    392                        
    393                
    394  
    395                 if ($delete_option_sql != '') 
    396                
    397                         $sql = "DELETE FROM " . VOTE_RESULTS_TABLE . " 
    398                                 WHERE vote_option_id IN ($delete_option_sql) 
    399                                         AND vote_id = $poll_id"; 
    400                         $db->sql_query($sql); 
    401                
    402        
    403  
    404         //$meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">'; 
    405         $meta = '<meta http-equiv="refresh" content="3;url=' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">'; 
    406         //$message = $lang['stored'] . '<br /><br />' . sprintf($lang['click_view_message'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">', '</a>') . '<br /><br />' . sprintf($lang['click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>'); 
    407         $message = $lang['stored'] . '<br /><br />' . sprintf($lang['click_view_message'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">', '</a>') . '<br /><br />' . sprintf($lang['click_return_forum'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . "=$forum_id") . '">', '</a>'); 
    408  
    409         return false; 
     272function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length) 
     273{ 
     274       global $config, $lang, $db, $root_path, $phpEx; 
     275       global $userdata, $user_ip; 
     276 
     277       include($root_path . 'phpBB2/includes/functions_search.'.$phpEx); 
     278 
     279       $current_time = time(); 
     280 
     281       if ($mode == 'newtopic' || $mode == 'reply' || $mode == 'editpost') 
     282       
     283               // 
     284               // Flood control 
     285               // 
     286               $where_sql = ($userdata['uid'] == ANONYMOUS) ? "poster_ip = '$user_ip'" : 'poster_id = ' . $userdata['uid']; 
     287               $sql = "SELECT MAX(post_time) AS last_post_time 
     288                       FROM " . POSTS_TABLE . " 
     289                       WHERE $where_sql"; 
     290               if ($result = $db->sql_query($sql)) 
     291               
     292                       if ($row = $db->sql_fetchrow($result)) 
     293                       
     294                               if (intval($row['last_post_time']) > 0 && ($current_time - intval($row['last_post_time'])) < intval($config['flood_interval'])) 
     295                               
     296                                       trigger_error($lang['flood_error']); 
     297                                       return; 
     298                               
     299                       
     300               
     301       
     302 
     303       if ($mode == 'editpost') 
     304       
     305               remove_search_post($post_id); 
     306       
     307 
     308       if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post'])) 
     309       
     310               $topic_vote = (!empty($poll_title) && count($poll_options) >= 2) ? 1 : 0; 
     311 
     312               $sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('" . $db->sql_escape($post_subject) . "', " . $userdata['uid'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '" . $db->sql_escape($post_subject) . "', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id"; 
     313               $db->sql_query($sql); 
     314 
     315               if ($mode == 'newtopic') 
     316               
     317                       $topic_id = $db->sql_nextid(); 
     318               
     319       
     320 
     321       $edited_sql = ($mode == 'editpost' && !$post_data['last_post'] && $post_data['poster_post']) ? ", post_edit_time = $current_time, post_edit_count = post_edit_count + 1 " : ""; 
     322       $sql = ($mode != "editpost") ? "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, post_created, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, $forum_id, " . $userdata['uid'] . ", '" . $db->sql_escape($post_username) . "', $current_time, $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $attach_sig)" : "UPDATE " . POSTS_TABLE . " SET post_username = '$post_username', enable_bbcode = $bbcode_on, enable_html = $html_on, enable_smilies = $smilies_on, enable_sig = $attach_sig" . $edited_sql . " WHERE post_id = $post_id"; 
     323       $db->sql_query($sql); 
     324 
     325       if ($mode != 'editpost') 
     326       
     327               $post_id = $db->sql_nextid(); 
     328       
     329 
     330       $sql = ($mode != 'editpost') ? "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, post_subject, post_text) VALUES ($post_id, '" . $db->sql_escape($post_subject) . "', '" . $db->sql_escape($post_message) . "')" : "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '" . $db->sql_escape($post_message) . "', post_subject = '" . $db->sql_escape($post_subject) . "' WHERE post_id = $post_id"; 
     331       $db->sql_query($sql); 
     332 
     333       add_search_words('single', $post_id, $post_message, $post_subject); 
     334 
     335       // 
     336       // Add poll 
     337       // 
     338       if (($mode == 'newtopic' || ($mode == 'editpost' && $post_data['edit_poll'])) && !empty($poll_title) && count($poll_options) >= 2) 
     339       
     340               $sql = (!$post_data['has_poll']) ? "INSERT INTO " . VOTE_DESC_TABLE . " (topic_id, vote_text, vote_start, vote_length) VALUES ($topic_id, '$poll_title', $current_time, " . ($poll_length * 86400) . ")" : "UPDATE " . VOTE_DESC_TABLE . " SET vote_text = '$poll_title', vote_length = " . ($poll_length * 86400) . " WHERE topic_id = $topic_id"; 
     341               $db->sql_query($sql); 
     342 
     343               $delete_option_sql = ''; 
     344               $old_poll_result = array(); 
     345               if ($mode == 'editpost' && $post_data['has_poll']) 
     346               
     347                       $sql = "SELECT vote_option_id, vote_result 
     348                               FROM " . VOTE_RESULTS_TABLE . " 
     349                               WHERE vote_id = $poll_id 
     350                               ORDER BY vote_option_id ASC"; 
     351                       $result = $db->sql_query($sql); 
     352 
     353                       while ($row = $db->sql_fetchrow($result)) 
     354                       
     355                               $old_poll_result[$row['vote_option_id']] = $row['vote_result']; 
     356 
     357                               if (!isset($poll_options[$row['vote_option_id']])) 
     358                               
     359                                       $delete_option_sql .= ($delete_option_sql != '') ? ', ' . $row['vote_option_id'] : $row['vote_option_id']; 
     360                               
     361                       
     362               
     363               else 
     364               
     365                       $poll_id = $db->sql_nextid(); 
     366               
     367 
     368               @reset($poll_options); 
     369 
     370               $poll_option_id = 1; 
     371               while (list($option_id, $option_text) = each($poll_options)) 
     372               
     373                       if (!empty($option_text)) 
     374                       
     375                               $option_text = str_replace("\'", "''", $option_text); 
     376                               $poll_result = ($mode == "editpost" && isset($old_poll_result[$option_id])) ? $old_poll_result[$option_id] : 0; 
     377 
     378                               $sql = ($mode != "editpost" || !isset($old_poll_result[$option_id])) ? "INSERT INTO " . VOTE_RESULTS_TABLE . " (vote_id, vote_option_id, vote_option_text, vote_result) VALUES ($poll_id, $poll_option_id, '$option_text', $poll_result)" : "UPDATE " . VOTE_RESULTS_TABLE . " SET vote_option_text = '$option_text', vote_result = $poll_result WHERE vote_option_id = $option_id AND vote_id = $poll_id"; 
     379                               $db->sql_query($sql); 
     380                               $poll_option_id++; 
     381                       
     382               
     383 
     384               if ($delete_option_sql != '') 
     385               
     386                       $sql = "DELETE FROM " . VOTE_RESULTS_TABLE . " 
     387                               WHERE vote_option_id IN ($delete_option_sql) 
     388                                       AND vote_id = $poll_id"; 
     389                       $db->sql_query($sql); 
     390               
     391       
     392 
     393       //$meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">'; 
     394       $meta = '<meta http-equiv="refresh" content="3;url=' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">'; 
     395       //$message = $lang['stored'] . '<br /><br />' . sprintf($lang['click_view_message'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">', '</a>') . '<br /><br />' . sprintf($lang['click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>'); 
     396       $message = $lang['stored'] . '<br /><br />' . sprintf($lang['click_view_message'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">', '</a>') . '<br /><br />' . sprintf($lang['click_return_forum'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . "=$forum_id") . '">', '</a>'); 
     397 
     398       return false; 
    410399} 
    411400 
     
    415404function update_post_stats(&$mode, &$post_data, &$forum_id, &$topic_id, &$post_id, &$user_id) 
    416405{ 
    417         global $db; 
    418  
    419         $sign = ($mode == 'delete') ? '- 1' : '+ 1'; 
    420         $forum_update_sql = "forum_posts = forum_posts $sign"; 
    421         $topic_update_sql = ''; 
    422  
    423         if ($mode == 'delete') 
    424        
    425                 if ($post_data['last_post']) 
    426                
    427                         if ($post_data['first_post']) 
    428                        
    429                                 $forum_update_sql .= ', forum_topics = forum_topics - 1'; 
    430                        
    431                         else 
    432                        
    433  
    434                                 $topic_update_sql .= 'topic_replies = topic_replies - 1'; 
    435  
    436                                 $sql = "SELECT MAX(post_id) AS last_post_id 
    437                                         FROM " . POSTS_TABLE . " 
    438                                         WHERE topic_id = $topic_id"; 
    439                                 $result = $db->sql_query($sql); 
    440  
    441                                 if ($row = $db->sql_fetchrow($result)) 
    442                                
    443                                         $topic_update_sql .= ', topic_last_post_id = ' . $row['last_post_id']; 
    444                                
    445                        
    446  
    447                         if ($post_data['last_topic']) 
    448                        
    449                                 $sql = "SELECT MAX(post_id) AS last_post_id 
    450                                         FROM " . POSTS_TABLE . " 
    451                                         WHERE forum_id = $forum_id"; 
    452                                 $result = $db->sql_query($sql); 
    453  
    454                                 if ($row = $db->sql_fetchrow($result)) 
    455                                
    456                                         $forum_update_sql .= ($row['last_post_id']) ? ', forum_last_post_id = ' . $row['last_post_id'] : ', forum_last_post_id = 0'; 
    457                                
    458                        
    459                
    460                 else if ($post_data['first_post']) 
    461                
    462                         $sql = "SELECT MIN(post_id) AS first_post_id 
    463                                 FROM " . POSTS_TABLE . " 
    464                                 WHERE topic_id = $topic_id"; 
    465                         $result = $db->sql_query($sql); 
    466  
    467                         if ($row = $db->sql_fetchrow($result)) 
    468                        
    469                                 $topic_update_sql .= 'topic_replies = topic_replies - 1, topic_first_post_id = ' . $row['first_post_id']; 
    470                        
    471                
    472                 else 
    473                
    474                         $topic_update_sql .= 'topic_replies = topic_replies - 1'; 
    475                
    476        
    477         else if ($mode != 'poll_delete') 
    478        
    479                 $forum_update_sql .= ", forum_last_post_id = $post_id" . (($mode == 'newtopic') ? ", forum_topics = forum_topics $sign" : ""); 
    480                 $topic_update_sql = "topic_last_post_id = $post_id" . (($mode == 'reply') ? ", topic_replies = topic_replies $sign" : ", topic_first_post_id = $post_id"); 
    481        
    482         else 
    483        
    484                 $topic_update_sql .= 'topic_vote = 0'; 
    485        
    486  
    487         if ($mode != 'poll_delete') 
    488        
    489                 $sql = "UPDATE " . FORUMS_TABLE . " SET 
    490                         $forum_update_sql 
    491                         WHERE forum_id = $forum_id"; 
    492                 $db->sql_query($sql); 
    493        
    494         if ($topic_update_sql != '') 
    495        
    496                 $sql = "UPDATE " . TOPICS_TABLE . " SET 
    497                         $topic_update_sql 
    498                         WHERE topic_id = $topic_id"; 
    499                 $db->sql_query($sql); 
    500        
    501  
    502         if ($mode != 'poll_delete') 
    503        
    504                 $sql = "UPDATE " . USERS_TABLE . " 
    505                         SET user_posts = user_posts $sign 
    506                         WHERE uid = $user_id"; 
    507                 $db->sql_query($sql); 
    508        
    509  
    510         return; 
     406       global $db; 
     407 
     408       $sign = ($mode == 'delete') ? '- 1' : '+ 1'; 
     409       $forum_update_sql = "forum_posts = forum_posts $sign"; 
     410       $topic_update_sql = ''; 
     411 
     412       if ($mode == 'delete') 
     413       
     414               if ($post_data['last_post']) 
     415               
     416                       if ($post_data['first_post']) 
     417                       
     418                               $forum_update_sql .= ', forum_topics = forum_topics - 1'; 
     419                       
     420                       else 
     421                       
     422 
     423                               $topic_update_sql .= 'topic_replies = topic_replies - 1'; 
     424 
     425                               $sql = "SELECT MAX(post_id) AS last_post_id 
     426                                       FROM " . POSTS_TABLE . " 
     427                                       WHERE topic_id = $topic_id"; 
     428                               $result = $db->sql_query($sql); 
     429 
     430                               if ($row = $db->sql_fetchrow($result)) 
     431                               
     432                                       $topic_update_sql .= ', topic_last_post_id = ' . $row['last_post_id']; 
     433                               
     434                       
     435 
     436                       if ($post_data['last_topic']) 
     437                       
     438                               $sql = "SELECT MAX(post_id) AS last_post_id 
     439                                       FROM " . POSTS_TABLE . " 
     440                                       WHERE forum_id = $forum_id"; 
     441                               $result = $db->sql_query($sql); 
     442 
     443                               if ($row = $db->sql_fetchrow($result)) 
     444                               
     445                                       $forum_update_sql .= ($row['last_post_id']) ? ', forum_last_post_id = ' . $row['last_post_id'] : ', forum_last_post_id = 0'; 
     446                               
     447                       
     448               
     449               else if ($post_data['first_post']) 
     450               
     451                       $sql = "SELECT MIN(post_id) AS first_post_id 
     452                               FROM " . POSTS_TABLE . " 
     453                               WHERE topic_id = $topic_id"; 
     454                       $result = $db->sql_query($sql); 
     455 
     456                       if ($row = $db->sql_fetchrow($result)) 
     457                       
     458                               $topic_update_sql .= 'topic_replies = topic_replies - 1, topic_first_post_id = ' . $row['first_post_id']; 
     459                       
     460               
     461               else 
     462               
     463                       $topic_update_sql .= 'topic_replies = topic_replies - 1'; 
     464               
     465       
     466       else if ($mode != 'poll_delete') 
     467       
     468               $forum_update_sql .= ", forum_last_post_id = $post_id" . (($mode == 'newtopic') ? ", forum_topics = forum_topics $sign" : ""); 
     469               $topic_update_sql = "topic_last_post_id = $post_id" . (($mode == 'reply') ? ", topic_replies = topic_replies $sign" : ", topic_first_post_id = $post_id"); 
     470       
     471       else 
     472       
     473               $topic_update_sql .= 'topic_vote = 0'; 
     474       
     475 
     476       if ($mode != 'poll_delete') 
     477       
     478               $sql = "UPDATE " . FORUMS_TABLE . " SET 
     479                       $forum_update_sql 
     480                       WHERE forum_id = $forum_id"; 
     481               $db->sql_query($sql); 
     482       
     483       if ($topic_update_sql != '') 
     484       
     485               $sql = "UPDATE " . TOPICS_TABLE . " SET 
     486                       $topic_update_sql 
     487                       WHERE topic_id = $topic_id"; 
     488               $db->sql_query($sql); 
     489       
     490 
     491       if ($mode != 'poll_delete') 
     492       
     493               $sql = "UPDATE " . USERS_TABLE . " 
     494                       SET user_posts = user_posts $sign 
     495                       WHERE uid = $user_id"; 
     496               $db->sql_query($sql); 
     497       
     498 
     499       return; 
    511500} 
    512501 
     
    516505function delete_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id) 
    517506{ 
    518         global $config, $lang, $db, $root_path, $phpEx; 
    519         global $userdata, $user_ip; 
    520  
    521         $forum_update_sql = ''; 
    522  
    523         if ($mode != 'poll_delete') 
    524        
    525                 include($root_path . 'phpBB2/includes/functions_search.'.$phpEx); 
    526  
    527                 $sql = "DELETE FROM " . POSTS_TABLE . " 
    528                         WHERE post_id = $post_id"; 
    529                 $db->sql_query($sql); 
    530  
    531                 $sql = "DELETE FROM " . POSTS_TEXT_TABLE . " 
    532                         WHERE post_id = $post_id"; 
    533                 $db->sql_query($sql); 
    534  
    535                 $sql = 'DELETE FROM ' . SIMPATY_TABLE . ' WHERE simpid = ' . $post_id . ' AND type = ' . SIMPATY_FORUM_POST; 
    536                 $db->sql_query($sql); 
    537  
    538                 if ($post_data['last_post']) 
    539                
    540                         if ($post_data['first_post']) 
    541                        
    542                                 $forum_update_sql .= ', forum_topics = forum_topics - 1'; 
    543                                 $sql = "DELETE FROM " . TOPICS_TABLE . " 
    544                                         WHERE topic_id = $topic_id 
    545                                                 OR topic_moved_id = $topic_id"; 
    546                                 $db->sql_query($sql); 
    547  
    548                                 $sql = "DELETE FROM " . TOPICS_WATCH_TABLE . " 
    549                                         WHERE topic_id = $topic_id"; 
    550                                 $db->sql_query($sql); 
    551                        
    552                
    553  
    554                 remove_search_post($post_id); 
    555        
    556  
    557         if ($mode == 'poll_delete' || ($mode == 'delete' && $post_data['first_post'] && $post_data['last_post']) && $post_data['has_poll'] && $post_data['edit_poll']) 
    558        
    559                 $sql = "DELETE FROM " . VOTE_DESC_TABLE . " 
    560                         WHERE topic_id = $topic_id"; 
    561                 $db->sql_query($sql); 
    562  
    563                 $sql = "DELETE FROM " . VOTE_RESULTS_TABLE . " 
    564                         WHERE vote_id = $poll_id"; 
    565                 $db->sql_query($sql); 
    566  
    567                 $sql = "DELETE FROM " . VOTE_USERS_TABLE . " 
    568                         WHERE vote_id = $poll_id"; 
    569                 $db->sql_query($sql); 
    570        
    571  
    572         if ($mode == 'delete' && $post_data['first_post'] && $post_data['last_post']) 
    573        
    574                 //$meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $forum_id) . '">'; 
    575                 $meta = '<meta http-equiv="refresh" content="3;url=' . append_sid($root_path . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . '=' . $forum_id) . '">'; 
    576                 $message = $lang['deleted']; 
    577        
    578         else 
    579        
    580                 //$meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $topic_id) . '">'; 
    581                 $meta = '<meta http-equiv="refresh" content="3;url=' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . '=' . $topic_id) . '">'; 
    582                 //$message = (($mode == 'poll_delete') ? $lang['poll_delete'] : $lang['deleted']) . '<br /><br />' . sprintf($lang['click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>'); 
    583                 $message = (($mode == 'poll_delete') ? $lang['poll_delete'] : $lang['deleted']) . '<br /><br />' . sprintf($lang['click_return_topic'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>'); 
    584        
    585  
    586         //$message .=  '<br /><br />' . sprintf($lang['click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>'); 
    587         $message .=  '<br /><br />' . sprintf($lang['click_return_forum'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . "=$forum_id") . '">', '</a>'); 
    588  
    589         return; 
     507       global $config, $lang, $db, $root_path, $phpEx; 
     508       global $userdata, $user_ip; 
     509 
     510       $forum_update_sql = ''; 
     511 
     512       if ($mode != 'poll_delete') 
     513       
     514               include($root_path . 'phpBB2/includes/functions_search.'.$phpEx); 
     515 
     516               $sql = "DELETE FROM " . POSTS_TABLE . " 
     517                       WHERE post_id = $post_id"; 
     518               $db->sql_query($sql); 
     519 
     520               $sql = "DELETE FROM " . POSTS_TEXT_TABLE . " 
     521                       WHERE post_id = $post_id"; 
     522               $db->sql_query($sql); 
     523 
     524               $sql = 'DELETE FROM ' . SIMPATY_TABLE . ' WHERE simpid = ' . $post_id . ' AND type = ' . SIMPATY_FORUM_POST; 
     525               $db->sql_query($sql); 
     526 
     527               if ($post_data['last_post']) 
     528               
     529                       if ($post_data['first_post']) 
     530                       
     531                               $forum_update_sql .= ', forum_topics = forum_topics - 1'; 
     532                               $sql = "DELETE FROM " . TOPICS_TABLE . " 
     533                                       WHERE topic_id = $topic_id 
     534                                               OR topic_moved_id = $topic_id"; 
     535                               $db->sql_query($sql); 
     536 
     537                               $sql = "DELETE FROM " . TOPICS_WATCH_TABLE . " 
     538                                       WHERE topic_id = $topic_id"; 
     539                               $db->sql_query($sql); 
     540                       
     541               
     542 
     543               remove_search_post($post_id); 
     544       
     545 
     546       if ($mode == 'poll_delete' || ($mode == 'delete' && $post_data['first_post'] && $post_data['last_post']) && $post_data['has_poll'] && $post_data['edit_poll']) 
     547       
     548               $sql = "DELETE FROM " . VOTE_DESC_TABLE . " 
     549                       WHERE topic_id = $topic_id"; 
     550               $db->sql_query($sql); 
     551 
     552               $sql = "DELETE FROM " . VOTE_RESULTS_TABLE . " 
     553                       WHERE vote_id = $poll_id"; 
     554               $db->sql_query($sql); 
     555 
     556               $sql = "DELETE FROM " . VOTE_USERS_TABLE . " 
     557                       WHERE vote_id = $poll_id"; 
     558               $db->sql_query($sql); 
     559       
     560 
     561       if ($mode == 'delete' && $post_data['first_post'] && $post_data['last_post']) 
     562       
     563               //$meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $forum_id) . '">'; 
     564               $meta = '<meta http-equiv="refresh" content="3;url=' . append_sid($root_path . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . '=' . $forum_id) . '">'; 
     565               $message = $lang['deleted']; 
     566       
     567       else 
     568       
     569               //$meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $topic_id) . '">'; 
     570               $meta = '<meta http-equiv="refresh" content="3;url=' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . '=' . $topic_id) . '">'; 
     571               //$message = (($mode == 'poll_delete') ? $lang['poll_delete'] : $lang['deleted']) . '<br /><br />' . sprintf($lang['click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>'); 
     572               $message = (($mode == 'poll_delete') ? $lang['poll_delete'] : $lang['deleted']) . '<br /><br />' . sprintf($lang['click_return_topic'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>'); 
     573       
     574 
     575       //$message .=  '<br /><br />' . sprintf($lang['click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>'); 
     576       $message .=  '<br /><br />' . sprintf($lang['click_return_forum'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . "=$forum_id") . '">', '</a>'); 
     577 
     578       return; 
    590579} 
    591580 
     
    595584function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topic_id, &$post_id, &$notify_user) 
    596585{ 
    597         global $config, $lang, $db, $root_path, $phpEx, $cache; 
    598         global $userdata, $user_ip; 
    599  
    600         $current_time = time(); 
    601  
    602         if ($mode != 'delete') 
    603         { 
    604                 if ($mode == 'reply') 
    605                 { 
    606  
    607                         $sql = "SELECT u.uid, u.email, u.language 
    608                                 FROM " . TOPICS_WATCH_TABLE . " tw, " . USERS_TABLE . " u 
    609                                 WHERE tw.topic_id = $topic_id 
    610                                         AND tw.user_id NOT IN (" . $userdata['uid'] . ", " . ANONYMOUS . ") 
    611                                         AND tw.notify_status = " . TOPIC_WATCH_UN_NOTIFIED . " 
    612                                         AND u.uid = tw.user_id 
    613                                         AND u.enabled = 1"; 
    614                         $result = $db->sql_query($sql); 
    615  
    616                         $update_watched_sql = ''; 
    617                         $bcc_list_ary = array(); 
    618  
    619                         if ($row = $db->sql_fetchrow($result)) 
    620                         { 
    621                                 // Sixty second limit 
    622                                 @set_time_limit(60); 
    623  
    624                                 do 
    625                                 { 
    626                                         if ($row['email'] != '') 
    627                                         { 
    628                                                 $bcc_list_ary[$row['language']][] = $row['email']; 
    629                                         } 
    630                                         $update_watched_sql .= ($update_watched_sql != '') ? ', ' . $row['uid'] : $row['uid']; 
    631                                 } 
    632                                 while ($row = $db->sql_fetchrow($result)); 
    633  
    634                                 if (sizeof($bcc_list_ary)) 
    635                                 { 
    636                                         include_once($root_path . 'include/functions_messenger.php'); 
    637                                         $messenger = new messenger(true); 
    638  
    639                                         $topic_title = censor_text(unprepare_message($topic_title)); 
    640  
    641                                         @reset($bcc_list_ary); 
    642                                         while (list($user_lang, $bcc_list) = each($bcc_list_ary)) 
    643                                         { 
    644                                                 for ($i = 0; $i < sizeof($bcc_list); $i++) 
    645                                                 { 
    646                                                         $messenger->template('topic_notify', $user_lang); 
    647                                                         $messenger->to($bcc_list[$i], $bcc_list[$i]); 
    648                                                         $messenger->assign_vars(array( 
    649                                                                 'SITENAME' => $config['sitename'], 
    650                                                                 'TOPIC_TITLE' => $topic_title, 
    651                                                                 'U_TOPIC' => generate_base_url() . "/phpbb2.php?page=viewtopic&" . POST_POST_URL . "=$post_id#$post_id", 
    652                                                                 'U_STOP_WATCHING_TOPIC' => generate_base_url() . "/phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id&unwatch=topic") 
    653  
    654                                                         ); 
    655                                                         $messenger->send(NOTIFY_EMAIL); 
    656                                                 } 
    657                                         } 
    658                                         $messenger->save_queue(); 
    659                                 } 
    660                         } 
    661                         $db->sql_freeresult($result); 
    662  
    663                         if ($update_watched_sql != '') 
    664                         { 
    665                                 $sql = "UPDATE " . TOPICS_WATCH_TABLE . " 
    666                                         SET notify_status = " . TOPIC_WATCH_NOTIFIED . " 
    667                                         WHERE topic_id = $topic_id 
    668                                                 AND user_id IN ($update_watched_sql)"; 
    669                                 $db->sql_query($sql); 
    670                         } 
    671                 } 
    672  
    673                 $sql = "SELECT topic_id 
    674                         FROM " . TOPICS_WATCH_TABLE . " 
    675                         WHERE topic_id = $topic_id 
    676                                 AND user_id = " . $userdata['uid']; 
    677                 $result = $db->sql_query($sql); 
    678  
    679                 $row = $db->sql_fetchrow($result); 
    680  
    681                 if (!$notify_user && !empty($row['topic_id'])) 
    682                 { 
    683                         $sql = "DELETE FROM " . TOPICS_WATCH_TABLE . " 
    684                                 WHERE topic_id = $topic_id 
    685                                         AND user_id = " . $userdata['uid']; 
    686                         $db->sql_query($sql); 
    687                 } 
    688                 else if ($notify_user && empty($row['topic_id'])) 
    689                 { 
    690                         $sql = "INSERT INTO " . TOPICS_WATCH_TABLE . " (user_id, topic_id, notify_status) 
    691                                 VALUES (" . $userdata['uid'] . ", $topic_id, 0)"; 
    692                         $db->sql_query($sql); 
    693                 } 
    694         } 
     586        global $config, $lang, $db, $root_path, $phpEx, $cache; 
     587        global $userdata, $user_ip; 
     588        // www.phpBB-SEO.com SEO TOOLKIT BEGIN 
     589        global $seo; 
     590        // www.phpBB-SEO.com SEO TOOLKIT END 
     591 
     592        $current_time = time(); 
     593 
     594        if ($mode != 'delete') 
     595        { 
     596                if ($mode == 'reply') 
     597                { 
     598 
     599                        $sql = "SELECT u.uid, u.email, u.language 
     600                                FROM " . TOPICS_WATCH_TABLE . " tw, " . USERS_TABLE . " u 
     601                                WHERE tw.topic_id = $topic_id 
     602                                        AND tw.user_id NOT IN (" . $userdata['uid'] . ", " . ANONYMOUS . ") 
     603                                        AND tw.notify_status = " . TOPIC_WATCH_UN_NOTIFIED . " 
     604                                        AND u.uid = tw.user_id 
     605                                        AND u.enabled = 1"; 
     606                        $result = $db->sql_query($sql); 
     607 
     608                        $update_watched_sql = ''; 
     609                        $bcc_list_ary = array(); 
     610 
     611                        if ($row = $db->sql_fetchrow($result)) 
     612                        { 
     613                                // Sixty second limit 
     614                                @set_time_limit(60); 
     615                                $base_url = generate_base_url(); 
     616 
     617                                do 
     618                                { 
     619                                        if ($row['email'] != '') 
     620                                        { 
     621                                                $bcc_list_ary[$row['language']][] = $row['email']; 
     622                                        } 
     623                                        $update_watched_sql .= ($update_watched_sql != '') ? ', ' . $row['uid'] : $row['uid']; 
     624                                } 
     625                                while ($row = $db->sql_fetchrow($result)); 
     626 
     627                                if (sizeof($bcc_list_ary)) 
     628                                { 
     629                                        include_once($root_path . 'include/functions_messenger.php'); 
     630                                        $messenger = new messenger(true); 
     631 
     632                                        $topic_title = censor_text(unprepare_message($topic_title)); 
     633 
     634                                        @reset($bcc_list_ary); 
     635                                        while (list($user_lang, $bcc_list) = each($bcc_list_ary)) 
     636                                        { 
     637                                                for ($i = 0; $i < sizeof($bcc_list); $i++) 
     638                                                { 
     639                                                        // www.phpBB-SEO.com SEO TOOLKIT BEGIN 
     640                                                        if ( $config['mod_rewrite_enabled'] ) { 
     641                                                                $seo->set_url(htmlspecialchars_decode($topic_title), $topic_id, $seo->seo_static['topic']); 
     642 
     643                                                                $u_topic = append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_POST_URL . "=$post_id#$post_id", false, false); 
     644                                                                $u_topic = $seo->drop_sid($u_topic); 
     645 
     646                                                                $u_stop_watching_topic = append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id&unwatch=topic", false, false); 
     647                                                                $u_stop_watching_topic = $seo->drop_sid($u_stop_watching_topic); 
     648                                                        } 
     649                                                        // www.phpBB-SEO.com SEO TOOLKIT END 
     650                                                        else { 
     651                                                                $u_topic = $base_url . "phpbb2.php?page=viewtopic&" . POST_POST_URL . "=$post_id#$post_id"; 
     652                                                                $u_stop_watching_topic = $base_url . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id&unwatch=topic"; 
     653                                                        } 
     654 
     655                                                        $messenger->template('topic_notify', $user_lang); 
     656 
     657                                                        $messenger->to($bcc_list[$i], $bcc_list[$i]); 
     658 
     659                                                        $messenger->assign_vars(array( 
     660                                                                'SITENAME' => $config['sitename'], 
     661                                                                'TOPIC_TITLE' => $topic_title, 
     662                                                                'U_TOPIC' => $u_topic, 
     663                                                                'U_STOP_WATCHING_TOPIC' => $u_stop_watching_topic 
     664                                                        )); 
     665 
     666                                                        $messenger->send(NOTIFY_EMAIL); 
     667                                                } 
     668                                        } 
     669                                        $messenger->save_queue(); 
     670                                } 
     671                        } 
     672                        $db->sql_freeresult($result); 
     673 
     674                        if ($update_watched_sql != '') 
     675                        { 
     676                                $sql = "UPDATE " . TOPICS_WATCH_TABLE . " 
     677                                        SET notify_status = " . TOPIC_WATCH_NOTIFIED . " 
     678                                        WHERE topic_id = $topic_id 
     679                                                AND user_id IN ($update_watched_sql)"; 
     680                                $db->sql_query($sql); 
     681                        } 
     682                } 
     683 
     684                $sql = "SELECT topic_id 
     685                        FROM " . TOPICS_WATCH_TABLE . " 
     686                        WHERE topic_id = $topic_id 
     687                                AND user_id = " . $userdata['uid']; 
     688                $result = $db->sql_query($sql); 
     689 
     690                $row = $db->sql_fetchrow($result); 
     691 
     692                if (!$notify_user && !empty($row['topic_id'])) 
     693                { 
     694                        $sql = "DELETE FROM " . TOPICS_WATCH_TABLE . " 
     695                                WHERE topic_id = $topic_id 
     696                                        AND user_id = " . $userdata['uid']; 
     697                        $db->sql_query($sql); 
     698                } 
     699                else if ($notify_user && empty($row['topic_id'])) 
     700                { 
     701                        $sql = "INSERT INTO " . TOPICS_WATCH_TABLE . " (user_id, topic_id, notify_status) 
     702                                VALUES (" . $userdata['uid'] . ", $topic_id, 0)"; 
     703                        $db->sql_query($sql); 
     704                } 
     705        } 
    695706} 
    696707 
     
    702713function clean_html($tag) 
    703714{ 
    704         global $config; 
    705  
    706         if (empty($tag[0])) 
    707        
    708                 return ''; 
    709        
    710  
    711         $allowed_html_tags = preg_split('/, */', utf_strtolower($config['allow_html_tags'])); 
    712         $disallowed_attributes = '/^(?:style|on)/i'; 
    713  
    714         // Check if this is an end tag 
    715         preg_match('/<[^\w\/]*\/[\W]*(\w+)/', $tag[0], $matches); 
    716         if (sizeof($matches)) 
    717        
    718                 if (in_array(utf_strtolower($matches[1]), $allowed_html_tags)) 
    719                
    720                         return  '</' . $matches[1] . '>'; 
    721                
    722                 else 
    723                
    724                         return  htmlspecialchars('</' . $matches[1] . '>'); 
    725                
    726        
    727  
    728         // Check if this is an allowed tag 
    729         if (in_array(utf_strtolower($tag[1]), $allowed_html_tags)) 
    730        
    731                 $attributes = ''; 
    732                 if (!empty($tag[2])) 
    733                
    734                         preg_match_all('/[\W]*?(\w+)[\W]*?=[\W]*?(["\'])((?:(?!\2).)*)\2/', $tag[2], $test); 
    735                         for ($i = 0; $i < sizeof($test[0]); $i++) 
    736                        
    737                                 if (preg_match($disallowed_attributes, $test[1][$i])) 
    738                                
    739                                         continue; 
    740                                
    741                                 $attributes .= ' ' . $test[1][$i] . '=' . $test[2][$i] . str_replace(array('[', ']'), array('&#91;', '&#93;'), htmlspecialchars($test[3][$i])) . $test[2][$i]; 
    742                        
    743                
    744                 if (in_array(utf_strtolower($tag[1]), $allowed_html_tags)) 
    745                
    746                         return '<' . $tag[1] . $attributes . '>'; 
    747                
    748                 else 
    749                
    750                         return htmlspecialchars('<' . $tag[1] . $attributes . '>'); 
    751                
    752        
    753         // Finally, this is not an allowed tag so strip all the attibutes and escape it 
    754         else 
    755        
    756                 return htmlspecialchars('<' .   $tag[1] . '>'); 
    757        
     715       global $config; 
     716 
     717       if (empty($tag[0])) 
     718       
     719               return ''; 
     720       
     721 
     722       $allowed_html_tags = preg_split('/, */', utf_strtolower($config['allow_html_tags'])); 
     723       $disallowed_attributes = '/^(?:style|on)/i'; 
     724 
     725       // Check if this is an end tag 
     726       preg_match('/<[^\w\/]*\/[\W]*(\w+)/', $tag[0], $matches); 
     727       if (sizeof($matches)) 
     728       
     729               if (in_array(utf_strtolower($matches[1]), $allowed_html_tags)) 
     730               
     731                       return  '</' . $matches[1] . '>'; 
     732               
     733               else 
     734               
     735                       return  htmlspecialchars('</' . $matches[1] . '>'); 
     736               
     737       
     738 
     739       // Check if this is an allowed tag 
     740       if (in_array(utf_strtolower($tag[1]), $allowed_html_tags)) 
     741       
     742               $attributes = ''; 
     743               if (!empty($tag[2])) 
     744               
     745                       preg_match_all('/[\W]*?(\w+)[\W]*?=[\W]*?(["\'])((?:(?!\2).)*)\2/', $tag[2], $test); 
     746                       for ($i = 0; $i < sizeof($test[0]); $i++) 
     747                       
     748                               if (preg_match($disallowed_attributes, $test[1][$i])) 
     749                               
     750                                       continue; 
     751                               
     752                               $attributes .= ' ' . $test[1][$i] . '=' . $test[2][$i] . str_replace(array('[', ']'), array('&#91;', '&#93;'), htmlspecialchars($test[3][$i])) . $test[2][$i]; 
     753                       
     754               
     755               if (in_array(utf_strtolower($tag[1]), $allowed_html_tags)) 
     756               
     757                       return '<' . $tag[1] . $attributes . '>'; 
     758               
     759               else 
     760               
     761                       return htmlspecialchars('<' . $tag[1] . $attributes . '>'); 
     762               
     763       
     764       // Finally, this is not an allowed tag so strip all the attibutes and escape it 
     765       else 
     766       
     767               return htmlspecialchars('<' .   $tag[1] . '>'); 
     768       
    758769} 
    759770 
  • phpBB2/includes/topic_review.php

    r266 r269  
    2727        global $userdata, $user_ip; 
    2828        global $starttime; 
     29        global $bb_code; 
    2930 
    3031        if ( !$is_inline_review ) 
     
    8687        } 
    8788 
     89                if ( !isset($bb_code) ) { 
     90                        $bb_code = new bbcode; 
     91                } 
     92 
    8893        // 
    8994        // Go ahead and pull all data for this topic 
    9095        // 
    91         $sql = "SELECT u.name AS username, u.uid, p.*,  pt.post_text, pt.post_subject, pt.bbcode_uid 
     96        $sql = "SELECT u.name AS username, u.uid, p.*,  pt.post_text, pt.post_subject 
    9297                FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt 
    9398                WHERE p.topic_id = $topic_id 
     
    132137 
    133138                        $message = $row['post_text']; 
    134                         $bbcode_uid = $row['bbcode_uid']; 
    135139 
    136140                        // 
     
    143147                        } 
    144148 
    145                         if ( $bbcode_uid != "" ) 
    146                         { 
    147                                 $message = ( $config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message); 
    148                         } 
    149  
    150                         $message = make_clickable($message); 
     149                                $bb_code->parse($message); 
     150                                $message = $bb_code->get_html(); 
    151151 
    152152                        $post_subject = censor_text($post_subject); 
    153153                        $message = censor_text($message); 
    154  
    155                         if ( $config['allow_smilies'] && $row['enable_smilies'] ) 
    156                         { 
    157                                 $message = smilies_pass($message); 
    158                         } 
    159154 
    160155                        $message = str_replace("\n", '<br />', $message); 
  • phpBB2/index.php

    r266 r269  
    399399                                                                $forum_data[$j]['topic_title'] = unprepare_message($forum_data[$j]['topic_title']); 
    400400                                                                $forum_data[$j]['topic_title'] = split_string($forum_data[$j]['topic_title'], 20); 
    401                                                                 $last_post_time = "<b>" . $lang['posted'] . "</b>: " . create_date($forum_data[$j]['post_time']); 
     401                                                                $last_post_time = "<b>" . $lang['added'] . "</b>: " . create_date($forum_data[$j]['post_time']); 
    402402                                                                $last_post = $last_post_time . '<br />'; 
    403403                                                                $last_post .= ( $forum_data[$j]['uid'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? "<b>" . $lang['poster'] . "</b>: " . $forum_data[$j]['post_username'] : "<b>" . $lang['poster']. "</b>: " . $lang['guest']) : "<b>" . $lang['poster'] . "</b>: " . get_user_class_color($forum_data[$j]['class'],$forum_data[$j]['username']); 
  • phpBB2/modcp.php

    r266 r269  
    3838include($root_path . 'phpBB2/includes/bbcode.'.$phpEx); 
    3939require($root_path . 'include/functions_admin.'.$phpEx); 
    40 include($root_path . 'include/functions_post.'.$phpEx); 
     40include($root_path . 'include/bbcode/bbcode.lib.php'); 
    4141 
    4242// 
     
    122122 
    123123// session id check 
    124 if (!empty($_POST['sid']) || !empty($_GET['sid'])) 
    125 
    126         $sid = (!empty($_POST['sid'])) ? $_POST['sid'] : $_GET['sid']; 
    127 
    128 else 
    129 
    130         $sid = ''; 
    131 
     124$sid = request_var('sid', ''); 
    132125 
    133126// 
     
    184177// End session management 
    185178// 
     179 
     180/* */ 
     181$bb_code = new bbcode; 
     182/* */ 
    186183 
    187184// session id check 
     
    380377                        { 
    381378                                //$redirect_page = "viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&amp;sid=" . $userdata['session_id']; 
    382                                 $redirect_page = "phpbb2.php?page=viewforum&" . POST_FORUM_URL . "=$forum_id&amp;sid=" . $userdata['session_id']; 
     379                                $redirect_page = $root_path . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . "=$forum_id&amp;sid=" . $userdata['session_id']; 
    383380                                $l_redirect = sprintf($lang['click_return_forum'], '<a href="' . $redirect_page . '">', '</a>'); 
    384381                        } 
     
    386383                        { 
    387384                                //$redirect_page = "modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id&amp;sid=" . $userdata['session_id']; 
    388                                 $redirect_page = "phpbb2.php?page=modcp&" . POST_FORUM_URL . "=$forum_id&amp;sid=" . $userdata['session_id']; 
     385                                $redirect_page = $root_path . "phpbb2.php?page=modcp&" . POST_FORUM_URL . "=$forum_id&amp;sid=" . $userdata['session_id']; 
    389386                                $l_redirect = sprintf($lang['click_return_modcp'], '<a href="' . $redirect_page . '">', '</a>'); 
    390387                        } 
     
    521518                        { 
    522519                                //$redirect_page = "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;sid=" . $userdata['session_id']; 
    523                                 $redirect_page = "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id&amp;sid=" . $userdata['session_id']
     520                                $redirect_page = append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id")
    524521                                $message .= sprintf($lang['click_return_topic'], '<a href="' . $redirect_page . '">', '</a>'); 
    525522                        } 
     
    527524                        { 
    528525                                //$redirect_page = "modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id&amp;sid=" . $userdata['session_id']; 
    529                                 $redirect_page = "phpbb2.php?page=modcp&" . POST_FORUM_URL . "=$forum_id&amp;sid=" . $userdata['session_id']
     526                                $redirect_page = append_sid($root_path . "phpbb2.php?page=modcp&" . POST_FORUM_URL . "=$forum_id")
    530527                                $message .= sprintf($lang['click_return_modcp'], '<a href="' . $redirect_page . '">', '</a>'); 
    531528                        } 
    532529 
    533530                        //$message = $message . '<br \><br \>' . sprintf($lang['click_return_forum'], '<a href="' . "viewforum.$phpEx?" . POST_FORUM_URL . "=$old_forum_id&amp;sid=" . $userdata['session_id'] . '">', '</a>'); 
    534                         $message = $message . '<br \><br \>' . sprintf($lang['click_return_forum'], '<a href="' . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . "=$old_forum_id&amp;sid=" . $userdata['session_id'] . '">', '</a>'); 
    535  
    536                         meta_refresh(3, append_sid($redirect_page)); 
     531                        $message = $message . '<br \><br \>' . sprintf($lang['click_return_forum'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . "=$old_forum_id") . '">', '</a>'); 
     532 
     533                        meta_refresh(3, $redirect_page); 
    537534 
    538535                        trigger_error($message); 
     
    656653                { 
    657654                        //$redirect_page = "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;sid=" . $userdata['session_id']; 
    658                         $redirect_page = "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id&amp;sid=" . $userdata['session_id']; 
     655                        $redirect_page = "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id"; 
     656                        $redirect_page = append_sid($redirect_page, false, true, $userdata['session_id']); 
    659657                        $message = sprintf($lang['click_return_topic'], '<a href="' . $redirect_page . '">', '</a>'); 
    660658                } 
     
    662660                { 
    663661                        //$redirect_page = "modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id&amp;sid=" . $userdata['session_id']; 
    664                         $redirect_page = "phpbb2.php?page=modcp&" . POST_FORUM_URL . "=$forum_id&amp;sid=" . $userdata['session_id']; 
     662                        $redirect_page = "phpbb2.php?page=modcp&" . POST_FORUM_URL . "=$forum_id"; 
     663                        $redirect_page = append_sid($root_path . $redirect_page, false, true, $userdata['session_id']); 
    665664                        $message = sprintf($lang['click_return_modcp'], '<a href="' . $redirect_page . '">', '</a>'); 
    666665                } 
    667666 
    668667                //$message = $message . '<br \><br \>' . sprintf($lang['click_return_forum'], '<a href="' . "viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&amp;sid=" . $userdata['session_id'] . '">', '</a>'); 
    669                 $message = $message . '<br \><br \>' . sprintf($lang['click_return_forum'], '<a href="' . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . "=$forum_id&amp;sid=" . $userdata['session_id'] . '">', '</a>'); 
     668                $url = append_sid($root_path . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . "=$forum_id", false, true, $userdata['session_id']); 
     669                $message = $message . '<br \><br \>' . sprintf($lang['click_return_forum'], '<a href="' . $url . '">', '</a>'); 
    670670 
    671671                meta_refresh(3, append_sid($redirect_page)); 
     
    766766                                        // done with getting topic_id 
    767767                                        // now, get forum id for destination topic 
    768                                         $sql = "SELECT forum_id 
    769                                                 FROM " . TOPICS_TABLE . " 
    770                                                 WHERE topic_id = $destination_topic_id"; 
     768                                        $sql = "SELECT t.forum_id, f.forum_name, t.topic_title 
     769                                                FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f 
     770                                                WHERE topic_id = $destination_topic_id 
     771                                                                           AND t.forum_id = f.forum_id"; 
    771772                                        $result = $db->sql_query($sql); 
    772773                                        $row = $db->sql_fetchrow($result); 
    773774                                        $destination_forum_id = $row['forum_id']; 
     775                                        $destination_forum_name = $row['forum_name']; 
     776                                        $destination_topic_title = $row['topic_title']; 
    774777                                        $db->sql_freeresult($result); 
    775778 
     
    820823                                        sync('forum', $forum_id); 
    821824 
    822                                         meta_refresh(3, append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$destination_topic_id")); 
    823  
    824                                         $message = $lang['topic_split'] . '<br /><br />' . sprintf($lang['click_return_topic'], '<a href="' . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$destination_topic_id&amp;sid=" . $userdata['session_id'] . '">', '</a>'); 
     825                                                                $url = append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$destination_topic_id", false, true, $userdata['session_id']); 
     826 
     827                                        meta_refresh(3, $url); 
     828 
     829                                        $message = $lang['topic_split'] . '<br /><br />' . sprintf($lang['click_return_topic'], '<a href="' . $url . '">', '</a>'); 
    825830                                        trigger_error($message); 
    826831                                } 
     
    849854                                while ($row = $db->sql_fetchrow($result)); 
    850855 
    851                                 $post_subject = trim(htmlspecialchars($_POST['subject'])); 
     856                                $post_subject = request_var('subject', ''); 
    852857                                if (empty($post_subject)) 
    853858                                { 
     
    856861                                } 
    857862 
    858                                 $new_forum_id = intval($_POST['new_forum_id']); 
     863                                $new_forum_id = request_var('new_forum_id', 0); 
     864 
    859865                                $topic_time = time(); 
    860866 
     
    897903                                sync('forum', $forum_id); 
    898904 
    899                                 meta_refresh(3, append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id")); 
     905                                $url = append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id", false, true, $userdata['session_id']); 
     906                                                  meta_refresh(3, $url); 
    900907 
    901908                                //$message = $lang['topic_split'] . '<br /><br />' . sprintf($lang['click_return_topic'], '<a href="' . "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;sid=" . $userdata['session_id'] . '">', '</a>'); 
    902                                 $message = $lang['topic_split'] . '<br /><br />' . sprintf($lang['click_return_topic'], '<a href="' . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id&amp;sid=" . $userdata['session_id'] . '">', '</a>'); 
     909                                $message = $lang['topic_split'] . '<br /><br />' . sprintf($lang['click_return_topic'], '<a href="' . $url . '">', '</a>'); 
    903910                                trigger_error($message); 
    904911                                return; 
     
    931938                                                                $template->assign_vars(array( 
    932939                                                                        'PARENT_FORUM'                  => 1, 
    933                                                                         'U_VIEW_PARENT_FORUM'   => append_sid($root_path . "viewforum.$phpEx?" . POST_FORUM_URL .'=' . $all_forums[$i]['forum_id']), 
     940                                                                        'U_VIEW_PARENT_FORUM'   => append_sid($root_path . "phpbb2.php?page=viewforum&amp;" . POST_FORUM_URL .'=' . $all_forums[$i]['forum_id']), 
    934941                                                                        'PARENT_FORUM_NAME'             => $all_forums[$i]['forum_name'], 
    935942                                                                )); 
     
    939946                                        // End Simple Subforums MOD 
    940947 
    941                         $sql = "SELECT u.name AS username, p.*, pt.post_text, pt.bbcode_uid, pt.post_subject, p.post_username 
     948                        $sql = "SELECT u.name AS username, p.*, pt.post_text, pt.post_subject, p.post_username 
    942949                                FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt 
    943950                                WHERE p.topic_id = $topic_id 
     
    968975                                        $post_date = create_date($postrow['post_time']); 
    969976 
    970                                         $bbcode_uid = $postrow['bbcode_uid']; 
    971977                                        $message = $postrow['post_text']; 
    972978                                        $post_subject = $postrow['post_subject']; 
     
    984990                                        } 
    985991 
    986                                         if ( $bbcode_uid != '' ) 
    987                                         { 
    988                                                 $message = ( $config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message); 
    989                                         } 
     992                                                        $bb_code->parse($message); 
     993                                                        $message = $bb_code->get_html(); 
     994 
    990995                                        $post_subject = censor_text($post_subject); 
    991996                                        $message = censor_text($message); 
    992  
    993                                         $message = make_clickable($message); 
    994  
    995                                         if ( $config['allow_smilies'] && $postrow['enable_smilies'] ) 
    996                                         { 
    997                                                 $message = smilies_pass($message); 
    998                                         } 
    999997 
    1000998                                        $message = str_replace("\n", '<br />', $message); 
     
    10841082                        sync('forum', $forum_id); 
    10851083 
    1086                         meta_refresh(3, append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id")); 
    1087  
    1088                         $message = $lang['delete_posts_succesfully'] . '<br /><br />' . sprintf($lang['click_return_topic'], '<a href="' . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id&amp;sid=" . $userdata['session_id'] . '">', '</a>'); 
     1084                                        $url = append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id", false, true, $userdata['session_id']); 
     1085 
     1086                        meta_refresh(3, $url); 
     1087 
     1088                        $message = $lang['delete_posts_succesfully'] . '<br /><br />' . sprintf($lang['click_return_topic'], '<a href="' . $url . '">', '</a>'); 
    10891089                        trigger_error($message); 
    10901090 
     
    10961096                        // 
    10971097 
    1098                         $sql = "SELECT u.name AS username, p.*, pt.post_text, pt.bbcode_uid, pt.post_subject, p.post_username 
     1098                        $sql = "SELECT u.name AS username, p.*, pt.post_text, pt.post_subject, p.post_username 
    10991099                                FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt 
    11001100                                WHERE p.topic_id = $topic_id 
     
    11281128                                        $post_date = create_date($postrow['post_time']); 
    11291129 
    1130                                         $bbcode_uid = $postrow['bbcode_uid']; 
    11311130                                        $message = $postrow['post_text']; 
    1132                                         $post_subject = ( $postrow['post_subject'] != '' ) ? $postrow['post_subject'] : $topic_title
     1131                                        $post_subject = ( $postrow['post_subject'] != '' ) ? $postrow['post_subject'] : ''
    11331132 
    11341133                                        // 
     
    11441143                                        } 
    11451144 
    1146                                         if ( $bbcode_uid != '' ) 
    1147                                         { 
    1148                                                 $message = ( $config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message); 
    1149                                         } 
     1145                                                        $bb_code->parse($message); 
     1146                                                        $message = $bb_code->get_html(); 
    11501147 
    11511148                                        $post_subject = censor_text($post_subject); 
    11521149                                        $message = censor_text($message); 
    1153  
    1154                                         $message = make_clickable($message); 
    1155  
    1156                                         if ( $config['allow_smilies'] && $postrow['enable_smilies'] ) 
    1157                                         { 
    1158                                                 $message = smilies_pass($message); 
    1159                                         } 
    11601150 
    11611151                                        $message = str_replace("\n", '<br />', $message); 
     
    14311421 
    14321422                        //$u_view_topic = "modcp.$phpEx?mode=split&amp;" . POST_TOPIC_URL . "=$topic_id&amp;sid=" . $userdata['session_id']; 
    1433                         $u_view_topic = "phpbb2.php?page=modcp&mode=split&amp;" . POST_TOPIC_URL . "=$topic_id&amp;sid=" . $userdata['session_id']; 
     1423 
     1424                        $u_view_topic = append_sid("phpbb2.php?page=modcp&mode=split&amp;" . POST_TOPIC_URL . "=$topic_id", false, true, $userdata['session_id']); 
    14341425                        $topic_replies = $row['topic_replies']; 
    14351426 
  • phpBB2/posting.php

    r266 r269  
    3030include($root_path . 'phpBB2/includes/bbcode.'.$phpEx); 
    3131include($root_path . 'phpBB2/includes/functions_post.'.$phpEx); 
     32include($root_path . 'include/bbcode/bbcode.lib.php'); 
    3233include($root_path . 'include/functions_post.'.$phpEx); 
    3334 
     
    205206                } 
    206207 
    207                 //$select_sql = (!$submit) ? ', t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid, u.name AS username, u.uid, u.user_sig, u.user_sig_bbcode_uid' : ''; 
     208                //$select_sql = (!$submit) ? ', t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, u.name AS username, u.uid, u.user_sig' : ''; 
    208209                //$from_sql = ( !$submit ) ? ", " . POSTS_TEXT_TABLE . " pt, " . USERS_TABLE . " u" : ''; 
    209210                //$where_sql = ( !$submit ) ? "AND pt.post_id = p.post_id AND u.uid = p.poster_id" : ''; 
    210                 $select_sql = ', t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, p.post_time, pt.post_subject, pt.post_text, pt.bbcode_uid, u.name AS username, u.uid, u.user_sig, u.user_sig_bbcode_uid'; 
     211                $select_sql = ', t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, p.post_time, pt.post_subject, pt.post_text, u.name AS username, u.uid, u.user_sig'; 
    211212                $from_sql = ", " . POSTS_TEXT_TABLE . " pt, " . USERS_TABLE . " u"; 
    212213                $where_sql = "AND pt.post_id = p.post_id AND u.uid = p.poster_id"; 
     
    587588                        if (!$merge) 
    588589                        { 
    589                                 $bbcode_uid = ''; 
    590  
    591                                 prepare_post($mode, $post_data, $bbcode_on, $html_on, $smilies_on, $error_msg, $username, $bbcode_uid, $subject, $message, $poll_title, $poll_options, $poll_length); 
     590 
     591                                prepare_post($mode, $post_data, $bbcode_on, $html_on, $smilies_on, $error_msg, $username, $subject, $message, $poll_title, $poll_options, $poll_length); 
    592592 
    593593                                if ( $error_msg == '' ) 
     
    595595                                $topic_type = ( $topic_type != $post_data['topic_type'] && !$is_auth['auth_sticky'] && !$is_auth['auth_announce'] ) ? $post_data['topic_type'] : $topic_type; 
    596596 
    597                                 submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length); 
     597                                submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length); 
    598598                                } 
    599599                        } 
     
    686686        { 
    687687                $user_sig = ( $post_info['user_sig'] != '' && $config['allow_sig'] ) ? $post_info['user_sig'] : ''; 
    688                 $userdata['user_sig_bbcode_uid'] = $post_info['user_sig_bbcode_uid']; 
    689688        } 
    690689 
    691690        if( $preview ) 
    692691        { 
    693                 $bbcode_uid = ( $bbcode_on ) ? make_bbcode_uid() : ''; 
    694                 $preview_message = prepare_message(unprepare_message($message), $html_on, $bbcode_on, $smilies_on, $bbcode_uid); 
     692 
     693                $bb_code = new bbcode; 
     694 
     695                $preview_message = prepare_message(unprepare_message($message), $html_on, $bbcode_on, $smilies_on); 
    695696                $preview_subject = $subject; 
    696697                $preview_username = $username; 
     
    707708                // Finalise processing as per viewtopic 
    708709                // 
    709                 $user_sig = ( $config['allow_sig'] == 2 ) ? preg_replace ('#((\r)+?(\n)+?)*(\[url(:'.$userdata['user_sig_bbcode_uid'].')?(.*)\])?\[img:'.$userdata['user_sig_bbcode_uid'].'\](.+)\[/img:'.$userdata['user_sig_bbcode_uid'].'\](\[/url(:'.$userdata['user_sig_bbcode_uid'].')?\])?#i', '', $user_sig) : $user_sig ; 
     710                $user_sig = ( $config['allow_sig'] == 2 ) ? preg_replace ('#((\r)+?(\n)+?)*(\[url(.*)\])?\[img\](.+)\[/img\](\[/url\])?#i', '', $user_sig) : $user_sig ; 
    710711                if( !$html_on ) 
    711712                { 
     
    715716                        } 
    716717                } 
    717                 if( $attach_sig && $user_sig != '' && $userdata['user_sig_bbcode_uid'] ) 
    718                 { 
    719                         $user_sig = bbencode_second_pass($user_sig, $userdata['user_sig_bbcode_uid']); 
     718 
     719                if( $attach_sig && $user_sig != '' ) 
     720                { 
     721                                $bb_code->parse($user_sig); 
     722                                $user_sig = $bb_code->get_html(); 
    720723                } 
    721724 
    722725                if( $bbcode_on ) 
    723726                { 
    724                         $preview_message = bbencode_second_pass($preview_message, $bbcode_uid); 
    725                 } 
     727                                $bb_code->parse($preview_message); 
     728                                $preview_message = $bb_code->get_html(); 
     729                } 
     730 
     731 
    726732 
    727733                $preview_username = censor_text($preview_username); 
     
    729735                $preview_message = censor_text($preview_message); 
    730736 
    731  
    732                 if( $user_sig != '' ) 
    733                 { 
    734                         $user_sig = make_clickable($user_sig); 
    735                 } 
    736                 $preview_message = make_clickable($preview_message); 
    737  
    738                 if( $smilies_on ) 
    739                 { 
    740                         if( $user_sig != '' ) 
    741                         { 
    742                                 $user_sig = smilies_pass($user_sig); 
    743                         } 
    744  
    745                         $preview_message = smilies_pass($preview_message); 
    746                 } 
    747737                if( $attach_sig && $user_sig != '' ) 
    748738                { 
     
    836826                } 
    837827 
    838                 if ( $post_info['bbcode_uid'] != '' ) 
    839                 { 
    840                         $message = preg_replace('/\:(([a-z0-9]:)?)' . $post_info['bbcode_uid'] . '/s', '', $message); 
    841                 } 
    842  
    843828                $message = str_replace('<', '&lt;', $message); 
    844829                $message = str_replace('>', '&gt;', $message); 
     
    851836                        // Use trim to get rid of spaces placed there by MS-SQL 2000 
    852837                        $quote_username = ( trim($post_info['post_username']) != '' ) ? $post_info['post_username'] : $post_info['username']; 
    853                         $message = '[quote=' . $quote_username . ']' . $message . '[/quote]'; 
     838                        $message = '[quote="' . $quote_username . '"]' . $message . '[/quote]'; 
    854839 
    855840                        // BEGIN Moderator Tags 
  • phpBB2/search.php

    r266 r269  
    3030include($root_path . 'phpBB2/includes/bbcode.'.$phpEx); 
    3131include($root_path . 'phpBB2/includes/functions_search.'.$phpEx); 
    32 include($root_path . 'include/functions_post.'.$phpEx); 
     32include($root_path . 'include/bbcode/bbcode.lib.php'); 
    3333 
    3434// 
     
    4040// End session management 
    4141// 
     42 
     43/* */ 
     44$bb_code = new bbcode; 
     45/* */ 
    4246 
    4347// 
     
    731735                if ( $show_results == 'posts' ) 
    732736                { 
    733                         $sql = "SELECT pt.post_text, pt.bbcode_uid, pt.post_subject, p.*, f.forum_id, f.forum_name, t.*, u.name AS username, u.uid 
     737                        $sql = "SELECT pt.post_text, pt.post_subject, p.*, f.forum_id, f.forum_name, t.*, u.name AS username, u.uid 
    734738                                FROM " . FORUMS_TABLE . " f, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE . " pt 
    735739                                WHERE p.post_id IN ($search_results) 
     
    882886                                if ( isset($return_chars) ) 
    883887                                { 
    884                                         $bbcode_uid = $searchset[$i]['bbcode_uid']; 
    885888 
    886889                                        // 
     
    891894                                        { 
    892895                                                $message = strip_tags($message); 
    893                                                 $message = preg_replace("/\[.*?:$bbcode_uid:?.*?\]/si", '', $message); 
    894896                                                $message = preg_replace('/\[url\]|\[\/url\]/si', '', $message); 
    895897                                                $message = ( utf_strlen($message) > $return_chars ) ? substr($message, 0, $return_chars) . ' ...' : $message; 
     
    899901                                                if ( !$config['allow_html'] ) 
    900902                                                { 
    901                                                         if ( $postrow[$i]['enable_html'] ) 
     903                                                        if ( $searchset[$i]['enable_html'] ) 
    902904                                                        { 
    903905                                                                $message = preg_replace('#(<)([\/]?.*?)(>)#is', '&lt;\\2&gt;', $message); 
     
    905907                                                } 
    906908 
    907                                                 if ( $bbcode_uid != '' ) 
    908                                                 { 
    909                                                         $message = ( $config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message); 
    910                                                 } 
    911  
    912                                                 $message = make_clickable($message); 
     909                                                                        $bb_code->parse($message); 
     910                                                                        $message = $bb_code->get_html(); 
    913911 
    914912                                                if ( $highlight_active ) 
     
    991989                                        $post_subject = ( $searchset[$i]['post_subject'] != '' ) ? censor_text($searchset[$i]['post_subject']) : $topic_title; 
    992990                                        $message = censor_text($message); 
    993  
    994                                         if ($config['allow_smilies'] && $searchset[$i]['enable_smilies']) 
    995                                         { 
    996                                                 $message = smilies_pass($message); 
    997                                         } 
    998991 
    999992                                        $message = str_replace("\n", '<br />', $message); 
  • phpBB2/viewforum.php

    r266 r269  
    234234while( $row = $db->sql_fetchrow($result) ) 
    235235{ 
    236         $moderators[] = '<a href="' . append_sid('userdetails.php?id=' . $row['uid']) . '">' . get_user_class_color($row['class'], $row['username']) . '</a>'; 
     236        $moderators[] = '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $row['uid']) . '">' . get_user_class_color($row['class'], $row['username']) . '</a>'; 
    237237} 
    238238 
     
    655655                $view_topic_url = append_sid($root_path . "phpbb2.php?page=viewtopic&amp;" . POST_TOPIC_URL . "=$topic_id"); 
    656656 
    657                 $topic_author = ($topic_rowset[$i]['uid'] == ANONYMOUS ) ? (($topic_rowset[$i]['post_username'] != '' ) ? $topic_rowset[$i]['post_username'] : $lang['guest'] ) : '<a href="' . append_sid('userdetails.php?id=' . $topic_rowset[$i]['uid']) . '">' . get_user_class_color($topic_rowset[$i]['class1'],$topic_rowset[$i]['username']) . '</a>'; 
     657                $topic_author = ($topic_rowset[$i]['uid'] == ANONYMOUS ) ? (($topic_rowset[$i]['post_username'] != '' ) ? $topic_rowset[$i]['post_username'] : $lang['guest'] ) : '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $topic_rowset[$i]['uid']) . '">' . get_user_class_color($topic_rowset[$i]['class1'],$topic_rowset[$i]['username']) . '</a>'; 
    658658 
    659659                $first_post_time = create_date($topic_rowset[$i]['topic_time']); 
     
    661661                $last_post_time = create_date($topic_rowset[$i]['post_time']); 
    662662 
    663                 $last_post_author = ( $topic_rowset[$i]['id2'] == ANONYMOUS ) ? ( ( isset($topic_rowset[$i]['post_username2']) ) ? $topic_rowset[$i]['post_username2'] . ' ' : $lang['guest'] . ' ' ) : '<a href="' . append_sid('userdetails.php?id=' . $topic_rowset[$i]['id2']) . '">' .  get_user_class_color($topic_rowset[$i]['class2'],$topic_rowset[$i]['user2']) . '</a>'; 
     663                $last_post_author = ( $topic_rowset[$i]['id2'] == ANONYMOUS ) ? ( ( isset($topic_rowset[$i]['post_username2']) ) ? $topic_rowset[$i]['post_username2'] . ' ' : $lang['guest'] . ' ' ) : '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $topic_rowset[$i]['id2']) . '">' .  get_user_class_color($topic_rowset[$i]['class2'],$topic_rowset[$i]['user2']) . '</a>'; 
    664664 
    665665                $last_post_url = '<a href="' . append_sid($root_path . "phpbb2.php?page=viewtopic&amp;"  . POST_POST_URL . '=' . $topic_rowset[$i]['topic_last_post_id']) . '#' . $topic_rowset[$i]['topic_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" alt="' . $lang['view_latest_post'] . '" title="' . $lang['view_latest_post'] . '" border="0" /></a>'; 
     
    834834        while( $row = $db->sql_fetchrow($result) ) 
    835835        { 
    836                 $subforum_moderators[$row['forum_id']][] = '<a href="' . append_sid('userdetails.php?id=' . $row['uid']) . '">' . $row['username'] . '</a>'; 
     836                $subforum_moderators[$row['forum_id']][] = '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $row['uid']) . '">' . $row['username'] . '</a>'; 
    837837        } 
    838838        $db->sql_freeresult($result); 
     
    923923                                $last_post = $last_post_time . '<br />'; 
    924924 
    925                                 $last_post .= ( $subforum_data[$j]['uid'] == ANONYMOUS ) ? ( ($subforum_data[$j]['post_username'] != '' ) ? $subforum_data[$j]['post_username'] . ' ' : $lang['guest'] . ' ' ) : '<a href="' . append_sid('userdetails.php?id=' . $subforum_data[$j]['uid']) . '">' . $subforum_data[$j]['username'] . '</a> '; 
     925                                $last_post .= ( $subforum_data[$j]['uid'] == ANONYMOUS ) ? ( ($subforum_data[$j]['post_username'] != '' ) ? $subforum_data[$j]['post_username'] . ' ' : $lang['guest'] . ' ' ) : '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $subforum_data[$j]['uid']) . '">' . $subforum_data[$j]['username'] . '</a> '; 
    926926 
    927927                                $last_post .= '<a href="' . append_sid($root_path . "phpbb2.php?page=viewtopic&amp;"  . POST_POST_URL . '=' . $subforum_data[$j]['forum_last_post_id']) . '#' . $subforum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['view_latest_post'] . '" title="' . $lang['view_latest_post'] . '" /></a>'; 
  • phpBB2/viewtopic.php

    r266 r269  
    940940        { 
    941941                //$temp_url = append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=$poster_id"); 
    942                 $temp_url = append_sid("userdetails.php?id=" . $postrow[$i]['uid']); 
     942                $temp_url = append_sid($root_path . "userdetails.php?id=" . $postrow[$i]['uid']); 
    943943                $profile_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_profile'] . '" alt="' . $lang['read_profile'] . '" title="' . $lang['read_profile'] . '" border="0" /></a>'; 
    944944                $profile = '<a href="' . $temp_url . '">' . $lang['read_profile'] . '</a>'; 
     
    984984 
    985985                //$temp_url = append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=$poster_id"); 
    986                 $temp_url = append_sid("userdetails.php?id=" . $postrow[$i]['uid']); 
     986                $temp_url = append_sid($root_path . "userdetails.php?id=" . $postrow[$i]['uid']); 
    987987                //$msn_img = ( $postrow[$i]['user_msnm'] ) ? '<a href="' . $temp_url . '"><img src="' . $images['icon_msnm'] . '" alt="' . $lang['msnm'] . '" title="' . $lang['msnm'] . '" border="0" /></a>' : ''; 
    988988                $msn_img = ( $postrow[$i]['msn'] ) ? '<a href="' . $temp_url . '"><img src="' . $images['icon_msnm'] . '" alt="' . $lang['msnm'] . '" title="' . $lang['msnm'] . '" border="0" /></a>' : ''; 
     
    12781278                $userslist .= ( $userslist ? ', ' : '' ); 
    12791279 
    1280                 $userslist .= '<a href="' . append_sid($root_path . 'userdetails.php?id=') . $users['uid'] . '"><span class="' . ( $users['simpaty'] ? 'usergoodResp' : 'userbadResp' ) . '">' . $users['name'] . '</span></a>'; 
     1280                $userslist .= '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $users['uid']) . '"><span class="' . ( $users['simpaty'] ? 'usergoodResp' : 'userbadResp' ) . '">' . $users['name'] . '</span></a>'; 
    12811281        } 
    12821282 
  • releases.php

    r241 r269  
    22$root_path = './'; 
    33require ($root_path . 'include/config.php'); 
    4 require ($root_path . 'include/functions_post.php'); 
    54require ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_upload_templates.php'); 
    65 
  • requests.php

    r266 r269  
    22$root_path = './'; 
    33require ($root_path . 'include/config.php'); 
    4 require ($root_path . 'include/functions_post.php'); 
    54require ($root_path . 'include/functions_selects.php'); 
    65require ($root_path . 'include/functions_check.php'); 
     
    170169 
    171170                $filled_torrent_id = (int) $matches[1]; 
    172                 $sql = 'SELECT name FROM ' . TORRENTS_TABLE . ' WHERE fid = ' . $filled_torrent_id . ' AND moderated = 1 AND banned = 0 AND hidden = 0'; 
    173                 $result = $db->sql_query($sql); 
    174                 if ( !($row = $db->sql_fetchrow($result)) ) { 
     171                $sql = 'SELECT name, category FROM ' . TORRENTS_TABLE . ' WHERE fid = ' . $filled_torrent_id . ' AND moderated = 1 AND banned = 0 AND hidden = 0'; 
     172                $result = $db->sql_query($sql); 
     173                if ( !$row = $db->sql_fetchrow($result) ) { 
    175174                        trigger_error($lang['invalid_url_for_uploaded_torrent']); 
    176175                } 
    177176                $torrent_name = censor_text($row['name']); 
     177                $cats = $cache->obtain_cats(); 
     178 
     179                $cat_id = $row['category']; 
     180                $cat_parent_id = ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_id']) ? $cats[$cats[$cat_id]['cat_parent']]['cat_id'] : 0 ); 
     181                if ( $config['mod_rewrite_enabled'] ) { 
     182                        $u_request = append_sid($root_path . 'requests.php?id=' . $id, false, true, ''); 
     183                        $u_userdetails = append_sid($root_path . 'userdetails.php?id=' . $userdata['uid'], false, true, ''); 
     184                        $u_details = append_sid($root_path . 'details.php?id=' . $filled_torrent_id, false, true, ''); 
     185                } 
     186                else { 
     187                        $base_url = generate_base_url(); 
     188                        $u_request = $base_url . '/requests.php?id=' . $id; 
     189                        $u_userdetails = $base_url . '/userdetails.php?id=' . $userdata['uid']; 
     190                        $u_details = $base_url . '/details.php?id=' . $filled_torrent_id; 
     191                } 
    178192 
    179193                $sql = 'SELECT a.userid, u.language, u.name, u.email, u.notifs, u.language, u.class 
     
    190204                                'sender' => 0, 
    191205                                'receiver' => $arr['userid'], 
    192                                 'msg' => sprintf($lang['pm_request_filled_body'], generate_base_url(), $id , $requests_name, generate_base_url(), $userdata['uid'], $userdata['name'], generate_base_url(), $filled_torrent_id, $torrent_name), 
     206                                'msg' => sprintf($lang['pm_request_filled_body'], $u_request, $requests_name, $u_userdetails, $userdata['name'], $u_details, $torrent_name), 
    193207                                'subject' => $lang['pm_request_filled_subject'], 
    194208                                'name' => $arr['name'], 
     
    265279                $result = $db->sql_query($sql); 
    266280 
    267                 if ( !($row = $db->sql_fetchrow($result)) ) { 
     281                if ( !$row = $db->sql_fetchrow($result) ) { 
    268282                        trigger_error (sprintf($lang['invalid_id'], $id)); 
    269283                } 
     284 
     285                /* */ 
     286                require ($root_path . 'include/bbcode/bbcode.lib.php'); 
     287                require ($root_path . 'include/functions_post.php'); 
     288                /* */ 
    270289 
    271290                if ( $row['userid'] <> ANONYMOUS ) { 
     
    282301                } 
    283302 
     303                $description = censor_text($row['descr']); 
     304                $bb_code = new bbcode($description); 
     305                $description = $bb_code->get_html(); 
    284306 
    285307                $template->assign_vars(array( 
     
    295317                        'REQUEST_DETAILS' => sprintf($lang['request_details'], $row['request']), 
    296318                        'REQUEST_NAME' => censor_text($row['request']), 
    297                         'DESCRIPTION' => format_comment(censor_text($row['descr']))
     319                        'DESCRIPTION' => $description
    298320                        'ADDED' => create_date($row['added']), 
    299321                        'TYPE' => $row['cat_name'], 
     
    331353                $tracking_requests = ( isset($_COOKIE[$config['cookie_name'] . '_r']) ) ? unserialize($_COOKIE[$config['cookie_name'] . '_r']) : array(); 
    332354 
    333                 if ( !empty($tracking_offers[$id]) ) 
     355                if ( !empty($tracking_requests[$id]) ) 
    334356                { 
    335357                        $req_comment_last_read = $tracking_requests[$id]; 
     
    478500                        list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, 'requests.php?' . $search_arr . 'sort=' . $sort . '&amp;' ); 
    479501 
    480                         $sql = 'SELECT u.downloaded, u.uploaded, u.name, u.class, r.filled, r.filledby, r.id, r.userid, r.request, r.added, r.hits, r.comments, u2.name AS filledby_username, u2.uid AS filledby_id, r.cat, t.name AS torrent_name 
     502                        $sql = 'SELECT u.downloaded, u.uploaded, u.name, u.class, r.filled, r.filledby, r.id, r.userid, r.request, r.added, r.hits, r.comments, u2.name AS filledby_username, u2.uid AS filledby_id, r.cat, t.name AS torrent_name, t.category AS t_category 
    481503                                        FROM ' . REQUESTS_TABLE . ' r 
    482504                                        LEFT JOIN ' . USERS_TABLE . ' u2 ON r.filledby = u2.uid 
     
    526548                                $filled = ( $row['filled'] ? append_sid($root_path . 'details.php?id=' . $row['filled']) : '' ); 
    527549                                $comment = ( $row['comments'] ?'<a href="' . append_sid('requests.php?id=' . $row['id']) . '#startcomments"><b>' . $row['comments'] . '</b></a>' : 0); 
    528                                 $filled_by = ( $row['filled'] ? $lang['filled_by'] .' <a href="' . append_sid('userdetails.php?id=' . $row['filledby_id']) . '">' . $row['filledby_username'] . '</a>':''); 
     550                                $filled_by = ( $row['filled'] ? $lang['filled_by'] .' <a href="' . append_sid($root_path . 'userdetails.php?id=' . $row['filledby_id']) . '">' . $row['filledby_username'] . '</a>':''); 
    529551                                $vote_link = ( $row['filled'] ? '' : '<a href="' . append_sid('requests.php?action=vote&amp;voteid=' . $row['id']) . '">' . $lang['vote'] . '</a>' ); 
    530552 
     
    534556                                        'U_CAT' => append_sid('requests.php?cat=' . $row['cat']), 
    535557                                        'U_REQUEST' => ( $filled ? $filled : append_sid('requests.php?id=' . $row['id']) ), 
    536                                         'U_REQUESTER' => append_sid('userdetails.php?id=' . $row['userid']), 
     558                                        'U_REQUESTER' => append_sid($root_path . 'userdetails.php?id=' . $row['userid']), 
    537559                                        'U_VOTES' => append_sid('requests.php?action=voteview&amp;requestid=' . $row['id']), 
    538560                                        'CAT_NAME_DISPLAY' => $cat_name_display, 
  • rss.php

    r266 r269  
    33$root_path = './'; 
    44require ($root_path . 'include/config.php'); 
    5 require ($root_path . 'include/functions_post.php'); 
     5require ($root_path . 'include/bbcode/bbcode.lib.php'); 
    66 
    77function ExitWithHeader( $output, $message = '' ) { 
     
    5858     $userdata = array('uid' => $row['uid'], 'tzoffset' => $row['tzoffset'], 'language' => $row['language'], 'user_style' => $row['user_style'], 'user_dst' => $row['user_dst']); 
    5959 
    60      setup_style($userdata['user_style']); 
    61      @include($root_path . 'languages/lang_' . $userdata['language'] . '/lang_main.php'); 
     60     init_userprefs($userdata); 
    6261} 
    6362else { 
     
    8685 
    8786$template->set_filenames(array( 
    88         'rss_tpl' => 'rss.html') 
    89 ); 
     87        'rss_tpl' => 'rss.html' 
     88)); 
     89 
     90$base_url = generate_base_url(); 
    9091 
    9192$template->assign_vars(array( 
    9293        'XML_HEADER' => '<?xml version="1.0" encoding="utf-8" ?>' . "\n", 
    93         'URL' => generate_base_url()
    94         'IMAGE_URL' => ($config['cookie_secure'] ? 'https://' : 'http://' ) . $config['server_name'] . ($config['server_port'] <> 80 ? ':' . trim($config['server_port']) : '' ) . '/SZ.gif', 
     94        'URL' => $base_url
     95        'IMAGE_URL' => $base_url . '/logo88x31.gif', 
    9596        'TITLE' => htmlspecialchars($config['sitename']), 
    9697        'DESCRIPTION' => htmlspecialchars($config['site_desc']), 
     
    129130        $result = $db->sql_query($sql, 30 * 60); 
    130131 
     132        $bb_code = new bbcode(); 
     133 
    131134        while ( $row = $db->sql_fetchrow($result) ) { 
    132135 
     136                $cat_id = $row['category']; 
     137                $cat_parent_id = ( isset($cats_arr[$cats_arr[$cat_id]['cat_parent']]['cat_id']) ? $cats_arr[$cats_arr[$cat_id]['cat_parent']]['cat_id'] : 0 ); 
     138                $id = $row['fid']; 
    133139 
    134                 $link = ( isset($_GET['feed']) ? 'details.php?id=' . $row['fid'] . '&amp;action=download' : 'details.php?id=' . $row['fid'] ); 
    135                 $description = format_comment($row['descr']); 
    136                 $description = str_replace('onload="imgFit(this, 500);"', '', $description); 
    137                 $description = str_replace('onclick="imgFit(this, 500);"', '', $description); 
     140                $description = censor_text($row['descr']); 
     141                $bb_code->parse($description); 
     142             $description = $bb_code->get_html(); 
     143 
     144                $link = ( isset($_GET['feed']) ? 'details.php?id=' . $id . '&amp;action=download' : 'details.php?id=' . $id ); 
    138145                $size = mksize($row['size']); 
    139                 $category = $cats_arr[$row['category']]['cat_name']; 
     146                $category = $cats_arr[$cat_id]['cat_name']; 
    140147                $date = create_date($row['ctime'], $tzoffset); 
    141148                $owner = ( $row['owner'] ? ( $row['privacy'] == PRIVACY_LEVEL_HIGH && $row['owner'] <> $userdata['uid'] ? $lang['anonymous'] : $row['name'] ) : $lang['unknown'] ); 
    142149 
    143150                if ( $config['mod_rewrite_enabled'] ) { 
    144                         $u_link = append_sid($root_path . $link); 
    145                         $u_reply = append_sid($root_path . 'comment.php?type=main&amp;action=add&amp;tid=' . $row['fid']); 
    146                         $u_category = append_sid($root_path . 'browse.php?cat=' . $row['category']); 
     151                        $u_link = append_sid($root_path . $link, false, true, ''); 
     152                        $u_reply = append_sid($root_path . 'comment.php?type=main&amp;action=add&amp;tid=' . $id, false, true, ''); 
     153                        $u_category = append_sid($root_path . 'browse.php?cat=' . $cat_id, false, true, ''); 
    147154                } 
    148155                else { 
    149                         $u_link = generate_base_url() . '/' . $link; 
    150                         $u_reply = generate_base_url() . '/comment.php?type=main&amp;action=add&amp;tid=' . $row['fid']
    151                         $u_category = generate_base_url() . '/browse.php?cat=' . $row['category']
     156                        $u_link = $base_url . '/' . $link; 
     157                        $u_reply = $base_url . '/comment.php?type=main&amp;action=add&amp;tid=' . $id
     158                        $u_category = $base_url . '/browse.php?cat=' . $cat_id
    152159                } 
    153160 
     
    156163                        'AUTHOR' => htmlspecialchars($row['name']), 
    157164                        'CATEGORY' => htmlspecialchars($category), 
    158                         'CAT_ID' => $row['category']
     165                        'CAT_ID' => $cat_id
    159166                        'SIZE' => $size, 
    160167                        'ADDED' => $date, 
  • scrape.php

    r241 r269  
    33$root_path = './'; 
    44require ($root_path . 'include/config.php'); 
    5 require ($root_path . 'include/benc.php'); 
     5require ($root_path . 'include/functions_announce.php'); 
    66 
    77 
  • signup.php

    r245 r269  
    33require ($root_path . 'include/config.php'); 
    44require ($root_path . 'include/functions_check.php'); 
    5 require ($root_path . 'include/benc.php'); 
    65 
    76$userdata = session_pagestart($user_ip); 
     
    2423             $db->sql_freeresult($result); 
    2524 
    26              $sec = hash_pad($row['editsecret']); 
     25             $sec = str_pad($row['editsecret'], 20); 
    2726 
    2827             $sql = 'UPDATE ' . USERS_TABLE . ' SET editsecret=\'\', email=' . "'" . $db->sql_escape($email) . "'" . ' WHERE uid=' . $id . ' AND editsecret=' . "'" . $db->sql_escape($row['editsecret']) . "'"; 
  • simpaty.php

    r266 r269  
    119119                        $userslist .= ( $userslist ? ', ' : '' ); 
    120120 
    121                         $userslist .= '<a href="' . append_sid('userdetails.php?id=') . $row['uid'] . '"><span class="' . ( $row['simpaty'] ? 'usergoodResp' : 'userbadResp' ) . '">' . $row['name'] . '</span></a>'; 
     121 
     122                        $userslist .= '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $row['uid'])  . '"><span class="' . ( $row['simpaty'] ? 'usergoodResp' : 'userbadResp' ) . '">' . $row['name'] . '</span></a>'; 
    122123                } 
    123124 
  • sql.sql

    r260 r269  
    414414('count_candidates_waiting', '0', 1), 
    415415('points_settings', '', 0), 
    416 ('mod_rewrite_enabled', '0', '0'); 
     416('mod_rewrite_enabled', '0', '0'), 
     417('tags_max_allow', '10', 0), 
     418('tags_max_length', '50', 0), 
     419('tags_min_length', '3', 0); 
    417420 
    418421-- -------------------------------------------------------- 
     
    768771CREATE TABLE IF NOT EXISTS `forum_posts_text` ( 
    769772  `post_id` mediumint(8) unsigned NOT NULL default '0', 
    770   `bbcode_uid` varchar(10) default NULL, 
    771773  `post_subject` varchar(60) default NULL, 
    772774  `post_text` mediumtext, 
     
    10901092  `news_comments` int(10) default '0', 
    10911093  `news_disable_comments` tinyint(1) default '0', 
    1092   PRIMARY KEY  (`id`), 
    1093   KEY `added` (`added`) 
     1094  PRIMARY KEY  (`id`) 
    10941095) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; 
    10951096 
     
    16831684  `themes_id` mediumint(8) unsigned NOT NULL auto_increment, 
    16841685  `template_name` varchar(30) default NULL, 
    1685   `bbcode_bitfield` blob, 
    16861686  `style_name` varchar(30) default NULL, 
    16871687  `is_use_right_menu` tinyint(1) default '0', 
     
    17381738-- 
    17391739 
    1740 INSERT INTO `themes` (`themes_id`, `template_name`, `bbcode_bitfield`, `style_name`, `is_use_right_menu`, `is_use_left_menu`, `head_stylesheet`, `body_background`, `body_bgcolor`, `body_text`, `body_link`, `body_vlink`, `body_alink`, `body_hlink`, `tr_color1`, `tr_color2`, `tr_color3`, `tr_class1`, `tr_class2`, `tr_class3`, `th_color1`, `th_color2`, `th_color3`, `th_class1`, `th_class2`, `th_class3`, `td_color1`, `td_color2`, `td_color3`, `td_class1`, `td_class2`, `td_class3`, `fontface1`, `fontface2`, `fontface3`, `fontsize1`, `fontsize2`, `fontsize3`, `fontcolor1`, `fontcolor2`, `fontcolor3`, `span_class1`, `span_class2`, `span_class3`, `img_size_poll`, `img_size_privmsg`, `online_color`, `offline_color`, `hidden_color`, `hidden_torrent_color`) VALUES 
    1741 (1, 'main', 0x6b4e673d, 'main', 1, 1, 'main.css', '', 'E5E5E5', '000000', '006699', '5493B4', '', 'DD6900', 'EFEFEF', 'DEE3E7', 'D1D7DC', '', '', '', '98AAB1', '006699', 'FFFFFF', 'cellpic1.gif', 'cellpic3.gif', 'cellpic2.jpg', 'FAFAFA', 'FFFFFF', '', 'row1', 'row2', '', 'Verdana, Arial, Helvetica, sans-serif', 'Trebuchet MS', 'Courier, ''Courier New'', sans-serif', 10, 11, 12, '444444', '006600', 'FFA34F', '', '', '', NULL, NULL, '008500', 'DF0000', 'EBD400', ''), 
    1742 (2, 'reflection', 0x6b4e673d, 'reflection', 0, 0, 'reflection.css', '', 'E5E5E5', '000000', '006699', '5493B4', '', 'DD6900', 'EFEFEF', 'DEE3E7', 'D1D7DC', '', '', '', '98AAB1', '006699', 'FFFFFF', 'cellpic1.gif', 'cellpic3.gif', 'cellpic2.jpg', 'FAFAFA', 'FFFFFF', '', 'row1', 'row2', '', 'Verdana, Arial, Helvetica, sans-serif', 'Trebuchet MS', 'Courier, \\\\''Courier New\\\\'', sans-serif', 10, 11, 12, '444444', '006600', 'FFA34F', '', '', '', 0, 0, '008500', 'DF0000', 'EBD400', 'CCCCCC'), 
    1743 (3, 'bithdtv', 0x6b4e673d, 'bithdtv', 0, 0, 'bithdtv.css', '', 'E5E5E5', '000000', '006699', '5493B4', '', 'DD6900', 'EFEFEF', 'DEE3E7', 'D1D7DC', '', '', '', '98AAB1', '006699', 'FFFFFF', 'cellpic1.gif', 'cellpic3.gif', 'cellpic2.jpg', 'FAFAFA', 'FFFFFF', '', 'row1', 'row2', '', 'Verdana, Arial, Helvetica, sans-serif', 'Trebuchet MS', 'Courier, \\''Courier New\\'', sans-serif', 10, 11, 12, '444444', '006600', 'FFA34F', '', '', '', 0, 0, '008500', 'DF0000', 'EBD400', 'CCCCCC'); 
     1740INSERT INTO `themes` (`themes_id`, `template_name`, `style_name`, `is_use_right_menu`, `is_use_left_menu`, `head_stylesheet`, `body_background`, `body_bgcolor`, `body_text`, `body_link`, `body_vlink`, `body_alink`, `body_hlink`, `tr_color1`, `tr_color2`, `tr_color3`, `tr_class1`, `tr_class2`, `tr_class3`, `th_color1`, `th_color2`, `th_color3`, `th_class1`, `th_class2`, `th_class3`, `td_color1`, `td_color2`, `td_color3`, `td_class1`, `td_class2`, `td_class3`, `fontface1`, `fontface2`, `fontface3`, `fontsize1`, `fontsize2`, `fontsize3`, `fontcolor1`, `fontcolor2`, `fontcolor3`, `span_class1`, `span_class2`, `span_class3`, `img_size_poll`, `img_size_privmsg`, `online_color`, `offline_color`, `hidden_color`, `hidden_torrent_color`) VALUES 
     1741(1, 'main', 'main', 1, 1, 'main.css', '', 'E5E5E5', '000000', '006699', '5493B4', '', 'DD6900', 'EFEFEF', 'DEE3E7', 'D1D7DC', '', '', '', '98AAB1', '006699', 'FFFFFF', 'cellpic1.gif', 'cellpic3.gif', 'cellpic2.jpg', 'FAFAFA', 'FFFFFF', '', 'row1', 'row2', '', 'Verdana, Arial, Helvetica, sans-serif', 'Trebuchet MS', 'Courier, ''Courier New'', sans-serif', 10, 11, 12, '444444', '006600', 'FFA34F', '', '', '', NULL, NULL, '008500', 'DF0000', 'EBD400', ''), 
     1742(2, 'reflection', 'reflection', 0, 0, 'reflection.css', '', 'E5E5E5', '000000', '006699', '5493B4', '', 'DD6900', 'EFEFEF', 'DEE3E7', 'D1D7DC', '', '', '', '98AAB1', '006699', 'FFFFFF', 'cellpic1.gif', 'cellpic3.gif', 'cellpic2.jpg', 'FAFAFA', 'FFFFFF', '', 'row1', 'row2', '', 'Verdana, Arial, Helvetica, sans-serif', 'Trebuchet MS', 'Courier, \\\\''Courier New\\\\'', sans-serif', 10, 11, 12, '444444', '006600', 'FFA34F', '', '', '', 0, 0, '008500', 'DF0000', 'EBD400', 'CCCCCC'), 
     1743(3, 'bithdtv', 'bithdtv', 0, 0, 'bithdtv.css', '', 'E5E5E5', '000000', '006699', '5493B4', '', 'DD6900', 'EFEFEF', 'DEE3E7', 'D1D7DC', '', '', '', '98AAB1', '006699', 'FFFFFF', 'cellpic1.gif', 'cellpic3.gif', 'cellpic2.jpg', 'FAFAFA', 'FFFFFF', '', 'row1', 'row2', '', 'Verdana, Arial, Helvetica, sans-serif', 'Trebuchet MS', 'Courier, \\''Courier New\\'', sans-serif', 10, 11, 12, '444444', '006600', 'FFA34F', '', '', '', 0, 0, '008500', 'DF0000', 'EBD400', 'CCCCCC'); 
    17441744 
    17451745-- -------------------------------------------------------- 
     
    18881888  `birthday` date default '0000-00-00', 
    18891889  `autodemote` tinyint(1) default '1', 
    1890   `client` varchar(30) default NULL, 
    1891   `simpaty` int(10) default '0', 
    18921890  `language` varchar(255) default NULL, 
    18931891  `total_seed_time` int(11) default '0', 
     
    19011899  `notify_forum` tinyint(1) default '1', 
    19021900  `user_sig` text, 
    1903   `user_sig_bbcode_uid` varchar(10) default NULL, 
    19041901  `user_style` tinyint(3) default '0', 
    19051902  `can_leech` tinyint(4) default '1', 
     
    19191916  KEY `download` (`download`), 
    19201917  KEY `parked` (`parked`), 
    1921   KEY `client` (`client`), 
    19221918  KEY `points` (`user_reputation`), 
    19231919  KEY `class` (`class`) 
     
    19281924-- 
    19291925 
    1930 INSERT INTO `users` (`uid`, `name`, `old_password`, `pass`, `secret`, `email`, `status`, `added`, `editsecret`, `privacy`, `acceptpms`, `ip`, `class`, `avatar`, `uploaded`, `downloaded`, `title`, `country`, `notifs`, `modcomment`, `enabled`, `avatars`, `donor`, `warneduntil`, `warn`, `torrentsperpage`, `deletepms`, `savepms`, `torrent_pass`, `tzoffset`, `user_dst`, `hiddentorrents`, `parked`, `invites`, `invited_by`, `download`, `upload`, `icq`, `msn`, `aim`, `yahoo`, `skype`, `commentpm`, `gender`, `birthday`, `autodemote`, `client`, `simpaty`, `language`, `total_seed_time`, `user_reputation`, `user_reputation_level`, `user_session_time`, `user_session_page`, `user_level`, `user_posts`, `user_lastvisit`, `notify_forum`, `user_sig`, `user_sig_bbcode_uid`, `user_style`, `can_leech`, `wait_time`, `peers_limit`, `torrents_limit`, `torrent_pass_secret`, `user_unread_pms`, `user_rank_id`) VALUES 
    1931 (0, 'Anonymous', '', '', '', '', 1, 943909200, '', 1, 1, '0.0.0.0', 1, '', 0, 0, '', 0, '', '', 1, 1, 0, 0, 0, 0, 1, 0, 'fbc807cec4a079dd5add35845ec9d059', 0.00, 0, 0, 0, 0, 0, 65536, 65536, '', '', '', '', '', 1, 0, '0000-00-00', 1, '', 0, 'russian', 3600000, 0, 0, 943909200, '0', NULL, 0, 0, 1, NULL, NULL, 1, 1, 0, 0, 5, 0, 0, 0), 
    1932 (1, 'admin', '', 'd41d8cd98f00b204e9800998ecf8427e', '', 'EMAIL@ADDRESS.COM', 1, UNIX_TIMESTAMP(NOW()), '', 3, 1, '127.0.0.1', 7, '', 0, 0, '', 3, '', '', 1, 1, 0, 0, 0, 60, 1, 1, MD5(UNIX_TIMESTAMP(NOW())), 3.00, 1, 0, 0, 0, 0, 10485760, 10485760, '', '', '', '', '', 1, 0, '0000-00-00', 1, '', 0, 'english', 0, 0, 0, 0, '', 1, 0, UNIX_TIMESTAMP(NOW()), 1, '', NULL, 1, 1, 0, 0, 0, 0, 0, 0); 
     1926INSERT INTO `users` (`uid`, `name`, `old_password`, `pass`, `secret`, `email`, `status`, `added`, `editsecret`, `privacy`, `acceptpms`, `ip`, `class`, `avatar`, `uploaded`, `downloaded`, `title`, `country`, `notifs`, `modcomment`, `enabled`, `avatars`, `donor`, `warneduntil`, `warn`, `torrentsperpage`, `deletepms`, `savepms`, `torrent_pass`, `tzoffset`, `user_dst`, `hiddentorrents`, `parked`, `invites`, `invited_by`, `download`, `upload`, `icq`, `msn`, `aim`, `yahoo`, `skype`, `commentpm`, `gender`, `birthday`, `autodemote`, `language`, `total_seed_time`, `user_reputation`, `user_reputation_level`, `user_session_time`, `user_session_page`, `user_level`, `user_posts`, `user_lastvisit`, `notify_forum`, `user_sig`, `user_sig_bbcode_uid`, `user_style`, `can_leech`, `wait_time`, `peers_limit`, `torrents_limit`, `torrent_pass_secret`, `user_unread_pms`, `user_rank_id`) VALUES 
     1927(0, 'Anonymous', '', '', '', '', 1, 943909200, '', 1, 1, '0.0.0.0', 1, '', 0, 0, '', 0, '', '', 1, 1, 0, 0, 0, 0, 1, 0, 'fbc807cec4a079dd5add35845ec9d059', 0.00, 0, 0, 0, 0, 0, 65536, 65536, '', '', '', '', '', 1, 0, '0000-00-00', 1, 'russian', 3600000, 0, 0, 943909200, '0', NULL, 0, 0, 1, NULL, NULL, 1, 1, 0, 0, 5, 0, 0, 0), 
     1928(1, 'admin', '', 'd41d8cd98f00b204e9800998ecf8427e', '', 'EMAIL@ADDRESS.COM', 1, UNIX_TIMESTAMP(NOW()), '', 3, 1, '127.0.0.1', 7, '', 0, 0, '', 3, '', '', 1, 1, 0, 0, 0, 60, 1, 1, MD5(UNIX_TIMESTAMP(NOW())), 3.00, 1, 0, 0, 0, 0, 10485760, 10485760, '', '', '', '', '', 1, 0, '0000-00-00', 1, 'english', 0, 0, 0, 0, '', 1, 0, UNIX_TIMESTAMP(NOW()), 1, '', NULL, 1, 1, 0, 0, 0, 0, 0, 0); 
    19331929 
    19341930-- -------------------------------------------------------- 
     
    20152011-- 
    20162012 
     2013CREATE TABLE IF NOT EXISTS tags ( 
     2014tag_name varchar(255) NOT NULL, 
     2015tag_type tinyint(1) NOT NULL, 
     2016tag_for_id int(10) NOT NULL, 
     2017tag_count int(10) NOT NULL DEFAULT '0', 
     2018KEY tag_type (tag_type), 
     2019KEY tag_for_id (tag_for_id) 
     2020) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
     2021 
     2022CREATE TABLE IF NOT EXISTS tags_users ( 
     2023tag_users_uid int(10) NOT NULL, 
     2024tag_users_for_id int(10) NOT NULL, 
     2025tag_users_type tinyint(1) NOT NULL, 
     2026tag_users_name varchar(255) NOT NULL, 
     2027KEY tag_users_type (tag_users_type), 
     2028KEY tag_users_for_id (tag_users_for_id), 
     2029KEY tag_users_uid (tag_users_uid) 
     2030) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
  • tags.php

    r241 r269  
    22$root_path = './'; 
    33require ($root_path . 'include/config.php'); 
    4 require ($root_path . 'include/functions_post.php'); 
     4require ($root_path . 'include/bbcode/bbcode.lib.php'); 
    55 
    66$userdata = session_pagestart($user_ip); 
     
    99 
    1010require_once ($root_path . 'languages/lang_' . $userdata['language'] . '/lang_bbcode.php'); 
     11 
     12/* */ 
     13$bb_code = new bbcode; 
     14/* */ 
    1115 
    1216$test = request_var('test', ''); 
     
    1721); 
    1822 
    19 if ($test) { 
     23if ( $test ) { 
     24 
     25        $bb_code->parse($test); 
     26        $test = $bb_code->get_html(); 
     27 
    2028        $template->assign_block_vars('test_zone', array( 
    21                 'FORMATTED_TEST' => format_comment($test)) 
    22         ); 
     29                'FORMATTED_TEST' => $test 
     30               )); 
    2331} 
    2432for ($i = 0; $i < sizeof($bbcode_faq_lang); $i++) { 
    2533 
    26         $result = format_comment($bbcode_faq_lang[$i][3]); 
     34        $result = $bbcode_faq_lang[$i][3]; 
     35        $bb_code->parse($result); 
     36        $result = $bb_code->get_html(); 
     37 
    2738        $template->assign_block_vars('tags_row', array( 
    2839                'NAME' => $bbcode_faq_lang[$i][0], 
    29                 'RESULT' => format_comment($bbcode_faq_lang[$i][3])
     40                'RESULT' => $result
    3041                'DESCRIPTION' => $bbcode_faq_lang[$i][1], 
    3142                'SYNTAX' => $bbcode_faq_lang[$i][2], 
  • templates/bithdtv/bbcode.html

    r225 r269  
    1 <!-- BEGIN ulist_open --><ul class="liststyle"><!-- END ulist_open --> 
    2 <!-- BEGIN ulist_open_default --><ul><!-- END ulist_open_default --> 
    3 <!-- BEGIN ulist_close --></ul><!-- END ulist_close --> 
    4  
    5 <!-- BEGIN olist_open --><ol style="list-style-type: {LIST_TYPE}"><!-- END olist_open --> 
    6 <!-- BEGIN olist_close --></ol><!-- END olist_close --> 
    7  
    8 <!-- BEGIN listitem --><li><!-- END listitem --> 
    9 <!-- BEGIN listitem_close --></li><!-- END listitem_close --> 
    10  
    111<!-- BEGIN quote_username_open --> 
    122<div class="quotetitle">{USERNAME} {L_POSTED}:</div><div class="quotecontent"> 
     
    2010</div> 
    2111<!-- END quote_close --> 
     12 
     13<!-- BEGIN spoiler_header_open --> 
     14<div class="quotetitle"><a href="javascript:;" onclick="$(this).parents('div:first').next('div').toggle('slow');">{TEXT}:</a></div><div class="quotecontent" style="display:none;"> 
     15<!-- END spoiler_header_open --> 
     16 
     17<!-- BEGIN spoiler_open --> 
     18<div class="quotetitle"><a href="javascript:;" onclick="$(this).parents('div:first').next('div').toggle('slow');">{L_SPOILER}:</a></div><div class="quotecontent" style="display:none"> 
     19<!-- END spoiler_open --> 
     20 
     21<!-- BEGIN spoiler_close --> 
     22</div> 
     23<!-- END spoiler_close --> 
    2224 
    2325<!-- BEGIN pre --> 
     
    3335<!-- END code_close --> 
    3436 
    35 <!-- BEGIN offtop_open --></span> 
    36 <span class="offtop"><b>{L_OFFTOP}:</b><!-- END offtop_open --
    37 <!-- BEGIN offtop_close --></span
    38 <span class="postbody"><!-- END offtop_close --> 
     37<!-- BEGIN offtop_open --> 
     38</span
     39<span class="offtop"><b>{L_OFFTOP}:</b
     40<!-- END offtop_open --> 
    3941 
    40 <!-- BEGIN b_open --><strong><!-- END b_open --> 
    41 <!-- BEGIN b_close --></strong><!-- END b_close --> 
    42  
    43 <!-- BEGIN u_open --><u><!-- END u_open --> 
    44 <!-- BEGIN u_close --></u><!-- END u_close --> 
    45  
    46 <!-- BEGIN i_open --><em><!-- END i_open --> 
    47 <!-- BEGIN i_close --></em><!-- END i_close --> 
    48  
    49 <!-- BEGIN color_open --><span style="color: {COLOR}"><!-- END color_open --> 
    50 <!-- BEGIN color_close --></span><!-- END color_close --> 
    51  
    52 <!-- BEGIN size_open --><span style="font-size: {SIZE}px; line-height: normal"><!-- END size_open --> 
    53 <!-- BEGIN size_close --></span><!-- END size_close --> 
    54  
    55 <!-- BEGIN font --><span style="font-family: {FONT_FAMILY};">{CONTENT}</span><!-- END font --> 
    56  
    57 <!-- BEGIN img --><img src="{URL}" alt="" onload="imgFit(this, 500);" onclick="imgFit(this, 500);" /><!-- END img --> 
    58  
    59 <!-- BEGIN url --><a href="{URL}" target="_blank">{DESCRIPTION}</a><!-- END url --> 
    60  
    61 <!-- BEGIN email --><a href="mailto:{EMAIL}">{DESCRIPTION}</a><!-- END email --> 
     42<!-- BEGIN offtop_close --> 
     43</span><br /> 
     44<span class="postbody"> 
     45<!-- END offtop_close --> 
    6246 
    6347<!-- BEGIN mod_username_open --> 
     
    8367<!-- END mod_close --> 
    8468 
    85 <!-- BEGIN thmbimg --> 
    86 <div align="{ALIGN}"> 
    87  <table border="0"> 
    88   <tr> 
    89    <td><img src="{IMAGE}" align="center" border="0" {SIZE}  onclick="window.open( '{IMAGE}', 'imgpop',  'width={WIDTH},height={HEIGHT},status=no,toolbar=no,menubar=no' );return false" /></td> 
    90   </tr> 
    91   <tr> 
    92    <td align="center" class="gensmall"><i>{NOTICE}</i></td> 
    93   </tr> 
    94  </table> 
    95 </div> 
    96 <!-- END thmbimg --> 
    97  
    9869<!-- BEGIN flash --> 
    9970        <object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=5,0,0,0" width="{WIDTH}" height="{HEIGHT}"> 
  • templates/bithdtv/bithdtv.cfg

    r87 r269  
    139139$config['vote_graphic_length'] = 300; 
    140140 
     141$config['min_tag_size'] = '11'; //min tag size in pixeils 
     142$config['max_tag_size'] = '25'; //max tag size in pixeils 
     143 
    141144// Start add - Online/Offline/Hidden Mod 
    142145$images['icon_online'] = $current_template_images . '/{LANG}/icon_online.png'; 
  • templates/bithdtv/bithdtv.css

    r240 r269  
    667667a.postlink:hover { text-decoration: underline; color : #DD6900} 
    668668 
    669 /* Quote & Code blocks */ 
     669/* Copyright and bottom info */ 
     670.copyright              { font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #444444; letter-spacing: -1px;} 
     671a.copyright             { color: #444444; text-decoration: none;} 
     672a.copyright:hover { color: #000000; text-decoration: underline;} 
     673 
     674/* The text input fields background colour */ 
     675input.post, textarea.post, select { 
     676        background-color : #FFFFFF; 
     677
     678 
     679/* The main submit button option */ 
     680input.mainoption { 
     681        background-color : #FAFAFA; 
     682        font-weight : bold; 
     683
     684 
     685/* None-bold submit button */ 
     686input.liteoption { 
     687        background-color : #FAFAFA; 
     688        font-weight : normal; 
     689
     690 
     691/* This is the line in the posting page which shows the rollover 
     692  help line. This is actually a text box, but if set to be the same 
     693  colour as the background no one will know ;) 
     694*/ 
     695.helpline { background-color: #DEE3E7; border-style: none; } 
     696/* Set Image style */ 
     697img, .forumline img { 
     698        border: 0; 
     699
     700/* Begin Simple Subforums MOD */ 
     701a.topic-new, a.topic-new:visited { color: #DD6900; } 
     702a.topic-new:hover, a.topic-new:active { color: #006699; } 
     703/* End Simple Subforums MOD */ 
     704 
     705.mod { 
     706    margin: 10px 5px 0px 5px; 
     707    line-height: 125%; 
     708    font-size:10px; background-color:#FFFFFF; 
     709    border-color: #A9B8C2; 
     710        border-width: 1px 1px 1px 1px; 
     711        border-style: solid; 
     712
     713.modtable { 
     714    background-color: #ff6060; 
     715        height:50px; width: 40px; 
     716        text-align:center; 
     717
     718.exclamation { 
     719    font-weight: bold; 
     720        font-family: Times New Roman, Verdana; 
     721        font-size : 45px; 
     722        color: #ffffff; 
     723
     724/*  Mail.ru Keyboard buttons styles 
     725*/ 
     726.b30 { width: 18px; background-color : white; } 
     727.b80 { width: 70px; background-color : white; } 
     728.b100 { width: 80px; background-color : white; } 
     729.b300 { width: 250px; background-color : white; } 
     730 
     731.pager_page { 
     732        padding:2px; 
     733        font-weight:bold; 
     734
     735 
     736.pager_page_selected { 
     737        padding:2px; 
     738        font-weight:bold; 
     739
     740 
     741a.upReputationLink:link, 
     742a.upReputationLink:visited 
     743
     744    font-size: 1em; 
     745    line-height: 10px; 
     746    background: transparent url(images/arrow-up-v2.gif) no-repeat 0 1px; 
     747    padding: 3px 6px; 
     748    text-decoration: none; 
     749
     750 
     751a.upReputationLink:hover, 
     752a.upReputationLink:active 
     753
     754    background: transparent url(images/arrow-up-v2.gif) no-repeat 0 -15px; 
     755
     756 
     757a.downReputationLink:link, 
     758a.downReputationLink:visited 
     759
     760    font-size: 1em; 
     761    line-height: 10px; 
     762    background: transparent url(images/arrow-down-v2.gif) no-repeat 0 1px; 
     763    padding: 3px 6px; 
     764    text-decoration: none; 
     765
     766 
     767a.downReputationLink:hover, 
     768a.downReputationLink:active 
     769
     770    background: transparent url(images/arrow-down-v2.gif) no-repeat 0 -15px; 
     771
     772 
     773span.goodResp 
     774
     775    background: #D6FEDB; 
     776    border: 1px solid #B6C9B9; 
     777    padding: 1px 3px 2px 3px; 
     778
     779 
     780span.badResp 
     781
     782    background: #FED5CD; 
     783    border: 1px solid #D0AEAE; 
     784    padding: 1px 3px 2px 3px; 
     785
     786 
     787.usergoodResp 
     788
     789    color: #009900; 
     790
     791 
     792.userbadResp 
     793
     794    color: #ff3300; 
     795
     796 
     797.respectUserList { 
     798        border-top:1px solid; 
     799        white-space: normal; 
     800
     801 
     802span.goodUserResp 
     803
     804    background: #ff9933; 
     805    border: 1px solid #ff6600; 
     806    padding: 0 3px 0 3px; 
     807    color: #ffffff; 
     808
     809 
     810span.badUserResp 
     811
     812    background: #ff6600; 
     813    border: 1px solid #cc6600; 
     814    padding: 0 3px 0 3px; 
     815    color: #ffffff; 
     816
     817 
     818/* bb tags */ 
    670819.codetitle { 
    671820        margin: 10px 5px 0px 5px; 
     
    727876} 
    728877 
    729 .liststyle { 
    730         margin-left:20px; 
    731 
    732  
    733 /* Copyright and bottom info */ 
    734 .copyright              { font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #444444; letter-spacing: -1px;} 
    735 a.copyright             { color: #444444; text-decoration: none;} 
    736 a.copyright:hover { color: #000000; text-decoration: underline;} 
    737  
    738 /* The text input fields background colour */ 
    739 input.post, textarea.post, select { 
    740         background-color : #FFFFFF; 
    741 
    742  
    743 /* The main submit button option */ 
    744 input.mainoption { 
    745         background-color : #FAFAFA; 
    746         font-weight : bold; 
    747 
    748  
    749 /* None-bold submit button */ 
    750 input.liteoption { 
    751         background-color : #FAFAFA; 
    752         font-weight : normal; 
    753 
    754  
    755 /* This is the line in the posting page which shows the rollover 
    756   help line. This is actually a text box, but if set to be the same 
    757   colour as the background no one will know ;) 
    758 */ 
    759 .helpline { background-color: #DEE3E7; border-style: none; } 
    760 /* Set Image style */ 
    761 img, .forumline img { 
    762         border: 0; 
    763 
    764 /* Begin Simple Subforums MOD */ 
    765 a.topic-new, a.topic-new:visited { color: #DD6900; } 
    766 a.topic-new:hover, a.topic-new:active { color: #006699; } 
    767 /* End Simple Subforums MOD */ 
    768  
    769 .mod { 
    770     margin: 10px 5px 0px 5px; 
    771     line-height: 125%; 
    772     font-size:10px; background-color:#FFFFFF; 
    773     border-color: #A9B8C2; 
    774         border-width: 1px 1px 1px 1px; 
    775         border-style: solid; 
    776 
    777 .modtable { 
    778     background-color: #ff6060; 
    779         height:50px; width: 40px; 
    780         text-align:center; 
    781 
    782 .exclamation { 
    783     font-weight: bold; 
    784         font-family: Times New Roman, Verdana; 
    785         font-size : 45px; 
    786         color: #ffffff; 
    787 
    788 /*  Mail.ru Keyboard buttons styles 
    789 */ 
    790 .b30 { width: 18px; background-color : white; } 
    791 .b80 { width: 70px; background-color : white; } 
    792 .b100 { width: 80px; background-color : white; } 
    793 .b300 { width: 250px; background-color : white; } 
    794  
    795 .pager_page { 
    796         padding:2px; 
    797         font-weight:bold; 
    798 
    799  
    800 .pager_page_selected { 
    801         padding:2px; 
    802         font-weight:bold; 
    803 
    804  
    805 a.upReputationLink:link, 
    806 a.upReputationLink:visited 
    807 
    808     font-size: 1em; 
    809     line-height: 10px; 
    810     background: transparent url(images/arrow-up-v2.gif) no-repeat 0 1px; 
    811     padding: 3px 6px; 
    812     text-decoration: none; 
    813 
    814  
    815 a.upReputationLink:hover, 
    816 a.upReputationLink:active 
    817 
    818     background: transparent url(images/arrow-up-v2.gif) no-repeat 0 -15px; 
    819 
    820  
    821 a.downReputationLink:link, 
    822 a.downReputationLink:visited 
    823 
    824     font-size: 1em; 
    825     line-height: 10px; 
    826     background: transparent url(images/arrow-down-v2.gif) no-repeat 0 1px; 
    827     padding: 3px 6px; 
    828     text-decoration: none; 
    829 
    830  
    831 a.downReputationLink:hover, 
    832 a.downReputationLink:active 
    833 
    834     background: transparent url(images/arrow-down-v2.gif) no-repeat 0 -15px; 
    835 
    836  
    837 span.goodResp 
    838 
    839     background: #D6FEDB; 
    840     border: 1px solid #B6C9B9; 
    841     padding: 1px 3px 2px 3px; 
    842 
    843  
    844 span.badResp 
    845 
    846     background: #FED5CD; 
    847     border: 1px solid #D0AEAE; 
    848     padding: 1px 3px 2px 3px; 
    849 
    850  
    851 .usergoodResp 
    852 
    853     color: #009900; 
    854 
    855  
    856 .userbadResp 
    857 
    858     color: #ff3300; 
    859 
    860  
    861 .respectUserList { 
    862         border-top:1px solid; 
    863         white-space: normal; 
    864 
    865  
    866 span.goodUserResp 
    867 
    868     background: #ff9933; 
    869     border: 1px solid #ff6600; 
    870     padding: 0 3px 0 3px; 
    871     color: #ffffff; 
    872 
    873  
    874 span.badUserResp 
    875 
    876     background: #ff6600; 
    877     border: 1px solid #cc6600; 
    878     padding: 0 3px 0 3px; 
    879     color: #ffffff; 
    880 
     878ul.bb, ol.bb { 
     879        padding-left:25px; 
     880
     881 
     882.jqifade{ 
     883      position: absolute; 
     884      background-color: #aaaaaa; 
     885
     886div.jqi{ 
     887      width: 400px; 
     888      font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; 
     889      position: absolute; 
     890      background-color: #ffffff; 
     891      font-size: 11px; 
     892      text-align: left; 
     893      border: solid 1px #eeeeee; 
     894      -moz-border-radius: 10px; 
     895      -webkit-border-radius: 10px; 
     896      padding: 7px; 
     897
     898div.jqi .jqicontainer{ 
     899      font-weight: bold; 
     900
     901div.jqi .jqiclose{ 
     902      position: absolute; 
     903      top: 4px; right: -2px; 
     904      width: 18px; 
     905      cursor: default; 
     906      color: #bbbbbb; 
     907      font-weight: bold; 
     908
     909div.jqi .jqimessage{ 
     910      padding: 10px; 
     911      line-height: 20px; 
     912      color: #444444; 
     913
     914div.jqi .jqibuttons{ 
     915      text-align: right; 
     916      padding: 5px 0 5px 0; 
     917      border: solid 1px #eeeeee; 
     918      background-color: #f4f4f4; 
     919
     920div.jqi button{ 
     921      padding: 3px 10px; 
     922      margin: 0 10px; 
     923      background-color: #2F6073; 
     924      border: solid 1px #f4f4f4; 
     925      color: #ffffff; 
     926      font-weight: bold; 
     927      font-size: 12px; 
     928
     929div.jqi button:hover{ 
     930      background-color: #728A8C; 
     931
     932div.jqi button.jqidefaultbutton{ 
     933      background-color: #BF5E26; 
     934
     935.jqiwarning .jqi .jqibuttons{ 
     936      background-color: #BF5E26; 
     937
     938 
     939.ac_results { 
     940        padding: 0px; 
     941        border: 1px solid WindowFrame; 
     942        background-color: Window; 
     943        overflow: hidden; 
     944
     945 
     946.ac_results ul { 
     947        width: 100%; 
     948        list-style-position: outside; 
     949        list-style: none; 
     950        padding: 0; 
     951        margin: 0; 
     952
     953 
     954.ac_results iframe { 
     955        display:none;/*sorry for IE5*/ 
     956        display/**/:block;/*sorry for IE5*/ 
     957        position:absolute; 
     958        top:0; 
     959        left:0; 
     960        z-index:-1; 
     961        filter:mask(); 
     962        width:3000px; 
     963        height:3000px; 
     964
     965 
     966.ac_results li { 
     967        margin: 0px; 
     968        padding: 2px 5px; 
     969        cursor: pointer; 
     970        display: block; 
     971        width: 100%; 
     972        font: menu; 
     973        font-size: 12px; 
     974        overflow: hidden; 
     975
     976 
     977.ac_over { 
     978        background-color: Highlight; 
     979        color: HighlightText; 
     980
  • templates/bithdtv/browse.html

    r259 r269  
    2828<table width=700 class=main border=0 cellpadding=5> 
    2929        <tr> 
    30                 <td class=detail align=center width=35%><b>{L_SEARCH} </b><input type="text" name="search" size="35" value="{SEARCH_STRING}" onmouseover="return overlib('{L_JS_SEARCH_EXPLAIN}');" onmouseout="return nd();" /></td> 
     30                <td class=detail align=center width=35%><b>{L_SEARCH} </b><input type="text" name="search" size="35" value="{SEARCH_STRING}" onmouseover="return overlib(L_JS_SEARCH_EXPLAIN);" onmouseout="return nd();" /></td> 
    3131                <td class=detail align=center width=28%><b>{L_IN} </b>{CAT_DROP_DOWN}</td> 
    32                 <td class=detail align=center width=17%><b>{L_IN} </b><select name="search_in"><option value="1" {SEARCH_IN_CHECKED_1}>{L_NAME}</option><option value="2" {SEARCH_IN_CHECKED_2}>{L_DESCRIPTION}</option></select></td> 
     32                <td class=detail align=center width=17%><b>{L_IN} </b>{SEARCH_IN_SELECT}</td> 
    3333    <tr> 
    3434        <td colspan=5 align=center><input type="submit" value="{L_SEARCH}" /></td> 
  • templates/bithdtv/details.html

    r259 r269  
    33<script type="text/javascript" src="{ROOT_PATH}js/ajax.js"></script> 
    44<script type="text/javascript" src="{ROOT_PATH}js/ajax_common.js"></script> 
    5 <script type="text/javascript"> 
    6 var sos_confirm = '{L_SOS_CONFIRM}'; 
    7 var simpaty_descr = '{L_SIMPATY_DESCR}'; 
    8 var resp = '{L_RESPECT}'; 
    9 var antiresp = '{L_ANTIRESPECT}'; 
    10 var L_JS_SEE_FULL_LIST = '{L_SEE_FULL_LIST}'; 
    11 var L_JS_HIDE_LIST = '{L_HIDE_LIST}'; 
    12 </script> 
    135 
    14 <!-- BEGIN torrent_details --> 
    156<!-- IF MESSAGE1 --><h1>{MESSAGE1}</h1><!-- ENDIF --> 
    167<!-- IF MESSAGE2 --><p>{MESSAGE2}</p><!-- ENDIF --> 
     
    4031        </tr> 
    4132        <!-- END switch_nfo_section --> 
    42         <!-- BEGIN switch_banned_section --> 
     33        <!-- IF S_USER_IS_MOD --> 
    4334        <tr> 
    4435        <td class="detail" valign="top" align="right">{L_BANNED}</td> 
    4536        <td class="detail" valign="top" align="left">{BANNED}</td> 
    4637        </tr> 
    47         <!-- END switch_banned_section --> 
     38        <!-- ENDIF --> 
    4839        <tr> 
    4940        <td class="detail" valign="top" align="right">{L_TYPE}</td> 
    5041        <td class="detail" valign="top" align="left">{TYPE}</td> 
     42        </tr> 
     43        <tr> 
     44        <td class="detail" valign="top" align="right">{L_TAGS}</td> 
     45        <td class="detail" valign="top" align="left"><!-- INCLUDE tags_view_form.html --></td> 
    5146        </tr> 
    5247        <tr> 
     
    6459        <select name="rating" id="rating_select"> 
    6560        <option value="0">({L_ADD_RATING})</option> 
    66         {torrent_details.switch_rating_form.RATING_OPTIONS} 
     61        {switch_rating_form.RATING_OPTIONS} 
    6762        </select> 
    6863        <input type="button" value="{L_VOTE}!" onclick="rating('{ID}', document.getElementById('rating_select').value );return false;" id="rating_button"  /> 
     
    8681                <td class="detail" valign="top" align="right"><a name="snatchedlist" id="snatchedlist"></a>{L_SNATCHED_USERS}<br /> 
    8782                    <a href="javascript:void(0);" onclick="view_details_ext('snatchedlist', '{ID}', 'details');" id="snatchedlist_href">[<!-- IF SNATCHEDLIST_TPL -->{L_HIDE_LIST}<!-- ELSE -->{L_SEE_FULL_LIST}<!-- ENDIF -->]</a></td> 
    88                 <td class="detail" valign="top" align="left">{torrent_details.switch_simple_snatched.SIMPLE_SNATCHED_COUNT}<div id="snatchedlist_row">{SNATCHEDLIST_TPL}</div></td> 
     83                <td class="detail" valign="top" align="left">{switch_simple_snatched.SIMPLE_SNATCHED_COUNT}<div id="snatchedlist_row">{SNATCHEDLIST_TPL}</div></td> 
    8984        </tr> 
    9085        <!-- END switch_simple_snatched --> 
     
    127122        </tr> 
    128123        <!-- END switch_sos_section --> 
    129         <tr> 
    130         <td class="detail" valign="top" align="right">{L_THANKS_USERS}</td> 
    131             <td class="detail" valign="top" align="left"> 
    132         <!-- BEGIN switch_thanks --> 
    133             <input type="button" id="thanks_button" value="{L_THANKS}"  onclick="thanks('{ID}', <!-- IF torrent_details.switch_thanks.THANKS_USERS -->1<!-- ELSE -->0<!-- ENDIF -->);return false;" {torrent_details.switch_thanks.DISABLED} /> 
    134         <span id="thanks_users"><!-- IF torrent_details.switch_thanks.THANKS_USERS -->{torrent_details.switch_thanks.THANKS_USERS}<!-- ELSE -->{L_NO_THANKS}<!-- ENDIF --></span> 
    135             <!-- END switch_thanks --> 
    136         </td> 
    137         </tr> 
     124 
     125  <tr> 
     126    <td class="detail" valign="top" align="right">{L_THANKS_USERS}</td> 
     127    <td class="detail" valign="top" align="left"><input type="button" id="thanks_button" value="{L_THANKS}"  onclick="thanks('{ID}', 0);return false;" /> 
     128    <a href="javascript:;" onclick="view_details_ext('thanks', '{ID}', 'details');" id="thanks_href">[{L_SEE_FULL_LIST}]</a><div id="thanks_row"></div></td> 
     129  </tr> 
     130 
    138131</table> 
    139 <!-- END torrent_details --> 
    140132 
    141  
    142 <!-- BEGIN switch_comments_details_head --> 
    143  
    144 <h1>{switch_comments_details_head.COMMENTS_FOR}</h1> 
    145 <!-- END switch_comments_details_head --> 
    146 <br /> 
    147 <!-- BEGIN switch_no_comments_details --> 
    148 <h1>{L_NO_COMMENTS_YET}</h1> 
    149 <!-- IF switch_no_comments_details.DISABLE_COMMENTS == 0 --><a href="{switch_no_comments_details.U_ADD_COMMENT}">{switch_no_comments_details.L_ADD_NEW_COMMENT}</a> 
    150 &nbsp;&nbsp;&nbsp;&nbsp; 
    151 <!-- IF switch_no_comments_details.U_CHECK --><a href="{switch_no_comments_details.U_CHECK}">{switch_no_comments_details.CHECK_TITLE}</a><!-- ENDIF --><!-- ELSE -->{L_COMMENTS_DISABLED}<!-- ENDIF --> 
     133<!-- INCLUDE details_comments.html --> 
    152134 
    153135<!-- INCLUDE overall_footer.html --> 
    154  
    155 <!-- END switch_no_comments_details --> 
    156  
    157  
    158 <!-- BEGIN switch_comments_details --> 
    159 <!-- IF switch_comments_details.DISABLE_COMMENTS == 0 --><a href="{switch_comments_details.U_ADD_COMMENT}">{switch_comments_details.L_ADD_NEW_COMMENT}</a> 
    160 &nbsp;&nbsp;&nbsp;&nbsp; 
    161 <!-- IF switch_comments_details.U_CHECK --><a href="{switch_comments_details.U_CHECK}">{switch_comments_details.CHECK_TITLE}</a><!-- ENDIF --><!-- ELSE -->{L_COMMENTS_DISABLED}<!-- ENDIF --> 
    162 <br /> 
    163 {switch_comments_details.PAGERTOP} 
    164 <br /> 
    165 <a name="startcomments" id="startcomments"></a> 
    166 {COMMENTS_TABLE} 
    167 {switch_comments_details.PAGERBOTTOM} 
    168 <!-- IF switch_comments_details.DISABLE_COMMENTS == 0 --><a href="{switch_comments_details.U_ADD_COMMENT}">{switch_comments_details.L_ADD_NEW_COMMENT}</a> 
    169 &nbsp;&nbsp;&nbsp;&nbsp; 
    170 <!-- IF switch_comments_details.U_CHECK --><a href="{switch_comments_details.U_CHECK}">{switch_comments_details.CHECK_TITLE}</a><!-- ENDIF --><!-- ELSE -->{L_COMMENTS_DISABLED}<!-- ENDIF --> 
    171  
    172 <!-- INCLUDE overall_footer.html --> 
    173 <!-- END switch_comments_details --> 
  • templates/bithdtv/forum/index_body.tpl

    r87 r269  
    88        </td> 
    99        <td align="right" valign="bottom"> 
    10                 <!-- BEGIN switch_curuser_view --> 
     10                <!-- IF S_USER_LOGGED_IN --> 
    1111                <a href="{U_SEARCH_NEW}" class="gensmall">{L_SEARCH_NEW}</a><br /><a href="{U_SEARCH_SELF}" class="gensmall">{L_SEARCH_YOUR_POSTS}</a><br /> 
    12                 <!-- END switch_curuser_view --> 
     12                <!-- ENDIF --> 
    1313                <a href="{U_SEARCH_UNANSWERED}" class="gensmall">{L_SEARCH_UNANSWERED}</a></td> 
    1414  </tr> 
     
    4949  <tr> 
    5050        <td align="left"> 
    51         <!-- BEGIN switch_curuser_view --> 
     51        <!-- IF S_USER_LOGGED_IN --> 
    5252        <span class="gensmall"><a href="{U_MARK_READ}" class="gensmall">{L_MARK_ALL_FORUMS}</a></span> 
    53          <!-- END switch_curuser_view --> 
     53         <!-- ENDIF --> 
    5454        </td> 
    5555        <td align="right"><span class="gensmall">{S_TIMEZONE}</span></td> 
  • templates/bithdtv/forum/modcp_delete_posts.tpl

    r87 r269  
    3131                <table width="100%" cellspacing="0" cellpadding="3" border="0"> 
    3232                  <tr> 
    33                         <td valign="middle" class="{postrow.ROW_CLASS}" align="left"><img src="templates/main/images/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_POSTED}: 
     33                        <td valign="middle" class="{postrow.ROW_CLASS}" align="left"><img src="templates/main/images/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_ADDED}: 
    3434                          {postrow.POST_DATE}&nbsp;&nbsp;&nbsp;&nbsp;{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 
    3535                  </tr> 
  • templates/bithdtv/forum/modcp_split.tpl

    r87 r269  
    5252                <table width="100%" cellspacing="0" cellpadding="3" border="0"> 
    5353                  <tr> 
    54                         <td valign="middle" class="{postrow.ROW_CLASS}" align="left"><img src="templates/main/images/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_POSTED}: 
     54                        <td valign="middle" class="{postrow.ROW_CLASS}" align="left"><img src="templates/main/images/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_ADDED}: 
    5555                          {postrow.POST_DATE}&nbsp;&nbsp;&nbsp;&nbsp;{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 
    5656                  </tr> 
  • templates/bithdtv/forum/posting_body.tpl

    r259 r269  
    372372                                          <option style="color:black; background-color: {T_TD_COLOR1}" value="black" class="genmed">{L_COLOR_BLACK}</option> 
    373373                                        </select> &nbsp;<select name="addbbcodefontsize" onChange="bbfontstyle('[size=' + this.form.addbbcodefontsize.options[this.form.addbbcodefontsize.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;" onMouseOver="helpline('f')"> 
    374                                                               <option value="0" selected="selected">{L_TEXT_SIZE}</option> 
    375                                           <option value="7" class="genmed">{L_FONT_TINY}</option> 
    376                                           <option value="9" class="genmed">{L_FONT_SMALL}</option> 
    377                                           <option value="12" class="genmed">{L_FONT_NORMAL}</option> 
    378                                           <option value="18" class="genmed">{L_FONT_LARGE}</option> 
    379                                           <option  value="24" class="genmed">{L_FONT_HUGE}</option> 
     374                                                              <option value="0" selected="selected">{L_FONT_SIZE}</option> 
     375                                          <option value="1" class="genmed">{L_FONT_TINY}</option> 
     376                                          <option value="2" class="genmed">{L_FONT_SMALL}</option> 
     377                                          <option value="3" class="genmed">{L_FONT_NORMAL}</option> 
     378                                          <option value="5" class="genmed">{L_FONT_LARGE}</option> 
     379                                          <option  value="7" class="genmed">{L_FONT_HUGE}</option> 
    380380                                        </select> 
    381381                                        </span></td> 
  • templates/bithdtv/forum/posting_preview.tpl

    r87 r269  
    11<table class="forumline" width="100%" cellspacing="1" cellpadding="4" border="0"> 
    2         <tr>  
     2        <tr> 
    33                <th height="25" class="thHead">{L_PREVIEW}</th> 
    44        </tr> 
    5         <tr>  
    6                 <td class="row1" align="left"><img src="templates/main/images/icon_minipost.gif" alt="{L_POST}" /><span class="postdetails">{L_POSTED}: {POST_DATE} &nbsp;&nbsp;&nbsp; {L_POST_SUBJECT}: {POST_SUBJECT}</span></td> 
     5        <tr> 
     6                <td class="row1" align="left"><img src="templates/main/images/icon_minipost.gif" alt="{L_POST}" /><span class="postdetails">{L_ADDED}: {POST_DATE} &nbsp;&nbsp;&nbsp; {L_POST_SUBJECT}: {POST_SUBJECT}</span></td> 
    77        </tr> 
    8         <tr>  
     8        <tr> 
    99                <td class="row1"><table width="100%" border="0" cellspacing="0" cellpadding="0"> 
    1010                        <tr> 
     
    1515                </table></td> 
    1616        </tr> 
    17         <tr>  
     17        <tr> 
    1818                <td class="spaceRow" height="1"><img src="templates/main/images/spacer.gif" width="1" height="1" /></td> 
    1919        </tr> 
  • templates/bithdtv/forum/posting_topic_review.tpl

    r87 r269  
    1919                <td class="{postrow.ROW_CLASS}" height="28" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> 
    2020                        <tr> 
    21                                 <td width="100%"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_POSTED}: {postrow.POST_DATE}<span class="gen">&nbsp;</span>&nbsp;&nbsp;&nbsp;{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 
     21                                <td width="100%"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_ADDED}: {postrow.POST_DATE}<span class="gen">&nbsp;</span>&nbsp;&nbsp;&nbsp;{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 
    2222                        </tr> 
    2323                        <tr> 
  • templates/bithdtv/forum/search_results_posts.tpl

    r87 r269  
    2828          {L_VIEWS}: <b>{searchresults.TOPIC_VIEWS}</b></span><br /> 
    2929        </td> 
    30         <td width="100%" valign="top" class="row1" align="left"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_FORUM}:&nbsp;<b><a href="{searchresults.U_FORUM}" class="postdetails">{searchresults.FORUM_NAME}</a></b>&nbsp; &nbsp;{L_POSTED}: {searchresults.POST_DATE}&nbsp; &nbsp;{L_SUBJECT}: <b><a href="{searchresults.U_POST}">{searchresults.POST_SUBJECT}</a></b></span></td> 
     30        <td width="100%" valign="top" class="row1" align="left"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_FORUM}:&nbsp;<b><a href="{searchresults.U_FORUM}" class="postdetails">{searchresults.FORUM_NAME}</a></b>&nbsp; &nbsp;{L_ADDED}: {searchresults.POST_DATE}&nbsp; &nbsp;{L_SUBJECT}: <b><a href="{searchresults.U_POST}">{searchresults.POST_SUBJECT}</a></b></span></td> 
    3131  </tr> 
    3232  <tr> 
  • templates/bithdtv/forum/topic_search_results.tpl

    r87 r269  
    2626          <br /> 
    2727        </td> 
    28         <td width="100%" valign="top" class="row1" align="left"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails">&nbsp;{L_POSTED}: {searchresults.POST_DATE}&nbsp;</span></td> 
     28        <td width="100%" valign="top" class="row1" align="left"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails">&nbsp;{L_ADDED}: {searchresults.POST_DATE}&nbsp;</span></td> 
    2929  </tr> 
    3030  <tr> 
  • templates/bithdtv/forum/viewtopic_body.tpl

    r259 r269  
    8585                <td class="{postrow.ROW_CLASS}" height="28" valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"> 
    8686                        <tr> 
    87                                 <td class="{postrow.ROW_CLASS}" align="left"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails">{L_POSTED}: {postrow.POST_DATE}<span class="gen">&nbsp;</span>&nbsp; &nbsp;{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 
     87                                <td class="{postrow.ROW_CLASS}" align="left"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails">{L_ADDED}: {postrow.POST_DATE}<span class="gen">&nbsp;</span>&nbsp; &nbsp;{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 
    8888                                <td valign="top" nowrap="nowrap" class="{postrow.ROW_CLASS}" align="right">{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}</td> 
    8989                        </tr> 
  • templates/bithdtv/overall_header.html

    r260 r269  
    1212<link href="{TEMPLATE_PATH}/bithdtv.css" rel="stylesheet" type="text/css" media="screen" /> 
    1313<script type="text/javascript" src="{ROOT_PATH}js/functions.js"></script> 
     14<script type="text/javascript" src="{ROOT_PATH}js/jquery.js"></script> 
    1415<script type="text/javascript"> 
    15         var sizes_ary = {'{L_KILOBYTES}':1024,'{L_MEGABYTES}':1024*1024,'{L_GIGABYTES}':1024*1024*1024,'{L_TERABYTES}':1024*1024*1024*1024}; 
    1616        var SID = '{SID}'; 
    1717        var TRACKER_URL = '{ROOT_PATH}'; 
    18         var l_post_something = '{L_POST_SOMETHING}'; 
    19         var L_JS_MARKED = '{L_MARKED}'; 
    2018        var ol_fgcolor = "#FFFFFF"; 
     19 
     20        <!-- BEGIN javascript_lang --> 
     21        var {javascript_lang.KEY} = '{javascript_lang.VALUE}'; 
     22        <!-- END --> 
    2123</script> 
    2224</head> 
     
    2830                        <div id="logo"> 
    2931                        <table width="852"> 
    30                         <!-- BEGIN switch_curuser_view --> 
     32                        <!-- IF S_USER_LOGGED_IN --> 
    3133                                <tr> 
    3234                                        <td class="btnbg2" align="center"><a href="{U_MY}">{L_CONTROL_PANEL}</a></td> 
     
    5860                                        <td class="btnbg2" align="center"><a href="{U_DONATE}">{L_DONATE}</a></td> 
    5961                                </tr> 
    60                                 <!-- END switch_curuser_view --> 
     62                                <!-- ENDIF --> 
    6163 
    62                                 <!-- BEGIN switch_moderator_view --> 
     64                                <!-- IF S_USER_IS_MOD --> 
    6365                                <tr> 
    6466                                        <td class="btnbg2" align="center"><a href="{U_HELPDESC}"><!-- IF HELPDESC_NUM > 0 --><span style="color:red;"><b>{L_HELPDESC} ({HELPDESC_NUM})</b></span><!-- ELSE --><span>{L_HELPDESC}</span><!-- ENDIF --></a></td> 
     
    7072                                        <td class="btnbg2" align="center"><a href="{U_USERSEARCH}"><span>{L_USER_SEARCH}</span></a></td> 
    7173                                        <td class="per">::</td> 
    72                                        <!-- END switch_moderator_view --> 
     74                                <!-- ENDIF --> 
    7375                                        <!-- BEGIN switch_admin_view --> 
    7476                                        <td class="btnbg2" align="center"><a href="{U_RELEASES_ADD}"><span>{L_RELEASES}</span></a></td> 
     
    8385                        </div> 
    8486 
    85                         <!-- BEGIN user_panel --> 
     87                        <!-- IF S_USER_LOGGED_IN --> 
    8688                        <div id="statusbar"> 
    8789                                <table cellpadding="4" cellspacing="1" border="0" width="852"> 
    8890                                        <tr> 
    89                                                 <td>{L_HELLO}<a href="{U_USERDETAILS_LINK}">{user_panel.CURUSER_NAME}</a> {user_panel.CURUSER_ICONS} 
     91                                                <td>{L_HELLO}<a href="{U_USERDETAILS_LINK}">{CURRENT_USER_NAME}</a> {CURRENT_USER_ICONS} 
    9092 
    9193                                                <span class="<!-- IF CURRENT_USER_POINTS_LEVEL < 0 -->badUserResp<!-- ELSE -->goodUserResp<!-- ENDIF -->">{CURRENT_USER_POINTS_LEVEL}</span> 
     
    9395                                                [<a href="{U_LOGOUT}">{L_LOGOUT}</a>]<br /> 
    9496 
    95                                                 <span style="color:#BE5101">{L_RATIO}:</span> {user_panel.RATIO} 
    96                                                 <span style="color:green">{L_UPLOADED}:</span> {user_panel.UPED} 
    97                                                 <span style="color:red">{L_DOWNLOADED}:</span> {user_panel.DOWNED} 
    98                                                 {user_panel.WARN_PANEL}</td> 
    99                                                 <td align="right">{user_panel.S_CURRENT_TIME}<br /> 
    100                                                 <a href="{U_MESSAGES_INBOX}"><img src="{user_panel.INBOX_PM_PIC}" height="14" alt="{user_panel.PM_TITLE}" /></a> {L_INBOX} 
    101                                                 <a href="{U_MESSAGES_SENTBOX}"> <img src="{user_panel.SENTBOX_PIC}" height="14" alt="{L_SENTBOX}" /></a> {L_SENTBOX} 
    102                                                 <a href="{U_MY_FRIENDS}"><img src="{user_panel.BUDDYLIST_PIC}" height="14" alt="{L_BUDDYLIST}" /></a></td> 
     97                                                <span style="color:#BE5101">{L_RATIO}:</span> {CURRENT_USER_RATIO} 
     98                                                <span style="color:green">{L_UPLOADED}:</span> {CURRENT_USER_UPED} 
     99                                                <span style="color:red">{L_DOWNLOADED}:</span> {CURRENT_USER_DOWNED} 
     100                                                {CURRENT_USER_WARN_PANEL}</td> 
     101                                                <td align="right">{S_CURRENT_TIME}<br /> 
     102                                                <a href="{U_MESSAGES_INBOX}"><img src="{INBOX_PM_PIC}" height="14" alt="{PM_TITLE}" /></a> {L_INBOX} 
     103                                                <a href="{U_MESSAGES_SENTBOX}"> <img src="{SENTBOX_PIC}" height="14" alt="{L_SENTBOX}" /></a> {L_SENTBOX} 
     104                                                <a href="{U_MY_FRIENDS}"><img src="{BUDDYLIST_PIC}" height="14" alt="{L_BUDDYLIST}" /></a></td> 
    103105                                        </tr> 
    104106                                </table> 
     
    109111                                clock.tik_tak(); 
    110112                        </script> 
    111                         <!-- END user_panel --> 
     113                        <!-- ENDIF --> 
    112114 
    113115                        <div id="menuwrapper" align="center"> 
     
    122124                                                <td class="btnbg" align="center"><a href="{U_UPLOAD}">{L_UPLOAD}</a></td> 
    123125                                                <!-- END switch_uploader_view --> 
    124                                                 <!-- BEGIN switch_non_curuser_view --> 
     126                                                <!-- IF not S_USER_LOGGED_IN --> 
    125127                                                <td class="btnbg" align="center"><a href="{U_LOGIN}">{L_LOGIN}</a></td> 
    126128                                                <td class="btnbg" align="center"><a href="{U_SIGNUP}">{L_SIGNUP}</a></td> 
    127                                                 <!-- END switch_non_curuser_view --> 
     129                                                <!-- ENDIF --> 
    128130                                                <td class="btnbg" align="center"><a href="{U_FORUM}">{L_FORUMS}</a></td> 
    129131                                                <td class="btnbg" align="center"><a href="{U_RULES}">{L_RULES}</a></td> 
    130132                                                <td class="btnbg" align="center"><a href="{U_FAQ}">{L_FAQ}</a></td> 
    131                                                 <!-- BEGIN switch_curuser_view --> 
     133                                                <!-- IF S_USER_LOGGED_IN --> 
    132134                                                <td class="btnbg" align="center"><a href="{U_TOPTEN}">{L_TOP10}</a></td> 
    133135                                                <td class="btnbg" align="center"><a href="{U_LOG}">{L_LOG}</a></td> 
    134136                                                <td class="btnbg" align="center"><a href="{U_HELPDESC}">{L_HELPDESC}</a></td> 
    135                                                 <!-- END switch_curuser_view --> 
     137                                                <!-- ENDIF --> 
    136138                                                <td class="btnbg" align="center"><a href="{U_STAFF}">{L_STAFF}</a></td> 
    137139                                        </tr> 
  • templates/bithdtv/textbbcode.html

    r259 r269  
    279279                </select> 
    280280 
    281                 <select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;"> 
    282                 <option value="0" selected="selected">{L_TEXT_SIZE}</option> 
    283                 <option value="7" class="genmed">{L_SMALL}</option> 
    284                 <option value="11" class="genmed">{L_STANDART}</option> 
    285                 <option value="16" class="genmed">{L_BIG}</option> 
    286                 <option value="24" class="genmed">{L_VERY_BIG}</option> 
     281                <select name="addbbcode30" onchange="bbfontstyle('[size=' + this.form.addbbcode30.options[this.form.addbbcode30.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;"> 
     282                <option value="0" selected="selected">{L_FONT_SIZE}</option> 
     283                                           <option value="1" class="genmed">{L_FONT_TINY}</option> 
     284                                          <option value="2" class="genmed">{L_FONT_SMALL}</option> 
     285                                          <option value="3" class="genmed">{L_FONT_NORMAL}</option> 
     286                                          <option value="5" class="genmed">{L_FONT_LARGE}</option> 
     287                                          <option  value="7" class="genmed">{L_FONT_HUGE}</option> 
    287288                </select> 
    288289 
  • templates/bithdtv/userdetails.html

    r260 r269  
    33<script type="text/javascript" src="{ROOT_PATH}js/ajax.js"></script> 
    44<script type="text/javascript" src="{ROOT_PATH}js/ajax_common.js"></script> 
    5 <script type="text/javascript"> 
    6 var L_JS_SEE_FULL_LIST = '{L_SEE_FULL_LIST}'; 
    7 var L_JS_HIDE_LIST = '{L_HIDE_LIST}'; 
    8 </script> 
    95 
    106<p> 
  • templates/main/bbcode.html

    r225 r269  
    1 <!-- BEGIN ulist_open --><ul class="liststyle"><!-- END ulist_open --> 
    2 <!-- BEGIN ulist_open_default --><ul><!-- END ulist_open_default --> 
    3 <!-- BEGIN ulist_close --></ul><!-- END ulist_close --> 
    4  
    5 <!-- BEGIN olist_open --><ol style="list-style-type: {LIST_TYPE}"><!-- END olist_open --> 
    6 <!-- BEGIN olist_close --></ol><!-- END olist_close --> 
    7  
    8 <!-- BEGIN listitem --><li><!-- END listitem --> 
    9 <!-- BEGIN listitem_close --></li><!-- END listitem_close --> 
    10  
    111<!-- BEGIN quote_username_open --> 
    122<div class="quotetitle">{USERNAME} {L_POSTED}:</div><div class="quotecontent"> 
     
    2010</div> 
    2111<!-- END quote_close --> 
     12 
     13<!-- BEGIN spoiler_header_open --> 
     14<div class="quotetitle"><a href="javascript:;" onclick="$(this).parents('div:first').next('div').toggle('slow');">{TEXT}:</a></div><div class="quotecontent" style="display:none;"> 
     15<!-- END spoiler_header_open --> 
     16 
     17<!-- BEGIN spoiler_open --> 
     18<div class="quotetitle"><a href="javascript:;" onclick="$(this).parents('div:first').next('div').toggle('slow');">{L_SPOILER}:</a></div><div class="quotecontent" style="display:none"> 
     19<!-- END spoiler_open --> 
     20 
     21<!-- BEGIN spoiler_close --> 
     22</div> 
     23<!-- END spoiler_close --> 
    2224 
    2325<!-- BEGIN pre --> 
     
    3335<!-- END code_close --> 
    3436 
    35 <!-- BEGIN offtop_open --></span> 
    36 <span class="offtop"><b>{L_OFFTOP}:</b><!-- END offtop_open --
    37 <!-- BEGIN offtop_close --></span
    38 <span class="postbody"><!-- END offtop_close --> 
     37<!-- BEGIN offtop_open --> 
     38</span
     39<span class="offtop"><b>{L_OFFTOP}:</b
     40<!-- END offtop_open --> 
    3941 
    40 <!-- BEGIN b_open --><strong><!-- END b_open --> 
    41 <!-- BEGIN b_close --></strong><!-- END b_close --> 
    42  
    43 <!-- BEGIN u_open --><u><!-- END u_open --> 
    44 <!-- BEGIN u_close --></u><!-- END u_close --> 
    45  
    46 <!-- BEGIN i_open --><em><!-- END i_open --> 
    47 <!-- BEGIN i_close --></em><!-- END i_close --> 
    48  
    49 <!-- BEGIN color_open --><span style="color: {COLOR}"><!-- END color_open --> 
    50 <!-- BEGIN color_close --></span><!-- END color_close --> 
    51  
    52 <!-- BEGIN size_open --><span style="font-size: {SIZE}px; line-height: normal"><!-- END size_open --> 
    53 <!-- BEGIN size_close --></span><!-- END size_close --> 
    54  
    55 <!-- BEGIN font --><span style="font-family: {FONT_FAMILY};">{CONTENT}</span><!-- END font --> 
    56  
    57 <!-- BEGIN img --><img src="{URL}" alt="" onload="imgFit(this, 500);" onclick="imgFit(this, 500);" /><!-- END img --> 
    58  
    59 <!-- BEGIN url --><a href="{URL}" target="_blank">{DESCRIPTION}</a><!-- END url --> 
    60  
    61 <!-- BEGIN email --><a href="mailto:{EMAIL}">{DESCRIPTION}</a><!-- END email --> 
     42<!-- BEGIN offtop_close --> 
     43</span><br /> 
     44<span class="postbody"> 
     45<!-- END offtop_close --> 
    6246 
    6347<!-- BEGIN mod_username_open --> 
     
    8367<!-- END mod_close --> 
    8468 
    85 <!-- BEGIN thmbimg --> 
    86 <div align="{ALIGN}"> 
    87  <table border="0"> 
    88   <tr> 
    89    <td><img src="{IMAGE}" align="center" border="0" {SIZE}  onclick="window.open( '{IMAGE}', 'imgpop',  'width={WIDTH},height={HEIGHT},status=no,toolbar=no,menubar=no' );return false" /></td> 
    90   </tr> 
    91   <tr> 
    92    <td align="center" class="gensmall"><i>{NOTICE}</i></td> 
    93   </tr> 
    94  </table> 
    95 </div> 
    96 <!-- END thmbimg --> 
    97  
    9869<!-- BEGIN flash --> 
    9970        <object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=5,0,0,0" width="{WIDTH}" height="{HEIGHT}"> 
  • templates/main/browse.html

    r259 r269  
    3232 
    3333<fieldset> 
    34 {L_SEARCH} <input type="text" name="search" size="40" value="{SEARCH_STRING}" onmouseover="return overlib('{L_JS_SEARCH_EXPLAIN}');" onmouseout="return nd();" /> {L_IN} {CAT_DROP_DOWN} {L_IN} 
    35  <select name="search_in"> 
    36 <option value="1" {SEARCH_IN_CHECKED_1}>{L_NAME}</option> 
    37 <option value="2" {SEARCH_IN_CHECKED_2}>{L_DESCRIPTION}</option> 
    38 </select> 
     34{L_SEARCH} <input type="text" name="search" size="40" value="{SEARCH_STRING}" onmouseover="return overlib(L_JS_SEARCH_EXPLAIN);" onmouseout="return nd();" /> {L_IN} {CAT_DROP_DOWN} {L_IN} 
     35 {SEARCH_IN_SELECT} 
    3936<input type="submit" value="{L_SEARCH}" /><br /> 
    4037 
  • templates/main/details.html

    r259 r269  
    44<script type="text/javascript" src="{ROOT_PATH}js/ajax_common.js"></script> 
    55<script type="text/javascript" src="{ROOT_PATH}js/overlib.js"></script> 
    6 <script type="text/javascript"> 
    7 var sos_confirm = '{L_SOS_CONFIRM}'; 
    8 var L_JS_SEE_FULL_LIST = '{L_SEE_FULL_LIST}'; 
    9 var L_JS_HIDE_LIST = '{L_HIDE_LIST}'; 
    10 </script> 
    116 
    12 <!-- BEGIN torrent_details --> 
    137<!-- IF MESSAGE1 --><h1>{MESSAGE1}</h1><!-- ENDIF --> 
    148<!-- IF MESSAGE2 --><p>{MESSAGE2}</p><!-- ENDIF --> 
     
    1711  <tr> 
    1812    <td>{L_DOWNLOAD}</td> 
    19     <td><a href="{U_DOWNLOAD}" onclick="alert('{L_DOWNLOAD_WARNING}'); return true;"<!-- IF U_DOWNLOAD_AS_GZIP --> onmouseover="return overlib('&lt;a href=&quot;{U_DOWNLOAD_AS_GZIP}&quot;&gt;{L_DOWNLOAD_AS_GZIP_ARCHIVE}&lt;/a&gt;', STICKY, MOUSEOFF);" onmouseout="return nd();"<!-- ENDIF -->>{TORRENT_FILENAME}</a><!-- IF L_ADD_TO_BOOKMARKS --> [<a href="{U_ADD_TO_BOOKMARKS}">{L_ADD_TO_BOOKMARKS}</a>] 
     13    <td><a href="{U_DOWNLOAD}" onclick="alert('{L_DOWNLOAD_WARNING}'); return true;"<!-- IF U_DOWNLOAD_AS_GZIP --> onmouseover="return overlib('&lt;a href=&quot;{U_DOWNLOAD_AS_GZIP}&quot;&gt;{L_DOWNLOAD_AS_GZIP_ARCHIVE}&lt;/a&gt;', STICKY, MOUSEOFF);" onmouseout="return nd();"<!-- ENDIF -->>{TORRENT_FILENAME}</a> 
     14<!-- IF S_USER_LOGGED_IN --> 
     15 
     16    [<a href="{U_ADD_TO_BOOKMARKS}">{L_ADD_TO_BOOKMARKS}</a>] 
    2017    <!-- BEGIN switch_add_to_index --> 
    2118    [<a href="{switch_add_to_index.U_ADD_TO_INDEX}">{L_ADD_TO_INDEX}</a>] 
    2219    <!-- END switch_add_to_index --> 
    23         <!-- ENDIF --> 
     20 
     21<!-- ENDIF --> 
    2422    </td> 
    2523  </tr> 
     
    3836  </tr> 
    3937  <!-- END switch_nfo_section --> 
    40   <!-- BEGIN switch_banned_section --> 
     38  <!-- IF S_USER_IS_MOD --> 
    4139  <tr> 
    4240    <td>{L_BANNED}</td> 
    4341    <td>{BANNED}</td> 
    4442  </tr> 
    45   <!-- END switch_banned_section --> 
     43  <!-- ENDIF --> 
    4644  <tr> 
    4745    <td>{L_TYPE}</td> 
    4846    <td>{TYPE}</td> 
     47  </tr> 
     48  <tr> 
     49    <td>{L_TAGS}</td> 
     50    <td><!-- INCLUDE tags_view_form.html --></td> 
    4951  </tr> 
    5052  <tr> 
     
    6264    <select name="rating" id="rating_select"> 
    6365    <option value="0">({L_ADD_RATING})</option> 
    64     {torrent_details.switch_rating_form.RATING_OPTIONS} 
     66    {switch_rating_form.RATING_OPTIONS} 
    6567    </select> 
    6668    <input type="button" value="{L_VOTE}!" onclick="rating('{ID}', document.getElementById('rating_select').value );return false;" id="rating_button"  /> 
     
    8082    <td>{HITS}</td> 
    8183  </tr> 
     84 
     85  <!-- IF S_USER_LOGGED_IN --> 
     86 
    8287  <!-- BEGIN switch_simple_snatched --> 
    8388  <tr> 
    8489    <td valign="top"><a name="snatchedlist" id="snatchedlist"></a>{L_SNATCHED_USERS}<br /> 
    8590    <a href="javascript:void(0);" onclick="view_details_ext('snatchedlist', '{ID}', 'details');" id="snatchedlist_href">[<!-- IF SNATCHEDLIST_TPL -->{L_HIDE_LIST}<!-- ELSE -->{L_SEE_FULL_LIST}<!-- ENDIF -->]</a></td> 
    86     <td valign="top">{torrent_details.switch_simple_snatched.SIMPLE_SNATCHED_COUNT}<div id="snatchedlist_row">{SNATCHEDLIST_TPL}</div></td> 
     91    <td valign="top">{switch_simple_snatched.SIMPLE_SNATCHED_COUNT}<div id="snatchedlist_row">{SNATCHEDLIST_TPL}</div></td> 
    8792  </tr> 
    8893  <!-- END switch_simple_snatched --> 
     
    9398  </tr> 
    9499  <!-- END switch_hidden_section --> 
     100 
     101  <!-- ENDIF --> 
     102 
    95103  <tr> 
    96104    <td>{L_UPLOADED}</td> 
     
    111119    <td valign="top">{NUM_FILES}<div id="filelist_row">{FILELIST_TPL}</div></td> 
    112120  </tr> 
     121 
     122  <!-- IF S_USER_LOGGED_IN --> 
     123 
    113124  <tr> 
    114125    <td valign="top">{L_PEERS}<br /><a href="javascript:void(0);" onclick="view_details_ext('peerlist', '{ID}', 'details');" id="peerlist_href">[<!-- IF PEERLIST_TPL -->{L_HIDE_LIST}<!-- ELSE -->{L_SEE_FULL_LIST}<!-- ENDIF -->]</a></td> 
     
    127138  <tr> 
    128139    <td valign="top">{L_THANKS_USERS}</td> 
    129     <td valign="top"> 
    130     <!-- BEGIN switch_thanks --> 
    131     <input type="button" id="thanks_button" value="{L_THANKS}"  onclick="thanks('{ID}', <!-- IF torrent_details.switch_thanks.THANKS_USERS -->1<!-- ELSE -->0<!-- ENDIF -->);return false;" {torrent_details.switch_thanks.DISABLED} /> 
    132     <span id="thanks_users"><!-- IF torrent_details.switch_thanks.THANKS_USERS -->{torrent_details.switch_thanks.THANKS_USERS}<!-- ELSE -->{L_NO_THANKS}<!-- ENDIF --></span> 
    133     <!-- END switch_thanks --> 
    134     </td> 
     140    <td valign="top"><input type="button" id="thanks_button" value="{L_THANKS}"  onclick="thanks('{ID}', 0);return false;" /> 
     141    <a href="javascript:;" onclick="view_details_ext('thanks', '{ID}', 'details');" id="thanks_href">[{L_SEE_FULL_LIST}]</a><div id="thanks_row"></div></td> 
    135142  </tr> 
     143 
     144  <!-- ENDIF --> 
     145 
    136146</table> 
    137 <!-- END torrent_details --> 
    138147 
    139  
    140 <!-- BEGIN switch_comments_details_head --> 
    141  
    142 <h1>{switch_comments_details_head.COMMENTS_FOR}</h1> 
    143 <!-- END switch_comments_details_head --> 
    144 <br /> 
    145 <!-- BEGIN switch_no_comments_details --> 
    146 <h1>{L_NO_COMMENTS_YET}</h1> 
    147 <!-- IF switch_no_comments_details.DISABLE_COMMENTS == 0 --><a href="{switch_no_comments_details.U_ADD_COMMENT}">{switch_no_comments_details.L_ADD_NEW_COMMENT}</a> 
    148 &nbsp;&nbsp;&nbsp;&nbsp; 
    149 <!-- IF switch_no_comments_details.U_CHECK --><a href="{switch_no_comments_details.U_CHECK}">{switch_no_comments_details.CHECK_TITLE}</a><!-- ENDIF --><!-- ELSE -->{L_COMMENTS_DISABLED}<!-- ENDIF --> 
     148<!-- INCLUDE details_comments.html --> 
    150149 
    151150<!-- INCLUDE overall_footer.html --> 
    152  
    153 <!-- END switch_no_comments_details --> 
    154  
    155  
    156 <!-- BEGIN switch_comments_details --> 
    157 <!-- IF switch_comments_details.DISABLE_COMMENTS == 0 --><a href="{switch_comments_details.U_ADD_COMMENT}">{switch_comments_details.L_ADD_NEW_COMMENT}</a> 
    158 &nbsp;&nbsp;&nbsp;&nbsp; 
    159 <!-- IF switch_comments_details.U_CHECK --><a href="{switch_comments_details.U_CHECK}">{switch_comments_details.CHECK_TITLE}</a><!-- ENDIF --><!-- ELSE -->{L_COMMENTS_DISABLED}<!-- ENDIF --> 
    160 <br /> 
    161 {switch_comments_details.PAGERTOP} 
    162 <br /> 
    163 <a name="startcomments" id="startcomments"></a> 
    164 {COMMENTS_TABLE} 
    165 {switch_comments_details.PAGERBOTTOM} 
    166 <!-- IF switch_comments_details.DISABLE_COMMENTS == 0 --><a href="{switch_comments_details.U_ADD_COMMENT}">{switch_comments_details.L_ADD_NEW_COMMENT}</a> 
    167 &nbsp;&nbsp;&nbsp;&nbsp; 
    168 <!-- IF switch_comments_details.U_CHECK --><a href="{switch_comments_details.U_CHECK}">{switch_comments_details.CHECK_TITLE}</a><!-- ENDIF --><!-- ELSE -->{L_COMMENTS_DISABLED}<!-- ENDIF --> 
    169  
    170 <!-- INCLUDE overall_footer.html --> 
    171 <!-- END switch_comments_details --> 
  • templates/main/forum/index_body.tpl

    r89 r269  
    88        </td> 
    99        <td align="right" valign="bottom"> 
    10                 <!-- BEGIN switch_curuser_view --> 
     10                <!-- IF S_USER_LOGGED_IN --> 
    1111                <a href="{U_SEARCH_NEW}" class="gensmall">{L_SEARCH_NEW}</a><br /><a href="{U_SEARCH_SELF}" class="gensmall">{L_SEARCH_YOUR_POSTS}</a><br /> 
    12                 <!-- END switch_curuser_view --> 
     12                <!-- ENDIF --> 
    1313                <a href="{U_SEARCH_UNANSWERED}" class="gensmall">{L_SEARCH_UNANSWERED}</a></td> 
    1414  </tr> 
     
    4949  <tr> 
    5050        <td align="left"> 
    51         <!-- BEGIN switch_curuser_view --> 
     51        <!-- IF S_USER_LOGGED_IN --> 
    5252        <span class="gensmall"><a href="{U_MARK_READ}" class="gensmall">{L_MARK_ALL_FORUMS}</a></span> 
    53          <!-- END switch_curuser_view --> 
     53         <!-- ENDIF --> 
    5454        </td> 
    5555        <td align="right"><span class="gensmall">{S_TIMEZONE}</span></td> 
  • templates/main/forum/modcp_delete_posts.tpl

    r89 r269  
    3131                <table width="100%" cellspacing="0" cellpadding="3" border="0"> 
    3232                  <tr> 
    33                         <td valign="middle" class="{postrow.ROW_CLASS}" align="left"><img src="{TEMPLATE_PATH}/images/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_POSTED}: 
     33                        <td valign="middle" class="{postrow.ROW_CLASS}" align="left"><img src="{TEMPLATE_PATH}/images/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_ADDED}: 
    3434                          {postrow.POST_DATE}&nbsp;&nbsp;&nbsp;&nbsp;{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 
    3535                  </tr> 
  • templates/main/forum/modcp_split.tpl

    r89 r269  
    5252                <table width="100%" cellspacing="0" cellpadding="3" border="0"> 
    5353                  <tr> 
    54                         <td valign="middle" class="{postrow.ROW_CLASS}" align="left"><img src="{TEMPLATE_PATH}/images/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_POSTED}: 
     54                        <td valign="middle" class="{postrow.ROW_CLASS}" align="left"><img src="{TEMPLATE_PATH}/images/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_ADDED}: 
    5555                          {postrow.POST_DATE}&nbsp;&nbsp;&nbsp;&nbsp;{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 
    5656                  </tr> 
  • templates/main/forum/posting_body.tpl

    r259 r269  
    4646// Define the bbCode tags 
    4747bbcode = new Array(); 
    48 bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[offtop]','[/offtop]','[mod={EDITOR_NAME}]','[/mod]'); 
     48bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[offtop]','[/offtop]','[spoiler]','[/spoiler]','[mod={EDITOR_NAME}]','[/mod]'); 
    4949imageTag = false; 
    5050 
     
    372372                                          <option style="color:black; background-color: {T_TD_COLOR1}" value="black" class="genmed">{L_COLOR_BLACK}</option> 
    373373                                        </select> &nbsp;<select name="addbbcodefontsize" onChange="bbfontstyle('[size=' + this.form.addbbcodefontsize.options[this.form.addbbcodefontsize.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;" onMouseOver="helpline('f')"> 
    374                                                               <option value="0" selected="selected">{L_TEXT_SIZE}</option> 
    375                                           <option value="7" class="genmed">{L_FONT_TINY}</option> 
    376                                           <option value="9" class="genmed">{L_FONT_SMALL}</option> 
    377                                           <option value="12" class="genmed">{L_FONT_NORMAL}</option> 
    378                                           <option value="18" class="genmed">{L_FONT_LARGE}</option> 
    379                                           <option  value="24" class="genmed">{L_FONT_HUGE}</option> 
     374                                                              <option value="0" selected="selected">{L_FONT_SIZE}</option> 
     375                                          <option value="1" class="genmed">{L_FONT_TINY}</option> 
     376                                          <option value="2" class="genmed">{L_FONT_SMALL}</option> 
     377                                          <option value="3" class="genmed">{L_FONT_NORMAL}</option> 
     378                                          <option value="5" class="genmed">{L_FONT_LARGE}</option> 
     379                                          <option  value="7" class="genmed">{L_FONT_HUGE}</option> 
    380380                                        </select> 
    381381                                        </span></td> 
  • templates/main/forum/posting_preview.tpl

    r89 r269  
    44        </tr> 
    55        <tr>  
    6                 <td class="row1" align="left"><img src="{TEMPLATE_PATH}/images/icon_minipost.gif" alt="{L_POST}" /><span class="postdetails">{L_POSTED}: {POST_DATE} &nbsp;&nbsp;&nbsp; {L_POST_SUBJECT}: {POST_SUBJECT}</span></td> 
     6                <td class="row1" align="left"><img src="{TEMPLATE_PATH}/images/icon_minipost.gif" alt="{L_POST}" /><span class="postdetails">{L_ADDED}: {POST_DATE} &nbsp;&nbsp;&nbsp; {L_POST_SUBJECT}: {POST_SUBJECT}</span></td> 
    77        </tr> 
    88        <tr>  
  • templates/main/forum/posting_topic_review.tpl

    r89 r269  
    1919                <td class="{postrow.ROW_CLASS}" height="28" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> 
    2020                        <tr> 
    21                                 <td width="100%"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_POSTED}: {postrow.POST_DATE}<span class="gen">&nbsp;</span>&nbsp;&nbsp;&nbsp;{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 
     21                                <td width="100%"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_ADDED}: {postrow.POST_DATE}<span class="gen">&nbsp;</span>&nbsp;&nbsp;&nbsp;{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 
    2222                        </tr> 
    2323                        <tr> 
  • templates/main/forum/search_results_posts.tpl

    r89 r269  
    2828          {L_VIEWS}: <b>{searchresults.TOPIC_VIEWS}</b></span><br /> 
    2929        </td> 
    30         <td width="100%" valign="top" class="row1" align="left"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_FORUM}:&nbsp;<b><a href="{searchresults.U_FORUM}" class="postdetails">{searchresults.FORUM_NAME}</a></b>&nbsp; &nbsp;{L_POSTED}: {searchresults.POST_DATE}&nbsp; &nbsp;{L_SUBJECT}: <b><a href="{searchresults.U_POST}">{searchresults.POST_SUBJECT}</a></b></span></td> 
     30        <td width="100%" valign="top" class="row1" align="left"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_FORUM}:&nbsp;<b><a href="{searchresults.U_FORUM}" class="postdetails">{searchresults.FORUM_NAME}</a></b>&nbsp; &nbsp;{L_ADDED}: {searchresults.POST_DATE}&nbsp; &nbsp;{L_SUBJECT}: <b><a href="{searchresults.U_POST}">{searchresults.POST_SUBJECT}</a></b></span></td> 
    3131  </tr> 
    3232  <tr> 
  • templates/main/forum/topic_search_results.tpl

    r85 r269  
    2626          <br /> 
    2727        </td> 
    28         <td width="100%" valign="top" class="row1" align="left"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails">&nbsp;{L_POSTED}: {searchresults.POST_DATE}&nbsp;</span></td> 
     28        <td width="100%" valign="top" class="row1" align="left"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails">&nbsp;{L_ADDED}: {searchresults.POST_DATE}&nbsp;</span></td> 
    2929  </tr> 
    3030  <tr> 
  • templates/main/forum/viewtopic_body.tpl

    r259 r269  
    2323l_no_text_selected = "{L_NO_TEXT_SELECTED}"; 
    2424bbcode = new Array(); 
    25 bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[offtop]','[/offtop]','[mod={S_EDITOR_NAME}]','[/mod]'); 
     25bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[offtop]','[/offtop]','[spoiler]','[/spoiler]','[mod={S_EDITOR_NAME}]','[/mod]'); 
    2626imageTag = false; 
    2727//--> 
     
    8787                <td class="{postrow.ROW_CLASS}" height="28" valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"> 
    8888                        <tr> 
    89                                 <td class="{postrow.ROW_CLASS}" align="left"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails">{L_POSTED}: {postrow.POST_DATE}<span class="gen">&nbsp;</span>&nbsp; &nbsp;{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 
     89                                <td class="{postrow.ROW_CLASS}" align="left"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails">{L_ADDED}: {postrow.POST_DATE}<span class="gen">&nbsp;</span>&nbsp; &nbsp;{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 
    9090                                <td valign="top" nowrap="nowrap" class="{postrow.ROW_CLASS}" align="right">{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}</td> 
    9191                        </tr> 
  • templates/main/main.cfg

    r83 r269  
    143143$config['vote_graphic_length'] = 205; 
    144144 
     145$config['min_tag_size'] = '11'; //min tag size in pixeils 
     146$config['max_tag_size'] = '30'; //max tag size in pixeils 
     147 
    145148// Start add - Online/Offline/Hidden Mod 
    146149$images['icon_online'] = $current_template_images . '/{LANG}/icon_online.png'; 
  • templates/main/main.css

    r234 r269  
    11741174a.postlink:hover { text-decoration: underline; color : #DD6900} 
    11751175 
    1176 /* Quote & Code blocks */ 
     1176.liststyle { 
     1177        margin-left:20px; 
     1178
     1179 
     1180/* Copyright and bottom info */ 
     1181.copyright              { font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #444444; letter-spacing: -1px;} 
     1182a.copyright             { color: #444444; text-decoration: none;} 
     1183a.copyright:hover { color: #000000; text-decoration: underline;} 
     1184 
     1185/* The text input fields background colour */ 
     1186input.post, textarea.post, select { 
     1187        background-color : #FFFFFF; 
     1188
     1189 
     1190/* The main submit button option */ 
     1191input.mainoption { 
     1192        background-color : #FAFAFA; 
     1193        font-weight : bold; 
     1194
     1195 
     1196/* None-bold submit button */ 
     1197input.liteoption { 
     1198        background-color : #FAFAFA; 
     1199        font-weight : normal; 
     1200
     1201 
     1202/* This is the line in the posting page which shows the rollover 
     1203  help line. This is actually a text box, but if set to be the same 
     1204  colour as the background no one will know ;) 
     1205*/ 
     1206.helpline { background-color: #DEE3E7; border-style: none; } 
     1207/* Set Image style */ 
     1208img, .forumline img { 
     1209        border: 0; 
     1210
     1211/* Begin Simple Subforums MOD */ 
     1212a.topic-new, a.topic-new:visited { color: #DD6900; } 
     1213a.topic-new:hover, a.topic-new:active { color: #006699; } 
     1214/* End Simple Subforums MOD */ 
     1215--> 
     1216 
     1217.pager_page { 
     1218        padding:2px; 
     1219        font-weight:bold; 
     1220
     1221 
     1222.pager_page_selected { 
     1223        padding:2px; 
     1224        font-weight:bold; 
     1225
     1226 
     1227a.upReputationLink:link, 
     1228a.upReputationLink:visited 
     1229
     1230    font-size: 1em; 
     1231    line-height: 10px; 
     1232    background: transparent url(images/arrow-up-v2.gif) no-repeat 0 1px; 
     1233    padding: 3px 6px; 
     1234    text-decoration: none; 
     1235
     1236 
     1237a.upReputationLink:hover, 
     1238a.upReputationLink:active 
     1239
     1240    background: transparent url(images/arrow-up-v2.gif) no-repeat 0 -15px; 
     1241
     1242 
     1243a.downReputationLink:link, 
     1244a.downReputationLink:visited 
     1245
     1246    font-size: 1em; 
     1247    line-height: 10px; 
     1248    background: transparent url(images/arrow-down-v2.gif) no-repeat 0 1px; 
     1249    padding: 3px 6px; 
     1250    text-decoration: none; 
     1251
     1252 
     1253a.downReputationLink:hover, 
     1254a.downReputationLink:active 
     1255
     1256    background: transparent url(images/arrow-down-v2.gif) no-repeat 0 -15px; 
     1257
     1258 
     1259span.goodResp 
     1260
     1261    background: #D6FEDB; 
     1262    border: 1px solid #B6C9B9; 
     1263    padding: 1px 3px 2px 3px; 
     1264
     1265 
     1266span.badResp 
     1267
     1268    background: #FED5CD; 
     1269    border: 1px solid #D0AEAE; 
     1270    padding: 1px 3px 2px 3px; 
     1271
     1272 
     1273.usergoodResp 
     1274
     1275    color: #009900; 
     1276
     1277 
     1278.userbadResp 
     1279
     1280    color: #ff3300; 
     1281
     1282 
     1283.respectUserList { 
     1284        border-top:1px solid; 
     1285        white-space: normal; 
     1286
     1287 
     1288span.goodUserResp 
     1289
     1290    background: #0099cc; 
     1291    border: 1px solid #006699; 
     1292    padding: 0 3px 0 3px; 
     1293    color: #ffffff; 
     1294
     1295 
     1296span.badUserResp 
     1297
     1298    background: #006699; 
     1299    border: 1px solid #003366; 
     1300    padding: 0 3px 0 3px; 
     1301    color: #ffffff; 
     1302
     1303 
     1304/* bb tags */ 
    11771305.codetitle { 
    11781306        margin: 10px 5px 0px 5px; 
     
    12041332} 
    12051333 
    1206 .quotetitle, .attachtitle { 
     1334.quotetitle, .spoilertitle { 
    12071335        margin: 10px 5px 0px 5px; 
    12081336        padding: 4px; 
     
    12161344} 
    12171345 
    1218 .quotetitle .quotetitle { 
     1346.quotetitle, .spoilertitle { 
    12191347        font-size: 1em; 
    12201348} 
    12211349 
    1222 .quotecontent, .attachcontent { 
     1350.quotecontent, .spoilercontent { 
    12231351        margin: 0px 5px 10px 5px; 
    12241352        padding: 5px; 
     
    12341362} 
    12351363 
    1236 .liststyle { 
    1237         margin-left:20px; 
    1238 
    1239  
    1240 /* Copyright and bottom info */ 
    1241 .copyright              { font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #444444; letter-spacing: -1px;} 
    1242 a.copyright             { color: #444444; text-decoration: none;} 
    1243 a.copyright:hover { color: #000000; text-decoration: underline;} 
    1244  
    1245 /* The text input fields background colour */ 
    1246 input.post, textarea.post, select { 
    1247         background-color : #FFFFFF; 
    1248 
    1249  
    1250 /* The main submit button option */ 
    1251 input.mainoption { 
    1252         background-color : #FAFAFA; 
    1253         font-weight : bold; 
    1254 
    1255  
    1256 /* None-bold submit button */ 
    1257 input.liteoption { 
    1258         background-color : #FAFAFA; 
    1259         font-weight : normal; 
    1260 
    1261  
    1262 /* This is the line in the posting page which shows the rollover 
    1263   help line. This is actually a text box, but if set to be the same 
    1264   colour as the background no one will know ;) 
    1265 */ 
    1266 .helpline { background-color: #DEE3E7; border-style: none; } 
    1267 /* Set Image style */ 
    1268 img, .forumline img { 
    1269         border: 0; 
    1270 
    1271 /* Begin Simple Subforums MOD */ 
    1272 a.topic-new, a.topic-new:visited { color: #DD6900; } 
    1273 a.topic-new:hover, a.topic-new:active { color: #006699; } 
    1274 /* End Simple Subforums MOD */ 
    1275 --> 
    1276  
    1277 .pager_page { 
    1278         padding:2px; 
    1279         font-weight:bold; 
    1280 
    1281  
    1282 .pager_page_selected { 
    1283         padding:2px; 
    1284         font-weight:bold; 
    1285 
    1286  
    1287 a.upReputationLink:link, 
    1288 a.upReputationLink:visited 
    1289 
    1290     font-size: 1em; 
    1291     line-height: 10px; 
    1292     background: transparent url(images/arrow-up-v2.gif) no-repeat 0 1px; 
    1293     padding: 3px 6px; 
    1294     text-decoration: none; 
    1295 
    1296  
    1297 a.upReputationLink:hover, 
    1298 a.upReputationLink:active 
    1299 
    1300     background: transparent url(images/arrow-up-v2.gif) no-repeat 0 -15px; 
    1301 
    1302  
    1303 a.downReputationLink:link, 
    1304 a.downReputationLink:visited 
    1305 
    1306     font-size: 1em; 
    1307     line-height: 10px; 
    1308     background: transparent url(images/arrow-down-v2.gif) no-repeat 0 1px; 
    1309     padding: 3px 6px; 
    1310     text-decoration: none; 
    1311 
    1312  
    1313 a.downReputationLink:hover, 
    1314 a.downReputationLink:active 
    1315 
    1316     background: transparent url(images/arrow-down-v2.gif) no-repeat 0 -15px; 
    1317 
    1318  
    1319 span.goodResp 
    1320 
    1321     background: #D6FEDB; 
    1322     border: 1px solid #B6C9B9; 
    1323     padding: 1px 3px 2px 3px; 
    1324 
    1325  
    1326 span.badResp 
    1327 
    1328     background: #FED5CD; 
    1329     border: 1px solid #D0AEAE; 
    1330     padding: 1px 3px 2px 3px; 
    1331 
    1332  
    1333 .usergoodResp 
    1334 
    1335     color: #009900; 
    1336 
    1337  
    1338 .userbadResp 
    1339 
    1340     color: #ff3300; 
    1341 
    1342  
    1343 .respectUserList { 
    1344         border-top:1px solid; 
    1345         white-space: normal; 
    1346 
    1347  
    1348 span.goodUserResp 
    1349 
    1350     background: #0099cc; 
    1351     border: 1px solid #006699; 
    1352     padding: 0 3px 0 3px; 
    1353     color: #ffffff; 
    1354 
    1355  
    1356 span.badUserResp 
    1357 
    1358     background: #006699; 
    1359     border: 1px solid #003366; 
    1360     padding: 0 3px 0 3px; 
    1361     color: #ffffff; 
    1362 
    1363  
     1364ul.bb, ol.bb { 
     1365        padding-left:25px; 
     1366
     1367 
     1368.jqifade{ 
     1369      position: absolute; 
     1370      background-color: #aaaaaa; 
     1371
     1372div.jqi{ 
     1373      width: 400px; 
     1374      font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; 
     1375      position: absolute; 
     1376      background-color: #ffffff; 
     1377      font-size: 11px; 
     1378      text-align: left; 
     1379      border: solid 1px #eeeeee; 
     1380      -moz-border-radius: 10px; 
     1381      -webkit-border-radius: 10px; 
     1382      padding: 7px; 
     1383
     1384div.jqi .jqicontainer{ 
     1385      font-weight: bold; 
     1386
     1387div.jqi .jqiclose{ 
     1388      position: absolute; 
     1389      top: 4px; right: -2px; 
     1390      width: 18px; 
     1391      cursor: default; 
     1392      color: #bbbbbb; 
     1393      font-weight: bold; 
     1394
     1395div.jqi .jqimessage{ 
     1396      padding: 10px; 
     1397      line-height: 20px; 
     1398      color: #444444; 
     1399
     1400div.jqi .jqibuttons{ 
     1401      text-align: right; 
     1402      padding: 5px 0 5px 0; 
     1403      border: solid 1px #eeeeee; 
     1404      background-color: #f4f4f4; 
     1405
     1406div.jqi button{ 
     1407      padding: 3px 10px; 
     1408      margin: 0 10px; 
     1409      background-color: #2F6073; 
     1410      border: solid 1px #f4f4f4; 
     1411      color: #ffffff; 
     1412      font-weight: bold; 
     1413      font-size: 12px; 
     1414
     1415div.jqi button:hover{ 
     1416      background-color: #728A8C; 
     1417
     1418div.jqi button.jqidefaultbutton{ 
     1419      background-color: #BF5E26; 
     1420
     1421.jqiwarning .jqi .jqibuttons{ 
     1422      background-color: #BF5E26; 
     1423
     1424 
     1425.ac_results { 
     1426        padding: 0px; 
     1427        border: 1px solid WindowFrame; 
     1428        background-color: Window; 
     1429        overflow: hidden; 
     1430
     1431 
     1432.ac_results ul { 
     1433        width: 100%; 
     1434        list-style-position: outside; 
     1435        list-style: none; 
     1436        padding: 0; 
     1437        margin: 0; 
     1438
     1439 
     1440.ac_results iframe { 
     1441        display:none;/*sorry for IE5*/ 
     1442        display/**/:block;/*sorry for IE5*/ 
     1443        position:absolute; 
     1444        top:0; 
     1445        left:0; 
     1446        z-index:-1; 
     1447        filter:mask(); 
     1448        width:3000px; 
     1449        height:3000px; 
     1450
     1451 
     1452.ac_results li { 
     1453        margin: 0px; 
     1454        padding: 2px 5px; 
     1455        cursor: pointer; 
     1456        display: block; 
     1457        width: 100%; 
     1458        font: menu; 
     1459        font-size: 12px; 
     1460        overflow: hidden; 
     1461
     1462 
     1463.ac_over { 
     1464        background-color: Highlight; 
     1465        color: HighlightText; 
     1466
  • templates/main/overall_header.html

    r260 r269  
    1212<link href="{TEMPLATE_PATH}/main.css" rel="stylesheet" type="text/css" media="screen" /> 
    1313<script type="text/javascript" src="{ROOT_PATH}js/functions.js"></script> 
     14<script type="text/javascript" src="{ROOT_PATH}js/jquery.js"></script> 
    1415<script type="text/javascript"> 
    15         var sizes_ary = {'{L_KILOBYTES}':1024,'{L_MEGABYTES}':1024*1024,'{L_GIGABYTES}':1024*1024*1024,'{L_TERABYTES}':1024*1024*1024*1024}; 
    1616        var SID = '{SID}'; 
    1717        var TRACKER_URL = '{ROOT_PATH}'; 
    18         var l_post_something = '{L_POST_SOMETHING}'; 
    19         var L_JS_MARKED = '{L_MARKED}'; 
    2018        var ol_bgcolor = "#FFFFFF"; 
     19 
     20        <!-- BEGIN javascript_lang --> 
     21        var {javascript_lang.KEY} = '{javascript_lang.VALUE}'; 
     22        <!-- END --> 
    2123</script> 
    2224</head> 
     
    2527        <div id="page-header">&nbsp;</div> 
    2628 
    27         <!-- BEGIN user_panel --> 
     29        <!-- IF S_USER_LOGGED_IN --> 
     30 
    2831        <div id="userbar"> 
    29                 <span class="left">{L_HELLO}<a href="{U_USERDETAILS_LINK}"><b>{user_panel.CURUSER_NAME}</b></a> {user_panel.CURUSER_ICONS} 
     32                <span class="left">{L_HELLO}<a href="{U_USERDETAILS_LINK}"><b>{CURRENT_USER_NAME}</b></a> {CURRENT_USER_ICONS} 
    3033 
    3134                <span class="<!-- IF CURRENT_USER_POINTS_LEVEL < 0 -->badUserResp<!-- ELSE -->goodUserResp<!-- ENDIF -->">{CURRENT_USER_POINTS_LEVEL}</span> 
    3235                <!-- IF CURRENT_USER_RANK_NAME --> [{CURRENT_USER_RANK_NAME}]<!-- ENDIF -->, {L_REPUTATION}: {CURRENT_USER_POINTS} 
    33                 [<a href="{U_LOGOUT}">{L_LOGOUT}</a>]<br />{L_RATIO}: {user_panel.RATIO} 
    34  
    35                 <img alt="{L_UPLOADED}" title="{L_UPLOADED}" src="pic/arrowup.gif" />  {user_panel.UPED} <img alt="{L_DOWNLOADED}" title="{L_DOWNLOADED}" src="pic/arrowdown.gif" />  {user_panel.DOWNED} {user_panel.WARN_PANEL}</span> 
    36                 <span class="right">{user_panel.S_CURRENT_TIME}<br /> 
    37                 <a href="{U_MESSAGES_INBOX}"><img src="{user_panel.INBOX_PM_PIC}" height="14" alt="{user_panel.PM_TITLE}" /></a> {L_INBOX} 
    38                 <a href="{U_MESSAGES_SENTBOX}"> <img src="{user_panel.SENTBOX_PIC}" height="14" alt="{L_SENTBOX}" /></a> {L_SENTBOX} 
    39                 <a href="{U_MY_FRIENDS}"><img src="{user_panel.BUDDYLIST_PIC}" height="14" alt="{L_BUDDYLIST}" /></a></span> 
     36                [<a href="{U_LOGOUT}">{L_LOGOUT}</a>]<br />{L_RATIO}: {CURRENT_USER_RATIO} 
     37 
     38                <img alt="{L_UPLOADED}" title="{L_UPLOADED}" src="pic/arrowup.gif" />  {CURRENT_USER_UPED} <img alt="{L_DOWNLOADED}" title="{L_DOWNLOADED}" src="pic/arrowdown.gif" />  {CURRENT_USER_DOWNED} {CURRENT_USER_WARN_PANEL}</span> 
     39                <span class="right">{S_CURRENT_TIME}<br /> 
     40                <a href="{U_MESSAGES_INBOX}"><img src="{INBOX_PM_PIC}" height="14" alt="{PM_TITLE}" /></a> {L_INBOX} 
     41                <a href="{U_MESSAGES_SENTBOX}"> <img src="{SENTBOX_PIC}" height="14" alt="{L_SENTBOX}" /></a> {L_SENTBOX} 
     42                <a href="{U_MY_FRIENDS}"><img src="{BUDDYLIST_PIC}" height="14" alt="{L_BUDDYLIST}" /></a></span> 
    4043        </div> 
    4144 
     
    4447                clock.tik_tak(); 
    4548        </script> 
    46         <!-- END user_panel --> 
     49 
     50        <!-- ENDIF --> 
    4751 
    4852        <div id="page-body"> 
     
    5155                                <li<!-- IF CURRENT_PAGE == U_INDEX --> id="activetab"<!-- ENDIF -->><a href="{U_INDEX}"><span>{L_INDEX}</span></a></li> 
    5256                                <li<!-- IF CURRENT_PAGE == U_BROWSE --> id="activetab"<!-- ENDIF -->><a href="{U_BROWSE}"><span>{L_BROWSE}</span></a></li> 
     57 
    5358                                <!-- BEGIN switch_non_uploader_view --> 
     59 
    5460                                <li<!-- IF CURRENT_PAGE == U_UPLOADAPP --> id="activetab"<!-- ENDIF -->><a href="{U_UPLOADAPP}"><span>{L_UPLOAD}</span></a></li> 
     61 
    5562                                <!-- END switch_non_uploader_view --> 
     63 
    5664                                <!-- BEGIN switch_uploader_view --> 
     65 
    5766                                <li<!-- IF CURRENT_PAGE == U_UPLOAD --> id="activetab"<!-- ENDIF -->><a href="{U_UPLOAD}"><span>{L_UPLOAD}</span></a></li> 
     67 
    5868                                <!-- END switch_uploader_view --> 
    59                                 <!-- BEGIN switch_non_curuser_view --> 
     69 
     70                                <!-- IF not S_USER_LOGGED_IN --> 
     71 
    6072                                <li<!-- IF CURRENT_PAGE == U_LOGIN --> id="activetab"<!-- ENDIF -->><a href="{U_LOGIN}"><span>{L_LOGIN}</span></a></li> 
    6173                                <li<!-- IF CURRENT_PAGE == U_SIGNUP --> id="activetab"<!-- ENDIF -->><a href="{U_SIGNUP}"><span>{L_SIGNUP}</span></a></li> 
    62                                 <!-- END switch_non_curuser_view --> 
     74 
     75                                <!-- ENDIF --> 
     76 
    6377                                <li<!-- IF CURRENT_PAGE == U_FORUM --> id="activetab"<!-- ENDIF -->><a href="{U_FORUM}"><span>{L_FORUMS}</span></a></li> 
    6478                                <li<!-- IF CURRENT_PAGE == U_RULES --> id="activetab"<!-- ENDIF -->><a href="{U_RULES}"><span>{L_RULES}</span></a></li> 
    6579                                <li<!-- IF CURRENT_PAGE == U_FAQ --> id="activetab"<!-- ENDIF -->><a href="{U_FAQ}"><span>{L_FAQ}</span></a></li> 
    66                                 <!-- BEGIN switch_curuser_view --> 
     80 
     81                                <!-- IF S_USER_LOGGED_IN --> 
     82 
    6783                                <li<!-- IF CURRENT_PAGE == U_HELPDESC --> id="activetab"<!-- ENDIF -->><a href="{U_HELPDESC}"><span>{L_HELPDESC}</span></a></li> 
    68                                 <!-- END switch_curuser_view --> 
     84 
     85                                <!-- ENDIF --> 
     86 
    6987                                <li<!-- IF CURRENT_PAGE == U_STAFF --> id="activetab"<!-- ENDIF -->><a href="{U_STAFF}"><span>{L_STAFF}</span></a></li> 
    7088                        </ul> 
     
    7795                                        <div id="menu"> 
    7896                                                <ul> 
    79                                                         <!-- BEGIN switch_curuser_view --> 
     97 
     98                                                        <!-- IF S_USER_LOGGED_IN --> 
    8099 
    81100                                                        <li class="header">{L_TORRENTS}</li> 
     
    85104                                                        <li<!-- IF CURRENT_PAGE == U_OFFERS --> id="activemenu"<!-- ENDIF -->><a href="{U_OFFERS}"><span>{L_OFFERS}</span></a></li> 
    86105 
    87                                                         <!-- END switch_curuser_view --> 
     106                                                        <!-- ENDIF --> 
    88107 
    89108                                                        <!-- BEGIN switch_non_uploader_view --> 
     
    98117 
    99118                                                        <!-- END switch_uploader_view --> 
    100  
    101119                                                        <li class="header">{L_COMMUNITY}</li> 
    102120                                                        <li<!-- IF CURRENT_PAGE == U_FORUM --> id="activemenu"<!-- ENDIF -->><a href="{U_FORUM}"><span>{L_FORUMS}</span></a></li> 
     
    105123                                                        <li<!-- IF CURRENT_PAGE == U_CHAT --> id="activemenu"<!-- ENDIF -->><a href="{U_CHAT}"><span>{L_CHAT}</span></a></li> 
    106124 
    107                                                         <!-- BEGIN switch_curuser_view --> 
     125                                                        <!-- IF S_USER_LOGGED_IN --> 
    108126 
    109127                                                        <li class="header">{L_PERSONAL}</li> 
     
    127145                                                        <!-- ENDIF --> 
    128146 
    129                                                         <!-- END switch_curuser_view --> 
     147                                                        <!-- ENDIF --> 
    130148 
    131149                                                        <li class="header">{L_OTHER}</li> 
     
    139157                                                        <li<!-- IF CURRENT_PAGE == U_LOG --> id="activemenu"<!-- ENDIF -->><a href="{U_LOG}"><span>{L_LOG}</span></a></li> 
    140158 
    141                                                         <!-- BEGIN switch_moderator_view --> 
     159                                                        <!-- IF S_USER_IS_MOD --> 
    142160 
    143161                                                        <li<!-- IF CURRENT_PAGE == U_HELPDESC --> id="activemenu"<!-- ENDIF -->><a href="{U_HELPDESC}"><!-- IF HELPDESC_NUM > 0 --><span style="color:red;"><b>{L_HELPDESC} ({HELPDESC_NUM})</b></span><!-- ELSE --><span>{L_HELPDESC}</span><!-- ENDIF --></a></li> 
     
    146164                                                        <li<!-- IF CURRENT_PAGE == U_USERSEARCH --> id="activemenu"<!-- ENDIF -->><a href="{U_USERSEARCH}"><span>{L_USER_SEARCH}</span></a></li> 
    147165 
    148                                                         <!-- END switch_moderator_view --> 
     166                                                        <!-- ENDIF --> 
    149167 
    150168                                                        <!-- BEGIN switch_admin_view --> 
  • templates/main/textbbcode.html

    r259 r269  
    5757// Define the bbCode tags 
    5858bbcode = new Array(); 
    59 bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[pre]','[/pre]','[*]','[*]','[*]','[*]','[img]','[/img]','[url]','[/url]','[mod={EDITOR_NAME}]','[/mod]'); 
     59bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[pre]','[/pre]','[*]','[*]','[*]','[*]','[img]','[/img]','[url]','[/url]','[mod={EDITOR_NAME}]','[/mod]','[spoiler]','[/spoiler]'); 
    6060imageTag = false; 
    6161 
     
    256256        <input type="button" accesskey="m" name="addbbcode18" value="MOD" style="width:35px" onclick="bbstyle(18)" /> 
    257257        <!-- END switch_mod_section --> 
     258 
     259        <input type="button" accesskey="s" name="addbbcode20" value="{L_SPOILER}" style="width:60px" onclick="bbstyle(20)" /> 
     260 
    258261        <input type="button" value="..]" style="width:35px" onclick="javascript:bbstyle(-1)" /> 
    259262        </td> 
     
    280283        </select> 
    281284 
    282         <select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;"> 
    283         <option value="0" selected="selected">{L_TEXT_SIZE}</option> 
    284         <option value="7" class="genmed">{L_SMALL}</option> 
    285         <option value="11" class="genmed">{L_STANDART}</option> 
    286         <option value="16" class="genmed">{L_BIG}</option> 
    287         <option value="24" class="genmed">{L_VERY_BIG}</option> 
     285        <select name="addbbcode30" onchange="bbfontstyle('[size=' + this.form.addbbcode30.options[this.form.addbbcode30.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;"> 
     286        <option value="0" selected="selected">{L_FONT_SIZE}</option> 
     287                                          <option value="1" class="genmed">{L_FONT_TINY}</option> 
     288                                          <option value="2" class="genmed">{L_FONT_SMALL}</option> 
     289                                          <option value="3" class="genmed">{L_FONT_NORMAL}</option> 
     290                                          <option value="5" class="genmed">{L_FONT_LARGE}</option> 
     291                                          <option  value="7" class="genmed">{L_FONT_HUGE}</option> 
    288292        </select> 
    289293 
  • templates/main/userdetails.html

    r260 r269  
    33<script type="text/javascript" src="{ROOT_PATH}js/ajax.js"></script> 
    44<script type="text/javascript" src="{ROOT_PATH}js/ajax_common.js"></script> 
    5 <script type="text/javascript"> 
    6 var L_JS_SEE_FULL_LIST = '{L_SEE_FULL_LIST}'; 
    7 var L_JS_HIDE_LIST = '{L_HIDE_LIST}'; 
    8 </script> 
    95 
    106<h1>{USERNAME} {USER_ICONS} <span class="<!-- IF USER_POINTS_LEVEL < 0 -->badUserResp<!-- ELSE -->goodUserResp<!-- ENDIF -->">{USER_POINTS_LEVEL}</span> 
     
    206202        <tr> 
    207203          <td align="center"> 
    208             <input type="button" value="{L_SEND_PM_SHORT}" onclick="javascript: location.href='{switch_buttons.U_SEND_PM}'" /
     204            <span class="tbut"><a href="{switch_buttons.U_SEND_PM}">{L_SEND_PM_SHORT}</a></span
    209205          </td> 
    210206          <td align="center"> 
    211             <input type="button" value="{L_REPORT_TO_USER}" onclick="javascript: location.href='{switch_buttons.U_REPORT}'" /
     207                 <span class="tbut"><a href="{switch_buttons.U_REPORT}">{L_REPORT_TO_USER}</a></span
    212208          </td> 
    213209        </tr> 
  • templates/reflection/bbcode.html

    r225 r269  
    1 <!-- BEGIN ulist_open --><ul class="liststyle"><!-- END ulist_open --> 
    2 <!-- BEGIN ulist_open_default --><ul><!-- END ulist_open_default --> 
    3 <!-- BEGIN ulist_close --></ul><!-- END ulist_close --> 
    4  
    5 <!-- BEGIN olist_open --><ol style="list-style-type: {LIST_TYPE}"><!-- END olist_open --> 
    6 <!-- BEGIN olist_close --></ol><!-- END olist_close --> 
    7  
    8 <!-- BEGIN listitem --><li><!-- END listitem --> 
    9 <!-- BEGIN listitem_close --></li><!-- END listitem_close --> 
    10  
    111<!-- BEGIN quote_username_open --> 
    122<div class="quotetitle">{USERNAME} {L_POSTED}:</div><div class="quotecontent"> 
     
    2010</div> 
    2111<!-- END quote_close --> 
     12 
     13<!-- BEGIN spoiler_header_open --> 
     14<div class="quotetitle"><a href="javascript:;" onclick="$(this).parents('div:first').next('div').toggle('slow');">{TEXT}:</a></div><div class="quotecontent" style="display:none;"> 
     15<!-- END spoiler_header_open --> 
     16 
     17<!-- BEGIN spoiler_open --> 
     18<div class="quotetitle"><a href="javascript:;" onclick="$(this).parents('div:first').next('div').toggle('slow');">{L_SPOILER}:</a></div><div class="quotecontent" style="display:none"> 
     19<!-- END spoiler_open --> 
     20 
     21<!-- BEGIN spoiler_close --> 
     22</div> 
     23<!-- END spoiler_close --> 
    2224 
    2325<!-- BEGIN pre --> 
     
    3335<!-- END code_close --> 
    3436 
    35 <!-- BEGIN offtop_open --></span> 
    36 <span class="offtop"><b>{L_OFFTOP}:</b><!-- END offtop_open --
    37 <!-- BEGIN offtop_close --></span
    38 <span class="postbody"><!-- END offtop_close --> 
     37<!-- BEGIN offtop_open --> 
     38</span
     39<span class="offtop"><b>{L_OFFTOP}:</b
     40<!-- END offtop_open --> 
    3941 
    40 <!-- BEGIN b_open --><strong><!-- END b_open --> 
    41 <!-- BEGIN b_close --></strong><!-- END b_close --> 
    42  
    43 <!-- BEGIN u_open --><u><!-- END u_open --> 
    44 <!-- BEGIN u_close --></u><!-- END u_close --> 
    45  
    46 <!-- BEGIN i_open --><em><!-- END i_open --> 
    47 <!-- BEGIN i_close --></em><!-- END i_close --> 
    48  
    49 <!-- BEGIN color_open --><span style="color: {COLOR}"><!-- END color_open --> 
    50 <!-- BEGIN color_close --></span><!-- END color_close --> 
    51  
    52 <!-- BEGIN size_open --><span style="font-size: {SIZE}px; line-height: normal"><!-- END size_open --> 
    53 <!-- BEGIN size_close --></span><!-- END size_close --> 
    54  
    55 <!-- BEGIN font --><span style="font-family: {FONT_FAMILY};">{CONTENT}</span><!-- END font --> 
    56  
    57 <!-- BEGIN img --><img src="{URL}" alt="" onload="imgFit(this, 500);" onclick="imgFit(this, 500);" /><!-- END img --> 
    58  
    59 <!-- BEGIN url --><a href="{URL}" target="_blank">{DESCRIPTION}</a><!-- END url --> 
    60  
    61 <!-- BEGIN email --><a href="mailto:{EMAIL}">{DESCRIPTION}</a><!-- END email --> 
     42<!-- BEGIN offtop_close --> 
     43</span><br /> 
     44<span class="postbody"> 
     45<!-- END offtop_close --> 
    6246 
    6347<!-- BEGIN mod_username_open --> 
     
    8367<!-- END mod_close --> 
    8468 
    85 <!-- BEGIN thmbimg --> 
    86 <div align="{ALIGN}"> 
    87  <table border="0"> 
    88   <tr> 
    89    <td><img src="{IMAGE}" align="center" border="0" {SIZE}  onclick="window.open( '{IMAGE}', 'imgpop',  'width={WIDTH},height={HEIGHT},status=no,toolbar=no,menubar=no' );return false" /></td> 
    90   </tr> 
    91   <tr> 
    92    <td align="center" class="gensmall"><i>{NOTICE}</i></td> 
    93   </tr> 
    94  </table> 
    95 </div> 
    96 <!-- END thmbimg --> 
    97  
    9869<!-- BEGIN flash --> 
    9970        <object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=5,0,0,0" width="{WIDTH}" height="{HEIGHT}"> 
  • templates/reflection/browse.html

    r259 r269  
    2222 
    2323<fieldset class="catNamesBlock"> 
    24 {L_SEARCH} <input type="text" name="search" size="40" value="{SEARCH_STRING}" onmouseover="return overlib('{L_JS_SEARCH_EXPLAIN}');" onmouseout="return nd();" /> {L_IN} {CAT_DROP_DOWN} {L_IN} 
    25                 <select name="search_in"><option value="1" {SEARCH_IN_CHECKED_1}>{L_NAME}</option><option value="2" {SEARCH_IN_CHECKED_2}>{L_DESCRIPTION}</option></select> 
     24{L_SEARCH} <input type="text" name="search" size="40" value="{SEARCH_STRING}" onmouseover="return overlib(L_JS_SEARCH_EXPLAIN);" onmouseout="return nd();" /> {L_IN} {CAT_DROP_DOWN} {L_IN} 
     25                {SEARCH_IN_SELECT} 
    2626                <input type="submit" value="{L_SEARCH}" /> 
    2727</fieldset> 
  • templates/reflection/details.html

    r259 r269  
    44<script type="text/javascript" src="{ROOT_PATH}js/ajax_common.js"></script> 
    55<script type="text/javascript" src="{ROOT_PATH}js/overlib.js"></script> 
    6 <script type="text/javascript"> 
    7 var sos_confirm = '{L_SOS_CONFIRM}'; 
    8 var simpaty_descr = '{L_SIMPATY_DESCR}'; 
    9 var resp = '{L_RESPECT}'; 
    10 var antiresp = '{L_ANTIRESPECT}'; 
    11 var L_JS_SEE_FULL_LIST = '{L_SEE_FULL_LIST}'; 
    12 var L_JS_HIDE_LIST = '{L_HIDE_LIST}'; 
    13 </script> 
    146 
    15 <!-- BEGIN torrent_details --> 
    167<!-- IF MESSAGE1 --><h1>{MESSAGE1}</h1><!-- ENDIF --> 
    178<!-- IF MESSAGE2 --><p>{MESSAGE2}</p><!-- ENDIF --> 
     
    3930<!-- END switch_nfo_section --> 
    4031 
    41 <!-- BEGIN switch_banned_section --> 
     32<!-- IF S_USER_IS_MOD --> 
    4233<div class="torrentViewLeft">{L_BANNED}</div> 
    4334<div class="torrentViewRight">{BANNED}</div> 
    44 <!-- END switch_banned_section --> 
     35<!-- ENDIF --> 
    4536 
    4637<div class="torrentViewLeft">{L_TYPE}</div> 
    4738<div class="torrentViewRight">{TYPE}</div> 
     39 
     40<div class="torrentViewLeft">{L_TAGS}</div> 
     41<div class="torrentViewRight"><!-- INCLUDE tags_view_form.html --></div> 
    4842 
    4943<div class="torrentViewLeft">{L_LAST_SEEDER}</div> 
     
    5852    <select name="rating" id="rating_select"> 
    5953    <option value="0">({L_ADD_RATING})</option> 
    60     {torrent_details.switch_rating_form.RATING_OPTIONS} 
     54    {switch_rating_form.RATING_OPTIONS} 
    6155    </select> 
    6256    <input type="button" value="{L_VOTE}!" onclick="rating('{ID}', document.getElementById('rating_select').value );return false;" id="rating_button"  /> 
     
    7670<div class="torrentViewLeft"><a name="snatchedlist" id="snatchedlist"></a>{L_SNATCHED_USERS}<br /> 
    7771    <a href="javascript:void(0);" onclick="view_details_ext('snatchedlist', '{ID}', 'details');" id="snatchedlist_href">[<!-- IF SNATCHEDLIST_TPL -->{L_HIDE_LIST}<!-- ELSE -->{L_SEE_FULL_LIST}<!-- ENDIF -->]</a></div> 
    78 <div class="torrentViewRight">{torrent_details.switch_simple_snatched.SIMPLE_SNATCHED_COUNT}<div id="snatchedlist_row">{SNATCHEDLIST_TPL}</div></div> 
     72<div class="torrentViewRight">{switch_simple_snatched.SIMPLE_SNATCHED_COUNT}<div id="snatchedlist_row">{SNATCHEDLIST_TPL}</div></div> 
    7973<br /><br /><br /><br /> 
    8074<!-- END switch_simple_snatched --> 
     
    109103<div class="torrentViewLeft">{L_THANKS_USERS}</div> 
    110104<div class="torrentViewRight"> 
    111     <!-- BEGIN switch_thanks --> 
    112     <input type="button" id="thanks_button" value="{L_THANKS}"  onclick="thanks('{ID}', <!-- IF torrent_details.switch_thanks.THANKS_USERS -->1<!-- ELSE -->0<!-- ENDIF -->);return false;" {torrent_details.switch_thanks.DISABLED} /> 
    113     <span id="thanks_users"><!-- IF torrent_details.switch_thanks.THANKS_USERS -->{torrent_details.switch_thanks.THANKS_USERS}<!-- ELSE -->{L_NO_THANKS}<!-- ENDIF --></span> 
    114     <!-- END switch_thanks --> 
     105<input type="button" id="thanks_button" value="{L_THANKS}"  onclick="thanks('{ID}', 0);return false;" /> 
     106<a href="javascript:;" onclick="view_details_ext('thanks', '{ID}', 'details');" id="thanks_href">[{L_SEE_FULL_LIST}]</a><div id="thanks_row"></div> 
    115107</div> 
     108 
    116109</div> 
    117110<br clear="all" /> 
    118111 
    119 <!-- END torrent_details --> 
    120  
    121  
    122 <!-- BEGIN switch_comments_details_head --> 
    123  
    124 <h1>{switch_comments_details_head.COMMENTS_FOR}</h1> 
    125 <!-- END switch_comments_details_head --> 
    126 <!-- BEGIN switch_no_comments_details --> 
    127 <h1>{L_NO_COMMENTS_YET}</h1> 
    128 <!-- IF switch_no_comments_details.DISABLE_COMMENTS == 0 --><a href="{switch_no_comments_details.U_ADD_COMMENT}">{switch_no_comments_details.L_ADD_NEW_COMMENT}</a> 
    129 &nbsp;&nbsp;&nbsp;&nbsp; 
    130 <!-- IF switch_no_comments_details.U_CHECK --><a href="{switch_no_comments_details.U_CHECK}">{switch_no_comments_details.CHECK_TITLE}</a><!-- ENDIF --><!-- ELSE -->{L_COMMENTS_DISABLED}<!-- ENDIF --> 
     112<!-- INCLUDE details_comments.html --> 
    131113 
    132114<!-- INCLUDE overall_footer.html --> 
    133  
    134 <!-- END switch_no_comments_details --> 
    135  
    136  
    137 <!-- BEGIN switch_comments_details --> 
    138  
    139 <!-- IF switch_comments_details.DISABLE_COMMENTS == 0 --><a href="{switch_comments_details.U_ADD_COMMENT}">{switch_comments_details.L_ADD_NEW_COMMENT}</a> 
    140 &nbsp;&nbsp;&nbsp;&nbsp; 
    141 <!-- IF switch_comments_details.U_CHECK --><a href="{switch_comments_details.U_CHECK}">{switch_comments_details.CHECK_TITLE}</a><!-- ENDIF --><!-- ELSE -->{L_COMMENTS_DISABLED}<!-- ENDIF --> 
    142 <br /> 
    143 {switch_comments_details.PAGERTOP} 
    144 <br /> 
    145 <a name="startcomments" id="startcomments"></a> 
    146 {COMMENTS_TABLE} 
    147 {switch_comments_details.PAGERBOTTOM} 
    148 <!-- IF switch_comments_details.DISABLE_COMMENTS == 0 --><a href="{switch_comments_details.U_ADD_COMMENT}">{switch_comments_details.L_ADD_NEW_COMMENT}</a> 
    149 &nbsp;&nbsp;&nbsp;&nbsp; 
    150 <!-- IF switch_comments_details.U_CHECK --><a href="{switch_comments_details.U_CHECK}">{switch_comments_details.CHECK_TITLE}</a><!-- ENDIF --><!-- ELSE -->{L_COMMENTS_DISABLED}<!-- ENDIF --> 
    151  
    152 <!-- INCLUDE overall_footer.html --> 
    153 <!-- END switch_comments_details --> 
  • templates/reflection/forum/index_body.tpl

    r90 r269  
    4949  <tr> 
    5050        <td align="left"> 
    51         <!-- BEGIN switch_curuser_view --> 
     51        <!-- IF S_USER_LOGGED_IN --> 
    5252        <span class="gensmall"><a href="{U_MARK_READ}" class="gensmall">{L_MARK_ALL_FORUMS}</a></span> 
    53          <!-- END switch_curuser_view --> 
     53         <!-- ENDIF --> 
    5454        </td> 
    5555        <td align="right"><span class="gensmall">{S_TIMEZONE}</span></td> 
  • templates/reflection/forum/modcp_delete_posts.tpl

    r90 r269  
    3131                <table width="100%" cellspacing="0" cellpadding="3" border="0"> 
    3232                  <tr> 
    33                         <td valign="middle" class="{postrow.ROW_CLASS}" align="left"><img src="{TEMPLATE_PATH}/images/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_POSTED}: 
     33                        <td valign="middle" class="{postrow.ROW_CLASS}" align="left"><img src="{TEMPLATE_PATH}/images/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_ADDED}: 
    3434                          {postrow.POST_DATE}&nbsp;&nbsp;&nbsp;&nbsp;{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 
    3535                  </tr> 
  • templates/reflection/forum/modcp_split.tpl

    r90 r269  
    5252                <table width="100%" cellspacing="0" cellpadding="3" border="0"> 
    5353                  <tr>  
    54                         <td valign="middle"><img src="{TEMPLATE_PATH}/images/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_POSTED}:  
     54                        <td valign="middle"><img src="{TEMPLATE_PATH}/images/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_ADDED}:  
    5555                          {postrow.POST_DATE}&nbsp;&nbsp;&nbsp;&nbsp;{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 
    5656                  </tr> 
  • templates/reflection/forum/posting_body.tpl

    r259 r269  
    4646// Define the bbCode tags 
    4747bbcode = new Array(); 
    48 bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[offtop]','[/offtop]','[mod={EDITOR_NAME}]','[/mod]'); 
     48bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[offtop]','[/offtop]','[spoiler]','[/spoiler]','[mod={EDITOR_NAME}]','[/mod]'); 
    4949imageTag = false; 
    5050 
     
    357357                                                                        </select> &nbsp; 
    358358                                                                        <select name="addbbcodefontsize" onChange="bbfontstyle('[size=' + this.form.addbbcodefontsize.options[this.form.addbbcodefontsize.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;" onMouseOver="helpline('f')"> 
    359                                                                     <option value="0" selected="selected">{L_TEXT_SIZE}</option> 
    360                                                                                <option value="7" class="genmed">{L_FONT_TINY}</option> 
    361                                                              <option value="9" class="genmed">{L_FONT_SMALL}</option> 
    362                                                        <option value="12" class="genmed">{L_FONT_NORMAL}</option> 
    363                                                        <option value="18" class="genmed">{L_FONT_LARGE}</option> 
    364                                                        <option  value="24" class="genmed">{L_FONT_HUGE}</option> 
     359                                                                    <option value="0" selected="selected">{L_FONT_SIZE}</option> 
     360                                          <option value="1" class="genmed">{L_FONT_TINY}</option> 
     361                                          <option value="2" class="genmed">{L_FONT_SMALL}</option> 
     362                                          <option value="3" class="genmed">{L_FONT_NORMAL}</option> 
     363                                          <option value="5" class="genmed">{L_FONT_LARGE}</option> 
     364                                          <option  value="7" class="genmed">{L_FONT_HUGE}</option> 
    365365                                                </select> 
    366366                                                                </td> 
  • templates/reflection/forum/posting_preview.tpl

    r90 r269  
    55        </tr> 
    66        <tr>  
    7                 <td class="row1"><img src="{TEMPLATE_PATH}/images/icon_minipost.gif" alt="{L_POST}" /><span class="postdetails">{L_POSTED}: {POST_DATE} &nbsp;&nbsp;&nbsp; {L_POST_SUBJECT}: {POST_SUBJECT}</span></td> 
     7                <td class="row1"><img src="{TEMPLATE_PATH}/images/icon_minipost.gif" alt="{L_POST}" /><span class="postdetails">{L_ADDED}: {POST_DATE} &nbsp;&nbsp;&nbsp; {L_POST_SUBJECT}: {POST_SUBJECT}</span></td> 
    88        </tr> 
    99        <tr>  
  • templates/reflection/forum/posting_topic_review.tpl

    r90 r269  
    1919                <td class="{postrow.ROW_CLASS}" height="28" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> 
    2020                        <tr> 
    21                                 <td width="100%"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_POSTED}: {postrow.POST_DATE}<span class="gen">&nbsp;</span>&nbsp;&nbsp;&nbsp;{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 
     21                                <td width="100%"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_ADDED}: {postrow.POST_DATE}<span class="gen">&nbsp;</span>&nbsp;&nbsp;&nbsp;{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 
    2222                        </tr> 
    2323                        <tr> 
  • templates/reflection/forum/search_results_posts.tpl

    r90 r269  
    2828          {L_VIEWS}: <b>{searchresults.TOPIC_VIEWS}</b></span><br /> 
    2929        </td> 
    30         <td width="100%" valign="top" class="row1"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_FORUM}:&nbsp;<b><a href="{searchresults.U_FORUM}" class="postdetails">{searchresults.FORUM_NAME}</a></b>&nbsp; &nbsp;{L_POSTED}: {searchresults.POST_DATE}&nbsp; &nbsp;{L_SUBJECT}: <b><a href="{searchresults.U_POST}">{searchresults.POST_SUBJECT}</a></b></span></td> 
     30        <td width="100%" valign="top" class="row1"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_FORUM}:&nbsp;<b><a href="{searchresults.U_FORUM}" class="postdetails">{searchresults.FORUM_NAME}</a></b>&nbsp; &nbsp;{L_ADDED}: {searchresults.POST_DATE}&nbsp; &nbsp;{L_SUBJECT}: <b><a href="{searchresults.U_POST}">{searchresults.POST_SUBJECT}</a></b></span></td> 
    3131  </tr> 
    3232  <tr> 
  • templates/reflection/forum/topic_search_results.tpl

    r83 r269  
    2626          <br /> 
    2727        </td> 
    28         <td width="100%" valign="top" class="row1" align="left"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails">&nbsp;{L_POSTED}: {searchresults.POST_DATE}&nbsp;</span></td> 
     28        <td width="100%" valign="top" class="row1" align="left"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails">&nbsp;{L_ADDED}: {searchresults.POST_DATE}&nbsp;</span></td> 
    2929  </tr> 
    3030  <tr> 
  • templates/reflection/forum/viewtopic_body.tpl

    r259 r269  
    2323l_no_text_selected = "{L_NO_TEXT_SELECTED}"; 
    2424bbcode = new Array(); 
    25 bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[offtop]','[/offtop]','[mod={S_EDITOR_NAME}]','[/mod]'); 
     25bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[offtop]','[/offtop]','[spoiler]','[/spoiler]','[mod={S_EDITOR_NAME}]','[/mod]'); 
    2626imageTag = false; 
    2727//--> 
     
    9191                <table width="100%" border="0" cellspacing="0" cellpadding="0"> 
    9292                        <tr> 
    93                                 <td width="100%"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails">{L_POSTED}: {postrow.POST_DATE}<span class="gen">&nbsp;</span>&nbsp; &nbsp;{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 
     93                                <td width="100%"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails">{L_ADDED}: {postrow.POST_DATE}<span class="gen">&nbsp;</span>&nbsp; &nbsp;{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 
    9494                                <td valign="top" nowrap="nowrap" class="{postrow.ROW_CLASS}" align="right">{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}</td> 
    9595                        </tr> 
  • templates/reflection/overall_header.html

    r260 r269  
    2727 
    2828<script type="text/javascript" src="{ROOT_PATH}js/functions.js"></script> 
     29<script type="text/javascript" src="{ROOT_PATH}js/jquery.js"></script> 
    2930<script type="text/javascript"> 
    30         var sizes_ary = {'{L_KILOBYTES}':1024,'{L_MEGABYTES}':1024*1024,'{L_GIGABYTES}':1024*1024*1024,'{L_TERABYTES}':1024*1024*1024*1024}; 
    3131        var SID = '{SID}'; 
    3232        var TRACKER_URL = '{ROOT_PATH}'; 
    33         var l_post_something = '{L_POST_SOMETHING}'; 
    34         var L_JS_MARKED = '{L_MARKED}'; 
    3533        var ol_bgcolor = "#FFFFFF"; 
     34 
     35        <!-- BEGIN javascript_lang --> 
     36        var {javascript_lang.KEY} = '{javascript_lang.VALUE}'; 
     37        <!-- END --> 
    3638</script> 
    3739 
     
    5456                <!-- Menu is displayed in reverse order from how you define it (caused by float: right) --> 
    5557                <a href="{U_STAFF}" class="lastMenuItem">{L_STAFF}</a> 
    56                 <!-- BEGIN switch_curuser_view --> 
     58                <!-- IF S_USER_LOGGED_IN --> 
    5759                <a href="{U_HELPDESC}">{L_HELPDESC}</a> 
    58                 <!-- END switch_curuser_view --> 
     60                <!-- ENDIF --> 
    5961                <a href="{U_FORUM}">{L_FORUMS}</a> 
    6062                <a href="{U_RULES}">{L_RULES}</a> 
    6163                <a href="{U_FAQ}">{L_FAQ}</a> 
    62                 <!-- BEGIN switch_non_curuser_view --> 
     64                <!-- IF not S_USER_LOGGED_IN --> 
    6365                <a href="{U_LOGIN}">{L_LOGIN}</a> 
    6466                <a href="{U_SIGNUP}">{L_SIGNUP}</a> 
    65                 <!-- END switch_non_curuser_view --> 
     67                <!-- ENDIF --> 
    6668                <!-- BEGIN switch_non_uploader_view --> 
    6769                <a href="{U_UPLOADAPP}">{L_UPLOAD}</a> 
     
    8183 
    8284                        <div id="contentLeftWrapper"> 
    83                                 <!-- BEGIN user_panel --> 
     85                                <!-- IF S_USER_LOGGED_IN --> 
    8486                                <p> 
    8587                                <span class="header">{L_MY_PROFILE}</span> 
    86                                 {L_HELLO}<a href="{U_USERDETAILS_LINK}"><b>{user_panel.CURUSER_NAME}</b></a> {user_panel.CURUSER_ICONS} 
     88                                {L_HELLO}<a href="{U_USERDETAILS_LINK}"><b>{CURRENT_USER_NAME}</b></a> {CURRENT_USER_ICONS} 
    8789 
    8890                                <span class="<!-- IF CURRENT_USER_POINTS_LEVEL < 0 -->badUserResp<!-- ELSE -->goodUserResp<!-- ENDIF -->">{CURRENT_USER_POINTS_LEVEL}</span> 
     
    9092                                [<a href="{U_LOGOUT}">{L_LOGOUT}</a>]<br /> 
    9193 
    92                                 {L_RATIO}: {user_panel.RATIO}  <img alt="{L_UPLOADED}" title="{L_UPLOADED}" src="pic/arrowup.gif" />  {user_panel.UPED} <img alt="{L_DOWNLOADED}" title="{L_DOWNLOADED}" src="pic/arrowdown.gif" />  {user_panel.DOWNED}<br /> 
    93                                 <!-- IF WARN_PANEL -->{user_panel.WARN_PANEL}<br /><!-- ENDIF --> 
    94                                 <a href="{U_MESSAGES_INBOX}"><img src="{user_panel.INBOX_PM_PIC}" height="14" alt="{user_panel.PM_TITLE}" /></a> {L_INBOX} 
    95                                 <a href="{U_MESSAGES_SENTBOX}"> <img src="{user_panel.SENTBOX_PIC}" height="14" alt="{L_SENTBOX}" /></a> {L_SENTBOX} 
    96                                 <a href="{U_MY_FRIENDS}"><img src="{user_panel.BUDDYLIST_PIC}" height="14" alt="{L_BUDDYLIST}" /></a><br /> 
    97                                 {user_panel.S_CURRENT_TIME} 
     94                                {L_RATIO}: {CURRENT_USER_RATIO}        <img alt="{L_UPLOADED}" title="{L_UPLOADED}" src="pic/arrowup.gif" />  {CURRENT_USER_UPED} <img alt="{L_DOWNLOADED}" title="{L_DOWNLOADED}" src="pic/arrowdown.gif" />  {CURRENT_USER_DOWNED}<br /> 
     95                                <!-- IF CURRENT_USER_WARN_PANEL -->{CURRENT_USER_WARN_PANEL}<br /><!-- ENDIF --> 
     96                                <a href="{U_MESSAGES_INBOX}"><img src="{INBOX_PM_PIC}" height="14" alt="{PM_TITLE}" /></a> {L_INBOX} 
     97                                <a href="{U_MESSAGES_SENTBOX}"> <img src="{SENTBOX_PIC}" height="14" alt="{L_SENTBOX}" /></a> {L_SENTBOX} 
     98                                <a href="{U_MY_FRIENDS}"><img src="{BUDDYLIST_PIC}" height="14" alt="{L_BUDDYLIST}" /></a><br /> 
     99                                {S_CURRENT_TIME} 
    98100                                <script type="text/javascript"> 
    99101                                clock.add_clock('{CURRENT_TIME}', 'clock'); 
     
    101103                                </script> 
    102104                                </p> 
    103                                 <!-- END user_panel --> 
    104  
    105                                 <p> 
    106                                 <!-- BEGIN switch_curuser_view --> 
     105                                <!-- ENDIF --> 
     106 
     107                                <p> 
     108                                <!-- IF S_USER_LOGGED_IN --> 
    107109                                <span class="header">{L_TORRENTS}</span> 
    108110                                <a href="{U_BROWSE}">{L_BROWSE}</a><br /> 
     
    110112                                <a href="{U_REQUESTS}">{L_REQUESTS}</a><br /> 
    111113                                <a href="{U_OFFERS}">{L_OFFERS}</a><br /> 
    112                                 <!-- END switch_curuser_view --> 
     114                                <!-- ENDIF --> 
    113115                                <!-- BEGIN switch_non_uploader_view --> 
    114116                                <a href="{U_UPLOADAPP}">{L_UPLOAD}</a> 
     
    127129                                </p> 
    128130 
    129                                 <!-- BEGIN switch_curuser_view --> 
     131                                <!-- IF S_USER_LOGGED_IN --> 
    130132                                <p> 
    131133                                <span class="header">{L_PERSONAL}</span> 
     
    140142                                <!-- IF U_MY_INVITES --><a href="{U_MY_INVITES}">{L_MY_INVITES}</a><!-- ENDIF --> 
    141143                                </p> 
    142                                 <!-- END switch_curuser_view --> 
     144                                <!-- ENDIF --> 
     145 
    143146 
    144147                                <p> 
     
    154157                                <a href="{U_STAFF}">{L_STAFF}</a><br /> 
    155158                                <a href="{U_LOG}">{L_LOG}</a><br /> 
    156                                 <!-- BEGIN switch_moderator_view --> 
     159                                <!-- IF S_USER_IS_MOD --> 
    157160                                <a href="{U_HELPDESC}"><!-- IF HELPDESC_NUM > 0 --><span style="color:red;"><b>{L_HELPDESC} ({HELPDESC_NUM})</b></span><!-- ELSE -->{L_HELPDESC}<!-- ENDIF --></a><br /> 
    158161                                <a href="{U_UPLOADAPP}"><!-- IF CANDIDATES_NUM > 0 --><span style="color:red;"><b>{L_CANDIDATES} ({CANDIDATES_NUM})</b></span><!-- ELSE -->{L_CANDIDATES}<!-- ENDIF --></a><br /> 
    159162                                <a href="{U_REPORTS}"><!-- IF REPORTS_NUM > 0 --><span style="color:red;"><b>{L_REPORTS} ({REPORTS_NUM})</b></span><!-- ELSE -->{L_REPORTS}<!-- ENDIF --></a><br /> 
    160163                                <a href="{U_USERSEARCH}"><span>{L_USER_SEARCH}</span></a><br /> 
    161                                 <!-- END switch_moderator_view --> 
     164                                <!-- ENDIF --> 
    162165 
    163166                                <!-- BEGIN switch_admin_view --> 
  • templates/reflection/reflection.cfg

    r83 r269  
    141141$config['vote_graphic_length'] = 205; 
    142142 
     143$config['min_tag_size'] = '11'; //min tag size in pixeils 
     144$config['max_tag_size'] = '25'; //max tag size in pixeils 
     145 
    143146// Start add - Online/Offline/Hidden Mod 
    144147$images['icon_online'] = $current_template_images . '/{LANG}/icon_online.png'; 
  • templates/reflection/reflection.css

    r234 r269  
    809809.helpline { background-color: #DEE3E7; border-style: none; } 
    810810 
    811 /* Quote & Code blocks */ 
     811.liststyle { 
     812        margin-left:20px; 
     813
     814 
     815/* Copyright and bottom info */ 
     816.copyright              { font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #444444; letter-spacing: -1px;} 
     817a.copyright             { color: #444444; text-decoration: none;} 
     818a.copyright:hover { color: #000000; text-decoration: underline;} 
     819 
     820/* The text input fields background colour */ 
     821input.post, textarea.post, select { 
     822        background-color : #FFFFFF; 
     823
     824 
     825/* The main submit button option */ 
     826input.mainoption { 
     827        background-color : #FAFAFA; 
     828        font-weight : bold; 
     829
     830 
     831/* None-bold submit button */ 
     832input.liteoption { 
     833        background-color : #FAFAFA; 
     834        font-weight : normal; 
     835
     836 
     837/* This is the line in the posting page which shows the rollover 
     838  help line. This is actually a text box, but if set to be the same 
     839  colour as the background no one will know ;) 
     840*/ 
     841.helpline { background-color: #DEE3E7; border-style: none; } 
     842/* Set Image style */ 
     843img, .forumline img { 
     844        border: 0; 
     845
     846/* Begin Simple Subforums MOD */ 
     847a.topic-new, a.topic-new:visited { color: #DD6900; } 
     848a.topic-new:hover, a.topic-new:active { color: #006699; } 
     849/* End Simple Subforums MOD */ 
     850 
     851.pager_page { 
     852        padding:2px; 
     853        font-weight:bold; 
     854
     855 
     856.pager_page_selected { 
     857        padding:2px; 
     858        font-weight:bold; 
     859
     860 
     861a.upReputationLink:link, 
     862a.upReputationLink:visited 
     863
     864    font-size: 1em; 
     865    line-height: 10px; 
     866    background: transparent url(images/arrow-up-v2.gif) no-repeat 0 1px; 
     867    padding: 1px 5px; 
     868    text-decoration: none; 
     869
     870 
     871a.upReputationLink:hover, 
     872a.upReputationLink:active 
     873
     874    background: transparent url(images/arrow-up-v2.gif) no-repeat 0 -15px; 
     875
     876 
     877a.downReputationLink:link, 
     878a.downReputationLink:visited 
     879
     880    font-size: 1em; 
     881    line-height: 10px; 
     882    background: transparent url(images/arrow-down-v2.gif) no-repeat 0 1px; 
     883    padding: 1px 6px; 
     884    text-decoration: none; 
     885
     886 
     887a.downReputationLink:hover, 
     888a.downReputationLink:active 
     889
     890    background: transparent url(images/arrow-down-v2.gif) no-repeat 0 -15px; 
     891
     892 
     893span.goodResp 
     894
     895    background: #66cc66; 
     896    border: 1px solid #339966; 
     897    padding: 1px 3px 2px 3px; 
     898
     899 
     900span.badResp 
     901
     902    background: #ff6666; 
     903    border: 1px solid #ff3333; 
     904    padding: 1px 3px 2px 3px; 
     905
     906 
     907span.usergoodResp 
     908
     909    color: #66cc66; 
     910
     911 
     912span.userbadResp 
     913
     914    color: #ff3333; 
     915
     916 
     917.respectUserList { 
     918        border-top:1px solid #696969; 
     919        white-space: normal; 
     920
     921 
     922.message_msg p {font-size: 10px; color: #000000; margin:8px 0px 0px 0px;} 
     923 
     924.mod { 
     925    margin: 10px 5px 0px 5px; 
     926    line-height: 125%; 
     927    font-size:10px; background-color:#FFFFFF; 
     928    border-color: #A9B8C2; 
     929        border-width: 1px 1px 1px 1px; 
     930        border-style: solid; 
     931        color:#000000; 
     932
     933.modtable { 
     934    background-color: #ff6060; 
     935        height:50px; width: 40px; 
     936        text-align:center; 
     937
     938.exclamation { 
     939    font-weight: bold; 
     940        font-family: Times New Roman, Verdana; 
     941        font-size : 45px; 
     942        color: #ffffff; 
     943
     944 
     945span.goodUserResp 
     946
     947    background: #cccc00; 
     948    border: 1px solid #999900; 
     949    padding: 0 3px 0 3px; 
     950    color: #ffffff; 
     951
     952 
     953span.badUserResp 
     954
     955    background: #999900; 
     956    border: 1px solid #666600; 
     957    padding: 0 3px 0 3px; 
     958    color: #ffffff; 
     959
     960 
     961/* bb tags */ 
    812962.codetitle { 
    813963        margin: 10px 5px 0px 5px; 
     
    8691019} 
    8701020 
    871 .liststyle { 
    872         margin-left:20px; 
    873 
    874  
    875 /* Copyright and bottom info */ 
    876 .copyright              { font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #444444; letter-spacing: -1px;} 
    877 a.copyright             { color: #444444; text-decoration: none;} 
    878 a.copyright:hover { color: #000000; text-decoration: underline;} 
    879  
    880 /* The text input fields background colour */ 
    881 input.post, textarea.post, select { 
    882         background-color : #FFFFFF; 
    883 
    884  
    885 /* The main submit button option */ 
    886 input.mainoption { 
    887         background-color : #FAFAFA; 
    888         font-weight : bold; 
    889 
    890  
    891 /* None-bold submit button */ 
    892 input.liteoption { 
    893         background-color : #FAFAFA; 
    894         font-weight : normal; 
    895 
    896  
    897 /* This is the line in the posting page which shows the rollover 
    898   help line. This is actually a text box, but if set to be the same 
    899   colour as the background no one will know ;) 
    900 */ 
    901 .helpline { background-color: #DEE3E7; border-style: none; } 
    902 /* Set Image style */ 
    903 img, .forumline img { 
    904         border: 0; 
    905 
    906 /* Begin Simple Subforums MOD */ 
    907 a.topic-new, a.topic-new:visited { color: #DD6900; } 
    908 a.topic-new:hover, a.topic-new:active { color: #006699; } 
    909 /* End Simple Subforums MOD */ 
    910  
    911 .pager_page { 
    912         padding:2px; 
    913         font-weight:bold; 
    914 
    915  
    916 .pager_page_selected { 
    917         padding:2px; 
    918         font-weight:bold; 
    919 
    920  
    921 a.upReputationLink:link, 
    922 a.upReputationLink:visited 
    923 
    924     font-size: 1em; 
    925     line-height: 10px; 
    926     background: transparent url(images/arrow-up-v2.gif) no-repeat 0 1px; 
    927     padding: 1px 5px; 
    928     text-decoration: none; 
    929 
    930  
    931 a.upReputationLink:hover, 
    932 a.upReputationLink:active 
    933 
    934     background: transparent url(images/arrow-up-v2.gif) no-repeat 0 -15px; 
    935 
    936  
    937 a.downReputationLink:link, 
    938 a.downReputationLink:visited 
    939 
    940     font-size: 1em; 
    941     line-height: 10px; 
    942     background: transparent url(images/arrow-down-v2.gif) no-repeat 0 1px; 
    943     padding: 1px 6px; 
    944     text-decoration: none; 
    945 
    946  
    947 a.downReputationLink:hover, 
    948 a.downReputationLink:active 
    949 
    950     background: transparent url(images/arrow-down-v2.gif) no-repeat 0 -15px; 
    951 
    952  
    953 span.goodResp 
    954 
    955     background: #66cc66; 
    956     border: 1px solid #339966; 
    957     padding: 1px 3px 2px 3px; 
    958 
    959  
    960 span.badResp 
    961 
    962     background: #ff6666; 
    963     border: 1px solid #ff3333; 
    964     padding: 1px 3px 2px 3px; 
    965 
    966  
    967 span.usergoodResp 
    968 
    969     color: #66cc66; 
    970 
    971  
    972 span.userbadResp 
    973 
    974     color: #ff3333; 
    975 
    976  
    977 .respectUserList { 
    978         border-top:1px solid #696969; 
    979         white-space: normal; 
    980 
    981  
    982 .message_msg p {font-size: 10px; color: #000000; margin:8px 0px 0px 0px;} 
    983  
    984 .mod { 
    985     margin: 10px 5px 0px 5px; 
    986     line-height: 125%; 
    987     font-size:10px; background-color:#FFFFFF; 
    988     border-color: #A9B8C2; 
    989         border-width: 1px 1px 1px 1px; 
    990         border-style: solid; 
    991         color:#000000; 
    992 
    993 .modtable { 
    994     background-color: #ff6060; 
    995         height:50px; width: 40px; 
    996         text-align:center; 
    997 
    998 .exclamation { 
    999     font-weight: bold; 
    1000         font-family: Times New Roman, Verdana; 
    1001         font-size : 45px; 
    1002         color: #ffffff; 
    1003 
    1004  
    1005 span.goodUserResp 
    1006 
    1007     background: #cccc00; 
    1008     border: 1px solid #999900; 
    1009     padding: 0 3px 0 3px; 
    1010     color: #ffffff; 
    1011 
    1012  
    1013 span.badUserResp 
    1014 
    1015     background: #999900; 
    1016     border: 1px solid #666600; 
    1017     padding: 0 3px 0 3px; 
    1018     color: #ffffff; 
    1019 
     1021ul.bb, ol.bb { 
     1022        padding-left:25px; 
     1023
     1024 
     1025.jqifade{ 
     1026      position: absolute; 
     1027      background-color: #aaaaaa; 
     1028
     1029div.jqi{ 
     1030      width: 400px; 
     1031      font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; 
     1032      position: absolute; 
     1033      background-color: #ffffff; 
     1034      font-size: 11px; 
     1035      text-align: left; 
     1036      border: solid 1px #eeeeee; 
     1037      -moz-border-radius: 10px; 
     1038      -webkit-border-radius: 10px; 
     1039      padding: 7px; 
     1040
     1041div.jqi .jqicontainer{ 
     1042      font-weight: bold; 
     1043
     1044div.jqi .jqiclose{ 
     1045      position: absolute; 
     1046      top: 4px; right: -2px; 
     1047      width: 18px; 
     1048      cursor: default; 
     1049      color: #bbbbbb; 
     1050      font-weight: bold; 
     1051
     1052div.jqi .jqimessage{ 
     1053      padding: 10px; 
     1054      line-height: 20px; 
     1055      color: #444444; 
     1056
     1057div.jqi .jqibuttons{ 
     1058      text-align: right; 
     1059      padding: 5px 0 5px 0; 
     1060      border: solid 1px #eeeeee; 
     1061      background-color: #f4f4f4; 
     1062
     1063div.jqi button{ 
     1064      padding: 3px 10px; 
     1065      margin: 0 10px; 
     1066      background-color: #2F6073; 
     1067      border: solid 1px #f4f4f4; 
     1068      color: #ffffff; 
     1069      font-weight: bold; 
     1070      font-size: 12px; 
     1071
     1072div.jqi button:hover{ 
     1073      background-color: #728A8C; 
     1074
     1075div.jqi button.jqidefaultbutton{ 
     1076      background-color: #BF5E26; 
     1077
     1078.jqiwarning .jqi .jqibuttons{ 
     1079      background-color: #BF5E26; 
     1080
     1081 
     1082.ac_results { 
     1083        padding: 0px; 
     1084        border: 1px solid WindowFrame; 
     1085        background-color: Window; 
     1086        overflow: hidden; 
     1087
     1088 
     1089.ac_results ul { 
     1090        width: 100%; 
     1091        list-style-position: outside; 
     1092        list-style: none; 
     1093        padding: 0; 
     1094        margin: 0; 
     1095
     1096 
     1097.ac_results iframe { 
     1098        display:none;/*sorry for IE5*/ 
     1099        display/**/:block;/*sorry for IE5*/ 
     1100        position:absolute; 
     1101        top:0; 
     1102        left:0; 
     1103        z-index:-1; 
     1104        filter:mask(); 
     1105        width:3000px; 
     1106        height:3000px; 
     1107
     1108 
     1109.ac_results li { 
     1110        margin: 0px; 
     1111        padding: 2px 5px; 
     1112        cursor: pointer; 
     1113        display: block; 
     1114        width: 100%; 
     1115        font: menu; 
     1116        font-size: 12px; 
     1117        overflow: hidden; 
     1118
     1119 
     1120.ac_over { 
     1121        background-color: Highlight; 
     1122        color: HighlightText; 
     1123
  • templates/reflection/textbbcode.html

    r259 r269  
    279279        </select> 
    280280 
    281         <select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;"> 
    282         <option value="0" selected="selected">{L_TEXT_SIZE}</option> 
    283         <option value="7" class="genmed">{L_SMALL}</option> 
    284         <option value="11" class="genmed">{L_STANDART}</option> 
    285         <option value="16" class="genmed">{L_BIG}</option> 
    286         <option value="24" class="genmed">{L_VERY_BIG}</option> 
     281        <select name="addbbcode30" onchange="bbfontstyle('[size=' + this.form.addbbcode30.options[this.form.addbbcode30.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;"> 
     282        <option value="0" selected="selected">{L_FONT_SIZE}</option> 
     283                                          <option value="1" class="genmed">{L_FONT_TINY}</option> 
     284                                          <option value="2" class="genmed">{L_FONT_SMALL}</option> 
     285                                          <option value="3" class="genmed">{L_FONT_NORMAL}</option> 
     286                                          <option value="5" class="genmed">{L_FONT_LARGE}</option> 
     287                                          <option  value="7" class="genmed">{L_FONT_HUGE}</option> 
    287288        </select> 
    288289 
  • templates/reflection/userdetails.html

    r260 r269  
    33<script type="text/javascript" src="{ROOT_PATH}js/ajax.js"></script> 
    44<script type="text/javascript" src="{ROOT_PATH}js/ajax_common.js"></script> 
    5 <script type="text/javascript"> 
    6 var L_JS_SEE_FULL_LIST = '{L_SEE_FULL_LIST}'; 
    7 var L_JS_HIDE_LIST = '{L_HIDE_LIST}'; 
    8 </script> 
    95 
    106<h1>{USERNAME}{USER_ICONS} <span class="<!-- IF USER_POINTS_LEVEL < 0 -->badUserResp<!-- ELSE -->goodUserResp<!-- ENDIF -->">{USER_POINTS_LEVEL}</span> 
     
    224220        <!-- BEGIN switch_buttons --> 
    225221        <div class="tableRow"> 
    226                 <div class="leftCell" style="width:100%"> 
    227                   <input type="button" value="{L_SEND_PM_SHORT}" onclick="javascript: location.href='{switch_buttons.U_SEND_PM}'" /> 
    228                   <input type="button" value="{L_REPORT_TO_USER}" onclick="javascript: location.href='{switch_buttons.U_REPORT}'" /> 
     222                <div class="leftCell" style="width:100%;padding:5px;"> 
     223                        <div class="commentButtonsBlock"> 
     224                                <a href="{switch_buttons.U_SEND_PM}">{L_SEND_PM_SHORT}</a> 
     225                                <a href="{switch_buttons.U_REPORT}">{L_REPORT_TO_USER}</a> 
     226 
     227                        </div> 
    229228                </div> 
    230229                <div class="clear">&nbsp;</div> 
  • upload.php

    r266 r269  
    22$root_path = './'; 
    33require ($root_path . 'include/config.php'); 
    4 require ($root_path . 'include/functions_post.php'); 
    54require ($root_path . 'include/functions_check.php'); 
    65require ($root_path . 'include/functions_selects.php'); 
     
    1514$cat_id = request_var('cat', 0); 
    1615$cats = $cache->obtain_cats(); 
     16 
     17if ( defined('USE_XBTT') ) { 
     18        $base_announce = generate_base_url() . ':' . $config['xbt_listen_port'] . '/' . ( $userdata['session_logged_in'] ? $userdata['torrent_pass'] . '/' : '' ) . 'announce/'; 
     19} 
     20else { 
     21        $base_announce = generate_base_url() . '/announce.php' . ( $userdata['session_logged_in'] ? '?passkey=' . $userdata['torrent_pass'] : '' ); 
     22} 
    1723 
    1824if ( !check_user_class($config['min_class_allow_upload']) ) { 
     
    113119        } 
    114120        else { 
    115                 require ($root_path . 'include/benc.php'); 
    116  
    117121                $hidden = ( isset($_POST['hidden']) && ( $userdata['hiddentorrents'] || $userdata['class'] >= UC_MODERATOR ) ? 1 : 0); 
    118122 
    119                 //start torrent check 
    120                 if ( !isset($_FILES['file']) ) { 
    121                         trigger_error($lang['dont_empty_fields']); 
    122                 } 
    123                 list($tmpname, $infohash, $fname, $totallen, $filelist, $dname, $dict, $private) = check_torrent($_FILES['file']); 
    124                 //end torrent check 
    125123 
    126124          //start nfo check 
     
    135133               @unlink($root_path . '/cache/' . $nfofile['name']); 
    136134               $nfo = str_replace('\x0d\x0a', "\n", $nfo); 
     135                        $nfo = trim($nfo); 
    137136 
    138137               if ( function_exists('iconv') ) { 
     
    145144          // end nfo check 
    146145 
     146                //start torrent check 
     147                if ( !isset($_FILES['file']) ) { 
     148                        trigger_error($lang['dont_empty_fields']); 
     149                } 
     150                list($infohash, $fname, $totallen, $filelist, $dname, $filename) = check_torrent($_FILES['file']); 
     151                //end torrent check 
     152 
    147153          if ( $config['default_type_moderated_torrents'] == MODERATED_ALL_TORRENTS ) { 
    148154                  $moderated = 0; 
     
    154160                  $moderated = 1; 
    155161          } 
    156  
    157           $sql = 'SELECT name, fid FROM ' . TORRENTS_TABLE . ' WHERE info_hash = ' . "'" . $db->sql_escape($infohash) . "'"; 
     162          $torrent_dir = $root_path . ( !empty($config['torrent_dir']) ? $config['torrent_dir'] : 'torrents'); 
     163 
     164          $sql = 'SELECT name, fid, category FROM ' . TORRENTS_TABLE . ' WHERE info_hash = ' . "'" . $db->sql_escape($infohash) . "'"; 
    158165          $result = $db->sql_query($sql); 
    159166 
    160167             if ( $row = $db->sql_fetchrow($result) ) { 
    161                         $message = sprintf($lang['torrent_already_uploaded'], generate_base_url() . '/details.php?id=' . $row['fid'], $row['name']); 
     168 
     169                        if ( isset($cats[$cats[$row['category']]['cat_parent']]['cat_name']) ) { 
     170                                // www.phpBB-SEO.com SEO TOOLKIT BEGIN 
     171                                $seo->set_url($cat_parent['cat_name'], $cat_parent['cat_id'], $seo->seo_static['browse']); 
     172                                $seo->set_parent($cats[$row['category']]['cat_id'], $seo->seo_static['browse'], $cat_parent['cat_id'], $seo->seo_static['browse']); 
     173                                // www.phpBB-SEO.com SEO TOOLKIT END 
     174                        } 
     175 
     176                        @unlink($torrent_dir . DIRECTORY_SEPARATOR . $filename . '.torrent'); 
     177                        $message = sprintf($lang['torrent_already_uploaded'], append_sid($root_path . 'details.php?id=' . $row['fid']), $row['name']); 
    162178                  trigger_error($message); 
    163179          } 
     
    180196 
    181197          $sql = 'INSERT INTO ' . TORRENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); 
    182  
    183                 $db->sql_query($sql); 
    184  
     198                $db->sql_query($sql); 
    185199                $id = $db->sql_nextid(); 
    186200 
    187                 $torrent_dir = $root_path . ( !empty($config['torrent_dir']) ? $config['torrent_dir'] : 'torrents'); 
    188  
    189                 if ( @move_uploaded_file($tmpname, $torrent_dir . DIRECTORY_SEPARATOR . $id . '.torrent') !== false ) { 
    190  
    191                         $sql = 'INSERT INTO ' . COMMENTS_NOTIFY_TABLE . ' (checkcomm_userid, checkcomm_for_id, checkcomm_type) VALUES (' . $userdata['uid'] . ', ' . $id . ', ' . TYPE_TORRENT . ')'; 
     201                @rename($torrent_dir . DIRECTORY_SEPARATOR . $filename . '.torrent', $torrent_dir . DIRECTORY_SEPARATOR . $id . '.torrent'); 
     202 
     203                $sql = 'INSERT INTO ' . COMMENTS_NOTIFY_TABLE . ' (checkcomm_userid, checkcomm_for_id, checkcomm_type) VALUES (' . $userdata['uid'] . ', ' . $id . ', ' . TYPE_TORRENT . ')'; 
     204                $db->sql_query($sql); 
     205 
     206                $sql = 'DELETE FROM ' . FILES_TABLE . ' WHERE torrent = ' . $id; 
     207                $db->sql_query($sql); 
     208                foreach ( $filelist AS $file ) { 
     209               $sql = 'INSERT INTO ' . FILES_TABLE . ' (torrent, filename, size) VALUES (' . $id . ", '" . $db->sql_escape($file[0]) . "'," . $file[1] . ')'; 
     210                        $db->sql_query($sql); 
     211                } 
     212 
     213                /* start tags */ 
     214 
     215                $tags_name = request_var('tag_name', ''); 
     216                $tag_type = TYPE_TORRENT; 
     217 
     218                if ( strpos($tags_name, ',') !== false ) { 
     219                        $tags_name = explode(',', $tags_name); 
     220                } 
     221                else { 
     222                        $tags_name = array($tags_name); 
     223                } 
     224 
     225                foreach ( $tags_name AS $_null => $tag_name ) { 
     226                        $tag_name = trim($tag_name); 
     227                        $tag_name = preg_replace('/[\.,:\^]/', '', $tag_name); 
     228                        $tag_length = utf_strlen($tag_name); 
     229 
     230                        if ( !$tag_name ) { 
     231                                continue; 
     232                        } 
     233 
     234                        if ( $config['tags_max_length'] && $tag_length > $config['tags_max_length'] ) { 
     235                                continue; 
     236                        } 
     237 
     238                        if ( $config['tags_min_length'] && $tag_length < $config['tags_min_length'] ) { 
     239                                continue; 
     240                        } 
     241 
     242                        $sql = 'INSERT INTO ' . TAGS_TABLE . ' VALUES (LOWER(\'' . $db->sql_escape($tag_name) . '\'), ' . $tag_type . ', ' . $id . ', 1)'; 
    192243                        $db->sql_query($sql); 
    193244 
    194                         $sql = 'DELETE FROM ' . FILES_TABLE . ' WHERE torrent = ' . $id; 
    195                         $db->sql_query($sql); 
    196                         foreach ( $filelist AS $file ) { 
    197                        $sql = 'INSERT INTO ' . FILES_TABLE . ' (torrent, filename, size) VALUES (' . $id . ", '" . $db->sql_escape($file[0]) . "'," . $file[1] . ')'; 
    198                                 $db->sql_query($sql); 
    199                         } 
    200                         //private tracker start 
    201                         if ( !$private ) { 
    202                        if ( $fp = @fopen($torrent_dir . DIRECTORY_SEPARATOR . $id . '.torrent', 'w') ) { 
    203                          @fwrite($fp, benc($dict), strlen(benc($dict))); 
    204                          fclose($fp); 
    205                     } 
    206                } 
    207                //private tracker end 
    208  
    209                write_log( sprintf($lang['log_torrent_uploaded'], 'details_' . $id, $name, $userdata['name']) ); 
    210  
    211                if ( $moderated ) { 
    212                                 update_reputation($userdata, $simpaty_type, 1); 
    213                         } 
    214  
    215                 redirect( append_sid($root_path . 'details.php?id=' . $id . '&uploaded=1')); 
    216           } 
    217           else { 
    218                         $sql = 'DELETE FROM ' . TORRENTS_TABLE . ' WHERE fid = ' . $id; 
    219                         $db->sql_query($sql); 
    220                         if ( !file_exists($torrent_dir) || !is_writable($torrent_dir . DIRECTORY_SEPARATOR) ) { 
    221                                 trigger_error($lang['dir_not_exist_or_not_writable']); 
    222                         } 
    223                         else { 
    224                                 trigger_error($lang['file_cannot_be_uploaded']); 
    225                         } 
    226                 } 
     245                        $sql = 'INSERT INTO ' . TAGS_USERS_TABLE . ' VALUES (' . $userdata['uid'] . ', ' . $id . ', ' . $tag_type . ', LOWER(\'' . $db->sql_escape($tag_name) . '\'))'; 
     246                        $db->sql_query($sql); 
     247                } 
     248 
     249                /* end tags */ 
     250 
     251          write_log( sprintf($lang['log_torrent_uploaded'], $id, $name, $userdata['uid'], $userdata['name']) ); 
     252 
     253          if ( $moderated ) { 
     254                        update_reputation($userdata, $simpaty_type, 1); 
     255                } 
     256 
     257                if ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_name']) ) { 
     258                        // www.phpBB-SEO.com SEO TOOLKIT BEGIN 
     259                        $seo->set_url($cat_parent['cat_name'], $cat_parent['cat_id'], $seo->seo_static['browse']); 
     260                        $seo->set_parent($cats[$cat_id]['cat_id'], $seo->seo_static['browse'], $cat_parent['cat_id'], $seo->seo_static['browse']); 
     261                        // www.phpBB-SEO.com SEO TOOLKIT END 
     262                } 
     263 
     264        redirect( append_sid($root_path . 'details.php?id=' . $id . '&uploaded=1')); 
     265 
    227266        } 
    228267} 
     
    249288                'CATEGORY' => $cat_id, 
    250289                'TYPE' => $type, 
    251                 'S_ANNOUNCE_ADDRESS' => sprintf($lang['tracker_announce_address'], generate_base_url() . '/announce.php')   ) 
    252         ); 
     290                'S_ANNOUNCE_ADDRESS' => sprintf($lang['tracker_announce_address'], $base_announce) 
     291        )); 
     292 
    253293        if ( ( $userdata['hiddentorrents'] || $userdata['class'] >= UC_MODERATOR ) && $type == 'main' ) { 
    254                 $template->assign_block_vars('uploading.switch_hidden_section', array( 
    255                         'HIDDEN_CHECKED' => (isset($_POST['hidden']) ? ' checked="checked"' : '') ) 
    256                 ); 
    257         } 
    258         $template->assign_block_vars('uploading.uploading_preview', array( 
     294                $template->assign_block_vars('switch_hidden_section', array( 
     295                        'HIDDEN_CHECKED' => ( isset($_POST['hidden']) ? ' checked="checked"' : '') 
     296                )); 
     297        } 
     298 
     299        $descr = censor_text($descr); 
     300        $bb_code = new bbcode($descr); 
     301        $descr = $bb_code->get_html(); 
     302 
     303        $template->assign_block_vars('uploading_preview', array( 
    259304                'NAME' => censor_text($name), 
    260                 'DESCRIPTION' => format_comment(censor_text($descr)) ) 
    261         )
     305                'DESCRIPTION' => $descr 
     306        ))
    262307 
    263308        stdhead($heading, false); 
    264309        $template->set_filenames(array( 
    265                 'body' => 'upload.html') 
    266         )
     310                'body' => 'upload_body.html' 
     311        ))
    267312        stdfoot(); 
    268313} 
     
    273318        } 
    274319        $template->set_filenames(array( 
    275                 'template' => '../upload_templates/' . $cat_id . '.html') 
    276      ); 
     320                'template' => '../upload_templates/' . $cat_id . '.html' 
     321       )); 
    277322 
    278323        $sql = 'SELECT pic_url, group_name FROM ' . RELEASE_GROUPS_TABLE . ' ORDER by group_name ASC'; 
     
    283328     } 
    284329 
    285  
    286  
    287         $template->assign_block_vars('main_body', array()); 
    288  
    289330        $template->assign_vars(array( 
    290331                'S_FORM_ACTION' => append_sid('upload.php'), 
    291332                'TYPE' => $type, 
    292333                'CATEGORY' => $cat_id, 
    293                 'ANNOUNCE_URL' => ( $type == 'main'? generate_base_url() . '/announce.php' : '' ), 
     334                'ANNOUNCE_URL' => ( $type == 'main'? $base_announce : '' ), 
    294335                'L_JS_UNFILLED_FIELDS' => str_replace("'", "\'", $lang['js_unfilled_fields']), 
    295336             'RELEASE_GROUP_OPTIONS' => $release_group_options ) 
     
    300341        stdhead($heading, false); 
    301342        $template->set_filenames(array( 
    302                 'body' => 'upload.html') 
    303         )
     343                'body' => 'upload_template_body.html' 
     344        ))
    304345        stdfoot(); 
    305346} 
     
    308349 
    309350        $s .= '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; 
    310         $template->assign_block_vars('cat_select', array()); 
    311351 
    312352        $template->assign_vars(array( 
    313353                'S_FORM_ACTION' => append_sid('upload.php'), 
    314354                'CATS_SELECT' => $s, 
    315                 'TYPE' => $type ) 
    316         )
     355                'TYPE' => $type 
     356        ))
    317357 
    318358        stdhead($heading); 
    319359        $template->set_filenames(array( 
    320                 'body' => 'upload.html') 
    321         )
     360                'body' => 'cats_select_body.html' 
     361        ))
    322362        stdfoot(); 
    323363} 
  • uploadapp.php

    r266 r269  
    22$root_path = './'; 
    33require ($root_path . 'include/config.php'); 
    4 require ($root_path . 'include/functions_post.php'); 
    54require ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_modcomment_log.php'); 
    65 
     
    293292                } 
    294293 
     294                /* */ 
     295                require ($root_path . 'include/bbcode/bbcode.lib.php'); 
     296                $bb_code = new bbcode(); 
     297                /* */ 
     298 
    295299                $template->assign_vars(array( 
    296300                          'MESSAGE' => ( isset($message) ? $message : '' ), 
     
    324328                                        $upload = ($row['upload'] / 1048576) . ' ' . utf_ucfirst(utf_strtolower($lang['megabytes'])) . '/' . $lang['seconds_short']; 
    325329                                } 
     330                        } 
     331 
     332                        if ( $row['content'] ) { 
     333                                $bb_code->parse($row['content']); 
     334                          $row['content'] = $bb_code->get_html(); 
     335                        } 
     336 
     337                        if ( $row['comment'] ) { 
     338                                $bb_code->parse($row['comment']); 
     339                          $row['comment'] = $bb_code->get_html(); 
     340                        } 
     341 
     342                        if ( $row['modcomments'] ) { 
     343                                $bb_code->parse($row['modcomments']); 
     344                          $row['modcomments'] = $bb_code->get_html(); 
    326345                        } 
    327346 
     
    345364                                'SHOW_CLOSE_INPUT' => ( $userdata['class'] >= UC_ADMINISTRATOR && $row['active'] ? TRUE : FALSE ), 
    346365                                'SHOW_DELETE_INPUT' => ( $userdata['class'] >= UC_ADMINISTRATOR ? TRUE : FALSE ), 
    347                                 'CONTENT' => format_comment($row['content'])
    348                                 'COMMENT' => format_comment($row['comment'])
    349                                 'MODCOMMENTS' => ( $row['modcomments'] ? format_comment($row['modcomments']) : ( $row['active'] ? $lang['no_comments_yet'] : '' )  ), 
     366                                'CONTENT' => $row['content']
     367                                'COMMENT' => $row['comment']
     368                                'MODCOMMENTS' => ( $row['modcomments'] ? $row['modcomments'] : ( $row['active'] ? $lang['no_comments_yet'] : '' )  ), 
    350369                                'DISABLED' => ( $row['active'] ? '' : 'disabled="disabled"') 
    351370                        )); 
  • userdetails.php

    r266 r269  
    22$root_path = './'; 
    33require ($root_path . 'include/config.php'); 
    4 require ($root_path . 'include/functions_post.php'); 
     4require ($root_path . 'include/bbcode/bbcode.lib.php'); 
    55require ($root_path . 'include/functions_selects.php'); 
    66 
     
    1111function maketable( $row ) 
    1212{ 
    13         global $config, $lang, $template, $db, $images, $user, $userdata, $cats
     13        global $config, $lang, $template, $db, $images, $user, $userdata, $cats, $root_path
    1414 
    1515        for ( $i = 0; $i < sizeof( $row ); ++$i ) { 
     
    2727                        $ttl .= '<br />' . ( $ttl == 1? $lang['hour']: $lang['hours'] ); 
    2828                } 
     29 
     30                $cat_id = $row[$i]['category']; 
     31                $cat_parent_id = ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_id']) ? $cats[$cats[$cat_id]['cat_parent']]['cat_id'] : 0 ); 
    2932 
    3033 
     
    8386        switch ( $view ) { 
    8487                case 'uploaded_torrents': 
    85                         $template->set_filenames( array( 'uploaded_torrents_tpl' => 'userdetails_uploaded_torrents.html' ) 
    86                                 ); 
    87                         $sql = 'SELECT t.fid, t.name, t.seeders, t.leechers, t.category, t.ctime, t.free, t.ratingsum, t.numratings, COUNT(th.torrentid) AS thanks_per_torrent 
     88                        $template->set_filenames( 
     89                                array( 'uploaded_torrents_tpl' => 'userdetails_uploaded_torrents.html' 
     90                        )); 
     91                        $sql = 'SELECT t.fid, t.name, t.seeders, t.leechers, t.category, t.ctime, t.free, t.ratingsum, t.numratings 
    8892                                                FROM ' . TORRENTS_TABLE . ' t 
    89                                                 LEFT JOIN ' . THANKS_TABLE . ' th ON t.fid = th.torrentid 
    9093                                                WHERE t.owner = ' . $id . ' 
    9194                                                ' . $where . ' 
     
    97100                                        $added = create_date($row['ctime']); 
    98101 
    99                                         $template->assign_block_vars( 'uploaded_torrents_row', array( 
     102                                        $cat_id = $row['category']; 
     103                                        $cat_parent_id = ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_id']) ? $cats[$cats[$cat_id]['cat_parent']]['cat_id'] : 0 ); 
     104 
     105 
     106                                        $template->assign_block_vars('uploaded_torrents_row', array( 
    100107                                                        'U_DETAILS' => append_sid($root_path . 'details.php?id=' . $row['fid'] ), 
    101                                                         'U_PEERLIST' => append_sid( $root_path . 'details.php?id=' . $row['fid'] . '&amp;view=peerlist' ), 
     108                                                        'U_PEERLIST' => append_sid($root_path . 'details.php?id=' . $row['fid'] . '&amp;view=peerlist' ), 
    102109                                                        'CAT_PIC' => $cats[$row['category']]['cat_pic'], 
    103110                                                        'CAT_NAME' => $cats[$row['category']]['cat_name'], 
     
    106113                                                        'SEEDERS' => $row['seeders'], 
    107114                                                        'LEECHERS' => $row['leechers'], 
    108                                                         'ADDED' => str_replace( ' ', '<br />', $added ) ) 
    109                                                 ); 
    110                                 } while ( $row = $db->sql_fetchrow( $result ) ); 
     115                                                        'ADDED' => $added 
     116                                        )); 
     117                                } 
     118                                while ( $row = $db->sql_fetchrow($result) ); 
    111119                        } 
    112120                        $db->sql_freeresult(); 
     
    158166                                                ORDER BY t.name'; 
    159167                        $result = $db->sql_query( $sql ); 
    160                         if ( $a = $db->sql_fetchrow( $result ) ) { 
     168                        if ( $row = $db->sql_fetchrow( $result ) ) { 
    161169                                do { 
    162                                         $ratio = get_ratio( $a['uploaded'], $a['downloaded'] ); 
     170                                        $ratio = get_ratio( $row['uploaded'], $row['downloaded'] ); 
    163171                                        $ratio_color = get_ratio_color( $ratio ); 
    164172 
     173                                        $cat_id = $row['category']; 
     174                                        $cat_parent_id = ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_id']) ? $cats[$cats[$cat_id]['cat_parent']]['cat_id'] : 0 ); 
    165175 
    166176                                        $template->assign_block_vars( 'downloaded_torrents_row', array( 
    167                                                         'U_DETAILS' => append_sid($root_path . 'details.php?id=' . $a['fid'] ), 
    168                                                         'U_PEERLIST' => append_sid( $root_path . 'details.php?id=' . $a['fid'] . '&amp;view=peerlist' ), 
     177                                                        'U_DETAILS' => append_sid($root_path . 'details.php?id=' . $row['fid'] ), 
     178                                                        'U_PEERLIST' => append_sid( $root_path . 'details.php?id=' . $row['fid'] . '&amp;view=peerlist' ), 
    169179                                                        'RATIO' => ( $user['privacy'] <> PRIVACY_LEVEL_LOW && $userdata['class'] < UC_MODERATOR && $userdata['uid'] <> $id ? '---' : $ratio ), 
    170180                                                        'RATIO_COLOR' => $ratio_color, 
    171                                                         'CAT_PIC' => $cats[$a['category']]['cat_pic'], 
    172                                                         'CAT_NAME' => $cats[$a['category']]['cat_name'], 
    173                                                         'ID' => $a['fid'], 
    174                                                         'NAME' => $a['name'] . ( $a['free'] ? '<img src="' . $images['freedownload'] . '" alt="" />' : '' ), 
    175                                                         'SEEDERS' => $a['seeders'], 
    176                                                         'LEECHERS' => $a['leechers'], 
    177                                                         'UPLOADED' => ( $user['privacy'] <> PRIVACY_LEVEL_LOW && $userdata['class'] < UC_MODERATOR && $userdata['uid'] <> $id ? '---' : mksize( $a['uploaded'] ) ), 
    178                                                         'DOWNLOADED' => ( $user['privacy'] <> PRIVACY_LEVEL_LOW && $userdata['class'] < UC_MODERATOR && $userdata['uid'] <> $id ? '---' : mksize( $a['downloaded'] ) ) ) 
    179                                                 ); 
    180                                 } while ( $a = $db->sql_fetchrow( $result ) ); 
     181                                                        'CAT_PIC' => $cats[$row['category']]['cat_pic'], 
     182                                                        'CAT_NAME' => $cats[$row['category']]['cat_name'], 
     183                                                        'ID' => $row['fid'], 
     184                                                        'NAME' => $row['name'] . ( $row['free'] ? '<img src="' . $images['freedownload'] . '" alt="" />' : '' ), 
     185                                                        'SEEDERS' => $row['seeders'], 
     186                                                        'LEECHERS' => $row['leechers'], 
     187                                                        'UPLOADED' => ( $user['privacy'] <> PRIVACY_LEVEL_LOW && $userdata['class'] < UC_MODERATOR && $userdata['uid'] <> $id ? '---' : mksize( $row['uploaded'] ) ), 
     188                                                        'DOWNLOADED' => ( $user['privacy'] <> PRIVACY_LEVEL_LOW && $userdata['class'] < UC_MODERATOR && $userdata['uid'] <> $id ? '---' : mksize( $row['downloaded'] ) ) 
     189                                        )); 
     190                                } 
     191                                while ( $row = $db->sql_fetchrow( $result ) ); 
    181192                        } 
    182193                        $db->sql_freeresult(); 
     
    203214                                                ORDER BY t.name'; 
    204215                        $result = $db->sql_query( $sql ); 
    205                         if ( $a = $db->sql_fetchrow( $result ) ) { 
     216                        if ( $row = $db->sql_fetchrow( $result ) ) { 
    206217                                do { 
    207                                         $ratio = get_ratio( $a['uploaded'], $a['downloaded'] ); 
     218                                        $ratio = get_ratio( $row['uploaded'], $row['downloaded'] ); 
    208219                                        $ratio_color = get_ratio_color( $ratio ); 
    209220 
     221                                        $cat_id = $row['category']; 
     222                                        $cat_parent_id = ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_id']) ? $cats[$cats[$cat_id]['cat_parent']]['cat_id'] : 0 ); 
    210223 
    211224                                        $template->assign_block_vars( 'helped_torrents_row', array( 
    212                                                         'U_DETAILS' => append_sid($root_path . 'details.php?id=' . $a['fid'] ), 
    213                                                         'U_PEERLIST' => append_sid( $root_path . 'details.php?id=' . $a['fid'] . '&amp;view=peerlist' ), 
     225                                                        'U_DETAILS' => append_sid($root_path . 'details.php?id=' . $row['fid'] ), 
     226                                                        'U_PEERLIST' => append_sid( $root_path . 'details.php?id=' . $row['fid'] . '&amp;view=peerlist' ), 
    214227                                                        'RATIO' => ( $user['privacy'] <> PRIVACY_LEVEL_LOW && $userdata['class'] < UC_MODERATOR && $userdata['uid'] <> $id ? '---' : $ratio ), 
    215228                                                        'RATIO_COLOR' => $ratio_color, 
    216                                                         'CAT_PIC' => $cats[$a['category']]['cat_pic'], 
    217                                                         'CAT_NAME' => $cats[$a['category']]['cat_name'], 
    218                                                         'ID' => $a['fid'], 
    219                                                         'NAME' => $a['name'] . ( $a['free'] ? '<img src="' . $images['freedownload'] . '" alt="" />' : '' ), 
    220                                                         'SEEDERS' => $a['seeders'], 
    221                                                         'LEECHERS' => $a['leechers'], 
    222                                                         'UPLOADED' => ( $user['privacy'] <> PRIVACY_LEVEL_LOW && $userdata['class'] < UC_MODERATOR && $userdata['uid'] <> $id ? '---' : mksize( $a['uploaded'] ) ) ) 
    223                                                 ); 
    224                                 } while ( $a = $db->sql_fetchrow( $result ) ); 
     229                                                        'CAT_PIC' => $cats[$row['category']]['cat_pic'], 
     230                                                        'CAT_NAME' => $cats[$row['category']]['cat_name'], 
     231                                                        'ID' => $row['fid'], 
     232                                                        'NAME' => $row['name'] . ( $row['free'] ? '<img src="' . $images['freedownload'] . '" alt="" />' : '' ), 
     233                                                        'SEEDERS' => $row['seeders'], 
     234                                                        'LEECHERS' => $row['leechers'], 
     235                                                        'UPLOADED' => ( $user['privacy'] <> PRIVACY_LEVEL_LOW && $userdata['class'] < UC_MODERATOR && $userdata['uid'] <> $id ? '---' : mksize( $row['uploaded'] ) ) 
     236                                                )); 
     237                                } 
     238                                while ( $row = $db->sql_fetchrow($result) ); 
    225239                        } 
    226240                        $db->sql_freeresult(); 
     
    236250 
    237251$id = request_var('id', 0); 
     252$username = request_var('un', ''); 
    238253 
    239254$sql = 'SELECT u.*, co.flagpic AS country_pic, co.name AS country_name, u.user_posts 
    240255                FROM ' . USERS_TABLE . ' u, ' . COUNTRIES_TABLE . ' co 
    241                 WHERE u.uid = ' . $id . ' AND u.country = co.id'; 
     256                WHERE ' . ( $username ? 'u.name = \'' . $db->sql_escape($username) . '\'' : 'u.uid = ' . $id ) . ' AND u.country = co.id'; 
    242257$result = $db->sql_query( $sql ); 
    243 if ( !( $user = $db->sql_fetchrow( $result ) ) || !$id ) { 
     258if ( !$user = $db->sql_fetchrow($result) ) { 
    244259        trigger_error( sprintf( $lang['invalid_id'], $id ) ); 
    245260} 
    246261$db->sql_freeresult(); 
     262 
     263$id = $user['uid']; 
    247264 
    248265if ( !$user['status'] ) { 
     
    265282        $count = ( $row = $db->sql_fetchrow( $result ) ) ? $row['count'] : 0; 
    266283 
    267         list( $pagertop, $pagerbottom, $limit ) = pager( $config['posts_per_page'], $count, 'userdetails.php?comments_history=1&amp;id=' . $id . '&amp;' ); 
    268  
    269         $subject = '<a href="' . append_sid( 'userdetails.php?id=' . $id ) . '"><b>' . $user['name'] . '</b></a>' . get_user_icons( $user, true ); 
    270  
    271         $sql = "SELECT t.name, c.comment_id, c.comment_for_id, c.comment_added, c.comment_text, c.comment_type, r.request AS request_name, o.name AS offer_name, r.id AS request_id, o.id AS offer_id 
     284        list( $pagertop, $pagerbottom, $limit ) = pager( $config['posts_per_page'], $count, 'userdetails.php?id=' . $id . '&amp;comments_history=1&amp;' ); 
     285 
     286        $subject = '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $id) . '"><b>' . $user['name'] . '</b></a>' . get_user_icons( $user, true ); 
     287 
     288        $sql = "SELECT t.name, t.category AS t_category, c.comment_id, c.comment_for_id, c.comment_added, c.comment_text, c.comment_type, r.request AS request_name, o.name AS offer_name, r.id AS request_id, o.id AS offer_id 
    272289                                FROM $from_is 
    273290                                WHERE c.comment_user = " . $id . " 
     
    275292        $result = $db->sql_query( $sql ); 
    276293 
    277         $template->assign_vars( array( 'SUBJECT' => sprintf( $lang['history_comments'], $subject ), 
     294        $template->assign_vars( array( 
     295                        'SUBJECT' => sprintf( $lang['history_comments'], $subject ), 
    278296                        'PAGERTOP' => $pagertop, 
    279                         'PAGERBOTTOM' => $pagerbottom ) 
    280                 ); 
     297                        'PAGERBOTTOM' => $pagerbottom 
     298        )); 
     299 
     300        $bb_code = new bbcode(); 
     301        $cats = $cache->obtain_cats(); 
    281302 
    282303        if ( $row = $db->sql_fetchrow( $result ) ) { 
     
    291312                                case TYPE_TORRENT: 
    292313 
     314                                        $cat_id = $row['t_category']; 
     315                                        $cat_parent_id = ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_id']) ? $cats[$cats[$cat_id]['cat_parent']]['cat_id'] : 0 ); 
     316 
    293317                                        $name = $lang['torrent']; 
    294318                                        $link = '<a href="' . append_sid($root_path . 'details.php?id=' . $row['comment_for_id'] ) . '#startcomments">' . $torrent . '</a>'; 
     
    309333                        } 
    310334 
    311                         $template->assign_block_vars( 'viewcomm_row', array( 'ADDED' => $added, 
     335                        $comment_text = censor_text($row['comment_text']); 
     336                        $bb_code->parse($comment_text); 
     337                  $comment_text = $bb_code->get_html(); 
     338 
     339                        $template->assign_block_vars( 'viewcomm_row', array( 
     340                                        'ADDED' => $added, 
    312341                                        'NAME' => $name, 
    313342                                        'LINK' => $link, 
    314343                                        'COMMENT_LINK' => $comment_link, 
    315                                         'BODY' => format_comment( censor_text( $row['comment_text'] ) ) ) 
    316                                ); 
     344                                        'BODY' => $comment_text 
     345                        )); 
    317346                } 
    318347                while ( $row = $db->sql_fetchrow( $result ) ); 
     
    376405        if ( $user_sig ) { 
    377406                // now we delete imgs if config allow_sig == 2 
    378                 $user_sig = ( $config['allow_sig'] == 2 ) ? preg_replace( '#((\r)+?(\n)+?)*(\[url(:' . $user['user_sig_bbcode_uid'] . ')?(.*)\])?\[img.*?:' . $user['user_sig_bbcode_uid'] . '\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img.*?:' . $user['user_sig_bbcode_uid'] . '\](\[/url(:' . $user['user_sig_bbcode_uid'] . ')?\])?#i', '', $user_sig ) : $user_sig; 
    379                 // now we remove bbcode uid from sig, because bbcode uid uses only at forum 
    380                 $user_sig = preg_replace( '#:' . $user['user_sig_bbcode_uid'] . '#', '', $user_sig ); 
     407                $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; 
    381408                // and now we format sig 
    382                $user_sig = preg_replace( '/\[img(.*?)\]/', '[img]', $user_sig ); 
    383                $user_sig = format_comment( $user_sig ); 
     409             $bb_code = new bbcode($user_sig); 
     410             $user_sig = $bb_code->get_html(); 
    384411        } 
    385412 
     
    528555                        'AGE' => $age, 
    529556                        'BIRTHDAY' => $user['birthday'], 
    530                         'COMMENTS' => ( $user['comments_count'] ? '<a href="' . append_sid( 'userdetails.php?id=' . $id . '&amp;comments_history=1' ) . '">' . $user['comments_count'] . '</a>' : 0 ), 
     557                        'COMMENTS' => ( $user['comments_count'] ? '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $id . '&amp;comments_history=1' ) . '">' . $user['comments_count'] . '</a>' : 0 ), 
    531558                        'FORUM_POSTS' => ( $user['user_posts'] ? '<a href="' . append_sid( 'phpbb2.php?page=search&amp;search_author=' . $user['name'] ) . '">' . $user['user_posts'] . '</a>' : 0 ), 
    532559                        'USER_SIGNATURE' => censor_text( $user_sig ),