Changeset 241

Show
Ignore:
Timestamp:
04/24/09 15:45:32 (3 years ago)
Author:
Nafania
Message:

Пофиксен баг из этого поста http://tbdevsz.ru/post3464.html#p3464
Функции хедера и футера убраны в общии функции (зачем каждый раз инклудить одни и те же файлы).
global.php переименован в functions.php (ибо так все же правильнее).
Мелкие фиксы.

Files:

Legend:

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

    r212 r241  
    2121        $confirm = isset($_POST['confirm']); 
    2222        $cancel = isset($_POST['cancel']); 
     23        $id = request_var('id', 0); 
    2324 
    2425        if ( $confirm ) { 
    25                 $newsid = ( isset($_POST['id']) ? intval($_POST['id']) : 0 ); 
    26                 $sql = 'DELETE FROM ' . NEWS_TABLE . ' WHERE id = ' . $newsid; 
    27                $db->sql_query($sql); 
     26                require($root_path . 'include/functions_delete.php'); 
     27 
     28               delete_news($id); 
    2829 
    2930                $cache->destroy('sql', NEWS_TABLE); 
     
    3334     } 
    3435     elseif ( !$cancel ) { 
    35                 $newsid = ( isset($_GET['id']) ? intval($_GET['id']) : 0 ); 
    3636                $template->set_filenames(array( 
    3737                  'body' => '../admin/confirm_body.tpl') 
    3838          ); 
    3939 
    40                 $hidden_fields = '<input type="hidden" name="action" value="delete" /><input type="hidden" name="id" value="' . $newsid . '" />'; 
     40                $hidden_fields = '<input type="hidden" name="action" value="delete" /><input type="hidden" name="id" value="' . $id . '" />'; 
    4141 
    4242          $template->assign_vars(array( 
  • announce.php

    r239 r241  
    22define('IN_ANNOUNCE', true); 
    33$root_path = './'; 
    4 require($root_path . 'include/config.php'); 
    5 require($root_path . 'include/benc.php'); 
    6 @include($root_path . '/languages/lang_' . $config['default_lang'] . '/lang_announce.php'); 
     4require ($root_path . 'include/config.php'); 
     5require ($root_path . 'include/benc.php'); 
     6require ($root_path . '/languages/lang_' . $config['default_lang'] . '/lang_announce.php'); 
    77 
    88 
     
    314314        } 
    315315        else { 
    316              $error = $db->sql_error(); 
    317                 if ( $error['code'] == 1062 ) { //we have unique key in database at fid-uid-ip rows 
    318                         err('You can\'t leech or seed one torrent from one IP more than one time'); 
    319                 } 
    320316                err('Insert peers error'); 
    321317        } 
     
    466462} 
    467463benc_resp_raw($resp); 
    468 if ( !empty($cache) ) { 
    469         $cache->unload(); 
    470 } 
    471 if ( !empty($db) ) { 
    472         $db->sql_close(); 
    473 } 
    474 exit(); 
    475464?> 
  • bookmarks.php

    r184 r241  
    11<?php 
    22$root_path = './'; 
    3 require($root_path . 'include/config.php'); 
    4 require($root_path . 'include/functions_torrenttable.php'); 
    5 @include ($root_path . 'include/overall_header.php'); 
    6 @include ($root_path . 'include/overall_footer.php'); 
     3require ($root_path . 'include/config.php'); 
     4require ($root_path . 'include/functions_torrenttable.php'); 
    75 
    86$userdata = session_pagestart($user_ip); 
  • browse.php

    r227 r241  
    11<?php 
    22$root_path = './'; 
    3 require_once ($root_path . 'include/config.php'); 
    4 require_once ($root_path . 'include/functions_torrenttable.php'); 
    5 require_once ($root_path . 'include/functions_selects.php'); 
    6 require_once ($root_path . 'include/functions_search.php'); 
    7 require_once ($root_path . 'include/overall_header.php'); 
    8 require_once ($root_path . 'include/overall_footer.php'); 
     3require ($root_path . 'include/config.php'); 
     4require ($root_path . 'include/functions_torrenttable.php'); 
     5require ($root_path . 'include/functions_selects.php'); 
     6require ($root_path . 'include/functions_search.php'); 
    97 
    108$userdata = session_pagestart($user_ip); 
  • chat.php

    r216 r241  
    11<?php 
    22$root_path = './'; 
    3 require_once ($root_path . 'include/config.php'); 
    4 require_once ($root_path . 'include/overall_header.php'); 
    5 require_once ($root_path . 'include/overall_footer.php'); 
     3require ($root_path . 'include/config.php'); 
    64 
    75$userdata = session_pagestart($user_ip); 
  • cheaters.php

    r227 r241  
    11<?php 
    22$root_path = './'; 
    3 require($root_path . 'include/config.php'); 
    4 @include ($root_path . 'include/overall_header.php'); 
    5 @include ($root_path . 'include/overall_footer.php'); 
    6 @include ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_modcomment_log.php'); 
     3require ($root_path . 'include/config.php'); 
     4require ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_modcomment_log.php'); 
     5 
    76$userdata = session_pagestart($user_ip); 
    87init_userprefs($userdata); 
  • comment.php

    r240 r241  
    11<?php 
    22$root_path = './'; 
    3 require_once ($root_path . 'include/config.php'); 
    4 require_once ($root_path . 'include/functions_post.php'); 
    5 require_once ($root_path . 'include/overall_header.php'); 
    6 require_once ($root_path . 'include/overall_footer.php'); 
     3require ($root_path . 'include/config.php'); 
     4require ($root_path . 'include/functions_post.php'); 
    75 
    86$userdata = session_pagestart($user_ip); 
     
    219217 
    220218                        case TYPE_NEWS: 
    221                                 $select = 'n.title, n.id'; 
     219                                $select = 'n.title AS name, n.id'; 
    222220                                $from = NEWS_TABLE . ' n'; 
    223221                                $where = 'c.comment_for_id = n.id'; 
  • db_updater.php

    r240 r241  
    55 
    66$root_path = './'; 
    7 require_once ($root_path . 'include/config.php'); 
    8 require_once ($root_path . 'include/overall_header.php'); 
    9 require_once ($root_path . 'include/overall_footer.php'); 
     7require ($root_path . 'include/config.php'); 
    108 
    119$userdata = session_pagestart($user_ip); 
  • details.php

    r240 r241  
    11<?php 
    22$root_path = './'; 
    3 require_once ( $root_path . 'include/config.php' ); 
    4 require_once ( $root_path . 'include/functions_post.php' ); 
    5 require_once ( $root_path . 'include/benc.php' ); 
    6 require_once ( $root_path . 'include/overall_header.php' ); 
    7 require_once ( $root_path . 'include/overall_footer.php' ); 
     3require ( $root_path . 'include/config.php'); 
     4require ( $root_path . 'include/functions_post.php'); 
     5require ( $root_path . 'include/benc.php'); 
    86 
    97$userdata = session_pagestart( $user_ip ); 
  • donate.php

    r226 r241  
    11<?php 
    22$root_path = './'; 
    3 require_once ($root_path . 'include/config.php'); 
    4 require_once ($root_path . 'include/overall_header.php'); 
    5 require_once ($root_path . 'include/overall_footer.php'); 
     3require ($root_path . 'include/config.php'); 
    64 
    75$userdata = session_pagestart($user_ip); 
  • faq.php

    r226 r241  
    11<?php 
    22$root_path = './'; 
    3 require_once ($root_path . 'include/config.php'); 
    4 require_once ($root_path . 'include/overall_header.php'); 
    5 require_once ($root_path . 'include/overall_footer.php'); 
     3require ($root_path . 'include/config.php'); 
    64 
    75$userdata = session_pagestart($user_ip); 
  • getrss.php

    r184 r241  
    11<?php 
    22$root_path = './'; 
    3 require($root_path . 'include/config.php'); 
    4 @include ($root_path . 'include/overall_header.php'); 
    5 @include ($root_path . 'include/overall_footer.php'); 
     3require ($root_path . 'include/config.php'); 
     4 
    65$userdata = session_pagestart($user_ip); 
    76init_userprefs($userdata); 
     
    1312        $login_type = request_var('login', ''); 
    1413        $feed = request_var('feed', ''); 
     14        $cat = request_var('cat', array( 0 => 0 ) ); 
    1515        if ( $feed == 'dl' ) { 
    1616                $query[] = 'feed=dl'; 
    1717     } 
    1818 
    19         if ( isset($_POST['cat']) ) { 
    20                 if ( sizeof($_POST['cat']) != sizeof($cats) ) { 
    21                         $query[] = 'cat=' . implode(',', $_POST['cat']); 
    22                
    23      
     19        if ( $sizeof_cat = sizeof($cat) ) { 
     20                if ( $sizeof_cat != sizeof($cats) ) { 
     21                        $query[] = 'cat=' . implode(',', $cat); 
     22           
     23       
    2424        else { 
    2525                trigger_error($lang['you_must_select_category']); 
     
    5656                                $selected =  (strpos($userdata['notifs'], '[cat' . $cat_id . ']') !== false ? ' checked="checked"' : ''); 
    5757                                $catoptions .= ' --> <input type="checkbox" name="cat[]" value="' . $key . '"' . $selected . ' /> ' . $value. "<br />\n"; 
    58                                 //$select .= '<option value="' . $key . '"' . $selected . '> --> ' . $value . '</option>' . "\n"; 
    5958                        } 
    6059                } 
     
    6261 
    6362     $template->assign_vars(array( 
    64                'CATOPTIONS' => $catoptions, 
    65                'S_FORM_ACTION' => append_sid('getrss.php')
    66         )
     63            'CATOPTIONS' => $catoptions, 
     64          'S_FORM_ACTION' => append_sid('getrss.php'
     65        ))
    6766 
    6867        stdhead($lang['rss']); 
  • helpdesk.php

    r240 r241  
    11<?php 
    22$root_path = './'; 
    3 require_once ($root_path . 'include/config.php'); 
    4 require_once ($root_path . 'include/functions_post.php'); 
    5 require_once ($root_path . 'include/overall_header.php'); 
    6 require_once ($root_path . 'include/overall_footer.php'); 
     3require ($root_path . 'include/config.php'); 
     4require ($root_path . 'include/functions_post.php'); 
    75 
    86$userdata = session_pagestart($user_ip); 
  • include/benc.php

    r211 r241  
    212212} 
    213213 
    214 function err($msg) { 
    215         global $db, $cache; 
    216  
    217         benc_resp(array('failure reason' => array('type' => 'string', 'value' => $msg))); 
     214function err ( $msg ) { 
     215        benc_resp(array( 
     216                'failure reason' => array( 
     217                        'type' => 'string', 
     218                        'value' => $msg 
     219                ) 
     220        )); 
     221
     222 
     223function benc_resp ( $d ) { 
     224        benc_resp_raw(benc(array('type' => 'dictionary', 'value' => $d))); 
     225
     226 
     227function benc_resp_raw ( $x ) { 
     228        global $cache, $db; 
     229 
     230        if ( $_SERVER['HTTP_ACCEPT_ENCODING'] == 'gzip' ) { 
     231                header('Content-Encoding: gzip'); 
     232                $x = gzencode($x, 9, FORCE_GZIP); 
     233        } 
     234        header('Content-Type: text/plain'); 
     235        header('Pragma: no-cache'); 
     236        header('Cache-Control: no-cache, must-revalidate'); // HTTP/1.1 
     237        header('Expires: Mon, 26 Jul 1997 05:00:00 +0400'); // Date in the past 
     238 
     239        echo $x; 
    218240 
    219241        if ( !empty($cache) ) { 
     
    223245                $db->sql_close(); 
    224246        } 
    225  
    226247        exit(); 
    227 } 
    228  
    229 function benc_resp($d) { 
    230         benc_resp_raw(benc(array('type' => 'dictionary', 'value' => $d))); 
    231 } 
    232  
    233 function benc_resp_raw($x) { 
    234         if ($_SERVER['HTTP_ACCEPT_ENCODING'] == 'gzip') { 
    235                 header('Content-Encoding: gzip'); 
    236                 $x = gzencode($x, 9, FORCE_GZIP); 
    237         } 
    238         header('Content-Type: text/plain'); 
    239         header('Pragma: no-cache'); 
    240         header('Cache-Control: no-cache, must-revalidate'); // HTTP/1.1 
    241         header('Expires: Mon, 26 Jul 1997 05:00:00 +0400'); // Date in the past 
    242         echo $x; 
    243248} 
    244249 
  • include/config.php

    r238 r241  
    114114//we don't include some scripts when we are in announce 
    115115if ( !defined('IN_ANNOUNCE') ) { 
    116         require_once($root_path . 'include/global.php'); 
     116        require_once($root_path . 'include/functions.php'); 
    117117        require_once($root_path . 'include/functions_utf.php'); 
    118118        set_error_handler('msg_handler'); 
     
    154154 
    155155//start determine user ip 
    156 if( isset($_SERVER) ) { 
    157         if( isset($_SERVER['HTTP_X_FORWARDED_FOR']) && ( $_SERVER['HTTP_X_FORWARDED_FOR'] != 'unknown') ) { 
    158                 $user_ip = $_SERVER['HTTP_X_FORWARDED_FOR']; 
    159         } 
    160         elseif( isset($_SERVER['HTTP_CLIENT_IP']) ) { 
    161                 $user_ip = $_SERVER['HTTP_CLIENT_IP']; 
    162         } 
    163         else { 
    164                 $user_ip = $_SERVER['REMOTE_ADDR']; 
    165         } 
     156if( isset($_SERVER['HTTP_X_FORWARDED_FOR']) && ( $_SERVER['HTTP_X_FORWARDED_FOR'] != 'unknown') ) { 
     157        $user_ip = $_SERVER['HTTP_X_FORWARDED_FOR']; 
     158
     159elseif( isset($_SERVER['HTTP_CLIENT_IP']) ) { 
     160        $user_ip = $_SERVER['HTTP_CLIENT_IP']; 
    166161} 
    167162else { 
    168         if( getenv('HTTP_X_FORWARDED_FOR') && ( getenv('HTTP_X_FORWARDED_FOR') != 'unknown') ) { 
    169                 $user_ip = getenv( 'HTTP_X_FORWARDED_FOR'); 
    170         } 
    171         elseif ( getenv('HTTP_CLIENT_IP') ) { 
    172                 $user_ip = getenv('HTTP_CLIENT_IP'); 
    173         } 
    174         else { 
    175                 $user_ip = getenv('REMOTE_ADDR'); 
    176         } 
     163        $user_ip = $_SERVER['REMOTE_ADDR']; 
    177164} 
    178165$user_ip = implode('.', array_slice(explode('.', $user_ip), 0, 4)); 
  • include/functions_delete.php

    r211 r241  
    221221        return; 
    222222} 
     223 
     224function delete_news ( $id ) { 
     225        $sql = 'DELETE FROM ' . NEWS_TABLE . ' WHERE id = ' . $id; 
     226     $db->sql_query($sql); 
     227        $sql = 'DELETE FROM ' . COMMENTS_TABLE . ' WHERE comment_for_id = ' . $id . ' AND comment_type = ' . TYPE_NEWS; 
     228        $db->sql_query($sql); 
     229        $sql = 'DELETE FROM ' . COMMENTS_NOTIFY_TABLE . ' WHERE checkcomm_for_id = ' . $id . ' AND checkcomm_type = ' . TYPE_NEWS; 
     230        $db->sql_query($sql); 
     231} 
    223232?> 
  • include/sessions.php

    r238 r241  
    934934{ 
    935935        global $SID, $_EXTRA_URL; 
     936        global $seo; 
     937 
     938        if (!empty($seo->seo_opt['url_rewrite'])) { 
     939                return $seo->url_rewrite($url, $params, $is_amp, $session_id); 
     940        } 
    936941 
    937942        // Assign sid if session id is not specified 
  • index.php

    r240 r241  
    11<?php 
    22$root_path = './'; 
    3 require_once ($root_path . 'include/config.php'); 
    4 require_once ($root_path . 'include/functions_post.php'); 
    5 require_once ($root_path . 'include/overall_header.php'); 
    6 require_once ($root_path . 'include/overall_footer.php'); 
     3require ($root_path . 'include/config.php'); 
     4require ($root_path . 'include/functions_post.php'); 
    75 
    86$userdata = session_pagestart($user_ip); 
  • log.php

    r184 r241  
    11<?php 
    22$root_path = './'; 
    3 require_once ($root_path . 'include/config.php'); 
    4 require_once ($root_path . 'include/overall_header.php'); 
    5 require_once ($root_path . 'include/overall_footer.php'); 
    6 require_once ($root_path . 'include/functions_search.php'); 
    7 require_once ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_modcomment_log.php'); 
     3require ($root_path . 'include/config.php'); 
     4require ($root_path . 'include/functions_search.php'); 
     5require ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_modcomment_log.php'); 
     6 
    87$userdata = session_pagestart($user_ip); 
    98init_userprefs($userdata); 
  • login.php

    r184 r241  
    11<?php 
    22$root_path = './'; 
    3 require_once ($root_path . 'include/config.php'); 
    4 require_once ($root_path . 'include/overall_header.php'); 
    5 require_once ($root_path . 'include/overall_footer.php'); 
     3require ($root_path . 'include/config.php'); 
    64 
    75$userdata = session_pagestart($user_ip); 
  • message.php

    r234 r241  
    11<?php 
    22$root_path = './'; 
    3 require_once ($root_path . 'include/config.php'); 
    4 require_once ($root_path . 'include/functions_post.php'); 
    5 require_once ($root_path . 'include/functions_check.php'); 
    6 require_once ($root_path . 'include/overall_header.php'); 
    7 require_once ($root_path . 'include/overall_footer.php'); 
    8 require_once ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_pms.php'); 
     3require ($root_path . 'include/config.php'); 
     4require ($root_path . 'include/functions_post.php'); 
     5require ($root_path . 'include/functions_check.php'); 
     6require ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_pms.php'); 
    97 
    108$userdata = session_pagestart($user_ip); 
  • modtask.php

    r184 r241  
    11<?php 
    22$root_path = './'; 
    3 require_once ($root_path . 'include/config.php'); 
    4 require_once ($root_path . 'include/functions_selects.php'); 
    5 require_once ($root_path . 'include/functions_post.php'); 
    6 require_once ($root_path . 'include/functions_check.php'); 
    7 require_once ($root_path . 'include/overall_header.php'); 
    8 require_once ($root_path . 'include/overall_footer.php'); 
    9 require_once ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_modcomment_log.php'); 
     3require ($root_path . 'include/config.php'); 
     4require ($root_path . 'include/functions_selects.php'); 
     5require ($root_path . 'include/functions_post.php'); 
     6require ($root_path . 'include/functions_check.php'); 
     7require ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_modcomment_log.php'); 
    108 
    119$userdata = session_pagestart($user_ip); 
  • my.php

    r229 r241  
    11<?php 
    22$root_path = './'; 
    3 require_once ($root_path . 'include/config.php'); 
    4 require_once ($root_path . 'include/functions_check.php'); 
    5 require_once ($root_path . 'include/overall_header.php'); 
    6 require_once ($root_path . 'include/overall_footer.php'); 
     3require ($root_path . 'include/config.php'); 
     4require ($root_path . 'include/functions_check.php'); 
    75 
    86$userdata = session_pagestart($user_ip); 
  • news.php

    r240 r241  
    11<?php 
    22$root_path = './'; 
    3 require_once ($root_path . 'include/config.php'); 
    4 require_once ($root_path . 'include/functions_post.php'); 
    5 require_once ($root_path . 'include/overall_header.php'); 
    6 require_once ($root_path . 'include/overall_footer.php'); 
     3require ($root_path . 'include/config.php'); 
     4require ($root_path . 'include/functions_post.php'); 
    75 
    86$userdata = session_pagestart($user_ip); 
  • offers.php

    r234 r241  
    11<?php 
    22$root_path = './'; 
    3 require_once ($root_path . 'include/config.php'); 
    4 require_once ($root_path . 'include/functions_check.php'); 
    5 require_once ($root_path . 'include/functions_post.php'); 
    6 require_once ($root_path . 'include/functions_selects.php'); 
    7 require_once ($root_path . 'include/overall_header.php'); 
    8 require_once ($root_path . 'include/overall_footer.php'); 
     3require ($root_path . 'include/config.php'); 
     4require ($root_path . 'include/functions_check.php'); 
     5require ($root_path . 'include/functions_post.php'); 
     6require ($root_path . 'include/functions_selects.php'); 
    97 
    108$userdata = session_pagestart($user_ip); 
  • phpBB2/index.php

    r184 r241  
    257257        // 
    258258        define('SHOW_ONLINE', true); 
    259         $page_title = $lang['index']; 
    260259 
    261260        $online_time = ( $config['online_time'] > 60 ) ? round($config['online_time'] / 60 ) : 1; 
     
    589588// Generate the page 
    590589// 
    591 stdhead($lang['forums'] . ( isset($page_title) ? ' :: ' . $page_title : '' ), false); 
     590stdhead($lang['forums'], false); 
    592591 
    593592$template->set_filenames(array( 
  • phpBB2/viewtopic.php

    r237 r241  
    585585// Output page header 
    586586// 
    587 $page_title = $lang['view_topic'] .' - ' . $topic_title; 
     587$page_title = $topic_title; 
    588588if(isset($_GET['printertopic'])) 
    589589{ 
  • phpbb2.php

    r184 r241  
    33$root_path = './'; 
    44require ($root_path . 'include/config.php'); 
    5 @include ($root_path . 'include/overall_header.php'); 
    6 @include ($root_path . 'include/overall_footer.php'); 
    75 
    8 $page = ( isset($_GET['page']) ? htmlspecialchars($_GET['page']) : '' ); 
    9 $mode = ( isset($_GET['mode']) ? htmlspecialchars($_GET['mode']) : '' ); 
     6$page = request_var('page', ''); 
     7$mode = request_var('mode', ''); 
    108 
    119switch ($page) 
  • releases.php

    r225 r241  
    11<?php 
    22$root_path = './'; 
    3 require($root_path . 'include/config.php'); 
     3require ($root_path . 'include/config.php'); 
    44require ($root_path . 'include/functions_post.php'); 
    5 @include ($root_path . 'include/overall_header.php'); 
    6 @include ($root_path . 'include/overall_footer.php'); 
    7 @include($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_upload_templates.php'); 
     5require ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_upload_templates.php'); 
     6 
    87$userdata = session_pagestart($user_ip); 
    98init_userprefs($userdata); 
  • reports.php

    r240 r241  
    11<?php 
    22$root_path = './'; 
    3 require_once ($root_path . 'include/config.php'); 
    4 require_once ($root_path . 'include/overall_header.php'); 
    5 require_once ($root_path . 'include/overall_footer.php'); 
     3require ($root_path . 'include/config.php'); 
    64 
    75$userdata = session_pagestart($user_ip); 
  • requests.php

    r234 r241  
    11<?php 
    22$root_path = './'; 
    3 require_once ($root_path . 'include/config.php'); 
    4 require_once ($root_path . 'include/functions_post.php'); 
    5 require_once ($root_path . 'include/functions_selects.php'); 
    6 require_once ($root_path . 'include/functions_check.php'); 
    7 require_once ($root_path . 'include/overall_header.php'); 
    8 require_once ($root_path . 'include/overall_footer.php'); 
     3require ($root_path . 'include/config.php'); 
     4require ($root_path . 'include/functions_post.php'); 
     5require ($root_path . 'include/functions_selects.php'); 
     6require ($root_path . 'include/functions_check.php'); 
    97 
    108$userdata = session_pagestart($user_ip); 
  • rules.php

    r184 r241  
    11<?php 
    22$root_path = './'; 
    3 require($root_path . 'include/config.php'); 
    4 @include ($root_path . 'include/overall_header.php'); 
    5 @include ($root_path . 'include/overall_footer.php'); 
     3require ($root_path . 'include/config.php'); 
     4 
    65$userdata = session_pagestart($user_ip); 
    76init_userprefs($userdata); 
  • scrape.php

    r184 r241  
    22define('IN_ANNOUNCE', true); 
    33$root_path = './'; 
    4 require($root_path . 'include/config.php'); 
     4require ($root_path . 'include/config.php'); 
    55require ($root_path . 'include/benc.php'); 
    66 
     
    1818} 
    1919 
    20 if ( !($result = $db->sql_query($sql)) ) { 
     20if ( !$result = $db->sql_query($sql) ) { 
    2121        err('scrape sql error'); 
    2222} 
     
    2424if ( $row = $db->sql_fetchrow($result) ) { 
    2525        $r = 'd' . benc_str('files') . 'd'; 
    26         do { 
    27                $r .= '20:' . hash_pad($row['info_hash']) . 'd' . 
    28                       benc_str('complete') . 'i' . $row['seeders'] . 'e' . 
    29                       benc_str('downloaded') . 'i' . $row['completed'] . 'e' . 
    30                       benc_str('incomplete') . 'i' . $row['leechers'] . 'e' . 
    31                       'e'; 
    32         
    33         while ( $row = $db->sql_fetchrow($result) ); 
    34         $r .= benc_str('flags') . 'd' . benc_str('min_request_interval') . 'i' . $config['min_announce_interval'] . 'ee'; 
    35         $r .= 'ee'; 
     26       do { 
     27            $r .= '20:' . hash_pad($row['info_hash']) . 'd' . 
     28                       benc_str('complete') . 'i' . $row['seeders'] . 'e' . 
     29               benc_str('downloaded') . 'i' . $row['completed'] . 'e' . 
     30               benc_str('incomplete') . 'i' . $row['leechers'] . 'e' . 
     31               'e'; 
     32     
     33     while ( $row = $db->sql_fetchrow($result) ); 
     34     $r .= benc_str('flags') . 'd' . benc_str('min_request_interval') . 'i' . $config['min_announce_interval'] . 'ee'; 
     35       $r .= 'ee'; 
    3636} 
    3737else { 
     
    3939} 
    4040$db->sql_freeresult($result); 
    41  
    4241benc_resp_raw($r); 
    43  
    44 if ( !empty($cache) ) { 
    45         $cache->unload(); 
    46 } 
    47 if ( !empty($db) ) { 
    48         $db->sql_close(); 
    49 } 
    50 exit(); 
    5142?> 
  • signup.php

    r225 r241  
    11<?php 
    22$root_path = './'; 
    3 require_once ($root_path . 'include/config.php'); 
    4 require_once ($root_path . 'include/functions_check.php'); 
    5 require_once ($root_path . 'include/benc.php'); 
    6 require_once ($root_path . 'include/overall_header.php'); 
    7 require_once ($root_path . 'include/overall_footer.php'); 
     3require ($root_path . 'include/config.php'); 
     4require ($root_path . 'include/functions_check.php'); 
     5require ($root_path . 'include/benc.php'); 
    86 
    97$userdata = session_pagestart($user_ip); 
  • simpaty.php

    r234 r241  
    11<?php 
    22$root_path = './'; 
    3 require_once ($root_path . 'include/config.php'); 
    4 require_once ($root_path . 'include/overall_header.php'); 
    5 require_once ($root_path . 'include/overall_footer.php'); 
     3require ($root_path . 'include/config.php'); 
    64 
    75$userdata = session_pagestart($user_ip); 
    86init_userprefs($userdata); 
    97loggedinorreturn(); 
    10  
    11 /* 
    12 types 
    13 1 - comment 
    14 2 - torrent 
    15 3 - request 
    16 4 - offer 
    17 5 - forum post 
    18 */ 
    198 
    209$template->set_filenames(array( 
  • staff.php

    r197 r241  
    22$root_path = './'; 
    33require ($root_path . 'include/config.php'); 
    4 @include ($root_path . 'include/overall_header.php'); 
    5 @include ($root_path . 'include/overall_footer.php'); 
     4 
    65$userdata = session_pagestart($user_ip); 
    76init_userprefs($userdata); 
  • tags.php

    r186 r241  
    11<?php 
    22$root_path = './'; 
    3 require_once ($root_path . 'include/config.php'); 
    4 require_once ($root_path . 'include/functions_post.php'); 
    5 require_once ($root_path . 'include/overall_header.php'); 
    6 require_once ($root_path . 'include/overall_footer.php'); 
     3require ($root_path . 'include/config.php'); 
     4require ($root_path . 'include/functions_post.php'); 
    75 
    86$userdata = session_pagestart($user_ip); 
  • templates/main/overall_header.html

    r240 r241  
    4949                <div id="tabs"> 
    5050                        <ul> 
    51                                 <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'index')?' id="activetab"':'');<!-- ENDPHP -->><a href="{U_INDEX}"><span>{L_INDEX}</span></a></li> 
    52                                 <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'browse')?' id="activetab"':'');<!-- ENDPHP -->><a href="{U_BROWSE}"><span>{L_BROWSE}</span></a></li> 
     51                                <li<!-- IF CURRENT_PAGE == U_INDEX --> id="activetab"<!-- ENDIF -->><a href="{U_INDEX}"><span>{L_INDEX}</span></a></li> 
     52                                <li<!-- IF CURRENT_PAGE == U_BROWSE --> id="activetab"<!-- ENDIF -->><a href="{U_BROWSE}"><span>{L_BROWSE}</span></a></li> 
    5353                                <!-- BEGIN switch_non_uploader_view --> 
    54                                 <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'uploadapp')?' id="activetab"':'');<!-- ENDPHP -->><a href="{U_UPLOADAPP}"><span>{L_UPLOAD}</span></a></li> 
     54                                <li<!-- IF CURRENT_PAGE == U_UPLOADAPP --> id="activetab"<!-- ENDIF -->><a href="{U_UPLOADAPP}"><span>{L_UPLOAD}</span></a></li> 
    5555                                <!-- END switch_non_uploader_view --> 
    5656                                <!-- BEGIN switch_uploader_view --> 
    57                                 <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'upload.php')?' id="activetab"':'');<!-- ENDPHP -->><a href="{U_UPLOAD}"><span>{L_UPLOAD}</span></a></li> 
     57                                <li<!-- IF CURRENT_PAGE == U_UPLOAD --> id="activetab"<!-- ENDIF -->><a href="{U_UPLOAD}"><span>{L_UPLOAD}</span></a></li> 
    5858                                <!-- END switch_uploader_view --> 
    5959                                <!-- BEGIN switch_non_curuser_view --> 
    60                                 <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'login')?' id="activetab"':'');<!-- ENDPHP -->><a href="{U_LOGIN}"><span>{L_LOGIN}</span></a></li> 
    61                                 <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'signup')?' id="activetab"':'');<!-- ENDPHP -->><a href="{U_SIGNUP}"><span>{L_SIGNUP}</span></a></li> 
     60                                <li<!-- IF CURRENT_PAGE == U_LOGIN --> id="activetab"<!-- ENDIF -->><a href="{U_LOGIN}"><span>{L_LOGIN}</span></a></li> 
     61                                <li<!-- IF CURRENT_PAGE == U_SIGNUP --> id="activetab"<!-- ENDIF -->><a href="{U_SIGNUP}"><span>{L_SIGNUP}</span></a></li> 
    6262                                <!-- END switch_non_curuser_view --> 
    63                                 <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'phpbb2')?' id="activetab"':'');<!-- ENDPHP -->><a href="{U_FORUM}"><span>{L_FORUMS}</span></a></li> 
    64                                 <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'rules')?' id="activetab"':'');<!-- ENDPHP -->><a href="{U_RULES}"><span>{L_RULES}</span></a></li> 
    65                                 <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'faq')?' id="activetab"':'');<!-- ENDPHP -->><a href="{U_FAQ}"><span>{L_FAQ}</span></a></li> 
     63                                <li<!-- IF CURRENT_PAGE == U_FORUM --> id="activetab"<!-- ENDIF -->><a href="{U_FORUM}"><span>{L_FORUMS}</span></a></li> 
     64                                <li<!-- IF CURRENT_PAGE == U_RULES --> id="activetab"<!-- ENDIF -->><a href="{U_RULES}"><span>{L_RULES}</span></a></li> 
     65                                <li<!-- IF CURRENT_PAGE == U_FAQ --> id="activetab"<!-- ENDIF -->><a href="{U_FAQ}"><span>{L_FAQ}</span></a></li> 
    6666                                <!-- BEGIN switch_curuser_view --> 
    67                                 <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'helpdesk.php')?' id="activetab"':'');<!-- ENDPHP -->><a href="{U_HELPDESC}"><span>{L_HELPDESC}</span></a></li> 
     67                                <li<!-- IF CURRENT_PAGE == U_HELPDESC --> id="activetab"<!-- ENDIF -->><a href="{U_HELPDESC}"><span>{L_HELPDESC}</span></a></li> 
    6868                                <!-- END switch_curuser_view --> 
    69                                 <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'staff.php')?' id="activetab"':'');<!-- ENDPHP -->><a href="{U_STAFF}"><span>{L_STAFF}</span></a></li> 
     69                                <li<!-- IF CURRENT_PAGE == U_STAFF --> id="activetab"<!-- ENDIF -->><a href="{U_STAFF}"><span>{L_STAFF}</span></a></li> 
    7070                        </ul> 
    7171                </div> 
     
    7878                                                <ul> 
    7979                                                        <!-- BEGIN switch_curuser_view --> 
     80 
    8081                                                        <li class="header">{L_TORRENTS}</li> 
    81                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'browse')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_BROWSE}"><span>{L_BROWSE}</span></a></li> 
    82                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'browse.php?incldead=4')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_BROWSE_WITHOUT_SEED}"><span>{L_WITHOUT_SEED}</span></a></li> 
    83                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'requests')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_REQUESTS}"><span>{L_REQUESTS}</span></a></li> 
    84                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'offers')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_OFFERS}"><span>{L_OFFERS}</span></a></li> 
     82                                                        <li<!-- IF CURRENT_PAGE == U_BROWSE --> id="activemenu"<!-- ENDIF -->><a href="{U_BROWSE}"><span>{L_BROWSE}</span></a></li> 
     83                                                        <li<!-- IF CURRENT_PAGE == U_BROWSE_WITHOUT_SEED --> id="activemenu"<!-- ENDIF -->><a href="{U_BROWSE_WITHOUT_SEED}"><span>{L_WITHOUT_SEED}</span></a></li> 
     84                                                        <li<!-- IF CURRENT_PAGE == U_REQUESTS --> id="activemenu"<!-- ENDIF -->><a href="{U_REQUESTS}"><span>{L_REQUESTS}</span></a></li> 
     85                                                        <li<!-- IF CURRENT_PAGE == U_OFFERS --> id="activemenu"<!-- ENDIF -->><a href="{U_OFFERS}"><span>{L_OFFERS}</span></a></li> 
     86 
    8587                                                        <!-- END switch_curuser_view --> 
     88 
    8689                                                        <!-- BEGIN switch_non_uploader_view --> 
    87                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'uploadapp')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_UPLOADAPP}"><span>{L_UPLOAD}</span></a></li> 
     90 
     91                                                        <li<!-- IF CURRENT_PAGE == U_UPLOADAPP --> id="activemenu"<!-- ENDIF -->><a href="{U_UPLOADAPP}"><span>{L_UPLOAD}</span></a></li> 
     92 
    8893                                                        <!-- END switch_non_uploader_view --> 
     94 
    8995                                                        <!-- BEGIN switch_uploader_view --> 
    90                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'upload.php')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_UPLOAD}"><span>{L_UPLOAD}</span></a></li> 
     96 
     97                                                        <li<!-- IF CURRENT_PAGE == U_UPLOAD --> id="activemenu"<!-- ENDIF -->><a href="{U_UPLOAD}"><span>{L_UPLOAD}</span></a></li> 
     98 
    9199                                                        <!-- END switch_uploader_view --> 
     100 
    92101                                                        <li class="header">{L_COMMUNITY}</li> 
    93                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'phpbb2')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_FORUM}"><span>{L_FORUMS}</span></a></li> 
    94                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'users')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_USERS}"><span>{L_USERS}</span></a></li> 
    95                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'topten')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_TOPTEN}"><span>{L_TOP10}</span></a></li> 
    96                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'chat')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_CHAT}"><span>{L_CHAT}</span></a></li> 
     102                                                        <li<!-- IF CURRENT_PAGE == U_FORUM --> id="activemenu"<!-- ENDIF -->><a href="{U_FORUM}"><span>{L_FORUMS}</span></a></li> 
     103                                                        <li<!-- IF CURRENT_PAGE == U_USERS --> id="activemenu"<!-- ENDIF -->><a href="{U_USERS}"><span>{L_USERS}</span></a></li> 
     104                                                        <li<!-- IF CURRENT_PAGE == U_TOPTEN --> id="activemenu"<!-- ENDIF -->><a href="{U_TOPTEN}"><span>{L_TOP10}</span></a></li> 
     105                                                        <li<!-- IF CURRENT_PAGE == U_CHAT --> id="activemenu"<!-- ENDIF -->><a href="{U_CHAT}"><span>{L_CHAT}</span></a></li> 
     106 
    97107                                                        <!-- BEGIN switch_curuser_view --> 
     108 
    98109                                                        <li class="header">{L_PERSONAL}</li> 
    99                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'my')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_MY}"><span>{L_CONTROL_PANEL}</span></a></li> 
    100                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'userdetails')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_USERDETAILS_LINK}"><span>{L_MY_PROFILE}</span></a></li> 
    101                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'bookmarks')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_BOOKMARKS}"><span>{L_BOOKMARKS}</span></a></li> 
    102                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'], 'my.php?type=simpaty')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_MY_SIMPATY}"><span>{L_MY_RESPECTS}</span></a></li> 
    103                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'], 'my.php?type=checkcomm')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_MY_CHECKCOMM}"><span>{L_CHECKCOMM}</span></a></li> 
    104                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'], 'my.php?type=friends')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_MY_FRIENDS}"><span>{L_PERSONAL_LIST}</span></a></li> 
    105                                                         <!-- IF U_MY_BONUS --><li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'], 'my.php?type=bonus')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_MY_BONUS}"><span>{L_MY_BONUS}</span></a></li><!-- ENDIF --> 
    106                                                         <!-- IF U_MY_INVITES --><li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'], 'my.php?type=my_invites')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_MY_INVITES}"><span title="{S_YOU_HAVE_INVITES}">{L_MY_INVITES}</span></a></li><!-- ENDIF --> 
     110                                                        <li<!-- IF CURRENT_PAGE == U_MY --> id="activemenu"<!-- ENDIF -->><a href="{U_MY}"><span>{L_CONTROL_PANEL}</span></a></li> 
     111                                                        <li<!-- IF CURRENT_PAGE == U_USERDETAILS_LINK --> id="activemenu"<!-- ENDIF -->><a href="{U_USERDETAILS_LINK}"><span>{L_MY_PROFILE}</span></a></li> 
     112                                                        <li<!-- IF CURRENT_PAGE == U_BOOKMARKS --> id="activemenu"<!-- ENDIF -->><a href="{U_BOOKMARKS}"><span>{L_BOOKMARKS}</span></a></li> 
     113                                                        <li<!-- IF CURRENT_PAGE == U_MY_SIMPATY --> id="activemenu"<!-- ENDIF -->><a href="{U_MY_SIMPATY}"><span>{L_MY_RESPECTS}</span></a></li> 
     114                                                        <li<!-- IF CURRENT_PAGE == U_MY_CHECKCOMM --> id="activemenu"<!-- ENDIF -->><a href="{U_MY_CHECKCOMM}"><span>{L_CHECKCOMM}</span></a></li> 
     115                                                        <li<!-- IF CURRENT_PAGE == U_MY_FRIENDS --> id="activemenu"<!-- ENDIF -->><a href="{U_MY_FRIENDS}"><span>{L_PERSONAL_LIST}</span></a></li> 
     116 
     117                                                        <!-- IF U_MY_BONUS --> 
     118 
     119                                                        <li<!-- IF CURRENT_PAGE == U_MY_BONUS --> id="activemenu"<!-- ENDIF -->><a href="{U_MY_BONUS}"><span>{L_MY_BONUS}</span></a></li> 
     120 
     121                                                        <!-- ENDIF --> 
     122 
     123                                                        <!-- IF U_MY_INVITES --> 
     124 
     125                                                        <li<!-- IF CURRENT_PAGE == U_MY_INVITES --> id="activemenu"<!-- ENDIF -->><a href="{U_MY_INVITES}"><span title="{S_YOU_HAVE_INVITES}">{L_MY_INVITES}</span></a></li> 
     126 
     127                                                        <!-- ENDIF --> 
     128 
    107129                                                        <!-- END switch_curuser_view --> 
     130 
    108131                                                        <li class="header">{L_OTHER}</li> 
    109                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'getrss')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_GETRSS}"><span>{L_RSS}</span></a></li> 
    110                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'donate')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_DONATE}"><span>{L_DONATE}</span></a></li> 
     132                                                        <li<!-- IF CURRENT_PAGE == U_GETRSS --> id="activemenu"<!-- ENDIF -->><a href="{U_GETRSS}"><span>{L_RSS}</span></a></li> 
     133                                                        <li<!-- IF CURRENT_PAGE == U_DONATE --> id="activemenu"<!-- ENDIF -->><a href="{U_DONATE}"><span>{L_DONATE}</span></a></li> 
    111134                                                        <li class="header">{L_RULES}</li> 
    112                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'faq')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_FAQ}"><span>{L_FAQ}</span></a></li> 
    113                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'rules')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_RULES}"><span>{L_RULES}</span></a></li> 
     135                                                        <li<!-- IF CURRENT_PAGE == U_FAQ --> id="activemenu"<!-- ENDIF -->><a href="{U_FAQ}"><span>{L_FAQ}</span></a></li> 
     136                                                        <li<!-- IF CURRENT_PAGE == U_RULES --> id="activemenu"<!-- ENDIF -->><a href="{U_RULES}"><span>{L_RULES}</span></a></li> 
    114137                                                        <li class="header">{L_STAFF}</li> 
    115                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'staff')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_STAFF}"><span>{L_STAFF}</span></a></li> 
    116                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'log')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_LOG}"><span>{L_LOG}</span></a></li> 
     138                                                        <li<!-- IF CURRENT_PAGE == U_STAFF --> id="activemenu"<!-- ENDIF -->><a href="{U_STAFF}"><span>{L_STAFF}</span></a></li> 
     139                                                        <li<!-- IF CURRENT_PAGE == U_LOG --> id="activemenu"<!-- ENDIF -->><a href="{U_LOG}"><span>{L_LOG}</span></a></li> 
     140 
    117141                                                        <!-- BEGIN switch_moderator_view --> 
    118                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'helpdesk')?' id="activemenu"':'');<!-- ENDPHP -->><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> 
    119                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'uploadapp')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_UPLOADAPP}"><!-- IF CANDIDATES_NUM > 0 --><span style="color:red;"><b>{L_CANDIDATES} ({CANDIDATES_NUM})</b></span><!-- ELSE --><span>{L_CANDIDATES}</span><!-- ENDIF --></a></li> 
    120                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'reports')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_REPORTS}"><!-- IF REPORTS_NUM > 0 --><span style="color:red;"><b>{L_REPORTS} ({REPORTS_NUM})</b></span><!-- ELSE --><span>{L_REPORTS}</span><!-- ENDIF --></a></li> 
    121                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'usersearch')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_USERSEARCH}"><span>{L_USER_SEARCH}</span></a></li> 
     142 
     143                                                        <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> 
     144                                                        <li<!-- IF CURRENT_PAGE == U_UPLOADAPP --> id="activemenu"<!-- ENDIF -->><a href="{U_UPLOADAPP}"><!-- IF CANDIDATES_NUM > 0 --><span style="color:red;"><b>{L_CANDIDATES} ({CANDIDATES_NUM})</b></span><!-- ELSE --><span>{L_CANDIDATES}</span><!-- ENDIF --></a></li> 
     145                                                        <li<!-- IF CURRENT_PAGE == U_REPORTS --> id="activemenu"<!-- ENDIF -->><a href="{U_REPORTS}"><!-- IF REPORTS_NUM > 0 --><span style="color:red;"><b>{L_REPORTS} ({REPORTS_NUM})</b></span><!-- ELSE --><span>{L_REPORTS}</span><!-- ENDIF --></a></li> 
     146                                                        <li<!-- IF CURRENT_PAGE == U_USERSEARCH --> id="activemenu"<!-- ENDIF -->><a href="{U_USERSEARCH}"><span>{L_USER_SEARCH}</span></a></li> 
     147 
    122148                                                        <!-- END switch_moderator_view --> 
     149 
    123150                                                        <!-- BEGIN switch_admin_view --> 
    124                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'releases')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_RELEASES_ADD}"><span>{L_RELEASES}</span></a></li> 
     151 
     152                                                        <li<!-- IF CURRENT_PAGE == U_RELEASES_ADD --> id="activemenu"<!-- ENDIF -->><a href="{U_RELEASES_ADD}"><span>{L_RELEASES}</span></a></li> 
     153 
    125154                                                        <!-- END switch_admin_view --> 
     155 
    126156                                                        <!-- BEGIN switch_sysop_view --> 
    127                                                         <li<!-- PHP -->echo (strpos($_SERVER['PHP_SELF'], 'cheaters')?' id="activemenu"':'');<!-- ENDPHP -->><a href="{U_CHEATERS}"><span>{L_CHEATERS}</span></a></li> 
     157 
     158                                                        <li<!-- IF CURRENT_PAGE == U_CHEATERS --> id="activemenu"<!-- ENDIF -->><a href="{U_CHEATERS}"><span>{L_CHEATERS}</span></a></li> 
     159 
    128160                                                        <!-- END switch_sysop_view --> 
    129161                                                </ul> 
  • topten.php

    r238 r241  
    22$root_path = './'; 
    33require ($root_path . 'include/config.php'); 
    4 @include ($root_path . 'include/overall_header.php'); 
    5 @include ($root_path . 'include/overall_footer.php'); 
     4 
    65$userdata = session_pagestart($user_ip); 
    76init_userprefs($userdata); 
  • upload.php

    r237 r241  
    11<?php 
    22$root_path = './'; 
    3 require_once ($root_path . 'include/config.php'); 
    4 require_once ($root_path . 'include/functions_post.php'); 
    5 require_once ($root_path . 'include/functions_check.php'); 
    6 require_once ($root_path . 'include/functions_selects.php'); 
    7 require_once ($root_path . 'include/overall_header.php'); 
    8 require_once ($root_path . 'include/overall_footer.php'); 
    9 require_once ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_upload_templates.php'); //we include default language, because it's used in templates for torrents which uploaded to tracker 
    10 require_once ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_modcomment_log.php'); 
     3require ($root_path . 'include/config.php'); 
     4require ($root_path . 'include/functions_post.php'); 
     5require ($root_path . 'include/functions_check.php'); 
     6require ($root_path . 'include/functions_selects.php'); 
     7require ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_upload_templates.php'); //we include default language, because it's used in templates for torrents which uploaded to tracker 
     8require ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_modcomment_log.php'); 
    119 
    1210$userdata = session_pagestart($user_ip); 
  • uploadapp.php

    r240 r241  
    11<?php 
    22$root_path = './'; 
    3 require_once ($root_path . 'include/config.php'); 
    4 require_once ($root_path . 'include/functions_post.php'); 
    5 require_once ($root_path . 'include/overall_header.php'); 
    6 require_once ($root_path . 'include/overall_footer.php'); 
    7 @include ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_modcomment_log.php'); 
     3require ($root_path . 'include/config.php'); 
     4require ($root_path . 'include/functions_post.php'); 
     5require ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_modcomment_log.php'); 
    86 
    97$userdata = session_pagestart($user_ip); 
  • userdetails.php

    r237 r241  
    11<?php 
    22$root_path = './'; 
    3 require_once ( $root_path . 'include/config.php' ); 
    4 require_once ( $root_path . 'include/functions_post.php' ); 
    5 require_once ( $root_path . 'include/functions_selects.php' ); 
    6 require_once ( $root_path . 'include/overall_header.php' ); 
    7 require_once ( $root_path . 'include/overall_footer.php' ); 
     3require ($root_path . 'include/config.php'); 
     4require ($root_path . 'include/functions_post.php'); 
     5require ($root_path . 'include/functions_selects.php'); 
    86 
    97$userdata = session_pagestart( $user_ip ); 
  • users.php

    r184 r241  
    11<?php 
    22$root_path = './'; 
    3 require_once ($root_path . 'include/config.php'); 
    4 require_once ($root_path . 'include/overall_header.php'); 
    5 require_once ($root_path . 'include/overall_footer.php'); 
     3require ($root_path . 'include/config.php'); 
    64 
    75$userdata = session_pagestart($user_ip); 
  • usersearch.php

    r184 r241  
    44require ($root_path . 'include/functions_check.php'); 
    55require ($root_path . 'include/functions_selects.php'); 
    6 @include ($root_path . 'include/overall_header.php'); 
    7 @include ($root_path . 'include/overall_footer.php'); 
    86 
    97$userdata = session_pagestart($user_ip);