Changeset 316

Show
Ignore:
Timestamp:
06/22/10 18:52:19 (2 years ago)
Author:
Nafania
Message:

Апдейт добавляет возможность получать уведомление на мыло о новых комментариях, и небольшие изменения с уведомлениями в панели управления.
Мелкие фиксы.

Files:

Legend:

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

    r307 r316  
    643643                                        } 
    644644 
    645                                         $tables = array(BANLIST_TABLE, BOOKMARKS_TABLE, CATEGORIES_TABLE, CHEATERS_TABLE, COMMENTS_NOTIFY_TABLE, COMMENTS_TABLE, CONFIG_TABLE, CONFIRM_TABLE, COUNTRIES_TABLE, DISALLOW_TABLE, FILES_TABLE, AUTH_ACCESS_TABLE, FORUM_CATEGORIES_TABLE, FORUMS_TABLE, GROUPS_TABLE, POSTS_TABLE, POSTS_TEXT_TABLE, PRUNE_TABLE, SEARCH_TABLE, SEARCH_WORD_TABLE, SEARCH_MATCH_TABLE, TOPICS_TABLE, TOPICS_WATCH_TABLE, USER_GROUP_TABLE, FRIENDS_TABLE, HELPDESK_TABLE, INDEXRELEASES_TABLE, INVITES_TABLE, PRIVATE_MESSAGES_TABLE, NEWS_TABLE, OFFERS_TABLE, OFFERS_VOTES_TABLE, PEERS_TABLE, RATINGS_TABLE, RELEASE_GROUPS_TABLE, REPORTS_TABLE, REQUESTS_TABLE, REQUESTS_VOTES_TABLE, SESSIONS_TABLE, SESSIONS_KEYS_TABLE, SIMPATY_TABLE, SITELOG_TABLE, SMILIES_TABLE, SNATCHED_TABLE, SOS_TABLE, THANKS_TABLE, THEMES_TABLE, TORRENTS_TABLE, UPLOADAPP_TABLE, USERS_TABLE, WORDS_TABLE, VOTE_DESC_TABLE, VOTE_RESULTS_TABLE, VOTE_USERS_TABLE); 
     645                                        $tables = array(BANLIST_TABLE, BOOKMARKS_TABLE, CATEGORIES_TABLE, CHEATERS_TABLE, COMMENTS_NOTIFY_TABLE, COMMENTS_TABLE, CONFIG_TABLE, CONFIRM_TABLE, COUNTRIES_TABLE, DISALLOW_TABLE, FILES_TABLE, AUTH_ACCESS_TABLE, FORUM_CATEGORIES_TABLE, FORUMS_TABLE, GROUPS_TABLE, POSTS_TABLE, POSTS_TEXT_TABLE, PRUNE_TABLE, SEARCH_TABLE, SEARCH_WORD_TABLE, SEARCH_MATCH_TABLE, TOPICS_TABLE, USER_GROUP_TABLE, FRIENDS_TABLE, HELPDESK_TABLE, INDEXRELEASES_TABLE, INVITES_TABLE, PRIVATE_MESSAGES_TABLE, NEWS_TABLE, OFFERS_TABLE, OFFERS_VOTES_TABLE, PEERS_TABLE, RATINGS_TABLE, RELEASE_GROUPS_TABLE, REPORTS_TABLE, REQUESTS_TABLE, REQUESTS_VOTES_TABLE, SESSIONS_TABLE, SESSIONS_KEYS_TABLE, SIMPATY_TABLE, SITELOG_TABLE, SMILIES_TABLE, SNATCHED_TABLE, SOS_TABLE, THANKS_TABLE, THEMES_TABLE, TORRENTS_TABLE, UPLOADAPP_TABLE, USERS_TABLE, WORDS_TABLE, VOTE_DESC_TABLE, VOTE_RESULTS_TABLE, VOTE_USERS_TABLE); 
    646646 
    647647 
  • admin/admin_users.php

    r269 r316  
    8888                                'skype' => '', 
    8989                                'user_sig' => '', 
    90                                 'notifyreply' => 0, 
    9190                                'notifypm' => '', 
    9291                                'parked' => 0, 
     
    125124 
    126125                        $signature = str_replace('<br />', "\n", $user_sig); 
    127                         $notifypm = ( $notifypm ? '[pm]' : '' )
     126                        $notifypm = ''
    128127 
    129128                        validate_optional_fields($icq, $aim, $msn, $yim, $skype, $signature); 
     
    277276                        if( !$error ) 
    278277                        { 
     278                                $user_notify = request_var('user_notify', array(''=>0)); 
     279                                foreach ( $user_notify AS $key => $val ) { 
     280                                        $notifypm .= '[' . $key . ']'; 
     281                                } 
    279282 
    280283                                $sql = 'SELECT id FROM ' . CATEGORIES_TABLE; 
     
    290293                                $updateset[] = "aim = '" . $db->sql_escape($aim) . "'"; 
    291294                                $updateset[] = "yahoo = '" . $db->sql_escape($yim) . "'"; 
    292                                 $updateset[] = "msn = '" . $db->sql_escape($icq) . "'"; 
     295                                $updateset[] = "msn = '" . $db->sql_escape($msn) . "'"; 
    293296                                $updateset[] = "skype = '" . $db->sql_escape($skype) . "'"; 
    294297                                $updateset[] = "enabled = '" . $db->sql_escape($user_status) . "'"; 
    295                                 $updateset[] = "notify_forum = '" . $db->sql_escape($notifyreply) . "'"; 
    296298                                $updateset[] = "tzoffset = '" . $db->sql_escape($user_timezone) . "'"; 
    297299                                $updateset[] = "user_dst = '" . $db->sql_escape($user_dst) . "'"; 
     
    394396                        $signature = preg_replace($html_entities_match, $html_entities_replace, $signature); 
    395397 
    396                         $notifyreply = $this_userdata['notify_forum']; 
    397                         $notifypm = ( strpos($this_userdata['notifs'], "[pm]") !== false  ? 1 : 0 ); 
    398398                        $parked = ( $this_userdata['parked'] ? 1 : 0 ); 
    399399                        $accept_pm = $this_userdata['acceptpms']; 
     
    470470                     $privacy_input .= ' <input type="radio" name="privacy" id="privacy" value="' . PRIVACY_LEVEL_HIGH . '"' . ( $this_userdata['privacy'] == PRIVACY_LEVEL_HIGH ?' checked="checked"':'') . ' /> ' . $lang['high']; 
    471471 
     472                        $notifs = array('pm', 'forum', 'comments'); 
     473 
     474                        $notifs_options = ''; 
     475                        foreach ( $notifs AS $_null => $val ) { 
     476                                $name = 'user_notify[' . $val . ']'; 
     477                                $notifs_options .= '<input type="checkbox" id="' . $name . '" name="' . $name . '"' . ( strpos($this_userdata['notifs'], '[' . $val . ']') !== false ? ' checked="checked"' : '' ) . ' value="1" /> ' . $lang['email_notifis_' . $val] . '<br />'; 
     478                        } 
     479 
    472480                        $template->set_filenames(array( 
    473481                                "body" => "../admin/user_edit_body.tpl" 
     
    490498                                'SKYPE' => $skype, 
    491499                                'SIGNATURE' => str_replace('<br />', "\n", $signature), 
    492                                 'NOTIFY_REPLY_YES' => ( $notifyreply ) ? 'checked="checked"' : '', 
    493                                 'NOTIFY_REPLY_NO' => ( !$notifyreply ) ? 'checked="checked"' : '', 
    494                                 'NOTIFY_PM_YES' => ( $notifypm ) ? 'checked="checked"' : '', 
    495                                 'NOTIFY_PM_NO' => ( !$notifypm ) ? 'checked="checked"' : '', 
     500                                'NOTIFY_OPTIONS' => $notifs_options, 
    496501                                'PARKED_YES' => ( $parked ) ? 'checked="checked"' : '', 
    497502                                'PARKED_NO' => ( !$parked ) ? 'checked="checked"' : '', 
  • browse.php

    r315 r316  
    476476} 
    477477 
    478 if ( $userdata['hiddentorrents'] || $userdata['class'] >= UC_MODERATOR ) { 
    479         $template->assign_block_vars('switch_hidden_section', array()); 
    480 } 
    481  
    482478$incldead_ary = array( 
    483479        0 => $lang['include_dead'], 
     
    532528else { 
    533529        $back_link = ''; 
    534 } 
    535  
    536 if ( $userdata['class'] >= UC_UPLOADER ) { 
    537         $template->assign_block_vars('switch_uploader_section', array()); 
    538 } 
    539  
    540 if ( $searchstr ) { 
    541         $template->assign_block_vars('switch_searchstring_section', array()); 
    542530} 
    543531 
  • comment.php

    r313 r316  
    139139                                $sql = 'UPDATE ' . COMMENTS_TABLE . ' SET comment_text = ' . $updated_comment . ', comment_added = ' . time() . ' WHERE comment_id = ' . $merge_arr['comment_id']; 
    140140                                $db->sql_query($sql); 
    141                                 $sql = 'UPDATE ' . COMMENTS_NOTIFY_TABLE . ' SET checkcomm_notify_status = 0 WHERE checkcomm_userid != ' . $userdata['uid'] . ' AND checkcomm_notify_status = 1 AND checkcomm_for_id = ' . $id . ' AND checkcomm_type = ' . $type; 
    142                                 $db->sql_query($sql); 
     141                                //$sql = 'UPDATE ' . COMMENTS_NOTIFY_TABLE . ' SET checkcomm_view_status = ' . VIEW_STATUS_NOT_VIEWED . ' WHERE checkcomm_userid != ' . $userdata['uid'] . ' AND checkcomm_view_status = 1 AND checkcomm_for_id = ' . $id . ' AND checkcomm_type = ' . $type; 
     142                                //$db->sql_query($sql); 
    143143                        } 
    144144                        else { 
     
    160160                                $db->sql_query($sql); 
    161161 
    162                                 $sql = 'UPDATE ' . COMMENTS_NOTIFY_TABLE . ' SET checkcomm_notify_status = 0, checkcomm_last_comment_id = ' . $newid . ' WHERE checkcomm_userid != ' . $userdata['uid'] . ' AND checkcomm_notify_status = 1 AND checkcomm_for_id = ' . $id . ' AND checkcomm_type = ' . $type; 
     162                                /*$sql = 'UPDATE ' . COMMENTS_NOTIFY_TABLE . ' SET checkcomm_view_status = ' . VIEW_STATUS_NOT_VIEWED . ', checkcomm_last_comment_id = ' . $newid . ' WHERE checkcomm_userid != ' . $userdata['uid'] . ' AND checkcomm_view_status = 1 AND checkcomm_for_id = ' . $id . ' AND checkcomm_type = ' . $type; 
    163163                                $db->sql_query($sql); 
    164164 
     
    168168                                        $docheck = ( $row = $db->sql_fetchrow($result) ) ? $row['count'] : 0; 
    169169                                        if ( !$docheck ) { 
    170                                                 $sql = 'INSERT INTO ' . COMMENTS_NOTIFY_TABLE . ' (checkcomm_userid, checkcomm_for_id, checkcomm_type, checkcomm_last_comment_id) VALUES (' . $userdata['uid'] . ', ' . $id . ', ' . $type . ', ' . $newid . ')'; 
     170                                                $sql = 'INSERT INTO ' . COMMENTS_NOTIFY_TABLE . ' (checkcomm_userid, checkcomm_for_id, checkcomm_type, checkcomm_last_comment_id, checkcomm_view_status) VALUES (' . $userdata['uid'] . ', ' . $id . ', ' . $type . ', ' . $newid . ', ' . VIEW_STATUS_VIEWED . ')'; 
    171171                                                $db->sql_query($sql); 
    172172                                        } 
    173                                 } 
    174                         } 
     173                                }*/ 
     174                        } 
     175 
     176                        user_notification($userdata['commentpm'], $type, array('for_id' => $id, 'last_id' => $newid, 'name' => $arr['name'])); 
    175177                        redirect( append_sid($root_path . 'comment.php?cid=' . $newid) ); 
    176178                } 
     
    309311 
    310312                if ( $action == 'check' ) { 
    311                         $sql = 'INSERT INTO ' . COMMENTS_NOTIFY_TABLE . ' (checkcomm_userid, checkcomm_for_id, checkcomm_type, checkcomm_notify_status) VALUES (' . $userdata['uid'] . ', ' . $tid . ', ' . $type . ', 1)'; 
     313                        $sql = 'INSERT INTO ' . COMMENTS_NOTIFY_TABLE . ' (checkcomm_userid, checkcomm_for_id, checkcomm_type, checkcomm_view_status) VALUES (' . $userdata['uid'] . ', ' . $tid . ', ' . $type . ', ' . VIEW_STATUS_VIEWED . ')'; 
    312314                        $db->sql_query($sql); 
    313315                        trigger_error($lang['now_check_on']); 
     
    358360             $db->sql_query($sql); 
    359361 
    360                 $sql = 'UPDATE ' . COMMENTS_NOTIFY_TABLE . ' SET checkcomm_notify_status = 1 WHERE checkcomm_last_comment_id = ' . $id; 
     362                $sql = 'UPDATE ' . COMMENTS_NOTIFY_TABLE . ' SET checkcomm_view_status = ' . VIEW_STATUS_VIEWED . ' WHERE checkcomm_last_comment_id = ' . $id; 
    361363             $db->sql_query($sql); 
    362364 
  • details.php

    r313 r316  
    662662                } 
    663663                if ( $userdata['session_logged_in'] ) { 
    664                         $sql = 'SELECT checkcomm_notify_status FROM ' . COMMENTS_NOTIFY_TABLE . ' WHERE checkcomm_userid = ' . $userdata['uid'] . ' AND checkcomm_type = ' . TYPE_TORRENT . ' AND checkcomm_for_id = ' . $id; 
     664                        $sql = 'SELECT checkcomm_view_status FROM ' . COMMENTS_NOTIFY_TABLE . ' WHERE checkcomm_userid = ' . $userdata['uid'] . ' AND checkcomm_type = ' . TYPE_TORRENT . ' AND checkcomm_for_id = ' . $id; 
    665665                        $result = $db->sql_query( $sql ); 
    666666                        $checkcomm = $db->sql_fetchrow( $result ); 
    667667                        $db->sql_freeresult( $result ); 
    668668                        if ( $checkcomm ) { 
    669                                 if ( !$checkcomm['checkcomm_notify_status'] ) { 
     669                                if ( $checkcomm['checkcomm_view_status'] == VIEW_STATUS_NOT_VIEWED ) { 
    670670                                        $sql_priority = ( $db_type == 'mysql' ) ? ' LOW_PRIORITY' : ''; 
    671                                         $sql = 'UPDATE' . $sql_priority . ' ' . COMMENTS_NOTIFY_TABLE . ' SET checkcomm_notify_status = 1 WHERE checkcomm_userid = ' . $userdata['uid'] . ' AND checkcomm_type = ' . TYPE_TORRENT . ' AND checkcomm_for_id = ' . $id; 
     671                                        $sql = 'UPDATE' . $sql_priority . ' ' . COMMENTS_NOTIFY_TABLE . ' SET checkcomm_view_status = ' . VIEW_STATUS_VIEWED . ', checkcomm_notify_status = ' . NOTIFY_STATUS_UN_NOTIFIED . ' WHERE checkcomm_userid = ' . $userdata['uid'] . ' AND checkcomm_type = ' . TYPE_TORRENT . ' AND checkcomm_for_id = ' . $id; 
    672672                                        $db->sql_query($sql); 
    673673                                } 
  • docleanup.php

    r313 r316  
    88@set_time_limit(0); 
    99 
     10$step = request_var('step', 0); 
     11 
    1012if ( $userdata['class'] < UC_SYSOP ) { 
    1113        trigger_error($lang['access_denied']); 
    1214} 
    1315else { 
    14         if ( empty($_REQUEST['explain']) && defined('DEBUG_EXTRA') ) { 
    15                 redirect( append_sid('docleanup.php?explain=1')); 
    16         } 
    17         //begin sync tables, delete some old shit 
    18         $db->sql_query('DELETE c.*  FROM ' . COMMENTS_TABLE . ' c       LEFT JOIN ' . TORRENTS_TABLE . ' t ON ( c.comment_for_id = t.fid ) WHERE t.name IS NULL AND c.comment_type = ' . TYPE_TORRENT); 
    19         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned comments from torrents deleted', LOG_VIEW_SYSOP); 
    20         $db->sql_query('DELETE f.*  FROM ' . FILES_TABLE . ' f          LEFT JOIN ' . TORRENTS_TABLE . ' t ON f.torrent = t.fid    WHERE t.name IS NULL'); 
    21         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned files from torrents deleted', LOG_VIEW_SYSOP); 
    22         $db->sql_query('DELETE s.*  FROM ' . SOS_TABLE . ' s            LEFT JOIN ' . TORRENTS_TABLE . ' t ON s.torrentid = t.fid  WHERE t.name IS NULL'); 
    23         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned sos requests deleted', LOG_VIEW_SYSOP); 
    24         $db->sql_query('DELETE t1.* FROM ' . THANKS_TABLE . ' t1        LEFT JOIN ' . TORRENTS_TABLE . ' t ON t1.torrentid = t.fid WHERE t.name IS NULL'); 
    25         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned thankses deleted', LOG_VIEW_SYSOP); 
    26         $db->sql_query('DELETE s.*  FROM ' . SNATCHED_TABLE . ' s       LEFT JOIN ' . TORRENTS_TABLE . ' t ON s.torrentid = t.fid  WHERE t.name IS NULL'); 
    27         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned snatched rows deleted', LOG_VIEW_SYSOP); 
    28         $db->sql_query('DELETE r.*  FROM ' . RATINGS_TABLE . ' r        LEFT JOIN ' . TORRENTS_TABLE . ' t ON r.torrent = t.fid    WHERE t.name IS NULL'); 
    29         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned ratings deleted', LOG_VIEW_SYSOP); 
    30         $db->sql_query('DELETE i.*  FROM ' . INDEXRELEASES_TABLE . ' i   LEFT JOIN ' . TORRENTS_TABLE . ' t ON i.torrent_id = t.fid WHERE t.name IS NULL'); 
    31         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned indexreleases deleted', LOG_VIEW_SYSOP); 
    32         $db->sql_query('DELETE c.*  FROM ' . COMMENTS_NOTIFY_TABLE . ' c      LEFT JOIN ' . TORRENTS_TABLE . ' t ON ( c.checkcomm_for_id = t.fid ) WHERE t.name IS NULL AND c.checkcomm_type = ' . TYPE_TORRENT); 
    33         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned comments notifis deleted', LOG_VIEW_SYSOP); 
    34         $db->sql_query('DELETE b.*  FROM ' . BOOKMARKS_TABLE . ' b      LEFT JOIN ' . TORRENTS_TABLE . ' t ON b.torrentid = t.fid  WHERE t.name IS NULL'); 
    35         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned bookmarks deleted', LOG_VIEW_SYSOP); 
    36         $db->sql_query('DELETE s.*  FROM ' . SNATCHED_TABLE . ' s      LEFT JOIN ' . TORRENTS_TABLE . ' t ON s.torrentid = t.fid  WHERE t.name IS NULL'); 
    37         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned snatched deleted', LOG_VIEW_SYSOP); 
    38         $db->sql_query('DELETE r.*  FROM ' . REPORTS_TABLE . ' r      LEFT JOIN ' . TORRENTS_TABLE . ' t ON r.votedfor = t.fid  WHERE t.name IS NULL AND r.type = 2'); 
    39         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned reports deleted', LOG_VIEW_SYSOP); 
    4016 
    41         $db->sql_query('DELETE c.*  FROM ' . COMMENTS_TABLE . ' c       LEFT JOIN ' . REQUESTS_TABLE . ' r ON ( c.comment_for_id = r.id ) WHERE r.request IS NULL AND c.comment_type = ' . TYPE_REQUEST); 
    42         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned comments from requests deleted', LOG_VIEW_SYSOP); 
    43         $db->sql_query('DELETE c.*  FROM ' . COMMENTS_TABLE . ' c       LEFT JOIN ' . OFFERS_TABLE . ' o   ON ( c.comment_for_id = o.id ) WHERE o.name IS NULL AND c.comment_type = ' . TYPE_OFFER); 
    44         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned comments from offers deleted', LOG_VIEW_SYSOP); 
    45         $db->sql_query('DELETE v.*  FROM ' . REQUESTS_VOTES_TABLE . ' v LEFT JOIN ' . REQUESTS_TABLE . ' r ON v.requestid = r.id  WHERE r.request IS NULL'); 
    46         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned requests votes deleted', LOG_VIEW_SYSOP); 
    47         $db->sql_query('DELETE ov.* FROM ' . OFFERS_VOTES_TABLE . ' ov  LEFT JOIN ' . OFFERS_TABLE . ' o   ON ov.offerid = o.id   WHERE o.name IS NULL'); 
    48         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned offers votes deleted', LOG_VIEW_SYSOP); 
     17        switch($step) { 
     18                case 0: 
     19                        $db->sql_query('DELETE c.*  FROM ' . COMMENTS_TABLE . ' c       LEFT JOIN ' . TORRENTS_TABLE . ' t ON ( c.comment_for_id = t.fid ) WHERE t.name IS NULL AND c.comment_type = ' . TYPE_TORRENT); 
     20                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned comments from torrents deleted', LOG_VIEW_SYSOP); 
     21                        $db->sql_query('DELETE f.*  FROM ' . FILES_TABLE . ' f          LEFT JOIN ' . TORRENTS_TABLE . ' t ON f.torrent = t.fid    WHERE t.name IS NULL'); 
     22                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned files from torrents deleted', LOG_VIEW_SYSOP); 
     23                        $db->sql_query('DELETE s.*  FROM ' . SOS_TABLE . ' s            LEFT JOIN ' . TORRENTS_TABLE . ' t ON s.torrentid = t.fid  WHERE t.name IS NULL'); 
     24                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned sos requests deleted', LOG_VIEW_SYSOP); 
     25                        $db->sql_query('DELETE t1.* FROM ' . THANKS_TABLE . ' t1        LEFT JOIN ' . TORRENTS_TABLE . ' t ON t1.torrentid = t.fid WHERE t.name IS NULL'); 
     26                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned thankses deleted', LOG_VIEW_SYSOP); 
     27                        $db->sql_query('DELETE s.*  FROM ' . SNATCHED_TABLE . ' s       LEFT JOIN ' . TORRENTS_TABLE . ' t ON s.torrentid = t.fid  WHERE t.name IS NULL'); 
     28                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned snatched rows deleted', LOG_VIEW_SYSOP); 
     29                        $db->sql_query('DELETE r.*  FROM ' . RATINGS_TABLE . ' r        LEFT JOIN ' . TORRENTS_TABLE . ' t ON r.torrent = t.fid    WHERE t.name IS NULL'); 
     30                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned ratings deleted', LOG_VIEW_SYSOP); 
     31                        $db->sql_query('DELETE i.*  FROM ' . INDEXRELEASES_TABLE . ' i   LEFT JOIN ' . TORRENTS_TABLE . ' t ON i.torrent_id = t.fid WHERE t.name IS NULL'); 
     32                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned indexreleases deleted', LOG_VIEW_SYSOP); 
     33                        $db->sql_query('DELETE c.*  FROM ' . COMMENTS_NOTIFY_TABLE . ' c      LEFT JOIN ' . TORRENTS_TABLE . ' t ON ( c.checkcomm_for_id = t.fid ) WHERE t.name IS NULL AND c.checkcomm_type = ' . TYPE_TORRENT); 
     34                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned comments notifis deleted', LOG_VIEW_SYSOP); 
     35                        $db->sql_query('DELETE b.*  FROM ' . BOOKMARKS_TABLE . ' b      LEFT JOIN ' . TORRENTS_TABLE . ' t ON b.torrentid = t.fid  WHERE t.name IS NULL'); 
     36                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned bookmarks deleted', LOG_VIEW_SYSOP); 
     37                        $db->sql_query('DELETE s.*  FROM ' . SNATCHED_TABLE . ' s      LEFT JOIN ' . TORRENTS_TABLE . ' t ON s.torrentid = t.fid  WHERE t.name IS NULL'); 
     38                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned snatched deleted', LOG_VIEW_SYSOP); 
     39                        $db->sql_query('DELETE r.*  FROM ' . REPORTS_TABLE . ' r      LEFT JOIN ' . TORRENTS_TABLE . ' t ON r.votedfor = t.fid  WHERE t.name IS NULL AND r.type = 2'); 
     40                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned reports deleted', LOG_VIEW_SYSOP); 
     41                break; 
    4942 
    50         $db->sql_query('DELETE m.* FROM ' . PRIVATE_MESSAGES_TABLE . ' m  LEFT JOIN ' . USERS_TABLE . ' u  ON m.sender = u.uid   WHERE u.uid IS NULL'); 
    51         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned private messages deleted', LOG_VIEW_SYSOP); 
    52         $db->sql_query('DELETE m.* FROM ' . PRIVATE_MESSAGES_TABLE . ' m  LEFT JOIN ' . USERS_TABLE . ' u  ON m.receiver = u.uid   WHERE u.uid IS NULL'); 
    53         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned private messages deleted', LOG_VIEW_SYSOP); 
    54         $db->sql_query('DELETE s.* FROM ' . SNATCHED_TABLE . ' s      LEFT JOIN ' . USERS_TABLE . ' u ON s.userid = u.uid  WHERE u.uid IS NULL'); 
    55         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned snatched deleted', LOG_VIEW_SYSOP); 
    56         $db->sql_query('DELETE f.* FROM ' . FRIENDS_TABLE . ' f      LEFT JOIN ' . USERS_TABLE . ' u ON f.userid = u.uid  WHERE u.uid IS NULL'); 
    57         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned friends deleted', LOG_VIEW_SYSOP); 
    58         $db->sql_query('DELETE f.* FROM ' . FRIENDS_TABLE . ' f      LEFT JOIN ' . USERS_TABLE . ' u ON f.friendid = u.uid  WHERE u.uid IS NULL'); 
    59         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned friends deleted', LOG_VIEW_SYSOP); 
    60         $db->sql_query('DELETE f.* FROM ' . FRIENDS_TABLE . ' f      LEFT JOIN ' . USERS_TABLE . ' u ON f.blockid = u.uid  WHERE u.uid IS NULL'); 
    61         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned friends deleted', LOG_VIEW_SYSOP); 
    62         $db->sql_query('DELETE r.* FROM ' . REPORTS_TABLE . ' r      LEFT JOIN ' . USERS_TABLE . ' u ON r.addedby = u.uid  WHERE u.uid IS NULL'); 
    63         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned reports deleted', LOG_VIEW_SYSOP); 
    64         $db->sql_query('DELETE r.* FROM ' . REPORTS_TABLE . ' r      LEFT JOIN ' . USERS_TABLE . ' u ON r.votedfor = u.uid  WHERE u.uid IS NULL AND r.type = 1'); 
    65         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned reports deleted', LOG_VIEW_SYSOP); 
    66         $db->sql_query('DELETE s.* FROM ' . SESSIONS_TABLE . ' s      LEFT JOIN ' . USERS_TABLE . ' u ON s.session_user_id = u.uid  WHERE u.uid IS NULL'); 
    67         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned sessions deleted', LOG_VIEW_SYSOP); 
    68         $db->sql_query('DELETE s.* FROM ' . SESSIONS_KEYS_TABLE . ' s      LEFT JOIN ' . USERS_TABLE . ' u ON s.user_id = u.uid  WHERE u.uid IS NULL'); 
    69         write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned session keys deleted', LOG_VIEW_SYSOP); 
    70         //end sync tables, delete some old shit 
     43                case 1: 
     44                        $db->sql_query('DELETE c.*  FROM ' . COMMENTS_TABLE . ' c       LEFT JOIN ' . REQUESTS_TABLE . ' r ON ( c.comment_for_id = r.id ) WHERE r.request IS NULL AND c.comment_type = ' . TYPE_REQUEST); 
     45                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned comments from requests deleted', LOG_VIEW_SYSOP); 
     46                        $db->sql_query('DELETE c.*  FROM ' . COMMENTS_TABLE . ' c       LEFT JOIN ' . OFFERS_TABLE . ' o   ON ( c.comment_for_id = o.id ) WHERE o.name IS NULL AND c.comment_type = ' . TYPE_OFFER); 
     47                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned comments from offers deleted', LOG_VIEW_SYSOP); 
     48                        $db->sql_query('DELETE v.*  FROM ' . REQUESTS_VOTES_TABLE . ' v LEFT JOIN ' . REQUESTS_TABLE . ' r ON v.requestid = r.id  WHERE r.request IS NULL'); 
     49                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned requests votes deleted', LOG_VIEW_SYSOP); 
     50                        $db->sql_query('DELETE ov.* FROM ' . OFFERS_VOTES_TABLE . ' ov  LEFT JOIN ' . OFFERS_TABLE . ' o   ON ov.offerid = o.id   WHERE o.name IS NULL'); 
     51                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned offers votes deleted', LOG_VIEW_SYSOP); 
     52                break; 
    7153 
    72         //begin delete some old torrent-files and not torrent files from torrents dir 
    73         $sql = 'SELECT fid FROM ' . TORRENTS_TABLE; 
    74         $result = $db->sql_query($sql); 
    75         $torrents = $files = $delete_files = array(); 
    76         while ($row = $db->sql_fetchrow($result)) { 
    77                 $torrents[$row['fid']] = 1; 
    78         } 
    79         $torrent_dir = $root_path . ( !empty($config['torrent_dir']) ? $config['torrent_dir'] : 'torrents'); 
     54                case 2: 
     55                        $db->sql_query('DELETE m.* FROM ' . PRIVATE_MESSAGES_TABLE . ' m  LEFT JOIN ' . USERS_TABLE . ' u  ON m.sender = u.uid   WHERE u.uid IS NULL'); 
     56                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned private messages deleted', LOG_VIEW_SYSOP); 
     57                        $db->sql_query('DELETE m.* FROM ' . PRIVATE_MESSAGES_TABLE . ' m  LEFT JOIN ' . USERS_TABLE . ' u  ON m.receiver = u.uid   WHERE u.uid IS NULL'); 
     58                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned private messages deleted', LOG_VIEW_SYSOP); 
     59                        $db->sql_query('DELETE s.* FROM ' . SNATCHED_TABLE . ' s      LEFT JOIN ' . USERS_TABLE . ' u ON s.userid = u.uid  WHERE u.uid IS NULL'); 
     60                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned snatched deleted', LOG_VIEW_SYSOP); 
     61                        $db->sql_query('DELETE f.* FROM ' . FRIENDS_TABLE . ' f      LEFT JOIN ' . USERS_TABLE . ' u ON f.userid = u.uid  WHERE u.uid IS NULL'); 
     62                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned friends deleted', LOG_VIEW_SYSOP); 
     63                        $db->sql_query('DELETE f.* FROM ' . FRIENDS_TABLE . ' f      LEFT JOIN ' . USERS_TABLE . ' u ON f.friendid = u.uid  WHERE u.uid IS NULL'); 
     64                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned friends deleted', LOG_VIEW_SYSOP); 
     65                        $db->sql_query('DELETE f.* FROM ' . FRIENDS_TABLE . ' f      LEFT JOIN ' . USERS_TABLE . ' u ON f.blockid = u.uid  WHERE u.uid IS NULL'); 
     66                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned friends deleted', LOG_VIEW_SYSOP); 
     67                        $db->sql_query('DELETE r.* FROM ' . REPORTS_TABLE . ' r      LEFT JOIN ' . USERS_TABLE . ' u ON r.addedby = u.uid  WHERE u.uid IS NULL'); 
     68                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned reports deleted', LOG_VIEW_SYSOP); 
     69                        $db->sql_query('DELETE r.* FROM ' . REPORTS_TABLE . ' r      LEFT JOIN ' . USERS_TABLE . ' u ON r.votedfor = u.uid  WHERE u.uid IS NULL AND r.type = 1'); 
     70                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned reports deleted', LOG_VIEW_SYSOP); 
     71                        $db->sql_query('DELETE s.* FROM ' . SESSIONS_TABLE . ' s      LEFT JOIN ' . USERS_TABLE . ' u ON s.session_user_id = u.uid  WHERE u.uid IS NULL'); 
     72                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned sessions deleted', LOG_VIEW_SYSOP); 
     73                        $db->sql_query('DELETE s.* FROM ' . SESSIONS_KEYS_TABLE . ' s      LEFT JOIN ' . USERS_TABLE . ' u ON s.user_id = u.uid  WHERE u.uid IS NULL'); 
     74                        write_log('docleanup - ' . $db->sql_affectedrows() . ' orphaned session keys deleted', LOG_VIEW_SYSOP); 
     75                break; 
    8076 
    81         if ( $dp = opendir($torrent_dir . DIRECTORY_SEPARATOR) ) { 
    82                 while ( ( $file = readdir($dp) ) !== false ) { 
    83                         if ( $file != '.' && $file != '..' && !is_dir($torrent_dir . DIRECTORY_SEPARATOR . $file) ) { 
    84                                 if ( !preg_match('/^(\d+)\.torrent$/', $file, $matches) ) { 
    85                                         $delete_files[] = $file; 
    86                                 } 
    87                                 else { 
    88                                         if ( !isset($torrents[$matches[1]]) ) { 
    89                                                 $delete_files[] = $file; 
     77                case 3: 
     78                        //begin delete some old torrent-files and not torrent files from torrents dir 
     79                        $sql = 'SELECT fid FROM ' . TORRENTS_TABLE; 
     80                        $result = $db->sql_query($sql); 
     81                        $torrents = $files = $delete_files = array(); 
     82                        while ($row = $db->sql_fetchrow($result)) { 
     83                                $torrents[$row['fid']] = 1; 
     84                        } 
     85                        $torrent_dir = $root_path . ( !empty($config['torrent_dir']) ? $config['torrent_dir'] : 'torrents'); 
     86 
     87                        if ( $dp = opendir($torrent_dir . DIRECTORY_SEPARATOR) ) { 
     88                                while ( ( $file = readdir($dp) ) !== false ) { 
     89                                        if ( $file != '.' && $file != '..' && !is_dir($torrent_dir . DIRECTORY_SEPARATOR . $file) ) { 
     90                                                if ( !preg_match('/^(\d+)\.torrent$/', $file, $matches) ) { 
     91                                                        $delete_files[] = $file; 
     92                                                } 
     93                                                else { 
     94                                                        if ( !isset($torrents[$matches[1]]) ) { 
     95                                                                $delete_files[] = $file; 
     96                                                        } 
     97                                                } 
    9098                                        } 
    9199                                } 
     100                                closedir($dp); 
    92101                        } 
    93                 } 
    94                 closedir($dp); 
    95         } 
    96         if ( sizeof($delete_files) ) { 
    97                 for ( $i = 0; $i < sizeof($delete_files); ++$i ) { 
    98                         @unlink($torrent_dir . '/' . $delete_files[$i]); 
    99                         write_log('docleanup - ' . $delete_files[$i] . ' file deleted - not present in torrents table', LOG_VIEW_SYSOP); 
    100                 } 
    101         } 
    102         //end delete some old torrent-files and not torrent files from torrents dir 
     102                        if ( sizeof($delete_files) ) { 
     103                                for ( $i = 0; $i < sizeof($delete_files); ++$i ) { 
     104                                        @unlink($torrent_dir . '/' . $delete_files[$i]); 
     105                                        write_log('docleanup - ' . $delete_files[$i] . ' file deleted - not present in torrents table', LOG_VIEW_SYSOP); 
     106                                } 
     107                        } 
     108                        //end delete some old torrent-files and not torrent files from torrents dir 
     109                break; 
    103110 
    104         $user_uid = array(); 
    105         $sql = 'SELECT COUNT(m.id) AS unread_pms, m.receiver, u.user_unread_pms 
     111                case 4: 
     112                        $user_uid = array(); 
     113                        $sql = 'SELECT COUNT(m.id) AS unread_pms, m.receiver, u.user_unread_pms 
    106114                        FROM ' . PRIVATE_MESSAGES_TABLE . ' m, ' . USERS_TABLE . ' u 
    107115                        WHERE m.unread = 1 AND m.location = 1 AND m.receiver = u.uid 
    108116                        GROUP BY m.receiver 
    109117                        HAVING COUNT(m.id) <> user_unread_pms'; 
    110         $result = $db->sql_query($sql); 
    111         if ( $row = $db->sql_fetchrow($result) ) { 
    112                 do { 
    113                         $user_uid[$row['user_unread_pms']][] = $row['receiver']; 
    114                
    115                 while ( $row = $db->sql_fetchrow($result) ); 
     118                       $result = $db->sql_query($sql); 
     119                       if ( $row = $db->sql_fetchrow($result) ) { 
     120                               do { 
     121                                       $user_uid[$row['user_unread_pms']][] = $row['receiver']; 
     122                               
     123                               while ( $row = $db->sql_fetchrow($result) ); 
    116124 
    117                 foreach ( $user_uid AS $pms_count => $ary ) { 
    118                         $sql = 'UPDATE ' . USERS_TABLE . ' SET user_unread_pms = ' . $pms_count . ' WHERE ' . $db->sql_in_set('uid',  $ary); 
     125                                foreach ( $user_uid AS $pms_count => $ary ) { 
     126                                        $sql = 'UPDATE ' . USERS_TABLE . ' SET user_unread_pms = ' . $pms_count . ' WHERE ' . $db->sql_in_set('uid',  $ary); 
     127                                        $db->sql_query($sql); 
     128                                } 
     129 
     130                                write_log('docleanup - ' . sizeof($user_uid) . ' user PMs count updated', LOG_VIEW_SYSOP); 
     131                        } 
     132                break; 
     133 
     134                case 5: 
     135                        $user_limit_ary_torrents = unserialize($config['user_limit_ary_torrents']); 
     136                        $user_limit_ary_allow_download = unserialize($config['user_limit_ary_allow_download']); 
     137                        $users_class_arr = array(); 
     138                        $i = 0; 
     139                        while ( get_user_class_name($i) !== '' ) { 
     140                                $can_leech = ( isset($user_limit_ary_allow_download[$i]) ? 1 : 0 ); 
     141                                $sql = 'UPDATE ' . USERS_TABLE . ' SET torrents_limit = ' . $user_limit_ary_torrents[$i] . ', can_leech = ' . $can_leech . ' WHERE class = ' . $i; 
     142                                $db->sql_query($sql); 
     143                                ++$i; 
     144                                write_log('docleanup - ' . $db->sql_affectedrows() . ' users torrent limits updated', LOG_VIEW_SYSOP); 
     145                        } 
     146 
     147                        $sql = 'UPDATE ' . USERS_TABLE . ' SET torrents_limit = ' . $user_limit_ary_torrents['D'] . ' WHERE donor = 1'; 
    119148                        $db->sql_query($sql); 
    120                 } 
     149                       write_log('docleanup - ' . $db->sql_affectedrows() . ' users torrent limits updated', LOG_VIEW_SYSOP); 
    121150 
    122                 write_log('docleanup - ' . sizeof($user_uid) . ' user PMs count updated', LOG_VIEW_SYSOP); 
     151                        $sql = 'UPDATE ' . USERS_TABLE . ' SET torrents_limit = ' . $user_limit_ary_torrents['W'] . ' WHERE warneduntil > 0'; 
     152                        $db->sql_query($sql); 
     153                        write_log('docleanup - ' . $db->sql_affectedrows() . ' users torrent limits updated', LOG_VIEW_SYSOP); 
     154                break; 
     155 
     156                case 6: 
     157                        $sql = 'SELECT t.fid, u.uid FROM ' . TORRENTS_TABLE . ' t LEFT JOIN ' . USERS_TABLE . ' u ON ( t.owner = u.uid ) WHERE u.uid IS NULL'; 
     158                        $result = $db->sql_query($sql); 
     159                        if ( $row = $db->sql_fetchrow($result) ) { 
     160                                $i = 0; 
     161                                do { 
     162                                        $sql = 'UPDATE ' . TORRENTS_TABLE . ' SET owner = ' . ANONYMOUS . ' WHERE fid = ' . $row['fid']; 
     163                                        $db->sql_query($sql); 
     164 
     165                                        ++$i; 
     166                                } 
     167                                while ( $row = $db->sql_fetchrow($result) ); 
     168 
     169                                write_log('docleanup - ' . $i . ' torrent owner fixed', LOG_VIEW_SYSOP); 
     170                        } 
     171                break; 
     172 
     173                default: 
     174                        trigger_error('all is ok'); 
     175                break; 
     176 
    123177        } 
    124178 
    125         $user_limit_ary_torrents = unserialize($config['user_limit_ary_torrents']); 
    126         $user_limit_ary_allow_download = unserialize($config['user_limit_ary_allow_download']); 
    127         $users_class_arr = array(); 
    128      $i = 0; 
    129         while ( get_user_class_name($i) !== '' ) { 
    130                 $can_leech = ( isset($user_limit_ary_allow_download[$i]) ? 1 : 0 ); 
    131                 $sql = 'UPDATE ' . USERS_TABLE . ' SET torrents_limit = ' . $user_limit_ary_torrents[$i] . ', can_leech = ' . $can_leech . ' WHERE class = ' . $i; 
    132                 $db->sql_query($sql); 
    133           ++$i; 
    134           write_log('docleanup - ' . $db->sql_affectedrows() . ' users torrent limits updated', LOG_VIEW_SYSOP); 
    135      } 
    136  
    137         $sql = 'UPDATE ' . USERS_TABLE . ' SET torrents_limit = ' . $user_limit_ary_torrents['D'] . ' WHERE donor = 1'; 
    138         $db->sql_query($sql); 
    139      write_log('docleanup - ' . $db->sql_affectedrows() . ' users torrent limits updated', LOG_VIEW_SYSOP); 
    140  
    141         $sql = 'UPDATE ' . USERS_TABLE . ' SET torrents_limit = ' . $user_limit_ary_torrents['W'] . ' WHERE warneduntil > 0'; 
    142         $db->sql_query($sql); 
    143      write_log('docleanup - ' . $db->sql_affectedrows() . ' users torrent limits updated', LOG_VIEW_SYSOP); 
    144  
    145      $sql = 'SELECT t.fid, u.uid FROM ' . TORRENTS_TABLE . ' t LEFT JOIN ' . USERS_TABLE . ' u ON ( t.owner = u.uid ) WHERE u.uid IS NULL'; 
    146         $result = $db->sql_query($sql); 
    147         if ( $row = $db->sql_fetchrow($result) ) { 
    148                 $i = 0; 
    149                 do { 
    150                         $sql = 'UPDATE ' . TORRENTS_TABLE . ' SET owner = ' . ANONYMOUS . ' WHERE fid = ' . $row['fid']; 
    151                         $db->sql_query($sql); 
    152  
    153                         ++$i; 
    154                 } 
    155                 while ( $row = $db->sql_fetchrow($result) ); 
    156  
    157                 write_log('docleanup - ' . $i . ' torrent owner fixed', LOG_VIEW_SYSOP); 
    158         } 
    159  
    160         trigger_error('all is ok'); 
     179        meta_refresh(10, append_sid($root_path . 'docleanup.php?step=' . ($step + 1) )); 
     180        trigger_error('Wait 10 seconds'); 
    161181} 
    162182?> 
  • include/constants.php

    r308 r316  
    8080define('TOPIC_LOCKED', 1); 
    8181define('TOPIC_MOVED', 2); 
    82 define('TOPIC_WATCH_NOTIFIED', 1); 
    83 define('TOPIC_WATCH_UN_NOTIFIED', 0); 
    84  
    8582 
    8683// Topic types 
     
    146143define('TYPE_OFFER', 3); 
    147144define('TYPE_NEWS', 4); 
     145define('TYPE_FORUM_POST', 5); 
     146 
     147 
     148define('NOTIFY_STATUS_NOTIFIED', 1); 
     149define('NOTIFY_STATUS_UN_NOTIFIED', 0); 
     150define('VIEW_STATUS_VIEWED', 1); 
     151define('VIEW_STATUS_NOT_VIEWED', 0); 
    148152 
    149153//simpaty type 
     
    189193define('SEARCH_MATCH_TABLE',     'forum_search_wordmatch'); 
    190194define('TOPICS_TABLE',           'forum_topics'); 
    191 define('TOPICS_WATCH_TABLE',     'forum_topics_watch'); 
    192195define('USER_GROUP_TABLE',       'forum_user_group'); 
    193196define('FRIENDS_TABLE',          'friends'); 
  • include/functions.php

    r315 r316  
    889889function getagent($httpagent, $peer_id) { 
    890890 
    891         $httpagents = $peerids = $clients = array(); 
    892  
    893         $peerids[] = '/.*BC00([0-9]{2}).*/s'; 
    894         $clients[] = 'BitComet/0.\\1'; 
    895  
    896         $peerids[] = '/.*FG[0-9]+([0-9]+)([0-9]+)([0-9]+).*/s'; 
    897         $clients[] = 'FlashGet/\\1.\\2.\\3'; 
    898  
    899         $peerids[] = '/.*exbc\08.*/s'; 
    900         $clients[] = 'BitComet/0.56'; 
    901  
    902         $peerids[] = '/.*exbc\09.*/s'; 
    903         $clients[] = 'BitComet/0.57'; 
    904  
    905         $peerids[] = '/.*exbc\0:.*/s'; 
    906         $clients[] = 'BitComet/0.58'; 
    907  
    908         $peerids[] = '/.*exbc\0L.*/s'; 
    909         $clients[] = 'BitLord/1.0'; 
    910  
    911         $peerids[] = '/.*exbcL.*/s'; 
    912         $clients[] = 'BitLord/1.1'; 
    913  
    914         $peerids[] = '/.*UDP0.*/s'; 
    915         $clients[] = 'BitSpirit v.3'; 
    916  
    917         $peerids[] = '/.*ML([0-9]+).([0-9]+).([0-9]+).*/s'; 
    918         $clients[] = 'MLDonkey/\\1.\\2.\\3'; 
    919  
    920         $peerids[] = '/.*UT([0-9]+)([0-9]+)([0-9]+)([0-9A-Z]+).*/s'; 
    921         $clients[] = '&mu;Torrent/\\1.\\2.\\3.\\4'; 
    922  
    923         $peerids[] = '/.*CT([0-9]+)([0-9]+)([0-9]+)([0-9]+).*/s'; 
    924         $clients[] = 'cTorrent/\\1.\\2.\\3.\\4'; 
    925  
    926         $peerids[] = '/.*CD[0-9]+([0-9]+)[0-9]+([0-9]+).*/s'; 
    927         $clients[] = 'Enhanced CTorrent/\\1.\\2'; 
    928  
    929         $peerids[] = '/.*KT([0-9])([0-9])([0-9A-Z])([0-9A-Z]).*/s'; 
    930         $clients[] = 'KTorrent/\\1.\\2.\\3.\\4'; 
    931  
    932         $peerids[] = '/.*btpd\/([0-9]+\.[0-9]{2}).*/s'; 
    933         $clients[] = 'btpd/\\1'; 
    934  
    935         $peerids[] = '/.*M([0-9])-([0-9])-([0-9]).*/s'; 
    936         $clients[] = 'BitTorrent/\\1.\\2.\\3'; 
    937  
    938         $peerids[] = '/-G3.*/s'; 
    939         $clients[] = 'G3 Torrent'; 
    940  
    941         $peerids[] = '/.*AZ([0-9])([0-9])([0-9])([0-9]).*/s'; 
    942         $clients[] = 'Azureus/\\1.\\2.\\3.\\4'; 
    943  
    944         $peerids[] = '/.*LP([0-9])([0-9])([0-9])([0-9]).*/s'; 
    945         $clients[] = 'Lphant/\\2.\\3\\4'; 
    946  
    947         $peerids[] = '/.*DE([0-9])([0-9])([0-9])([0-9]).*/s'; 
    948         $clients[] = 'Deluge/\\1.\\2.\\3'; 
    949  
    950         $peerids[] = '/.*XX([0-9])([0-9])([0-9])([0-9]).*/s'; 
    951         $clients[] = 'Xtorrent/\\1.\\2'; 
    952  
    953         $recognised_client = preg_replace($peerids, $clients, $peer_id); 
    954  
    955         if ( $recognised_client != $peer_id ) { 
    956                 return $recognised_client; 
    957         } 
    958         else { 
    959                 $clients = array(); 
    960  
    961                 $httpagents[] = '/.*Bitcomet Turbo ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]).*/s'; 
    962                 $clients[] = 'Bitcomet Turbo/\\1'; 
    963  
    964                 $httpagents[] = '/.*BitTorrent\/S-([0-9]+\.[0-9]+\.[0-9]+).*/s'; 
    965                 $clients[] = 'Shadow\'s/\\1'; 
    966  
    967                 $httpagents[] = '/.*BitTorrent\/([0-9]+\.[0-9]+\.[0-9]+).*/s'; 
    968                 $clients[] = 'Bittorrent/\\1'; 
    969  
    970                 $httpagents[] = '/.*BitTorrent\/U-([0-9]+\.[0-9]+\.[0-9]+).*/s'; 
    971                 $clients[] = 'UPnP/\\1'; 
    972  
    973                 $httpagents[] = '/.*BitTor(rent|nado)\/T-(.+).*/s'; 
    974                 $clients[] = 'BitTornado/\\2'; 
    975  
    976                 $httpagents[] = '/.*ABC-([0-9]+\.[0-9]+\.[0-9]).*/s'; 
    977                 $clients[] = 'ABC/\\1'; 
    978  
    979                 $httpagents[] = '/.*Fast Torrent ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]).*/s'; 
    980                 $clients[] = 'Fast Torrent/\\1'; 
    981  
    982                 $httpagents[] = '/.*rtorrent\/([0-9]+\.[0-9]+\.[0-9]).*/s'; 
    983                 $clients[] = 'rtorrent/\\1'; 
    984  
    985                 $httpagents[] = '/.*Python-urllib\/.+?, BitTorrent\/([0-9]+\.[0-9]+\.[0-9]+).*/s'; 
    986                 $clients[] = 'BitTorrent/\\1'; 
    987  
    988                 $httpagents[] = '/.*DansClient.*/s'; 
    989                 $clients[] = 'XanTorrent'; 
    990  
    991                 $httpagents[] = '/.*BitTorrent\/brst.*/s'; 
    992                 $clients[] = 'Burst/\\1'; 
    993  
    994                 $httpagents[] = '/.*Shareaza ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]).*/s'; 
    995                 $clients[] = 'Shareaza/\\1'; 
    996  
    997                 $httpagents[] = '/.*Rufus\/([0-9]+\.[0-9]+\.[0-9]+).*/s'; 
    998                 $clients[] = 'Rufus/\\1'; 
    999  
    1000                 $httpagents[] = '/.*eXeem ([0-9]+\.[0-9]{2}).*/s'; 
    1001                 $clients[] = 'eXeem \\1'; 
    1002  
    1003                 $httpagents[] = '/.*BinTorrent ([0-9]+\.[0-9]+).*/s'; 
    1004                 $clients[] = 'BinTorrent \\1'; 
    1005  
    1006                 $httpagents[] = '/.*ML(Donkey)\/([0-9]+)\.([0-9]+)(\.([0-9]+)|).*/si'; 
    1007                 $clients[] = 'MLDonkey/\\2.\\3.\\4'; 
    1008  
    1009                 $httpagents[] = '/.*ed2k_plugin v([0-9]+\.[0-9]+).*/s'; 
    1010                 $clients[] = 'eDonkey/\\1'; 
    1011  
    1012                 $httpagents[] = '/.*0P3R4H.*/s'; 
    1013                 $clients[] = 'Opera BT Client'; 
    1014  
    1015                 $httpagents[] = '/.*Opera\/([0-9]+)\.([0-9]+).*/s'; 
    1016                 $clients[] = 'Opera/\\1.\\2'; 
    1017  
    1018                 $httpagents[] = '/.*qBittorrent v([0-9]+)\.([0-9]+)\.([0-9]+)*/s'; 
    1019                 $clients[] = 'qBittorrent/\\1.\\2.\\3'; 
    1020  
    1021                 $httpagents[] = '/.*Ares ([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)*/s'; 
    1022                 $clients[] = 'Ares/\\1.\\2.\\3.\\4'; 
    1023  
    1024                 $httpagents[] = '/.*libtorrent(\/| )([0-9]+)\.([0-9]+)\.([0-9]+)(\.([0-9]+)|)*/s'; 
    1025                 $clients[] = 'libtorrent/\\2.\\3'; 
    1026  
    1027                 $httpagents[] = '/.*Transmission\/([0-9]+)\.([0-9]+)([0-9]+|)([0-9A-Z]+|).*/s'; 
    1028                 $clients[] = ' Transmission/\\1.\\2 '; 
    1029  
    1030                 $httpagents[] = '/.*LimeWire\/([0-9]+)\.([0-9]+)\.([0-9]+).*/s'; 
    1031                 $clients[] = ' LimeWire/\\1.\\2.\\3 '; 
    1032  
    1033                 $httpagents[] = '/.*supertorrent.*/s'; 
    1034                 $clients[] = 'SuperTorrent'; 
    1035  
    1036                 $httpagents[] = '/.*Halite v ([0-9]+)\.([0-9]+)\.([0-9]+).*/s'; 
    1037                 $clients[] = 'Halite/\\1.\\2.\\3'; 
    1038  
    1039                 $recognised_client = preg_replace($httpagents, $clients, $httpagent); 
    1040  
    1041                 if ( $recognised_client != $httpagent ) { 
    1042                         return trim($recognised_client); 
    1043                 } 
    1044                 else { 
    1045                         return '---'; 
    1046                 } 
    1047         } 
     891        $peer_ids = array( 
     892                'BC0([0-9])([0-9])([0-9])' => 'BitComet/', 
     893                'FG[0-9]+([0-9]+)([0-9]+)([0-9]+)' => 'FlashGet/', 
     894                'exbc\08' => 'BitComet/0.56', 
     895                'exbc\09' => 'BitComet/0.57', 
     896                'exbc\0:' => 'BitComet/0.58', 
     897                'exbc\0L' => 'BitLord/1.0', 
     898                'exbcL' => 'BitLord/1.1', 
     899                'UDP0' => 'BitSpirit v.3', 
     900                'ML([0-9]+).([0-9]+).([0-9]+)' => 'MLDonkey/', 
     901                'UT([0-9]+)([0-9]+)([0-9]+)([0-9A-Z]+)' => '&mu;Torrent/', 
     902                'CT([0-9]+)([0-9]+)([0-9]+)([0-9]+)' => 'cTorrent/', 
     903                'CD[0-9]+([0-9]+)[0-9]+([0-9]+)' => 'Enhanced CTorrent/', 
     904                'KT([0-9])([0-9])([0-9A-Z])([0-9A-Z])' => 'KTorrent/', 
     905                'btpd\/([0-9]+\.[0-9]{2})' => 'btpd/\\1', 
     906                'M([0-9])-([0-9])-([0-9])' => 'BitTorrent/', 
     907                '-G3' => 'G3 Torrent', 
     908                'AZ([0-9])([0-9])([0-9])([0-9])' => 'Azureus/', 
     909                'LP[0-9]([0-9])([0-9])([0-9])' => 'Lphant/', 
     910                'DE([0-9])([0-9])([0-9])([0-9])' => 'Deluge/', 
     911                'XX([0-9])([0-9])([0-9])([0-9])' => 'Xtorrent/', 
     912                'TR([0-9])([0-9])([0-9])([0-9])' => 'Transmission/', 
     913                'LT([0-9])([0-9A-Z])([0-9])([0-9])' => 'libtorrent/', 
     914                'UM([0-9]+)([0-9]+)([0-9]+)([0-9A-Z]+)' => 'Mac &mu;Torrent/', 
     915        ); 
     916 
     917        foreach ( $peer_ids as $pattern => $recog ) { 
     918                if ( preg_match('/' . $pattern . '/si', $peer_id, $matches) ) { 
     919                        unset($matches[0]); 
     920                        return $recog . implode('.', $matches); 
     921                } 
     922        } 
     923 
     924        $httpagents = array( 
     925                'Bitcomet Turbo ([0-9]+\.[0-9]+\.[0-9]+\.[0-9])' => 'Bitcomet Turbo/', 
     926                'BitTorrent\/S-([0-9]+\.[0-9]+\.[0-9]+)' => 'Shadow\'s/', 
     927                'BitTorrent\/([0-9]+\.[0-9]+\.[0-9]+)' => 'Bittorrent/', 
     928                'BitTorrent\/U-([0-9]+\.[0-9]+\.[0-9]+)' => 'UPnP/', 
     929                'BitTor(rent|nado)\/T-(.+)' => 'BitTornado/', 
     930                'ABC-([0-9]+\.[0-9]+\.[0-9])' => 'ABC/', 
     931                'Fast Torrent ([0-9]+\.[0-9]+\.[0-9]+\.[0-9])' => 'Fast Torrent/', 
     932                'rtorrent\/([0-9]+\.[0-9]+\.[0-9])' => 'rtorrent/', 
     933                'Python-urllib\/.+?, BitTorrent\/([0-9]+\.[0-9]+\.[0-9]+)' => 'BitTorrent/', 
     934                'DansClient' => 'XanTorrent', 
     935                'BitTorrent\/brst.' => 'Burst/', 
     936                'Shareaza ([0-9]+\.[0-9]+\.[0-9]+\.[0-9])' => 'Shareaza/', 
     937                'Rufus\/([0-9]+\.[0-9]+\.[0-9]+)' => 'Rufus/', 
     938                'eXeem ([0-9]+\.[0-9]{2})' => 'eXeem/', 
     939                'BinTorrent ([0-9]+\.[0-9]+)' => 'BinTorrent/', 
     940                'ML(Donkey)\/([0-9]+)\.([0-9]+)(\.([0-9]+)|)' => 'MLDonkey/', 
     941                'ed2k_plugin v([0-9]+\.[0-9]+)' => 'eDonkey/', 
     942                '0P3R4H' => 'Opera BT Client', 
     943                'Opera\/([0-9]+)\.([0-9]+)' => 'Opera/', 
     944                'qBittorrent v([0-9]+)\.([0-9]+)\.([0-9]+)' => 'qBittorrent/', 
     945                'Ares ([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)' => 'Ares/', 
     946                'LimeWire\/([0-9]+)\.([0-9]+)\.([0-9]+)' => 'LimeWire/', 
     947                'supertorrent' => 'SuperTorrent', 
     948                'Halite v ([0-9]+)\.([0-9]+)\.([0-9]+)' => 'Halite/\\1.\\2.\\3', 
     949        ); 
     950 
     951        foreach ( $httpagents as $pattern => $recog ) { 
     952                if ( preg_match('/' . $pattern . '/si', $httpagent, $matches) ) { 
     953                        unset($matches[0]); 
     954                        return $recog . implode('.', $matches); 
     955                } 
     956        } 
     957    return '---'; 
    1048958} 
    1049959 
     
    15911501                'PAGE_DESCRIPTION' => $page_description, 
    15921502                'S_USER_LOGGED_IN' => $userdata['session_logged_in'], 
     1503 
     1504                'RSS_FEED' => '<link rel="alternate" type="application/rss+xml" title="' . $config['sitename'] . '" href="' . generate_base_url() . '/rss.php' . ( $userdata['session_logged_in'] ? '?passkey=' . $userdata['torrent_pass'] : '' ) . '" />' . "\n", 
    15931505 
    15941506                'S_USER_IS_MOD' => ( $userdata['class'] >= UC_MODERATOR ) ? 1 : 0, 
     
    16981610 
    16991611                $template->assign_vars(array( 
    1700                         'RSS_FEED' => '<link rel="alternate" type="application/rss+xml" title="' . $config['sitename'] . '" href="' . generate_base_url() . '/rss.php?passkey=' . $userdata['torrent_pass'] . '" />' . "\n", 
    17011612                        'S_YOU_HAVE_INVITES' => sprintf($lang['you_have_invites'], $userdata['invites']), 
    17021613                        'U_LOGOUT' => append_sid($root_path . 'login.php?action=logout'), 
  • include/functions_delete.php

    r295 r316  
    101101                $sql = 'DELETE FROM ' . THANKS_TABLE . ' WHERE userid IN (' . implode(',', $arr_ids) . ')'; 
    102102                $db->sql_query($sql); 
    103                 $sql = 'DELETE FROM ' . TOPICS_WATCH_TABLE . ' WHERE user_id IN (' . implode(',', $arr_ids) . ')'; 
    104                 $db->sql_query($sql); 
    105103                $sql = 'DELETE FROM ' . USER_GROUP_TABLE . ' WHERE user_id IN (' . implode(',', $arr_ids) . ')'; 
    106104                $db->sql_query($sql); 
  • include/functions_post.php

    r313 r316  
    352352 
    353353                        if ( $row['uid'] <> ANONYMOUS ) { 
    354                                 if ( ( $row['class'] == UC_VIP || $row['privacy'] <> PRIVACY_LEVEL_LOW ) && ( $userdata['class'] < UC_MODERATOR && $userdata['uid'] != $row['comment_user'] ) ) { 
     354                                if ( ( $row['class'] == UC_VIP || $row['privacy'] <> PRIVACY_LEVEL_LOW ) && ( $userdata['class'] < UC_MODERATOR && $userdata['uid'] != $row['uid'] ) ) { 
    355355                                        $ratio = '---'; 
    356356                                     $uploaded = '---'; 
  • include/sessions.php

    r313 r316  
    13511351} 
    13521352 
     1353// 
     1354// Handle user notification 
     1355// 
     1356function user_notification($notify_user, $notify_type, $info_data) 
     1357{ 
     1358        global $config, $lang, $db, $root_path, $phpEx, $cache; 
     1359        global $userdata, $user_ip; 
     1360        // www.phpBB-SEO.com SEO TOOLKIT BEGIN 
     1361        global $seo; 
     1362        // www.phpBB-SEO.com SEO TOOLKIT END 
     1363 
     1364        $current_time = time(); 
     1365        $base_url = generate_base_url(); 
     1366 
     1367        switch ( $notify_type ) { 
     1368                case TYPE_FORUM_POST: 
     1369 
     1370                        if ( $info_data['mode'] <> 'reply' ) { 
     1371                                return; 
     1372                        } 
     1373 
     1374                        $post_id = $info_data['post_id']; 
     1375                        $topic_id = $info_data['topic_id']; 
     1376 
     1377                        $for_id = $topic_id; 
     1378                        $last_id = $post_id; 
     1379                        $notifs_type = '[forum]'; 
     1380 
     1381                        $email_template = 'topic_notify'; 
     1382 
     1383                        $title = censor_text(unprepare_message($info_data['topic_title'])); 
     1384 
     1385                        // www.phpBB-SEO.com SEO TOOLKIT BEGIN 
     1386                        if ( $seo->seo_opt['url_rewrite'] ) { 
     1387                                $seo->set_url(htmlspecialchars_decode($title), $topic_id, $seo->seo_static['topic']); 
     1388 
     1389                                $u_view_url = append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_POST_URL . "=$post_id#$post_id", false, false); 
     1390                                $u_view_url = $seo->drop_sid($u_view_url); 
     1391 
     1392                                $u_stop_watching = append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id&unwatch=topic", false, false); 
     1393                                $u_stop_watching = $seo->drop_sid($u_stop_watching); 
     1394                        } 
     1395                        // www.phpBB-SEO.com SEO TOOLKIT END 
     1396                        else { 
     1397                                $u_view_url = $base_url . "/phpbb2.php?page=viewtopic&" . POST_POST_URL . "=$post_id#$post_id"; 
     1398                                $u_stop_watching = $base_url . "/phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id&unwatch=topic"; 
     1399                        } 
     1400                break; 
     1401 
     1402                case TYPE_TORRENT: 
     1403                case TYPE_REQUEST: 
     1404                case TYPE_OFFER: 
     1405                case TYPE_NEWS: 
     1406 
     1407                        $for_id = $info_data['for_id']; 
     1408                        $last_id = $info_data['last_id']; 
     1409                        $notifs_type = '[comments]'; 
     1410 
     1411                        $title = $info_data['name']; 
     1412 
     1413                        $email_template = 'comments_notify'; 
     1414 
     1415                        // www.phpBB-SEO.com SEO TOOLKIT BEGIN 
     1416                        if ( $seo->seo_opt['url_rewrite'] ) { 
     1417                                $u_stop_watching = append_sid($root_path . "comment.php?type=$notify_type&action=checkoff&tid=$for_id", false, false); 
     1418                                $u_stop_watching = $seo->drop_sid($u_stop_watching); 
     1419 
     1420                                $u_view_url = append_sid($root_path . 'comment.php?cid=' . $last_id, false, false); 
     1421                                $u_view_url = $seo->drop_sid($u_view_url); 
     1422                        } 
     1423                        // www.phpBB-SEO.com SEO TOOLKIT END 
     1424                        else { 
     1425                                $u_stop_watching = $base_url . "/comment.php?type=$notify_type&action=checkoff&tid=$for_id"; 
     1426                                $u_view_url = $base_url . '/comment.php?cid=' . $last_id; 
     1427                        } 
     1428 
     1429                break; 
     1430        } 
     1431 
     1432 
     1433        $sql = "SELECT u.uid, u.email, u.language, u.notifs 
     1434                        FROM " . COMMENTS_NOTIFY_TABLE . " tw, " . USERS_TABLE . " u 
     1435                        WHERE tw.checkcomm_for_id = " . $for_id . " 
     1436                        AND tw.checkcomm_userid NOT IN (" . $userdata['uid'] . ", " . ANONYMOUS . ") 
     1437                        AND tw.checkcomm_notify_status = " . NOTIFY_STATUS_UN_NOTIFIED . " 
     1438                        AND u.uid = tw.checkcomm_userid 
     1439                        AND u.enabled = 1 
     1440                        AND tw.checkcomm_type = " . $notify_type; 
     1441        $result = $db->sql_query($sql); 
     1442 
     1443        $update_watched_sql = ''; 
     1444        $bcc_list_ary = array(); 
     1445 
     1446        if ( $row = $db->sql_fetchrow($result) ) { 
     1447                // Sixty second limit 
     1448                @set_time_limit(60); 
     1449 
     1450                do 
     1451                { 
     1452                        if ( strpos($row['notifs'], $notifs_type) !== false ) 
     1453                        { 
     1454                                $bcc_list_ary[$row['language']][] = $row['email']; 
     1455                        } 
     1456                        $update_watched_sql .= ($update_watched_sql != '') ? ', ' . $row['uid'] : $row['uid']; 
     1457                } 
     1458                while ( $row = $db->sql_fetchrow($result) ); 
     1459 
     1460                if ( sizeof($bcc_list_ary) ) 
     1461                { 
     1462                        include_once($root_path . 'include/functions_messenger.php'); 
     1463                        $messenger = new messenger(true); 
     1464 
     1465                        foreach ( $bcc_list_ary AS $user_lang => $bcc_list ) { 
     1466 
     1467                                foreach ( $bcc_list AS $_null => $email ) { 
     1468 
     1469                                        $messenger->template($email_template, $user_lang); 
     1470 
     1471                                        $messenger->to($email, $email); 
     1472 
     1473                                        $messenger->assign_vars(array( 
     1474                                                'TITLE' => $title, 
     1475                                                'U_VIEW_URL' => $u_view_url, 
     1476                                                'U_STOP_WATCHING' => $u_stop_watching 
     1477                                        )); 
     1478 
     1479                                        $messenger->send(NOTIFY_EMAIL); 
     1480                                } 
     1481                        } 
     1482                        $messenger->save_queue(); 
     1483                } 
     1484        } 
     1485        $db->sql_freeresult($result); 
     1486 
     1487        if ( $update_watched_sql ) 
     1488        { 
     1489                $sql = 'UPDATE ' . COMMENTS_NOTIFY_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array( 
     1490                        'checkcomm_notify_status' => NOTIFY_STATUS_NOTIFIED, 
     1491                        'checkcomm_last_comment_id' => $last_id, 
     1492                        'checkcomm_view_status' => VIEW_STATUS_NOT_VIEWED, 
     1493                        )) . ' 
     1494                        WHERE checkcomm_for_id = ' . $for_id . ' 
     1495                        AND checkcomm_type = ' . $notify_type . ' 
     1496                        AND checkcomm_userid IN (' . $update_watched_sql . ')'; 
     1497                $db->sql_query($sql); 
     1498        } 
     1499 
     1500        if ( $notify_user ) { 
     1501                $sql = "SELECT checkcomm_for_id 
     1502                        FROM " . COMMENTS_NOTIFY_TABLE . " 
     1503                        WHERE checkcomm_for_id = $for_id 
     1504                        AND checkcomm_type = " . $notify_type . " 
     1505                        AND checkcomm_userid = " . $userdata['uid']; 
     1506                $result = $db->sql_query($sql); 
     1507 
     1508                if ( !$row = $db->sql_fetchrow($result) ) 
     1509                { 
     1510                        $sql = 'INSERT INTO ' . COMMENTS_NOTIFY_TABLE . ' ' . $db->sql_build_array('INSERT', array( 
     1511                                'checkcomm_userid' => $userdata['uid'], 
     1512                                'checkcomm_for_id' => $for_id, 
     1513                                'checkcomm_type' => $notify_type, 
     1514                                'checkcomm_notify_status' => NOTIFY_STATUS_UN_NOTIFIED, 
     1515                                'checkcomm_view_status' => VIEW_STATUS_VIEWED, 
     1516                                'checkcomm_last_comment_id' => $last_id, 
     1517                        )); 
     1518                        $db->sql_query($sql); 
     1519                } 
     1520        } 
     1521} 
     1522 
    13531523?> 
  • include/ucp/checkcomm.php

    r280 r316  
    11<?php 
    22 
    3 $sql = 'SELECT COUNT(*) AS count FROM ' . COMMENTS_NOTIFY_TABLE . ' WHERE checkcomm_userid = ' . $userdata['uid'] . ' AND checkcomm_notify_status = 0 AND checkcomm_last_comment_id <> 0'
     3$sql = 'SELECT COUNT(*) AS count FROM ' . COMMENTS_NOTIFY_TABLE . ' WHERE checkcomm_userid = ' . $userdata['uid'] . ' AND checkcomm_view_status = ' . VIEW_STATUS_NOT_VIEWED
    44$result = $db->sql_query($sql); 
    55$count = ( $row = $db->sql_fetchrow($result) ) ? intval($row['count']) : 0; 
    6 if ( !$count ) { 
    7         $template->assign_vars(array( 
    8                 'NO_FOUND' => true 
    9         )); 
    10 
    11 else { 
    12         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, 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 
    14                         FROM ' . COMMENTS_NOTIFY_TABLE . ' cn 
    15                         LEFT JOIN ' . TORRENTS_TABLE . ' t ON cn.checkcomm_for_id = t.fid 
    16                         LEFT JOIN ' . REQUESTS_TABLE . ' r ON cn.checkcomm_for_id = r.id 
    17                         LEFT JOIN ' . OFFERS_TABLE . ' o ON cn.checkcomm_for_id = o.id 
    18                         LEFT JOIN ' . NEWS_TABLE . ' n ON cn.checkcomm_for_id = n.id, 
    19                         ' . COMMENTS_TABLE . ' c, 
    20                         ' . USERS_TABLE . ' u 
    21                         WHERE cn.checkcomm_userid = ' . $userdata['uid'] . " 
    22                         AND cn.checkcomm_notify_status = 0 
    23                         AND c.comment_user = u.uid 
    24                         AND cn.checkcomm_last_comment_id = c.comment_id  $limit"; 
     6 
     7list($pagertop, $pagerbottom, $limit) = pager($config['posts_per_page'], $count, 'my.php?type=' . $type . '&amp;'); 
     8 
     9$i = 0; 
     10 
     11if ( $count ) { 
     12 
     13        //first sql - get all notifies 
     14        $sql = 'SELECT * 
     15                        FROM ' . COMMENTS_NOTIFY_TABLE . ' 
     16                        WHERE checkcomm_userid = ' . $userdata['uid'] . ' 
     17                        AND checkcomm_view_status = ' . VIEW_STATUS_NOT_VIEWED . ' ' . $limit; 
    2518        $result = $db->sql_query($sql); 
    2619 
    27         $template->assign_vars(array( 
    28                 'PAGERBOTTOM' => $pagerbottom, 
    29                 'NO_FOUND' => false, 
    30                 'IMAGE_INBOXNEW' => $images['inboxnew'], 
    31                 'IMAGE_ARROW_RIGHT' => $images['arrow_right'], 
    32         )); 
    33  
    34         $i = 0; 
     20        $notify_ary = array(); 
     21        $last_comments = array(); 
     22        $last_posts = array(); 
     23 
     24        while ( $row = $db->sql_fetchrow($result) ) { 
     25                $notify_ary[$row['checkcomm_type']][$row['checkcomm_for_id']] = $row; 
     26 
     27                if ( $row['checkcomm_last_comment_id'] <> 0 ) { 
     28                        if ( $row['checkcomm_type'] == TYPE_FORUM_POST ) { 
     29                                $last_posts[] = $row['checkcomm_last_comment_id']; 
     30                        } 
     31                        else { 
     32                                $last_comments[] = $row['checkcomm_last_comment_id']; 
     33                        } 
     34                } 
     35        } 
     36 
     37        $comments_data = array(); 
     38        $forum_posts_data = array(); 
     39 
     40        if ( sizeof($last_comments) || sizeof($last_posts) ) { 
     41 
     42                if ( ( !empty($notify_ary[TYPE_TORRENT]) || !empty($notify_ary[TYPE_REQUEST]) || !empty($notify_ary[TYPE_OFFER]) || !empty($notify_ary[TYPE_NEWS]) ) && sizeof($last_comments) ) { 
     43 
     44                        $sql = 'SELECT c.comment_added AS added, c.comment_id, u.name, u.uid, u.class 
     45                                        FROM ' . COMMENTS_TABLE . ' c, 
     46                                        ' . USERS_TABLE . ' u 
     47                                        WHERE c.comment_user = u.uid 
     48                                        AND ' . $db->sql_in_set('c.comment_id', $last_comments); 
     49                        $result = $db->sql_query($sql); 
     50 
     51                        while ( $row = $db->sql_fetchrow($result) ) { 
     52                                $comments_data[$row['comment_id']] = $row; 
     53                        } 
     54                } 
     55 
     56                if ( !empty($notify_ary[TYPE_FORUM_POST]) && sizeof($last_posts) ) { 
     57 
     58                        $sql = 'SELECT p.post_id, p.post_time AS added, u.name, u.uid, u.class 
     59                                        FROM ' . POSTS_TABLE . ' p, 
     60                                        ' . USERS_TABLE . ' u 
     61                                        WHERE p.poster_id = u.uid 
     62                                        AND ' . $db->sql_in_set('p.post_id', $last_posts); 
     63                        $result = $db->sql_query($sql); 
     64 
     65                        while ( $row = $db->sql_fetchrow($result) ) { 
     66                                $forum_posts_data[$row['post_id']] = $row; 
     67                        } 
     68                } 
     69        } 
    3570 
    3671        $cats = $cache->obtain_cats(); 
    3772 
    38         while ( $row = $db->sql_fetchrow($result) ) { 
    39                 ++$i; 
    40  
    41                 switch ( $row['checkcomm_type'] ) { 
     73        foreach ( $notify_ary AS $notify_type => $ary ) { 
     74 
     75                $keys = array_keys($ary); 
     76 
     77                $data_ary = array(); 
     78 
     79                switch ( $notify_type ) { 
    4280                        case TYPE_TORRENT: 
    43                                 $filename = 'details'; 
    44                                 $table = 'torrent'; 
    45                                 $name = $lang['torrent']; 
     81                                $sql = 'SELECT t.name, t.category, t.fid AS id 
     82                                                FROM ' . TORRENTS_TABLE . ' t 
     83                                                WHERE ' . $db->sql_in_set('t.fid', $keys); 
     84                                $result = $db->sql_query($sql); 
     85 
     86                                while ( $row = $db->sql_fetchrow($result) ) { 
     87                                        // www.phpBB-SEO.com SEO TOOLKIT BEGIN 
     88                                        $seo->set_torrent_url($row['id'], $row['name'], $row['category']); 
     89                                        // www.phpBB-SEO.com SEO TOOLKIT END 
     90 
     91                                        $row['u_file'] = 'details.php?id=' . $row['id']; 
     92                                        $data_ary[$row['id']] = $row; 
     93                                } 
     94 
     95                                $type_name = $lang['torrent']; 
    4696                        break; 
    4797 
    4898                        case TYPE_REQUEST: 
    49                                 $filename = 'requests'; 
    50                                 $table = 'request'; 
    51                                 $name = $lang['request']; 
     99                                $sql = 'SELECT t.request AS name, t.cat, t.id 
     100                                                FROM ' . REQUESTS_TABLE . ' t 
     101                                                WHERE ' . $db->sql_in_set('t.id', $keys); 
     102                                $result = $db->sql_query($sql); 
     103 
     104                                while ( $row = $db->sql_fetchrow($result) ) { 
     105                                        $row['u_file'] = 'requests.php?id=' . $row['id']; 
     106                                        $data_ary[$row['id']] = $row; 
     107                                } 
     108 
     109                                $type_name = $lang['request']; 
    52110                        break; 
    53111 
    54112                        case TYPE_OFFER: 
    55                                 $filename = 'offers'; 
    56                                 $table = 'offer'; 
    57                                 $name = $lang['offer']; 
    58                         break; 
     113                                $sql = 'SELECT t.name AS name, t.category, t.id 
     114                                                FROM ' . OFFERS_TABLE . ' t 
     115                                                WHERE ' . $db->sql_in_set('t.id', $keys); 
     116                                $result = $db->sql_query($sql); 
     117 
     118                                while ( $row = $db->sql_fetchrow($result) ) { 
     119                                        $row['u_file'] = 'requests.php?id=' . $row['id']; 
     120                                        $data_ary[$row['id']] = $row; 
     121                                } 
     122 
     123                                $type_name = $lang['offer']; 
     124                        break; 
     125 
    59126                        case TYPE_NEWS: 
    60                                 $filename = 'news'; 
    61                                 $table = 'news'; 
    62                                 $name = $lang['news']; 
    63                         break; 
    64                 } 
    65  
    66                 $cat_id = $row[$table . '_category']; 
    67  
    68                 if ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_name']) ) { 
    69                         $cat_parent = $cats[$cats[$cat_id]['cat_parent']]; 
    70                         // www.phpBB-SEO.com SEO TOOLKIT BEGIN 
    71                         $seo->set_url($cat_parent['cat_name'], $cat_parent['cat_id'], $seo->seo_static['browse']); 
    72                         $seo->set_parent($cats[$cat_id]['cat_id'], $seo->seo_static['browse'], $cat_parent['cat_id'], $seo->seo_static['browse']); 
    73                         // www.phpBB-SEO.com SEO TOOLKIT END 
    74                 } 
    75  
    76                 // www.phpBB-SEO.com SEO TOOLKIT BEGIN 
    77                 $seo->set_url($cats[$cat_id]['cat_name'], $cats[$cat_id]['cat_id'], $seo->seo_static['browse']); 
    78                 $seo->set_parent($row['checkcomm_for_id'], $seo->seo_static[$filename], $cats[$cat_id]['cat_id'], $seo->seo_static['browse']); 
    79                 $seo->set_url($row[$table . '_name'], $row['checkcomm_for_id'], $seo->seo_static[$filename]); 
    80                 // www.phpBB-SEO.com SEO TOOLKIT END 
    81  
    82                 if ( $row['uid'] <> ANONYMOUS ) { 
    83                         $u_last_poster = append_sid('userdetails.php?id=' . $row['uid']); 
    84                         $last_poster_name = get_user_class_color($row['class'], $row['name']); 
    85                 } 
    86                 else { 
    87                         $u_last_poster = ''; 
    88                         $last_poster_name = '<i>' . $lang['unknown'] . '</i>'; 
    89                 } 
    90  
    91                 $template->assign_block_vars('checkcomm_row', array( 
    92                         'U_FILE' => append_sid($root_path . $filename . '.php?id=' . $row['checkcomm_for_id']), 
    93                         'U_CHECKOFF' => append_sid($root_path . 'comment.php?type=' . $row['checkcomm_type'] . '&amp;action=checkoff&amp;tid=' . $row['checkcomm_for_id']), 
    94                         'TORRENT_NAME' => $row[$table . '_name'], 
    95                         'NAME' => $name, 
    96                         'ADDED' => create_date($row['comment_added']), 
    97                         'U_LAST_POSTER' => $u_last_poster, 
    98                         'U_COMMENTS' => append_sid($root_path . 'comment.php?cid=' . $row['comment_id']), 
    99                         'LAST_POSTER_NAME' => $last_poster_name, 
    100                         'ROW_CLASS' => ( $i % 2? $theme['td_class1'] : $theme['td_class2'] ) 
    101                 )); 
     127                                $sql = 'SELECT t.title AS name, t.id 
     128                                                FROM ' . NEWS_TABLE . ' t 
     129                                                WHERE ' . $db->sql_in_set('t.id', $keys); 
     130                                $result = $db->sql_query($sql); 
     131 
     132                                while ( $row = $db->sql_fetchrow($result) ) { 
     133                                        $row['u_file'] = 'news.php?id=' . $row['id']; 
     134                                        $data_ary[$row['id']] = $row; 
     135                                } 
     136 
     137                                $type_name = $lang['news']; 
     138                        break; 
     139 
     140                        case TYPE_FORUM_POST: 
     141                                $sql = 'SELECT t.topic_id, topic_title AS name, topic_last_post_time, f.forum_id, f.forum_name, f2.forum_id AS p_forum_id, f2.forum_name AS p_forum_name, c.cat_id, c.cat_title 
     142                                                FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f 
     143                                                LEFT JOIN ' . FORUMS_TABLE . ' f2 ON ( f.forum_parent = f2.forum_id ), 
     144                                                ' . FORUM_CATEGORIES_TABLE . ' c 
     145                                                WHERE t.forum_id = f.forum_id 
     146                                                AND f.cat_id = c.cat_id 
     147                                                AND ' . $db->sql_in_set('t.topic_id', $keys); 
     148                                $result = $db->sql_query($sql); 
     149 
     150                                while ( $row = $db->sql_fetchrow($result) ) { 
     151 
     152                                        // www.phpBB-SEO.com SEO TOOLKIT BEGIN 
     153                                        $seo->set_url($row['cat_title'], $row['cat_id'], $seo->seo_static['forum_cat']); 
     154                                        $seo->set_parent($row['forum_id'], $seo->seo_static['forum'], $row['cat_id'], $seo->seo_static['forum_cat']); 
     155 
     156                                        if ( !empty($row['p_forum_id']) ) { 
     157                                                $seo->set_url($row['p_forum_name'], $row['p_forum_id'], $seo->seo_static['forum']); 
     158                                                $seo->set_parent($row['forum_id'], $seo->seo_static['forum'], $row['p_forum_id'], $seo->seo_static['forum']); 
     159                                        } 
     160 
     161                                        $seo->set_url($row['forum_name'], $row['forum_id'], $seo->seo_static['forum']); 
     162 
     163                                        $seo->set_parent($row['topic_id'], $seo->seo_static['topic'], $row['forum_id'], $seo->seo_static['forum']); 
     164                                        $seo->set_url($row['name'], $row['topic_id'], $seo->seo_static['topic']); 
     165                                        // www.phpBB-SEO.com SEO TOOLKIT END 
     166 
     167                                        $row['u_file'] = 'phpbb2.php?page=viewtopic&amp;t=' . $row['topic_id']; 
     168 
     169                                        $data_ary[$row['topic_id']] = $row; 
     170                                } 
     171 
     172                                $type_name = $lang['forum_post']; 
     173                        break; 
     174                } 
     175 
     176                $i = 0; 
     177 
     178                foreach ( $ary AS $for_id => $data ) { 
     179 
     180                        ++$i; 
     181 
     182                        if ( $notify_type == TYPE_FORUM_POST ) { 
     183                                $comment_data = ( !empty($forum_posts_data[$data['checkcomm_last_comment_id']]) ? $forum_posts_data[$data['checkcomm_last_comment_id']] : false ); 
     184                        } 
     185                        else { 
     186                                $comment_data = ( !empty($comments_data[$data['checkcomm_last_comment_id']]) ? $comments_data[$data['checkcomm_last_comment_id']] : false ); 
     187                        } 
     188 
     189                        $info = $data_ary[$for_id]; 
     190 
     191                        $name = $info['name']; 
     192 
     193                        if ( $comment_data ) { 
     194                                $last_post_time = create_date($comment_data['added']); 
     195 
     196                                if ( $comment_data['uid'] <> ANONYMOUS ) { 
     197                                        $u_last_poster = append_sid($root_path . 'userdetails.php?id=' . $comment_data['uid']); 
     198                                        $last_poster_name = parse_username($comment_data); 
     199                                } 
     200                                else { 
     201                                        $u_last_poster = ''; 
     202                                        $last_poster_name = '<i>' . $lang['unknown'] . '</i>'; 
     203                                } 
     204                        } 
     205                        else { 
     206                                $last_post_time = $lang['na']; 
     207                                $u_last_poster = ''; 
     208                                $last_poster_name = '<i>' . $lang['unknown'] . '</i>'; 
     209                        } 
     210 
     211                        if ( $notify_type == TYPE_FORUM_POST ) { 
     212                                $u_comments = 'phpbb2.php?page=viewtopic&amp;p=' . $data['checkcomm_last_comment_id'] . '#' . $data['checkcomm_last_comment_id']; 
     213                                $u_checkoff = 'phpbb2.php?page=viewtopic&amp;t=' . $for_id . '&amp;unwatch=topic'; 
     214                        } 
     215                        else { 
     216                                $u_comments = 'comment.php?cid=' . $data['checkcomm_last_comment_id']; 
     217                                $u_checkoff = 'comment.php?type=' . $notify_type . '&amp;action=checkoff&amp;tid=' . $for_id; 
     218                        } 
     219 
     220                        $template->assign_block_vars('checkcomm_row', array( 
     221                                'U_FILE' => append_sid($root_path . $info['u_file']), 
     222                                'U_CHECKOFF' => append_sid($root_path . $u_checkoff), 
     223                                'NAME' => $name, 
     224                                'TYPE_NAME' => $type_name, 
     225                                'ADDED' => $last_post_time, 
     226                                'U_LAST_POSTER' => $u_last_poster, 
     227                                'U_COMMENTS' => append_sid($root_path . $u_comments), 
     228                                'LAST_POSTER_NAME' => $last_poster_name, 
     229                                'ROW_CLASS' => ( $i % 2? $theme['td_class1'] : $theme['td_class2'] ) 
     230                        )); 
     231                } 
    102232        } 
    103233} 
    104234 
     235$template->assign_vars(array( 
     236        'PAGERBOTTOM' => $pagerbottom, 
     237        'COUNT' => $count + $i, 
     238)); 
     239 
     240 
    105241$body = 'ucp_checkcomm_body.html'; 
    106242?> 
  • languages/lang_english/email/topic_notify.txt

    r85 r316  
    1 Subject: Topic Reply Notification - {TOPIC_TITLE} 
     1Subject: Topic Reply Notification - {TITLE} 
    22 
    33Hello, 
    44 
    5 You are receiving this email because you are watching the topic, "{TOPIC_TITLE}" at {SITENAME}. This topic has received a reply since your last visit. You can use the following link to view the replies made, no more notifications will be sent until you visit the topic. 
     5You are receiving this email because you are watching the topic, "{TITLE}" at {SITENAME}. This topic has received a reply since your last visit. You can use the following link to view the replies made, no more notifications will be sent until you visit the topic. 
    66 
    7 {U_TOPIC
     7{U_VIEW_URL
    88 
    99If you no longer wish to watch this topic you can either click the "Stop watching this topic link" found at the bottom of the topic above, or by clicking the following link: 
    1010 
    11 {U_STOP_WATCHING_TOPIC
     11{U_STOP_WATCHING
    1212 
    1313{EMAIL_SIG} 
  • languages/lang_english/lang_main.php

    r308 r316  
    628628        'email_notifis_pm' => 'Notify about new PMs by e-mail', 
    629629        'email_notifis_forum' => 'Notify about new forum messages', 
    630         'email_notifis_torrent' => 'Nofity about new torrent in chosen categories (default view)', 
    631         'commentpm' => 'Subscription', 
    632         'commentpm_descr' => 'Automaticaly enable subscription to torrent/request/offer, where you leave a comment', 
     630        'email_notifis_comments' => 'Nofity about new comments', 
     631        'auto_notify' => 'Auto subscription', 
     632        'auto_notify_explain' => 'Automaticaly enable subscription to torrent/request/offer/forum topic, where you leave a comment', 
    633633        'default_categories' => 'Default categories', 
    634634        'expand_cats_in_browse' => 'Expand default cats in browse', 
  • languages/lang_russian/email/topic_notify.txt

    r221 r316  
    1 Subject: Уведомление об ответе - {TOPIC_TITLE} 
     1Subject: Уведомление об ответе - {TITLE} 
    22 
    33Здравствуйте! 
    44 
    5 Вы получили это сообщение потому, что следите за темой "{TOPIC_TITLE}" на сайте {SITENAME}. В этой теме со времени вашего последнего посещения появилось новое сообщение. Вы можете перейти по ссылке, чтобы прочитать поступившие ответы; новые уведомления не будут приходить, пока вы не просмотрите тему: 
     5Вы получили это сообщение потому, что следите за темой "{TITLE}" на сайте {SITENAME}. В этой теме со времени вашего последнего посещения появилось новое сообщение. Вы можете перейти по ссылке, чтобы прочитать поступившие ответы; новые уведомления не будут приходить, пока вы не просмотрите тему: 
    66 
    7 {U_TOPIC
     7{U_VIEW_URL
    88 
    99Если вы больше не хотите следить за темой, то либо щёлкните по ссылке "перестать следить за темой" внизу страницы, либо перейдите по следующей ссылке: 
    1010 
    11 {U_STOP_WATCHING_TOPIC
     11{U_STOP_WATCHING
    1212 
    1313{EMAIL_SIG} 
  • languages/lang_russian/lang_main.php

    r313 r316  
    635635        'email_notifis_pm' => 'Уведомлять когда приходит ЛС', 
    636636        'email_notifis_forum' => 'Уведомлять о новых сообщениях на форуме', 
    637         'email_notifis_torrent' => 'Уведомлять когда появляется новый торрент в выбранных категориях просмотра по умолчанию', 
    638         'commentpm' => 'Подписка', 
    639         'commentpm_descr' => 'Включать подписку на торрент/запрос/предложение, где вы оставляли комментарий, автоматически', 
     637        'email_notifis_comments' => 'Уведомлять о новых комментариях', 
     638        'auto_notify' => 'Автоматическая подписка', 
     639        'auto_notify_explain' => 'Включать подписку на торрент/запрос/предложение/тему на форуме, где вы оставляли комментарий, автоматически', 
    640640        'default_categories' => 'Категории просмотра по умолчанию', 
    641641        'expand_cats_in_browse' => 'Разворачивать категории просмотра по умолчанию в обзоре', 
  • my.php

    r276 r316  
    4141        if ( isset($_POST['submit']) ) { 
    4242                $updateset = array(); 
     43                $notifs = ''; 
    4344                $full_cats = $cache->obtain_cats(); 
    4445 
     
    6364                $updateset['savepms'] = ( isset($_POST['savepms']) ? 1 : 0 ); 
    6465 
    65                 $pmnotif = ( isset($_POST['pmnotif']) ? 1 : 0 ); 
    66                 $notifs = ( $pmnotif  ? '[pm]' : '' ); 
    67  
    68                 $updateset['notify_forum'] = ( isset($_POST['notif_forum']) ? 1 : 0 ); 
     66                $user_notify = request_var('user_notify', array(''=>0)); 
     67                foreach ( $user_notify AS $key => $val ) { 
     68                        $notifs .= '[' . $key . ']'; 
     69                } 
    6970 
    7071                $comment_pm = request_var('commentpm', 0); 
     
    380381                } 
    381382 
     383                $notifs = array('pm', 'forum', 'comments'); 
     384 
     385                $notifs_options = ''; 
     386                foreach ( $notifs AS $_null => $val ) { 
     387                        $name = 'user_notify[' . $val . ']'; 
     388                        $notifs_options .= '<input type="checkbox" id="' . $name . '" name="' . $name . '"' . ( strpos($userdata['notifs'], '[' . $val . ']') !== false ? ' checked="checked"' : '' ) . ' value="1" /> ' . $lang['email_notifis_' . $val] . '<br />'; 
     389                } 
     390 
    382391                $template->assign_vars(array( 
    383392                                'LANG_INPUT' => $lang_select, 
     
    390399                                'BIRTHDAY_OPTIONS' => $birthday_select, 
    391400                                'PRIVACY_INPUT' => $privacy_input, 
    392                                 'EMAIL_NOTIFIS_INPUT' => '<input type="checkbox" id="pmnotif" name="pmnotif"' . (strpos($userdata['notifs'], "[pm]") !== false ? ' checked="checked"' : "") . ' value="yes" /> ' . $lang['email_notifis_pm'] . '<br /><input type="checkbox" id="notif_forum" name="notif_forum"' . (($userdata['notify_forum'] == 1)? ' checked="checked"' : '') . ' value="yes" /> ' . $lang['email_notifis_forum'] . "<br />\n") 
    393                 )
     401                                'EMAIL_NOTIFIS_INPUT' => $notifs_options 
     402                ))
    394403        } 
    395404 
  • news.php

    r311 r316  
    3232                )); 
    3333 
    34                 $sql = 'SELECT checkcomm_notify_status FROM ' . COMMENTS_NOTIFY_TABLE . ' WHERE checkcomm_userid = ' . $userdata['uid'] . ' AND checkcomm_type = ' . TYPE_NEWS . ' AND checkcomm_for_id = ' . $id; 
     34                $sql = 'SELECT checkcomm_view_status FROM ' . COMMENTS_NOTIFY_TABLE . ' WHERE checkcomm_userid = ' . $userdata['uid'] . ' AND checkcomm_type = ' . TYPE_NEWS . ' AND checkcomm_for_id = ' . $id; 
    3535                $result = $db->sql_query( $sql ); 
    3636                $checkcomm = $db->sql_fetchrow( $result ); 
    3737                $db->sql_freeresult( $result ); 
    3838                if ( $checkcomm ) { 
    39                         if ( !$checkcomm['checkcomm_notify_status'] ) { 
     39                        if ( !$checkcomm['checkcomm_view_status'] ) { 
    4040                                $sql_priority = ( $db_type == 'mysql' ) ? ' LOW_PRIORITY' : ''; 
    41                                 $sql = 'UPDATE' . $sql_priority . ' ' . COMMENTS_NOTIFY_TABLE . ' SET checkcomm_notify_status = 1 WHERE checkcomm_userid = ' . $userdata['uid'] . ' AND checkcomm_type = ' . TYPE_NEWS . ' AND checkcomm_for_id = ' . $id; 
     41                                $sql = 'UPDATE' . $sql_priority . ' ' . COMMENTS_NOTIFY_TABLE . ' SET checkcomm_view_status = ' . VIEW_STATUS_VIEWED . ', checkcomm_notify_status = ' . NOTIFY_STATUS_UN_NOTIFIED . ' WHERE checkcomm_userid = ' . $userdata['uid'] . ' AND checkcomm_type = ' . TYPE_NEWS . ' AND checkcomm_for_id = ' . $id; 
    4242                                $db->sql_query($sql); 
    4343                        } 
  • offers.php

    r311 r316  
    340340                } 
    341341 
    342                 $sql = 'SELECT checkcomm_notify_status FROM ' . COMMENTS_NOTIFY_TABLE . ' WHERE checkcomm_userid = ' . $userdata['uid'] . ' AND checkcomm_for_id = ' . $id . ' AND checkcomm_type = ' . TYPE_OFFER; 
     342                $sql = 'SELECT checkcomm_view_status FROM ' . COMMENTS_NOTIFY_TABLE . ' WHERE checkcomm_userid = ' . $userdata['uid'] . ' AND checkcomm_for_id = ' . $id . ' AND checkcomm_type = ' . TYPE_OFFER; 
    343343                $result = $db->sql_query($sql); 
    344344                $checkcomm = $db->sql_fetchrow($result); 
    345345                if ( $checkcomm ) { 
    346                         if ( !$checkcomm['checkcomm_notify_status'] ) { 
     346                        if ( !$checkcomm['checkcomm_view_status'] ) { 
    347347                                $sql_priority = ($db_type == 'mysql') ? ' LOW_PRIORITY' : ''; 
    348                                 $sql = 'UPDATE' . $sql_priority . ' ' . COMMENTS_NOTIFY_TABLE . ' SET checkcomm_notify_status = 1 WHERE checkcomm_userid = ' . $userdata['uid'] . ' AND checkcomm_for_id = ' . $id . ' AND checkcomm_type = ' . TYPE_OFFER; 
     348                                $sql = 'UPDATE' . $sql_priority . ' ' . COMMENTS_NOTIFY_TABLE . ' SET checkcomm_view_status = ' . VIEW_STATUS_VIEWED . ', checkcomm_notify_status = ' . NOTIFY_STATUS_UN_NOTIFIED . ' WHERE checkcomm_userid = ' . $userdata['uid'] . ' AND checkcomm_for_id = ' . $id . ' AND checkcomm_type = ' . TYPE_OFFER; 
    349349                                $db->sql_query($sql); 
    350350                        } 
  • phpBB2/includes/functions_post.php

    r310 r316  
    635635                                $db->sql_query($sql); 
    636636 
    637                                 $sql = "DELETE FROM " . TOPICS_WATCH_TABLE . " 
    638                                         WHERE topic_id = $topic_id"
     637                                $sql = "DELETE FROM " . COMMENTS_NOTIFY_TABLE . " 
     638                                        WHERE checkcomm_for_id = $topic_id AND checkcomm_type = " . TYPE_FORUM_POST
    639639                                $db->sql_query($sql); 
    640640                        } 
     
    679679} 
    680680 
    681 // 
    682 // Handle user notification on new post 
    683 // 
    684 function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topic_id, &$post_id, &$notify_user) 
    685 { 
    686         global $config, $lang, $db, $root_path, $phpEx, $cache; 
    687         global $userdata, $user_ip; 
    688         // www.phpBB-SEO.com SEO TOOLKIT BEGIN 
    689         global $seo; 
    690         // www.phpBB-SEO.com SEO TOOLKIT END 
    691  
    692         $current_time = time(); 
    693  
    694         if ($mode != 'delete') 
    695         { 
    696                 if ($mode == 'reply') 
    697                 { 
    698  
    699                         $sql = "SELECT u.uid, u.email, u.language 
    700                                 FROM " . TOPICS_WATCH_TABLE . " tw, " . USERS_TABLE . " u 
    701                                 WHERE tw.topic_id = $topic_id 
    702                                         AND tw.user_id NOT IN (" . $userdata['uid'] . ", " . ANONYMOUS . ") 
    703                                         AND tw.notify_status = " . TOPIC_WATCH_UN_NOTIFIED . " 
    704                                         AND u.uid = tw.user_id 
    705                                         AND u.enabled = 1"; 
    706                         $result = $db->sql_query($sql); 
    707  
    708                         $update_watched_sql = ''; 
    709                         $bcc_list_ary = array(); 
    710  
    711                         if ($row = $db->sql_fetchrow($result)) 
    712                         { 
    713                                 // Sixty second limit 
    714                                 @set_time_limit(60); 
    715                                 $base_url = generate_base_url(); 
    716  
    717                                 do 
    718                                 { 
    719                                         if ($row['email'] != '') 
    720                                         { 
    721                                                 $bcc_list_ary[$row['language']][] = $row['email']; 
    722                                         } 
    723                                         $update_watched_sql .= ($update_watched_sql != '') ? ', ' . $row['uid'] : $row['uid']; 
    724                                 } 
    725                                 while ($row = $db->sql_fetchrow($result)); 
    726  
    727                                 if (sizeof($bcc_list_ary)) 
    728                                 { 
    729                                         include_once($root_path . 'include/functions_messenger.php'); 
    730                                         $messenger = new messenger(true); 
    731  
    732                                         $topic_title = censor_text(unprepare_message($topic_title)); 
    733  
    734                                         @reset($bcc_list_ary); 
    735                                         while (list($user_lang, $bcc_list) = each($bcc_list_ary)) 
    736                                         { 
    737                                                 for ($i = 0; $i < sizeof($bcc_list); $i++) 
    738                                                 { 
    739                                                         // www.phpBB-SEO.com SEO TOOLKIT BEGIN 
    740                                                         if ( $seo->seo_opt['url_rewrite'] ) { 
    741                                                                 $seo->set_url(htmlspecialchars_decode($topic_title), $topic_id, $seo->seo_static['topic']); 
    742  
    743                                                                 $u_topic = append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_POST_URL . "=$post_id#$post_id", false, false); 
    744                                                                 $u_topic = $seo->drop_sid($u_topic); 
    745  
    746                                                                 $u_stop_watching_topic = append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id&unwatch=topic", false, false); 
    747                                                                 $u_stop_watching_topic = $seo->drop_sid($u_stop_watching_topic); 
    748                                                         } 
    749                                                         // www.phpBB-SEO.com SEO TOOLKIT END 
    750                                                         else { 
    751                                                                 $u_topic = $base_url . "/phpbb2.php?page=viewtopic&" . POST_POST_URL . "=$post_id#$post_id"; 
    752                                                                 $u_stop_watching_topic = $base_url . "/phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id&unwatch=topic"; 
    753                                                         } 
    754  
    755                                                         $messenger->template('topic_notify', $user_lang); 
    756  
    757                                                         $messenger->to($bcc_list[$i], $bcc_list[$i]); 
    758  
    759                                                         $messenger->assign_vars(array( 
    760                                                                 'SITENAME' => $config['sitename'], 
    761                                                                 'TOPIC_TITLE' => $topic_title, 
    762                                                                 'U_TOPIC' => $u_topic, 
    763                                                                 'U_STOP_WATCHING_TOPIC' => $u_stop_watching_topic 
    764                                                         )); 
    765  
    766                                                         $messenger->send(NOTIFY_EMAIL); 
    767                                                 } 
    768                                         } 
    769                                         $messenger->save_queue(); 
    770                                 } 
    771                         } 
    772                         $db->sql_freeresult($result); 
    773  
    774                         if ($update_watched_sql != '') 
    775                         { 
    776                                 $sql = "UPDATE " . TOPICS_WATCH_TABLE . " 
    777                                         SET notify_status = " . TOPIC_WATCH_NOTIFIED . " 
    778                                         WHERE topic_id = $topic_id 
    779                                                 AND user_id IN ($update_watched_sql)"; 
    780                                 $db->sql_query($sql); 
    781                         } 
    782                 } 
    783  
    784                 $sql = "SELECT topic_id 
    785                         FROM " . TOPICS_WATCH_TABLE . " 
    786                         WHERE topic_id = $topic_id 
    787                                 AND user_id = " . $userdata['uid']; 
    788                 $result = $db->sql_query($sql); 
    789  
    790                 $row = $db->sql_fetchrow($result); 
    791  
    792                 if (!$notify_user && !empty($row['topic_id'])) 
    793                 { 
    794                         $sql = "DELETE FROM " . TOPICS_WATCH_TABLE . " 
    795                                 WHERE topic_id = $topic_id 
    796                                         AND user_id = " . $userdata['uid']; 
    797                         $db->sql_query($sql); 
    798                 } 
    799                 else if ($notify_user && empty($row['topic_id'])) 
    800                 { 
    801                         $sql = "INSERT INTO " . TOPICS_WATCH_TABLE . " (user_id, topic_id, notify_status) 
    802                                 VALUES (" . $userdata['uid'] . ", $topic_id, 0)"; 
    803                         $db->sql_query($sql); 
    804                 } 
    805         } 
    806 } 
    807681 
    808682/** 
  • phpBB2/includes/prune.php

    r184 r316  
    8484                if ( $sql_post != '' ) 
    8585                { 
    86                         $sql = "DELETE FROM " . TOPICS_WATCH_TABLE . " 
    87                                 WHERE topic_id IN ($sql_topics)"
     86                        $sql = "DELETE FROM " . COMMENTS_NOTIFY_TABLE . " 
     87                                WHERE checkcomm_for_id IN ($sql_topics) AND checkcomm_type = " . TYPE_FORUM_POST
    8888                        $db->sql_query($sql); 
    8989 
  • phpBB2/index.php

    r313 r316  
    461461                                                        } 
    462462                                                        else { 
     463                                                                $last_post = str_replace('%', '%%', $last_post); 
    463464                                                                $last_post = sprintf($last_post, append_sid($root_path . "phpbb2.php?page=viewtopic&amp;"  . POST_TOPIC_URL . '=' . $forum_data[$j]['topic_id'])); 
    464465                                                        } 
     
    565566                $seo->set_url($forum_data['topic_title'], $forum_data['topic_id'], $seo->seo_static['topic']); 
    566567 
     568                $subforums_list[$i]['last_post'] = str_replace('%', '%%', $subforums_list[$i]['last_post']); 
    567569                $subforums_list[$i]['last_post'] = sprintf($subforums_list[$i]['last_post'], append_sid($root_path . "phpbb2.php?page=viewtopic&amp;"  . POST_TOPIC_URL . '=' . $forum_data['topic_id'])); 
    568570                // www.phpBB-SEO.com SEO TOOLKIT END 
  • phpBB2/modcp.php

    r307 r316  
    370370                        } 
    371371 
    372                         $sql = "DELETE 
    373                                 FROM " . TOPICS_WATCH_TABLE . " 
    374                                 WHERE topic_id IN ($topic_id_sql)"; 
     372                        $sql = "DELETE FROM " . COMMENTS_NOTIFY_TABLE . " 
     373                                WHERE checkcomm_for_id IN ($topic_id_sql) AND checkcomm_type = " . TYPE_FORUM_POST; 
    375374                        $db->sql_query($sql); 
    376375 
     
    821820                                        // Update topic watch table, switch users whose posts 
    822821                                        // have moved, over to watching the destination topic 
    823                                         $sql = "UPDATE " . TOPICS_WATCH_TABLE . " 
    824                                                 SET topic_id = $destination_topic_id 
    825                                                 WHERE topic_id = $topic_id 
    826                                                 AND user_id IN ($user_id_sql)"; 
     822                                        $sql = "UPDATE " . COMMENTS_NOTIFY_TABLE . " 
     823                                                SET checkcomm_for_id = $destination_topic_id 
     824                                                WHERE checkcomm_for_id = $topic_id 
     825                                                AND checkcomm_type = " . TYPE_FORUM_POST . " 
     826                                                AND checkcomm_userid IN ($user_id_sql)"; 
    827827                                        $db->sql_query($sql); 
    828828 
     
    907907                                // Update topic watch table, switch users whose posts 
    908908                                // have moved, over to watching the new topic 
    909                                 $sql = "UPDATE " . TOPICS_WATCH_TABLE . " 
    910                                         SET topic_id = $new_topic_id 
    911                                         WHERE topic_id = $topic_id 
    912                                                 AND user_id IN ($user_id_sql)"; 
     909                                $sql = "UPDATE " . COMMENTS_NOTIFY_TABLE . " 
     910                                        SET checkcomm_for_id = $new_topic_id 
     911                                        WHERE checkcomm_for_id = $topic_id 
     912                                        AND checkcomm_type = " . TYPE_FORUM_POST . " 
     913                                                AND checkcomm_userid IN ($user_id_sql)"; 
    913914                                $db->sql_query($sql); 
    914915 
  • phpBB2/posting.php

    r308 r316  
    432432        if ( $mode != 'newtopic' && $userdata['session_logged_in'] && $is_auth['auth_read'] ) 
    433433        { 
    434                 $sql = "SELECT topic_id 
    435                         FROM " . TOPICS_WATCH_TABLE . " 
    436                         WHERE topic_id = $topic_id 
    437                                 AND user_id = " . $userdata['uid']; 
     434                $sql = "SELECT checkcomm_for_id 
     435                        FROM " . COMMENTS_NOTIFY_TABLE . " 
     436                        WHERE checkcomm_for_id = $topic_id 
     437                        AND checkcomm_type = " . TYPE_FORUM_POST . " 
     438                                AND checkcomm_userid = " . $userdata['uid']; 
    438439                $result = $db->sql_query($sql); 
    439440 
    440                 $notify_user = ( $db->sql_fetchrow($result) ) ? TRUE : $userdata['notify_forum']; 
     441                $notify_user = ( $db->sql_fetchrow($result) ) ? TRUE : $userdata['commentpm']; 
    441442                $db->sql_freeresult($result); 
    442443        } 
    443444        else 
    444445        { 
    445                 $notify_user = ( $userdata['session_logged_in'] && $is_auth['auth_read'] ) ? $userdata['notify_forum'] : 0; 
     446                $notify_user = ( $userdata['session_logged_in'] && $is_auth['auth_read'] ) ? $userdata['commentpm'] : 0; 
    446447        } 
    447448} 
     
    638639                if ($error_msg == '' && $mode != 'poll_delete' && (!$merge)) 
    639640                { 
    640                         user_notification($mode, $post_data, $post_info['topic_title'], $forum_id, $topic_id, $post_id, $notify_user); 
     641                        user_notification($notify_user, TYPE_FORUM_POST, array('mode' => $mode, 'topic_title' => $post_info['topic_title'], 'topic_id' => $topic_id, 'post_id' => $post_id)); 
    641642                } 
    642643 
  • phpBB2/quick_reply.php

    r255 r316  
    3131 
    3232        $attach_sig = ( $userdata['session_logged_in'] && $config['allow_sig'] && $userdata['user_sig'] != '' ) ? "checked='checked'" : ''; 
    33         $notify_user = ($userdata['notify_forum']) ? 'checked="checked"' : ''
     33        $notify_user = ( $userdata['commentpm'] ? 'checked="checked"' : '' )
    3434 
    3535        $template->assign_vars(array( 
  • phpBB2/viewtopic.php

    r313 r316  
    268268        $can_watch_topic = true; 
    269269 
    270         $sql = "SELECT notify_status 
    271                 FROM " . TOPICS_WATCH_TABLE . " 
    272                 WHERE topic_id = $topic_id 
    273                         AND user_id = " . $userdata['uid']; 
     270        $sql = "SELECT checkcomm_view_status, checkcomm_notify_status 
     271                FROM " . COMMENTS_NOTIFY_TABLE . " 
     272                WHERE checkcomm_for_id = $topic_id 
     273                AND checkcomm_type = " . TYPE_FORUM_POST . " 
     274                        AND checkcomm_userid = " . $userdata['uid']; 
    274275        $result = $db->sql_query($sql); 
    275276 
     
    283284 
    284285                                $sql_priority = ($db_type == "mysql") ? "LOW_PRIORITY" : ''; 
    285                                 $sql = "DELETE $sql_priority FROM " . TOPICS_WATCH_TABLE . " 
    286                                         WHERE topic_id = $topic_id 
    287                                                 AND user_id = " . $userdata['uid']; 
     286                                $sql = "DELETE $sql_priority FROM " . COMMENTS_NOTIFY_TABLE . " 
     287                                        WHERE checkcomm_for_id = $topic_id 
     288                                        AND checkcomm_type = " . TYPE_FORUM_POST . " 
     289                                                AND checkcomm_userid = " . $userdata['uid']; 
    288290                                $result = $db->sql_query($sql); 
    289291                        } 
     
    300302                        $is_watching_topic = true; 
    301303 
    302                         if ( $row['notify_status'] ) 
     304                        $sql_priority = ($db_type == "mysql") ? "LOW_PRIORITY" : ''; 
     305 
     306                        if ( $row['checkcomm_view_status'] == VIEW_STATUS_NOT_VIEWED ) 
    303307                        { 
    304                                 $sql_priority = ($db_type == "mysql") ? "LOW_PRIORITY" : ''; 
    305                                 $sql = "UPDATE $sql_priority " . TOPICS_WATCH_TABLE . " 
    306                                         SET notify_status = 0 
    307                                         WHERE topic_id = $topic_id 
    308                                                AND user_id = " . $userdata['uid']; 
     308                                $sql = "UPDATE $sql_priority " . COMMENTS_NOTIFY_TABLE . " 
     309                                       SET checkcomm_view_status = " . VIEW_STATUS_VIEWED . ", checkcomm_notify_status = " . NOTIFY_STATUS_UN_NOTIFIED . " 
     310                                        WHERE checkcomm_for_id = $topic_id 
     311                                        AND checkcomm_type = " . TYPE_FORUM_POST . " 
     312                                        AND checkcomm_userid = " . $userdata['uid']; 
    309313                                $result = $db->sql_query($sql); 
    310314                        } 
     315                        elseif ( $row['checkcomm_view_status'] == VIEW_STATUS_VIEWED && $row['checkcomm_notify_status'] == NOTIFY_STATUS_NOTIFIED ) { 
     316                                $sql = "UPDATE $sql_priority " . COMMENTS_NOTIFY_TABLE . " 
     317                                        SET checkcomm_notify_status = " . NOTIFY_STATUS_UN_NOTIFIED . " 
     318                                        WHERE checkcomm_for_id = $topic_id 
     319                                        AND checkcomm_type = " . TYPE_FORUM_POST . " 
     320                                        AND checkcomm_userid = " . $userdata['uid']; 
     321                        } 
     322 
     323                        $result = $db->sql_query($sql); 
    311324                } 
    312325        } 
     
    320333 
    321334                                $sql_priority = ($db_type == "mysql") ? "LOW_PRIORITY" : ''; 
    322                                 $sql = "INSERT $sql_priority INTO " . TOPICS_WATCH_TABLE . " (user_id, topic_id, notify_status) 
    323                                         VALUES (" . $userdata['uid'] . ", $topic_id, 0)"; 
     335                                $sql = "INSERT $sql_priority INTO " . COMMENTS_NOTIFY_TABLE . " (checkcomm_userid, checkcomm_for_id, checkcomm_type, checkcomm_view_status, checkcomm_notify_status) 
     336                                        VALUES (" . $userdata['uid'] . ", $topic_id, " . TYPE_FORUM_POST . ", " . VIEW_STATUS_VIEWED . ", " . NOTIFY_STATUS_NOTIFIED . ")"; 
    324337                                $result = $db->sql_query($sql); 
    325338                        } 
  • redir.php

    r184 r316  
    44$userdata = session_pagestart($user_ip); 
    55init_userprefs($userdata); 
     6 
    67$url = ''; 
    78 
    8 while (list($var,$val) = each($_GET)) { 
     9foreach( $_GET AS $var => $val ) { 
    910        $url .= "&$var=$val"; 
    1011} 
     12 
    1113$i = strpos($url, "&url="); 
    1214 
    13 if ($i !== false) { 
    14         $url = substr($url, $i + 5); 
     15if ( $i !== false ) { 
     16       $url = substr($url, $i + 5); 
    1517} 
     18 
    1619if (substr($url, 0, 4) == "www.") { 
    17         $url = "http://" . $url; 
     20       $url = "http://" . $url; 
    1821} 
     22 
     23if ( strpos($url, '?') !== false ) { 
     24        $args = explode('?', $url); 
     25        $_url = $args[0] . '?'; 
     26        unset($args[0]); 
     27 
     28        if ( strpos($url, '&') !== false ) { 
     29                $args = explode('&',$args[1]); 
     30        } 
     31 
     32        $new_args = ''; 
     33 
     34        foreach ( $args AS $_null => $arg ) { 
     35                list($key, $val) = explode('=',$arg); 
     36 
     37                $new_args .= ( $new_args ? '&' : '' ) . $key . '=' . urlencode($val); 
     38        } 
     39 
     40        $url = $_url . $new_args; 
     41} 
     42 
    1943if (strstr(urldecode($url), "\n") || strstr(urldecode($url), "\r")) { 
    2044        trigger_error('Tried to redirect to potentially insecure url.'); 
  • requests.php

    r311 r316  
    342342                } 
    343343 
    344                 $sql = 'SELECT checkcomm_notify_status FROM ' . COMMENTS_NOTIFY_TABLE . ' WHERE checkcomm_userid = ' . $userdata['uid'] . ' AND checkcomm_for_id = ' . $id . ' AND checkcomm_type = ' . TYPE_REQUEST; 
     344                $sql = 'SELECT checkcomm_view_status FROM ' . COMMENTS_NOTIFY_TABLE . ' WHERE checkcomm_userid = ' . $userdata['uid'] . ' AND checkcomm_for_id = ' . $id . ' AND checkcomm_type = ' . TYPE_REQUEST; 
    345345                $result = $db->sql_query($sql); 
    346346                $checkcomm = $db->sql_fetchrow($result); 
    347347                if ( $checkcomm ) { 
    348                         if ( !$checkcomm['checkcomm_notify_status'] ) { 
     348                        if ( !$checkcomm['checkcomm_view_status'] ) { 
    349349                                $sql_priority = ($db_type == 'mysql') ? ' LOW_PRIORITY' : ''; 
    350                                 $sql = 'UPDATE' . $sql_priority . ' ' . COMMENTS_NOTIFY_TABLE . ' SET checkcomm_notify_status = 1 WHERE checkcomm_userid = ' . $userdata['uid'] . ' AND checkcomm_for_id = ' . $id . ' AND checkcomm_type = ' . TYPE_REQUEST; 
     350                                $sql = 'UPDATE' . $sql_priority . ' ' . COMMENTS_NOTIFY_TABLE . ' SET checkcomm_view_status = ' . VIEW_STATUS_VIEWED . ', checkcomm_notify_status = ' . NOTIFY_STATUS_UN_NOTIFIED . ' WHERE checkcomm_userid = ' . $userdata['uid'] . ' AND checkcomm_for_id = ' . $id . ' AND checkcomm_type = ' . TYPE_REQUEST; 
    351351                                $db->sql_query($sql); 
    352352                        } 
  • rss.php

    r307 r316  
    108108else { 
    109109        $sql = "SELECT t.fid, t.name AS torrent_name, t.descr, t.filename, t.size, t.category, t.ctime, u.name, t.owner, u.privacy 
    110                 FROM " . TORRENTS_TABLE . " t, " . USERS_TABLE . " u 
     110                FROM " . TORRENTS_TABLE . " t, " . USERS_TABLE . " u, " . CATEGORIES_TABLE . " c 
    111111                WHERE $where t.visible = 1 
    112112                AND t.hidden = 0 
    113113                AND t.banned = 0 
    114114                AND t.moderated = 1 
     115                AND c.id = t.category 
    115116                AND t.owner = u.uid 
    116117                " . ( $s_modified ? ' AND t.ctime > ' . $s_modified : '' ) . ' ORDER BY t.ctime DESC'; 
  • sql.sql

    r313 r316  
    1 -- 
    2 -- ����� `banlist` 
    3 -- 
    4  
     1-- phpMyAdmin SQL Dump 
     2-- version 3.2.3 
     3-- http://www.phpmyadmin.net 
     4-- 
     5-- Хост: localhost 
     6-- Время создания: Июн 22 2010 г., 17:41 
     7-- Версия сервера: 5.1.40 
     8-- Версия PHP: 5.2.12 
     9 
     10SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; 
     11 
     12 
     13/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 
     14/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 
     15/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 
     16/*!40101 SET NAMES utf8 */; 
     17 
     18-- 
     19-- База данных: `svn` 
     20-- 
     21 
     22-- -------------------------------------------------------- 
     23 
     24-- 
     25-- Структура таблицы `banlist` 
     26-- 
     27 
     28DROP TABLE IF EXISTS `banlist`; 
    529CREATE TABLE IF NOT EXISTS `banlist` ( 
    630  `ban_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, 
     
    1741 
    1842-- 
    19 -- ���� �� `banlist` 
    20 -- 
    21  
    22  
    23 -- -------------------------------------------------------- 
    24  
    25 -- 
    26 -- ����� `bookmarks` 
    27 -- 
    28  
     43-- Дамп данных таблицы `banlist` 
     44-- 
     45 
     46 
     47-- -------------------------------------------------------- 
     48 
     49-- 
     50-- Структура таблицы `bookmarks` 
     51-- 
     52 
     53DROP TABLE IF EXISTS `bookmarks`; 
    2954CREATE TABLE IF NOT EXISTS `bookmarks` ( 
    3055  `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 
     
    3560 
    3661-- 
    37 -- ���� �� `bookmarks` 
    38 -- 
    39  
    40  
    41 -- -------------------------------------------------------- 
    42  
    43 -- 
    44 -- ����� `categories` 
    45 -- 
    46  
     62-- Дамп данных таблицы `bookmarks` 
     63-- 
     64 
     65 
     66-- -------------------------------------------------------- 
     67 
     68-- 
     69-- Структура таблицы `categories` 
     70-- 
     71 
     72DROP TABLE IF EXISTS `categories`; 
    4773CREATE TABLE IF NOT EXISTS `categories` ( 
    4874  `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 
     
    5783 
    5884-- 
    59 -- ���� �� `categories` 
    60 -- 
    61  
    62  
    63 -- -------------------------------------------------------- 
    64  
    65 -- 
    66 -- ����� `chat_messages` 
    67 -- 
    68  
     85-- Дамп данных таблицы `categories` 
     86-- 
     87 
     88 
     89-- -------------------------------------------------------- 
     90 
     91-- 
     92-- Структура таблицы `chat_messages` 
     93-- 
     94 
     95DROP TABLE IF EXISTS `chat_messages`; 
    6996CREATE TABLE IF NOT EXISTS `chat_messages` ( 
    7097  `chat_msg_id` int(10) NOT NULL AUTO_INCREMENT, 
     
    79106 
    80107-- 
    81 -- ���� �� `chat_messages` 
    82 -- 
    83  
    84  
    85 -- -------------------------------------------------------- 
    86  
    87 -- 
    88 -- ����� `cheaters` 
    89 -- 
    90  
     108-- Дамп данных таблицы `chat_messages` 
     109-- 
     110 
     111 
     112-- -------------------------------------------------------- 
     113 
     114-- 
     115-- Структура таблицы `cheaters` 
     116-- 
     117 
     118DROP TABLE IF EXISTS `cheaters`; 
    91119CREATE TABLE IF NOT EXISTS `cheaters` ( 
    92120  `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 
     
    107135 
    108136-- 
    109 -- ���� �� `cheaters` 
    110 -- 
    111  
    112  
    113 -- -------------------------------------------------------- 
    114  
    115 -- 
    116 -- ����� `checkcomm` 
    117 -- 
    118  
     137-- Дамп данных таблицы `cheaters` 
     138-- 
     139 
     140 
     141-- -------------------------------------------------------- 
     142 
     143-- 
     144-- Структура таблицы `checkcomm` 
     145-- 
     146 
     147DROP TABLE IF EXISTS `checkcomm`; 
    119148CREATE TABLE IF NOT EXISTS `checkcomm` ( 
    120149  `checkcomm_userid` int(10) DEFAULT '0', 
    121150  `checkcomm_notify_status` tinyint(1) DEFAULT '0', 
     151  `checkcomm_view_status` tinyint(1) NOT NULL DEFAULT '0', 
    122152  `checkcomm_for_id` int(10) DEFAULT '0', 
    123153  `checkcomm_type` tinyint(1) DEFAULT '0', 
     
    128158 
    129159-- 
    130 -- ���� �� `checkcomm` 
    131 -- 
    132  
    133  
    134 -- -------------------------------------------------------- 
    135  
    136 -- 
    137 -- ����� `comments` 
    138 -- 
    139  
     160-- Дамп данных таблицы `checkcomm` 
     161-- 
     162 
     163 
     164-- -------------------------------------------------------- 
     165 
     166-- 
     167-- Структура таблицы `comments` 
     168-- 
     169 
     170DROP TABLE IF EXISTS `comments`; 
    140171CREATE TABLE IF NOT EXISTS `comments` ( 
    141172  `comment_id` int(10) unsigned NOT NULL AUTO_INCREMENT, 
     
    154185 
    155186-- 
    156 -- ���� �� `comments` 
    157 -- 
    158  
    159  
    160 -- -------------------------------------------------------- 
    161  
    162 -- 
    163 -- ����� `config` 
    164 -- 
    165  
     187-- Дамп данных таблицы `comments` 
     188-- 
     189 
     190 
     191-- -------------------------------------------------------- 
     192 
     193-- 
     194-- Структура таблицы `config` 
     195-- 
     196 
     197DROP TABLE IF EXISTS `config`; 
    166198CREATE TABLE IF NOT EXISTS `config` ( 
    167199  `name` varchar(255) NOT NULL DEFAULT '', 
     
    173205 
    174206-- 
    175 -- ���� �� `config` 
     207-- Дамп данных таблицы `config` 
    176208-- 
    177209 
     
    180212('onlinesince', '1268666465', 0), 
    181213('sitename', '', 0), 
    182 ('autoclean_last_run_clean_peers', '1268666468', 1), 
     214('autoclean_last_run_clean_peers', '1277214019', 1), 
    183215('sitemail', '', 0), 
    184216('max_torrent_size', '1000000', 0), 
     
    243275('server_port', '', 0), 
    244276('script_path', '', 0), 
    245 ('version', '0.3.4svn307', 0), 
     277('version', '0.3.4svn316', 0), 
    246278('default_lang', 'english', 0), 
    247279('max_login_attempts', '5', 0), 
     
    251283('merge_flood_interval', '5', 0), 
    252284('search_flood_interval', '0', 0), 
    253 ('rand_seed', '2f31aa0b65e7e8d00bbaa17169bb74a9', 1), 
     285('rand_seed', '7454c7512ffc7cfd8eb3d5c2fd56efb2', 1), 
    254286('search_min_chars', '3', 0), 
    255287('inactive_users_del_days', '0', 0), 
     
    325357('autoclean_interval_parse_queue', '10', 0), 
    326358('autoclean_interval_tidy_cache', '10', 0), 
    327 ('autoclean_last_run_sync_torrents_info', '1268666468', 1), 
    328 ('autoclean_last_run_clean_pending_accounts', '1268666468', 1), 
    329 ('autoclean_last_run_clean_inactive_users', '1268666468', 1), 
    330 ('autoclean_last_run_clean_old_torrents', '1268666468', 1), 
    331 ('autoclean_last_run_autowarn_autodemote', '1268666468', 1), 
    332 ('autoclean_last_run_remove_expired_warnings', '1268666468', 1), 
    333 ('autoclean_last_run_demote_uploaders', '1268666468', 1), 
     359('autoclean_last_run_sync_torrents_info', '1277214019', 1), 
     360('autoclean_last_run_clean_pending_accounts', '1277214019', 1), 
     361('autoclean_last_run_clean_inactive_users', '1277214019', 1), 
     362('autoclean_last_run_clean_old_torrents', '1277214019', 1), 
     363('autoclean_last_run_autowarn_autodemote', '1277214019', 1), 
     364('autoclean_last_run_remove_expired_warnings', '1277214019', 1), 
     365('autoclean_last_run_demote_uploaders', '1277214019', 1), 
    334366('autoclean_last_run_receive_invites', '0', 1), 
    335 ('autoclean_last_run_parse_queue', '1268666468', 1), 
    336 ('autoclean_last_run_tidy_cache', '1268666468', 1), 
     367('autoclean_last_run_parse_queue', '1277214019', 1), 
     368('autoclean_last_run_tidy_cache', '1277214019', 1), 
    337369('autoclean_interval_promote_demote_users', '1440', 0), 
    338 ('autoclean_last_run_promote_demote_users', '1268666468', 1), 
     370('autoclean_last_run_promote_demote_users', '1277214019', 1), 
    339371('user_limit_ary_allow_download', 'a:10:{s:1:"W";i:1;s:1:"D";i:1;i:0;i:0;i:1;i:1;i:2;i:1;i:3;i:1;i:4;i:1;i:5;i:1;i:6;i:1;i:7;i:1;}', 0), 
    340372('min_seeders_for_sos_button', '3', 0), 
     
    343375('site_keywords', '', 0), 
    344376('autoclean_interval_delete_old_sessions', '10', 0), 
    345 ('autoclean_last_run_delete_old_sessions', '1268666468', 1), 
     377('autoclean_last_run_delete_old_sessions', '1277214019', 1), 
    346378('cleanup_lock', '0', 1), 
    347379('offline_text', '', 0), 
     
    361393 
    362394-- 
    363 -- ����� `confirm` 
    364 -- 
    365  
     395-- Структура таблицы `confirm` 
     396-- 
     397 
     398DROP TABLE IF EXISTS `confirm`; 
    366399CREATE TABLE IF NOT EXISTS `confirm` ( 
    367400  `confirm_id` char(32) NOT NULL DEFAULT '', 
     
    372405 
    373406-- 
    374 -- ���� �� `confirm` 
    375 -- 
    376  
    377  
    378 -- -------------------------------------------------------- 
    379  
    380 -- 
    381 -- ����� `countries` 
    382 -- 
    383  
     407-- Дамп данных таблицы `confirm` 
     408-- 
     409 
     410 
     411-- -------------------------------------------------------- 
     412 
     413-- 
     414-- Структура таблицы `countries` 
     415-- 
     416 
     417DROP TABLE IF EXISTS `countries`; 
    384418CREATE TABLE IF NOT EXISTS `countries` ( 
    385419  `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 
     
    390424 
    391425-- 
    392 -- ���� �� `countries` 
     426-- Дамп данных таблицы `countries` 
    393427-- 
    394428 
     
    501535 
    502536-- 
    503 -- ����� `disallow` 
    504 -- 
    505  
     537-- Структура таблицы `disallow` 
     538-- 
     539 
     540DROP TABLE IF EXISTS `disallow`; 
    506541CREATE TABLE IF NOT EXISTS `disallow` ( 
    507542  `disallow_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, 
     
    511546 
    512547-- 
    513 -- ���� �� `disallow` 
    514 -- 
    515  
    516  
    517 -- -------------------------------------------------------- 
    518  
    519 -- 
    520 -- ����� `files` 
    521 -- 
    522  
     548-- Дамп данных таблицы `disallow` 
     549-- 
     550 
     551 
     552-- -------------------------------------------------------- 
     553 
     554-- 
     555-- Структура таблицы `files` 
     556-- 
     557 
     558DROP TABLE IF EXISTS `files`; 
    523559CREATE TABLE IF NOT EXISTS `files` ( 
    524560  `torrent` int(10) unsigned DEFAULT '0', 
     
    529565 
    530566-- 
    531 -- ���� �� `files` 
    532 -- 
    533  
    534  
    535 -- -------------------------------------------------------- 
    536  
    537 -- 
    538 -- ����� `forum_auth_access` 
    539 -- 
    540  
     567-- Дамп данных таблицы `files` 
     568-- 
     569 
     570 
     571-- -------------------------------------------------------- 
     572 
     573-- 
     574-- Структура таблицы `forum_auth_access` 
     575-- 
     576 
     577DROP TABLE IF EXISTS `forum_auth_access`; 
    541578CREATE TABLE IF NOT EXISTS `forum_auth_access` ( 
    542579  `group_id` mediumint(8) DEFAULT '0', 
     
    559596 
    560597-- 
    561 -- ���� �� `forum_auth_access` 
    562 -- 
    563  
    564  
    565 -- -------------------------------------------------------- 
    566  
    567 -- 
    568 -- ����� `forum_categories` 
    569 -- 
    570  
     598-- Дамп данных таблицы `forum_auth_access` 
     599-- 
     600 
     601 
     602-- -------------------------------------------------------- 
     603 
     604-- 
     605-- Структура таблицы `forum_categories` 
     606-- 
     607 
     608DROP TABLE IF EXISTS `forum_categories`; 
    571609CREATE TABLE IF NOT EXISTS `forum_categories` ( 
    572610  `cat_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, 
     
    578616 
    579617-- 
    580 -- ���� �� `forum_categories` 
    581 -- 
    582  
    583  
    584 -- -------------------------------------------------------- 
    585  
    586 -- 
    587 -- ����� `forum_forums` 
    588 -- 
    589  
     618-- Дамп данных таблицы `forum_categories` 
     619-- 
     620 
     621 
     622-- -------------------------------------------------------- 
     623 
     624-- 
     625-- Структура таблицы `forum_forums` 
     626-- 
     627 
     628DROP TABLE IF EXISTS `forum_forums`; 
    590629CREATE TABLE IF NOT EXISTS `forum_forums` ( 
    591630  `forum_id` smallint(5) unsigned NOT NULL DEFAULT '0', 
     
    620659 
    621660-- 
    622 -- ���� �� `forum_forums` 
    623 -- 
    624  
    625  
    626 -- -------------------------------------------------------- 
    627  
    628 -- 
    629 -- ����� `forum_groups` 
    630 -- 
    631  
     661-- Дамп данных таблицы `forum_forums` 
     662-- 
     663 
     664 
     665-- -------------------------------------------------------- 
     666 
     667-- 
     668-- Структура таблицы `forum_groups` 
     669-- 
     670 
     671DROP TABLE IF EXISTS `forum_groups`; 
    632672CREATE TABLE IF NOT EXISTS `forum_groups` ( 
    633673  `group_id` mediumint(8) NOT NULL AUTO_INCREMENT, 
     
    642682 
    643683-- 
    644 -- ���� �� `forum_groups` 
     684-- Дамп данных таблицы `forum_groups` 
    645685-- 
    646686 
     
    660700 
    661701-- 
    662 -- ����� `forum_posts` 
    663 -- 
    664  
     702-- Структура таблицы `forum_posts` 
     703-- 
     704 
     705DROP TABLE IF EXISTS `forum_posts`; 
    665706CREATE TABLE IF NOT EXISTS `forum_posts` ( 
    666707  `post_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, 
     
    687728 
    688729-- 
    689 -- ���� �� `forum_posts` 
    690 -- 
    691  
    692  
    693 -- -------------------------------------------------------- 
    694  
    695 -- 
    696 -- ����� `forum_posts_text` 
    697 -- 
    698  
     730-- Дамп данных таблицы `forum_posts` 
     731-- 
     732 
     733 
     734-- -------------------------------------------------------- 
     735 
     736-- 
     737-- Структура таблицы `forum_posts_text` 
     738-- 
     739 
     740DROP TABLE IF EXISTS `forum_posts_text`; 
    699741CREATE TABLE IF NOT EXISTS `forum_posts_text` ( 
    700742  `post_id` mediumint(8) unsigned NOT NULL DEFAULT '0', 
     
    705747 
    706748-- 
    707 -- ���� �� `forum_posts_text` 
    708 -- 
    709  
    710  
    711 -- -------------------------------------------------------- 
    712  
    713 -- 
    714 -- ����� `forum_prune` 
    715 -- 
    716  
     749-- Дамп данных таблицы `forum_posts_text` 
     750-- 
     751 
     752 
     753-- -------------------------------------------------------- 
     754 
     755-- 
     756-- Структура таблицы `forum_prune` 
     757-- 
     758 
     759DROP TABLE IF EXISTS `forum_prune`; 
    717760CREATE TABLE IF NOT EXISTS `forum_prune` ( 
    718761  `prune_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, 
     
    725768 
    726769-- 
    727 -- ���� �� `forum_prune` 
    728 -- 
    729  
    730  
    731 -- -------------------------------------------------------- 
    732  
    733 -- 
    734 -- ����� `forum_search_results` 
    735 -- 
    736  
     770-- Дамп данных таблицы `forum_prune` 
     771-- 
     772 
     773 
     774-- -------------------------------------------------------- 
     775 
     776-- 
     777-- Структура таблицы `forum_search_results` 
     778-- 
     779 
     780DROP TABLE IF EXISTS `forum_search_results`; 
    737781CREATE TABLE IF NOT EXISTS `forum_search_results` ( 
    738782  `search_id` int(11) unsigned NOT NULL DEFAULT '0', 
    739783  `session_id` varchar(32) DEFAULT NULL, 
    740   `search_array` LONGTEXT
     784  `search_array` longtext
    741785  `search_time` int(11) DEFAULT '0', 
    742786  PRIMARY KEY (`search_id`), 
     
    745789 
    746790-- 
    747 -- ���� �� `forum_search_results` 
    748 -- 
    749  
    750  
    751 -- -------------------------------------------------------- 
    752  
    753 -- 
    754 -- ����� `forum_search_wordlist` 
    755 -- 
    756  
     791-- Дамп данных таблицы `forum_search_results` 
     792-- 
     793 
     794 
     795-- -------------------------------------------------------- 
     796 
     797-- 
     798-- Структура таблицы `forum_search_wordlist` 
     799-- 
     800 
     801DROP TABLE IF EXISTS `forum_search_wordlist`; 
    757802CREATE TABLE IF NOT EXISTS `forum_search_wordlist` ( 
    758803  `word_text` varchar(50) NOT NULL DEFAULT '', 
     
    764809 
    765810-- 
    766 -- ���� �� `forum_search_wordlist` 
    767 -- 
    768  
    769  
    770 -- -------------------------------------------------------- 
    771  
    772 -- 
    773 -- ����� `forum_search_wordmatch` 
    774 -- 
    775  
     811-- Дамп данных таблицы `forum_search_wordlist` 
     812-- 
     813 
     814 
     815-- -------------------------------------------------------- 
     816 
     817-- 
     818-- Структура таблицы `forum_search_wordmatch` 
     819-- 
     820 
     821DROP TABLE IF EXISTS `forum_search_wordmatch`; 
    776822CREATE TABLE IF NOT EXISTS `forum_search_wordmatch` ( 
    777823  `post_id` mediumint(8) unsigned DEFAULT '0', 
     
    783829 
    784830-- 
    785 -- ���� �� `forum_search_wordmatch` 
    786 -- 
    787  
    788  
    789 -- -------------------------------------------------------- 
    790  
    791 -- 
    792 -- ����� `forum_topics` 
    793 -- 
    794  
     831-- Дамп данных таблицы `forum_search_wordmatch` 
     832-- 
     833 
     834 
     835-- -------------------------------------------------------- 
     836 
     837-- 
     838-- Структура таблицы `forum_topics` 
     839-- 
     840 
     841DROP TABLE IF EXISTS `forum_topics`; 
    795842CREATE TABLE IF NOT EXISTS `forum_topics` ( 
    796843  `topic_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, 
     
    818865 
    819866-- 
    820 -- ���� �� `forum_topics` 
    821 -- 
    822  
    823  
    824 -- -------------------------------------------------------- 
    825  
    826 -- 
    827 -- ����� `forum_topics_watch` 
    828 -- 
    829  
    830 CREATE TABLE IF NOT EXISTS `forum_topics_watch` ( 
    831   `topic_id` mediumint(8) unsigned DEFAULT '0', 
    832   `user_id` mediumint(8) DEFAULT '0', 
    833   `notify_status` tinyint(1) DEFAULT '0', 
    834   KEY `topic_id` (`topic_id`), 
    835   KEY `user_id` (`user_id`), 
    836   KEY `notify_status` (`notify_status`) 
    837 ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
    838  
    839 -- 
    840 -- ���� �� `forum_topics_watch` 
    841 -- 
    842  
    843  
    844 -- -------------------------------------------------------- 
    845  
    846 -- 
    847 -- ����� `forum_user_group` 
    848 -- 
    849  
     867-- Дамп данных таблицы `forum_topics` 
     868-- 
     869 
     870 
     871-- -------------------------------------------------------- 
     872 
     873-- 
     874-- Структура таблицы `forum_user_group` 
     875-- 
     876 
     877DROP TABLE IF EXISTS `forum_user_group`; 
    850878CREATE TABLE IF NOT EXISTS `forum_user_group` ( 
    851879  `group_id` mediumint(8) DEFAULT '0', 
     
    857885 
    858886-- 
    859 -- ���� �� `forum_user_group` 
     887-- Дамп данных таблицы `forum_user_group` 
    860888-- 
    861889 
     
    874902 
    875903-- 
    876 -- ����� `friends` 
    877 -- 
    878  
     904-- Структура таблицы `friends` 
     905-- 
     906 
     907DROP TABLE IF EXISTS `friends`; 
    879908CREATE TABLE IF NOT EXISTS `friends` ( 
    880909  `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 
     
    887916 
    888917-- 
    889 -- ���� �� `friends` 
    890 -- 
    891  
    892  
    893 -- -------------------------------------------------------- 
    894  
    895 -- 
    896 -- ����� `helpdesk` 
    897 -- 
    898  
     918-- Дамп данных таблицы `friends` 
     919-- 
     920 
     921 
     922-- -------------------------------------------------------- 
     923 
     924-- 
     925-- Структура таблицы `helpdesk` 
     926-- 
     927 
     928DROP TABLE IF EXISTS `helpdesk`; 
    899929CREATE TABLE IF NOT EXISTS `helpdesk` ( 
    900930  `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 
     
    914944 
    915945-- 
    916 -- ���� �� `helpdesk` 
    917 -- 
    918  
    919  
    920 -- -------------------------------------------------------- 
    921  
    922 -- 
    923 -- ����� `indexreleases` 
    924 -- 
    925  
     946-- Дамп данных таблицы `helpdesk` 
     947-- 
     948 
     949 
     950-- -------------------------------------------------------- 
     951 
     952-- 
     953-- Структура таблицы `indexreleases` 
     954-- 
     955 
     956DROP TABLE IF EXISTS `indexreleases`; 
    926957CREATE TABLE IF NOT EXISTS `indexreleases` ( 
    927958  `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 
     
    937968 
    938969-- 
    939 -- ���� �� `indexreleases` 
    940 -- 
    941  
    942  
    943 -- -------------------------------------------------------- 
    944  
    945 -- 
    946 -- ����� `invites` 
    947 -- 
    948  
     970-- Дамп данных таблицы `indexreleases` 
     971-- 
     972 
     973 
     974-- -------------------------------------------------------- 
     975 
     976-- 
     977-- Структура таблицы `invites` 
     978-- 
     979 
     980DROP TABLE IF EXISTS `invites`; 
    949981CREATE TABLE IF NOT EXISTS `invites` ( 
    950982  `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 
     
    960992 
    961993-- 
    962 -- ���� �� `invites` 
    963 -- 
    964  
    965  
    966 -- -------------------------------------------------------- 
    967  
    968 -- 
    969 -- ����� `messages` 
    970 -- 
    971  
     994-- Дамп данных таблицы `invites` 
     995-- 
     996 
     997 
     998-- -------------------------------------------------------- 
     999 
     1000-- 
     1001-- Структура таблицы `messages` 
     1002-- 
     1003 
     1004DROP TABLE IF EXISTS `messages`; 
    9721005CREATE TABLE IF NOT EXISTS `messages` ( 
    9731006  `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 
     
    9891022 
    9901023-- 
    991 -- ���� �� `messages` 
    992 -- 
    993  
    994  
    995 -- -------------------------------------------------------- 
    996  
    997 -- 
    998 -- ����� `news` 
    999 -- 
    1000  
     1024-- Дамп данных таблицы `messages` 
     1025-- 
     1026 
     1027 
     1028-- -------------------------------------------------------- 
     1029 
     1030-- 
     1031-- Структура таблицы `news` 
     1032-- 
     1033 
     1034DROP TABLE IF EXISTS `news`; 
    10011035CREATE TABLE IF NOT EXISTS `news` ( 
    10021036  `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 
     
    10131047 
    10141048-- 
    1015 -- ���� �� `news` 
    1016 -- 
    1017  
    1018  
    1019 -- -------------------------------------------------------- 
    1020  
    1021 -- 
    1022 -- ����� `offers` 
    1023 -- 
    1024  
     1049-- Дамп данных таблицы `news` 
     1050-- 
     1051 
     1052 
     1053-- -------------------------------------------------------- 
     1054 
     1055-- 
     1056-- Структура таблицы `offers` 
     1057-- 
     1058 
     1059DROP TABLE IF EXISTS `offers`; 
    10251060CREATE TABLE IF NOT EXISTS `offers` ( 
    10261061  `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 
     
    10401075 
    10411076-- 
    1042 -- ���� �� `offers` 
    1043 -- 
    1044  
    1045  
    1046 -- -------------------------------------------------------- 
    1047  
    1048 -- 
    1049 -- ����� `offers_votes` 
    1050 -- 
    1051  
     1077-- Дамп данных таблицы `offers` 
     1078-- 
     1079 
     1080 
     1081-- -------------------------------------------------------- 
     1082 
     1083-- 
     1084-- Структура таблицы `offers_votes` 
     1085-- 
     1086 
     1087DROP TABLE IF EXISTS `offers_votes`; 
    10521088CREATE TABLE IF NOT EXISTS `offers_votes` ( 
    10531089  `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 
     
    10591095 
    10601096-- 
    1061 -- ���� �� `offers_votes` 
    1062 -- 
    1063  
    1064  
    1065 -- -------------------------------------------------------- 
    1066  
    1067 -- 
    1068 -- ����� `peers` 
    1069 -- 
    1070  
     1097-- Дамп данных таблицы `offers_votes` 
     1098-- 
     1099 
     1100 
     1101-- -------------------------------------------------------- 
     1102 
     1103-- 
     1104-- Структура таблицы `peers` 
     1105-- 
     1106 
     1107DROP TABLE IF EXISTS `peers`; 
    10711108CREATE TABLE IF NOT EXISTS `peers` ( 
    10721109  `fid` int(10) unsigned DEFAULT '0', 
     
    10911128 
    10921129-- 
    1093 -- ���� �� `peers` 
    1094 -- 
    1095  
    1096  
    1097 -- -------------------------------------------------------- 
    1098  
    1099 -- 
    1100 -- ����� `ranks` 
    1101 -- 
    1102  
     1130-- Дамп данных таблицы `peers` 
     1131-- 
     1132 
     1133 
     1134-- -------------------------------------------------------- 
     1135 
     1136-- 
     1137-- Структура таблицы `ranks` 
     1138-- 
     1139 
     1140DROP TABLE IF EXISTS `ranks`; 
    11031141CREATE TABLE IF NOT EXISTS `ranks` ( 
    11041142  `rank_id` int(10) NOT NULL AUTO_INCREMENT, 
     
    11121150 
    11131151-- 
    1114 -- ���� �� `ranks` 
     1152-- Дамп данных таблицы `ranks` 
    11151153-- 
    11161154 
     
    11211159 
    11221160-- 
    1123 -- ����� `ratings` 
    1124 -- 
    1125  
     1161-- Структура таблицы `ratings` 
     1162-- 
     1163 
     1164DROP TABLE IF EXISTS `ratings`; 
    11261165CREATE TABLE IF NOT EXISTS `ratings` ( 
    11271166  `torrent` int(10) unsigned NOT NULL DEFAULT '0', 
     
    11331172 
    11341173-- 
    1135 -- ���� �� `ratings` 
    1136 -- 
    1137  
    1138  
    1139 -- -------------------------------------------------------- 
    1140  
    1141 -- 
    1142 -- ����� `release_groups` 
    1143 -- 
    1144  
     1174-- Дамп данных таблицы `ratings` 
     1175-- 
     1176 
     1177 
     1178-- -------------------------------------------------------- 
     1179 
     1180-- 
     1181-- Структура таблицы `release_groups` 
     1182-- 
     1183 
     1184DROP TABLE IF EXISTS `release_groups`; 
    11451185CREATE TABLE IF NOT EXISTS `release_groups` ( 
    11461186  `group_id` smallint(5) NOT NULL AUTO_INCREMENT, 
     
    11511191 
    11521192-- 
    1153 -- ���� �� `release_groups` 
    1154 -- 
    1155  
    1156  
    1157 -- -------------------------------------------------------- 
    1158  
    1159 -- 
    1160 -- ����� `reports` 
    1161 -- 
    1162  
     1193-- Дамп данных таблицы `release_groups` 
     1194-- 
     1195 
     1196 
     1197-- -------------------------------------------------------- 
     1198 
     1199-- 
     1200-- Структура таблицы `reports` 
     1201-- 
     1202 
     1203DROP TABLE IF EXISTS `reports`; 
    11631204CREATE TABLE IF NOT EXISTS `reports` ( 
    11641205  `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 
     
    11741215 
    11751216-- 
    1176 -- ���� �� `reports` 
    1177 -- 
    1178  
    1179  
    1180 -- -------------------------------------------------------- 
    1181  
    1182 -- 
    1183 -- ����� `requests` 
    1184 -- 
    1185  
     1217-- Дамп данных таблицы `reports` 
     1218-- 
     1219 
     1220 
     1221-- -------------------------------------------------------- 
     1222 
     1223-- 
     1224-- Структура таблицы `requests` 
     1225-- 
     1226 
     1227DROP TABLE IF EXISTS `requests`; 
    11861228CREATE TABLE IF NOT EXISTS `requests` ( 
    11871229  `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 
     
    12001242 
    12011243-- 
    1202 -- ���� �� `requests` 
    1203 -- 
    1204  
    1205  
    1206 -- -------------------------------------------------------- 
    1207  
    1208 -- 
    1209 -- ����� `requests_votes` 
    1210 -- 
    1211  
     1244-- Дамп данных таблицы `requests` 
     1245-- 
     1246 
     1247 
     1248-- -------------------------------------------------------- 
     1249 
     1250-- 
     1251-- Структура таблицы `requests_votes` 
     1252-- 
     1253 
     1254DROP TABLE IF EXISTS `requests_votes`; 
    12121255CREATE TABLE IF NOT EXISTS `requests_votes` ( 
    12131256  `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 
     
    12191262 
    12201263-- 
    1221 -- ���� �� `requests_votes` 
    1222 -- 
    1223  
    1224  
    1225 -- -------------------------------------------------------- 
    1226  
    1227 -- 
    1228 -- ����� `sessions` 
    1229 -- 
    1230  
     1264-- Дамп данных таблицы `requests_votes` 
     1265-- 
     1266 
     1267 
     1268-- -------------------------------------------------------- 
     1269 
     1270-- 
     1271-- Структура таблицы `sessions` 
     1272-- 
     1273 
     1274DROP TABLE IF EXISTS `sessions`; 
    12311275CREATE TABLE IF NOT EXISTS `sessions` ( 
    12321276  `session_id` varchar(32) NOT NULL DEFAULT '', 
     
    12441288 
    12451289-- 
    1246 -- ���� �� `sessions` 
    1247 -- 
    1248  
    1249  
    1250 -- -------------------------------------------------------- 
    1251  
    1252 -- 
    1253 -- ����� `sessions_keys` 
    1254 -- 
    1255  
     1290-- Дамп данных таблицы `sessions` 
     1291-- 
     1292 
     1293 
     1294-- -------------------------------------------------------- 
     1295 
     1296-- 
     1297-- Структура таблицы `sessions_keys` 
     1298-- 
     1299 
     1300DROP TABLE IF EXISTS `sessions_keys`; 
    12561301CREATE TABLE IF NOT EXISTS `sessions_keys` ( 
    12571302  `key_id` varchar(32) NOT NULL DEFAULT '', 
     
    12631308 
    12641309-- 
    1265 -- ���� �� `sessions_keys` 
    1266 -- 
    1267  
    1268  
    1269 -- -------------------------------------------------------- 
    1270  
    1271 -- 
    1272 -- ����� `simpaty` 
    1273 -- 
    1274  
     1310-- Дамп данных таблицы `sessions_keys` 
     1311-- 
     1312 
     1313 
     1314-- -------------------------------------------------------- 
     1315 
     1316-- 
     1317-- Структура таблицы `simpaty` 
     1318-- 
     1319 
     1320DROP TABLE IF EXISTS `simpaty`; 
    12751321CREATE TABLE IF NOT EXISTS `simpaty` ( 
    12761322  `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 
     
    12891335 
    12901336-- 
    1291 -- ���� �� `simpaty` 
    1292 -- 
    1293  
    1294  
    1295 -- -------------------------------------------------------- 
    1296  
    1297 -- 
    1298 -- ����� `sitelog` 
    1299 -- 
    1300  
     1337-- Дамп данных таблицы `simpaty` 
     1338-- 
     1339 
     1340 
     1341-- -------------------------------------------------------- 
     1342 
     1343-- 
     1344-- Структура таблицы `sitelog` 
     1345-- 
     1346 
     1347DROP TABLE IF EXISTS `sitelog`; 
    13011348CREATE TABLE IF NOT EXISTS `sitelog` ( 
    13021349  `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 
     
    13091356 
    13101357-- 
    1311 -- ���� �� `sitelog` 
    1312 -- 
    1313  
    1314  
    1315 -- -------------------------------------------------------- 
    1316  
    1317 -- 
    1318 -- ����� `smilies` 
    1319 -- 
    1320  
     1358-- Дамп данных таблицы `sitelog` 
     1359-- 
     1360 
     1361 
     1362-- -------------------------------------------------------- 
     1363 
     1364-- 
     1365-- Структура таблицы `smilies` 
     1366-- 
     1367 
     1368DROP TABLE IF EXISTS `smilies`; 
    13211369CREATE TABLE IF NOT EXISTS `smilies` ( 
    13221370  `smilies_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, 
     
    13281376 
    13291377-- 
    1330 -- ���� �� `smilies` 
     1378-- Дамп данных таблицы `smilies` 
    13311379-- 
    13321380 
     
    15131561 
    15141562-- 
    1515 -- ����� `snatched` 
    1516 -- 
    1517  
     1563-- Структура таблицы `snatched` 
     1564-- 
     1565 
     1566DROP TABLE IF EXISTS `snatched`; 
    15181567CREATE TABLE IF NOT EXISTS `snatched` ( 
    15191568  `torrentid` int(10) DEFAULT '0', 
     
    15291578 
    15301579-- 
    1531 -- ���� �� `snatched` 
    1532 -- 
    1533  
    1534  
    1535 -- -------------------------------------------------------- 
    1536  
    1537 -- 
    1538 -- ����� `sos` 
    1539 -- 
    1540  
     1580-- Дамп данных таблицы `snatched` 
     1581-- 
     1582 
     1583 
     1584-- -------------------------------------------------------- 
     1585 
     1586-- 
     1587-- Структура таблицы `sos` 
     1588-- 
     1589 
     1590DROP TABLE IF EXISTS `sos`; 
    15411591CREATE TABLE IF NOT EXISTS `sos` ( 
    15421592  `torrentid` int(11) DEFAULT '0', 
     
    15471597 
    15481598-- 
    1549 -- ���� �� `sos` 
    1550 -- 
    1551  
    1552  
    1553 -- -------------------------------------------------------- 
    1554  
    1555 -- 
    1556 -- ����� `tags` 
    1557 -- 
    1558  
     1599-- Дамп данных таблицы `sos` 
     1600-- 
     1601 
     1602 
     1603-- -------------------------------------------------------- 
     1604 
     1605-- 
     1606-- Структура таблицы `tags` 
     1607-- 
     1608 
     1609DROP TABLE IF EXISTS `tags`; 
    15591610CREATE TABLE IF NOT EXISTS `tags` ( 
    15601611  `tag_name` varchar(255) NOT NULL, 
     
    15671618 
    15681619-- 
    1569 -- ���� �� `tags` 
    1570 -- 
    1571  
    1572  
    1573 -- -------------------------------------------------------- 
    1574  
    1575 -- 
    1576 -- ����� `tags_users` 
    1577 -- 
    1578  
     1620-- Дамп данных таблицы `tags` 
     1621-- 
     1622 
     1623 
     1624-- -------------------------------------------------------- 
     1625 
     1626-- 
     1627-- Структура таблицы `tags_users` 
     1628-- 
     1629 
     1630DROP TABLE IF EXISTS `tags_users`; 
    15791631CREATE TABLE IF NOT EXISTS `tags_users` ( 
    15801632  `tag_users_uid` int(10) NOT NULL, 
     
    15881640 
    15891641-- 
    1590 -- ���� �� `tags_users` 
    1591 -- 
    1592  
    1593  
    1594 -- -------------------------------------------------------- 
    1595  
    1596 -- 
    1597 -- ����� `thanks` 
    1598 -- 
    1599  
     1642-- Дамп данных таблицы `tags_users` 
     1643-- 
     1644 
     1645 
     1646-- -------------------------------------------------------- 
     1647 
     1648-- 
     1649-- Структура таблицы `thanks` 
     1650-- 
     1651 
     1652DROP TABLE IF EXISTS `thanks`; 
    16001653CREATE TABLE IF NOT EXISTS `thanks` ( 
    16011654  `torrentid` int(10) DEFAULT '0', 
     
    16061659 
    16071660-- 
    1608 -- ���� �� `thanks` 
    1609 -- 
    1610  
    1611  
    1612 -- -------------------------------------------------------- 
    1613  
    1614 -- 
    1615 -- ����� `themes` 
    1616 -- 
    1617  
     1661-- Дамп данных таблицы `thanks` 
     1662-- 
     1663 
     1664 
     1665-- -------------------------------------------------------- 
     1666 
     1667-- 
     1668-- Структура таблицы `themes` 
     1669-- 
     1670 
     1671DROP TABLE IF EXISTS `themes`; 
    16181672CREATE TABLE IF NOT EXISTS `themes` ( 
    16191673  `themes_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, 
     
    16701724 
    16711725-- 
    1672 -- ���� �� `themes` 
     1726-- Дамп данных таблицы `themes` 
    16731727-- 
    16741728 
     
    16811735 
    16821736-- 
    1683 -- ����� `torrents` 
    1684 -- 
    1685  
     1737-- Структура таблицы `torrents` 
     1738-- 
     1739 
     1740DROP TABLE IF EXISTS `torrents`; 
    16861741CREATE TABLE IF NOT EXISTS `torrents` ( 
    16871742  `fid` int(10) unsigned NOT NULL AUTO_INCREMENT, 
     
    17341789 
    17351790-- 
    1736 -- ���� �� `torrents` 
    1737 -- 
    1738  
    1739  
    1740 -- -------------------------------------------------------- 
    1741  
    1742 -- 
    1743 -- ����� `uploadapp` 
    1744 -- 
    1745  
     1791-- Дамп данных таблицы `torrents` 
     1792-- 
     1793 
     1794 
     1795-- -------------------------------------------------------- 
     1796 
     1797-- 
     1798-- Структура таблицы `uploadapp` 
     1799-- 
     1800 
     1801DROP TABLE IF EXISTS `uploadapp`; 
    17461802CREATE TABLE IF NOT EXISTS `uploadapp` ( 
    17471803  `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 
     
    17621818 
    17631819-- 
    1764 -- ���� �� `uploadapp` 
    1765 -- 
    1766  
    1767  
    1768 -- -------------------------------------------------------- 
    1769  
    1770 -- 
    1771 -- ����� `users` 
    1772 -- 
    1773  
     1820-- Дамп данных таблицы `uploadapp` 
     1821-- 
     1822 
     1823 
     1824-- -------------------------------------------------------- 
     1825 
     1826-- 
     1827-- Структура таблицы `users` 
     1828-- 
     1829 
     1830DROP TABLE IF EXISTS `users`; 
    17741831CREATE TABLE IF NOT EXISTS `users` ( 
    17751832  `uid` int(10) unsigned NOT NULL DEFAULT '0', 
     
    18501907 
    18511908-- 
    1852 -- ���� �� `users` 
    1853 -- 
    1854  
    1855 INSERT INTO `users` (`uid`, `name`, `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_style`, `can_leech`, `torrents_limit`, `user_unread_pms`, `user_rank_id`, `user_lastmark`) VALUES 
    1856 (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', 0, 0, 0, 1, '', 1, 0, 0, 0, 0, 0), 
    1857 (1, 'admin', 'd41d8cd98f00b204e9800998ecf8427e', '', 'EMAIL@ADDRESS.COM', 1, 1268666466, '', 3, 1, '127.0.0.1', 7, '', 0, 0, '', 3, '', '', 1, 1, 0, 0, 0, 60, 1, 1, '57154e78ba0de787487576ae87207371', 3.00, 1, 0, 0, 0, 0, 10485760, 10485760, '', '', '', '', '', 1, 0, '0000-00-00', 1, 'english', 0, 0, 0, 1268666598, 'chat.php?action=view', 1, 0, 1268666469, 1, '', 1, 0, 0, 0, 0, 0); 
    1858  
    1859 -- -------------------------------------------------------- 
    1860  
    1861 -- 
    1862 -- ����� `vote_desc` 
    1863 -- 
    1864  
     1909-- Дамп данных таблицы `users` 
     1910-- 
     1911 
     1912INSERT INTO `users` (`uid`, `name`, `name_append`, `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_style`, `can_leech`, `torrents_limit`, `user_unread_pms`, `user_rank_id`, `user_lastmark`) VALUES 
     1913(0, 'Anonymous', '', '', '', '', 1, 943909200, '', 1, 1, '0.0.0.0', 1, '', 0, 0, '', 0, '[forum]', '', 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', 0, 0, 0, 1, '', 1, 0, 0, 0, 0, 0), 
     1914(1, 'admin', '', 'd41d8cd98f00b204e9800998ecf8427e', '', 'EMAIL@ADDRESS.COM', 1, 1268666466, '', 3, 1, '127.0.0.1', 7, '', 0, 0, '', 3, '[forum]', '', 1, 1, 0, 0, 0, 60, 1, 1, '57154e78ba0de787487576ae87207371', 3.00, 1, 0, 0, 0, 0, 10485760, 10485760, '', '', '', '', '', 1, 0, '0000-00-00', 1, 'english', 0, 0, 0, 1277214025, 'login.php', 1, 0, 1268666598, 1, '', 1, 0, 0, 0, 0, 0); 
     1915 
     1916-- -------------------------------------------------------- 
     1917 
     1918-- 
     1919-- Структура таблицы `vote_desc` 
     1920-- 
     1921 
     1922DROP TABLE IF EXISTS `vote_desc`; 
    18651923CREATE TABLE IF NOT EXISTS `vote_desc` ( 
    18661924  `vote_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, 
     
    18741932 
    18751933-- 
    1876 -- ���� �� `vote_desc` 
    1877 -- 
    1878  
    1879  
    1880 -- -------------------------------------------------------- 
    1881  
    1882 -- 
    1883 -- ����� `vote_results` 
    1884 -- 
    1885  
     1934-- Дамп данных таблицы `vote_desc` 
     1935-- 
     1936 
     1937 
     1938-- -------------------------------------------------------- 
     1939 
     1940-- 
     1941-- Структура таблицы `vote_results` 
     1942-- 
     1943 
     1944DROP TABLE IF EXISTS `vote_results`; 
    18861945CREATE TABLE IF NOT EXISTS `vote_results` ( 
    18871946  `vote_id` mediumint(8) unsigned DEFAULT '0', 
     
    18941953 
    18951954-- 
    1896 -- ���� �� `vote_results` 
    1897 -- 
    1898  
    1899  
    1900 -- -------------------------------------------------------- 
    1901  
    1902 -- 
    1903 -- ����� `vote_voters` 
    1904 -- 
    1905  
     1955-- Дамп данных таблицы `vote_results` 
     1956-- 
     1957 
     1958 
     1959-- -------------------------------------------------------- 
     1960 
     1961-- 
     1962-- Структура таблицы `vote_voters` 
     1963-- 
     1964 
     1965DROP TABLE IF EXISTS `vote_voters`; 
    19061966CREATE TABLE IF NOT EXISTS `vote_voters` ( 
    19071967  `vote_id` mediumint(8) unsigned DEFAULT '0', 
     
    19151975 
    19161976-- 
    1917 -- ���� �� `vote_voters` 
    1918 -- 
    1919  
    1920  
    1921 -- -------------------------------------------------------- 
    1922  
    1923 -- 
    1924 -- ����� `words` 
    1925 -- 
    1926  
     1977-- Дамп данных таблицы `vote_voters` 
     1978-- 
     1979 
     1980 
     1981-- -------------------------------------------------------- 
     1982 
     1983-- 
     1984-- Структура таблицы `words` 
     1985-- 
     1986 
     1987DROP TABLE IF EXISTS `words`; 
    19271988CREATE TABLE IF NOT EXISTS `words` ( 
    19281989  `word_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, 
     
    19331994 
    19341995-- 
    1935 -- ���� �� `words` 
    1936 -- 
     1996-- Дамп данных таблицы `words` 
     1997-- 
     1998 
  • templates/admin/user_edit_body.tpl

    r223 r316  
    155155        <tr> 
    156156          <td class="row1"><span class="gen">{L_NOTIFY_ON_REPLY}</span></td> 
    157           <td class="row2"> 
    158                 <input type="radio" name="notifyreply" value="1" {NOTIFY_REPLY_YES} /> 
    159                 <span class="gen">{L_YES}</span>&nbsp;&nbsp; 
    160                 <input type="radio" name="notifyreply" value="0" {NOTIFY_REPLY_NO} /> 
    161                 <span class="gen">{L_NO}</span></td> 
     157          <td class="row2">{NOTIFY_OPTIONS}</td> 
    162158        </tr> 
    163159                <tr> 
    164           <td class="row1"><span class="gen">{L_NOTIFY_PM}</span></td> 
    165           <td class="row2"> 
    166                 <input type="radio" name="notifypm" value="1" {NOTIFY_PM_YES} /> 
    167                 <span class="gen">{L_YES}</span>&nbsp;&nbsp; 
    168                 <input type="radio" name="notifypm" value="0" {NOTIFY_PM_NO} /> 
    169                 <span class="gen">{L_NO}</span></td> 
    170         </tr> 
    171         <tr> 
    172           <td class="row1"><span class="gen">{L_COMMENTPM}</span></td> 
     160          <td class="row1"><span class="gen">{L_AUTO_NOTIFY}</span></td> 
    173161          <td class="row2"> 
    174162                <input type="radio" name="commentpm" value="1" {COMMENT_PM_YES} /> 
     
    177165                <span class="gen">{L_NO}</span></td> 
    178166        </tr> 
     167 
    179168                        <tr> 
    180169          <td class="row1"><span class="gen">{L_ACCEPT_PM_FROM}</span></td> 
     
    189178        <tr> 
    190179          <td class="row1"><span class="gen">{L_DELETE_PM}</span></td> 
    191           <td class="row2"><input type="checkbox" name="deletepms" {DELETE_PM}  /> 
     180          <td class="row2"><input type="checkbox" name="deletepms" value="1" {DELETE_PM}  /> 
    192181          <span class="gen">{L_DELETE_PM_DESCR}</span></td> 
    193182        </tr> 
    194183        <tr> 
    195184          <td class="row1"><span class="gen">{L_SAVE_PM}</span></td> 
    196           <td class="row2"><input type="checkbox" name="savepms" {SAVE_PM}  /> 
     185          <td class="row2"><input type="checkbox" name="savepms" value="1" {SAVE_PM}  /> 
    197186          <span class="gen">{L_SAVE_PM_DESCR}</span></td> 
    198187        </tr> 
  • templates/bithdtv/details.html

    r305 r316  
    1010        <tr> 
    1111                <td class="detail" valign="top" align="right" width="100">{L_DOWNLOAD}</td> 
    12             <td class="detail" valign="top" align="left"><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 -->><img src="{TEMPLATE_PATH}/images/arrowdown.gif" border="0" alt="{L_DOWNLOAD}" title="{L_DOWNLOAD}" /> {TORRENT_FILENAME}</a><!-- IF L_ADD_TO_BOOKMARKS --> [<a href="{U_ADD_TO_BOOKMARKS}"><img src="{TEMPLATE_PATH}/images/bookmarks.gif" border="0" alt="{L_ADD_TO_BOOKMARKS}" title="{L_ADD_TO_BOOKMARKS}" /></a>] 
     12            <td class="detail" valign="top" align="left"><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 -->><img src="{TEMPLATE_PATH}/images/arrowdown.gif" border="0" alt="{L_DOWNLOAD}" title="{L_DOWNLOAD}" /> {TORRENT_FILENAME}</a> 
     13         
     14                <!-- IF S_USER_LOGGED_IN --> 
     15 
     16            [<a href="{U_ADD_TO_BOOKMARKS}">{L_ADD_TO_BOOKMARKS}</a>] 
    1317        <!-- BEGIN switch_add_to_index --> 
    14             [<a href="{switch_add_to_index.U_ADD_TO_INDEX}">{L_ADD_TO_INDEX}</a>] 
    15         <!-- END switch_add_to_index --> 
    16                 <!-- ENDIF --> 
     18 
     19                [<a href="{switch_add_to_index.U_ADD_TO_INDEX}">{L_ADD_TO_INDEX}</a>] 
     20 
     21                <!-- END switch_add_to_index --> 
     22 
     23                <!-- ENDIF --> 
    1724        </td> 
    1825        </tr> 
  • templates/bithdtv/ucp_body.html

    r308 r316  
    2424        </tr> 
    2525        <tr> 
    26                 <td class="detail"><label for="commentpm">{L_COMMENTPM}</label><br /><span>{L_COMMENTPM_DESCR}</span></td> 
     26                <td class="detail"><label for="commentpm">{L_AUTO_NOTIFY}</label><br /><span>{L_AUTO_NOTIFY_EXPLAIN}</span></td> 
    2727                <td class="detail">{COMMENTPM_INPUT}</td> 
    2828        </tr> 
     
    6666        <tr> 
    6767                <td class="detail"><label for="upload">{L_INTERNET_SPEED}</label><br /><span>{L_INTERNET_SPEED_EXPLAIN}</span></td> 
    68                 <td class="detail"><img src="{ROOT_PATH}pic/speed_up.png" alt="" /> {UPLOAD_SPEED_OPTIONS} <img src="{ROOT_PATH}pic/speed_down.png" alt="" /> {DOWNLOAD_SPEED_OPTIONS}</td> 
     68                <td class="detail"><img src="pic/speed_up.png" alt="" /> {UPLOAD_SPEED_OPTIONS} <img src="pic/speed_down.png" alt="" /> {DOWNLOAD_SPEED_OPTIONS}</td> 
    6969        </tr> 
    7070        <tr> 
    7171                <td class="detail"><label for="icq">{L_MESSAGING_SYSTEM}</label></td> 
    72                 <td class="detail"><img src="{ROOT_PATH}pic/contact/icq.gif" width="17" height="17" alt="{L_ICQ}" /><input maxlength="10" size="25" name="icq" id="icq" value="{USER_ICQ}" />{L_ICQ}<br /> 
    73                 <img src="{ROOT_PATH}pic/contact/aim.gif" width="17" height="17" alt="{L_AIM}" /><input maxlength="30" size="25" name="aim" id="aim" value="{USER_AIM}" />{L_AIM}<br /> 
    74                 <img src="{ROOT_PATH}pic/contact/msn.gif" width="17" height="17" alt="{L_MSN}" /><input maxlength="30" size="25" name="msn" id="msn" value="{USER_MSN}" />{L_MSN}<br /> 
    75                 <img src="{ROOT_PATH}pic/contact/yahoo.gif" width="17" height="17" alt="{L_YAHOO}" /><input maxlength="30" size="25" name="yahoo" id="yahoo" value="{USER_YAHOO}" />{L_YAHOO}<br /> 
    76                 <img src="{ROOT_PATH}pic/contact/skype.gif" width="17" height="17" alt="{L_SKYPE}" /><input maxlength="20" size="25" name="skype" id="skype" value="{USER_SKYPE}" />{L_SKYPE}</td> 
     72                <td class="detail"><img src="pic/contact/icq.gif" width="17" height="17" alt="{L_ICQ}" /><input maxlength="10" size="25" name="icq" id="icq" value="{USER_ICQ}" />{L_ICQ}<br /> 
     73                <img src="pic/contact/aim.gif" width="17" height="17" alt="{L_AIM}" /><input maxlength="30" size="25" name="aim" id="aim" value="{USER_AIM}" />{L_AIM}<br /> 
     74                <img src="pic/contact/msn.gif" width="17" height="17" alt="{L_MSN}" /><input maxlength="30" size="25" name="msn" id="msn" value="{USER_MSN}" />{L_MSN}<br /> 
     75                <img src="pic/contact/yahoo.gif" width="17" height="17" alt="{L_YAHOO}" /><input maxlength="30" size="25" name="yahoo" id="yahoo" value="{USER_YAHOO}" />{L_YAHOO}<br /> 
     76                <img src="pic/contact/skype.gif" width="17" height="17" alt="{L_SKYPE}" /><input maxlength="20" size="25" name="skype" id="skype" value="{USER_SKYPE}" />{L_SKYPE}</td> 
    7777        </tr> 
    7878        <tr> 
  • templates/bithdtv/ucp_checkcomm_body.html

    r148 r316  
    11<!-- INCLUDE ucp_header.html --> 
    22 
    3 <!-- IF NO_FOUND --> 
     3<!-- IF not COUNT --> 
    44 
    55{L_NO_CHECKCOMM} 
     
    1313                <td class="colhead" width=25% align="left" style="font-size:10px;">{L_LAST_POST}</td> 
    1414        </tr> 
    15         <!-- BEGIN checkcomm_row --> 
     15 
     16<!-- BEGIN checkcomm_row --> 
     17 
    1618        <tr> 
    17                 <td class="{checkcomm_row.ROW_CLASS}"><img src="{IMAGE_INBOXNEW}" title="{L_NEW_POSTS}" alt="{L_NEW_POSTS}" /></td> 
    18                 <td align="left" class="{checkcomm_row.ROW_CLASS}"><b><a href="{checkcomm_row.U_FILE}">{checkcomm_row.TORRENT_NAME}</a></b><br /> 
     19                <td class="{checkcomm_row.ROW_CLASS}"><img src="{TEMPLATE_IMAGE_INBOXNEW}" title="{L_NEW_POSTS}" alt="{L_NEW_POSTS}" /></td> 
     20                <td align="left" class="{checkcomm_row.ROW_CLASS}"><b><a href="{checkcomm_row.U_FILE}">{checkcomm_row.NAME}</a></b><br /> 
    1921                        <i>{checkcomm_row.NAME}</i>&nbsp;|&nbsp;<i><a href="{checkcomm_row.U_CHECKOFF}">{L_CHECKOFF}</a></i> 
    2022                </td> 
    2123                <td align="left" class="{checkcomm_row.ROW_CLASS}">{L_FROM} <!-- IF checkcomm_row.U_LAST_POSTER --><a href="{checkcomm_row.U_LAST_POSTER}">{checkcomm_row.LAST_POSTER_NAME}</a><!-- ELSE -->{checkcomm_row.LAST_POSTER_NAME}<!-- ENDIF --> 
    22                         <a href="{checkcomm_row.U_COMMENTS}"><img src="{IMAGE_ARROW_RIGHT}" alt="{L_GO_TO_THE_LAST_POST}" title="{L_GO_TO_THE_LAST_POST}" /></a><br /> 
     24                        <a href="{checkcomm_row.U_COMMENTS}"><img src="{TEMPLATE_IMAGE_ARROW_RIGHT}" alt="{L_GO_TO_THE_LAST_POST}" title="{L_GO_TO_THE_LAST_POST}" /></a><br /> 
    2325                        <i>{checkcomm_row.ADDED}</i> 
    2426                </td> 
    2527        </tr> 
    26         <!-- END checkcomm_row --> 
     28 
     29 
     30<!-- END checkcomm_row --> 
     31 
    2732</table> 
     33 
    2834{PAGERBOTTOM} 
    2935 
  • templates/main/ucp_body.html

    r308 r316  
    2424        </dl> 
    2525        <dl> 
    26                 <dt><label for="commentpm">{L_COMMENTPM}</label><br /><span>{L_COMMENTPM_DESCR}</span></dt> 
     26                <dt><label for="commentpm">{L_AUTO_NOTIFY}</label><br /><span>{L_AUTO_NOTIFY_EXPLAIN}</span></dt> 
    2727                <dd>{COMMENTPM_INPUT}</dd> 
    2828        </dl> 
  • templates/main/ucp_checkcomm_body.html

    r189 r316  
    11<!-- INCLUDE ucp_header.html --> 
    22 
    3 <!-- IF NO_FOUND --> 
     3<!-- IF not COUNT --> 
    44 
    55{L_NO_CHECKCOMM} 
     
    1919        <!-- BEGIN checkcomm_row --> 
    2020        <tr> 
    21                 <td class="{checkcomm_row.ROW_CLASS}"><img src="{IMAGE_INBOXNEW}" title="{L_NEW_POSTS}" alt="{L_NEW_POSTS}" /></td> 
    22                 <td align="left" class="{checkcomm_row.ROW_CLASS}"><b><a href="{checkcomm_row.U_FILE}">{checkcomm_row.TORRENT_NAME}</a></b><br /> 
    23                 <i>{checkcomm_row.NAME}</i>&nbsp;|&nbsp;<i><a href="{checkcomm_row.U_CHECKOFF}">{L_CHECKOFF}</a></i> 
     21                <td class="{checkcomm_row.ROW_CLASS}"><img src="{TEMPLATE_IMAGE_INBOXNEW}" title="{L_NEW_POSTS}" alt="{L_NEW_POSTS}" /></td> 
     22                <td align="left" class="{checkcomm_row.ROW_CLASS}"><b><a href="{checkcomm_row.U_FILE}">{checkcomm_row.NAME}</a></b><br /> 
     23                <i>{checkcomm_row.TYPE_NAME}</i>&nbsp;|&nbsp;<i><a href="{checkcomm_row.U_CHECKOFF}" target="_blank">{L_CHECKOFF}</a></i> 
    2424                </td> 
    2525                <td align="left" class="{checkcomm_row.ROW_CLASS}">{L_FROM} <!-- IF checkcomm_row.U_LAST_POSTER --><a href="{checkcomm_row.U_LAST_POSTER}">{checkcomm_row.LAST_POSTER_NAME}</a><!-- ELSE -->{checkcomm_row.LAST_POSTER_NAME}<!-- ENDIF --> 
    26                 <a href="{checkcomm_row.U_COMMENTS}"><img src="{IMAGE_ARROW_RIGHT}" alt="{L_GO_TO_THE_LAST_POST}" title="{L_GO_TO_THE_LAST_POST}" /></a><br /> 
     26                <a href="{checkcomm_row.U_COMMENTS}"><img src="{TEMPLATE_IMAGE_ARROW_RIGHT}" alt="{L_GO_TO_THE_LAST_POST}" title="{L_GO_TO_THE_LAST_POST}" /></a><br /> 
    2727                <i>{checkcomm_row.ADDED}</i> 
    2828                </td> 
  • templates/reflection/details.html

    r305 r316  
    1212<div class="torrentViewLeft">{L_DOWNLOAD}</div> 
    1313<div class="torrentViewRight"> 
    14     <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>] 
     14    <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> 
     15 
     16        <!-- IF S_USER_LOGGED_IN --> 
     17 
     18    [<a href="{U_ADD_TO_BOOKMARKS}">{L_ADD_TO_BOOKMARKS}</a>] 
    1519    <!-- BEGIN switch_add_to_index --> 
    16     [<a href="{switch_add_to_index.U_ADD_TO_INDEX}">{L_ADD_TO_INDEX}</a>] 
    17     <!-- END switch_add_to_index --> 
    18         <!-- ENDIF --> 
     20 
     21        [<a href="{switch_add_to_index.U_ADD_TO_INDEX}">{L_ADD_TO_INDEX}</a>] 
     22 
     23        <!-- END switch_add_to_index --> 
     24 
     25        <!-- ENDIF --> 
    1926</div> 
    2027 
  • templates/reflection/ucp_body.html

    r308 r316  
    2828        </div> 
    2929        <div class="tableRow"> 
    30                 <div class="leftCell" style="width:38%"><label for="commentpm">{L_COMMENTPM}</label><br /><span>{L_COMMENTPM_DESCR}</span></div> 
     30                <div class="leftCell" style="width:38%"><label for="commentpm">{L_AUTO_NOTIFY}</label><br /><span>{L_AUTO_NOTIFY_EXPLAIN}</span></div> 
    3131                <div class="rightCell" style="width:60%">{COMMENTPM_INPUT}</div> 
    3232                <div class="clear">&nbsp;</div> 
  • templates/reflection/ucp_checkcomm_body.html

    r148 r316  
    11<!-- INCLUDE ucp_header.html --> 
    22 
    3 <!-- IF NO_FOUND --> 
     3<!-- IF not COUNT --> 
    44 
    55{L_NO_CHECKCOMM} 
     
    1616<!-- BEGIN checkcomm_row --> 
    1717        <div class="tableRow"> 
    18                 <div class="leftCell" style="width:2%;"><img src="{IMAGE_INBOXNEW}" title="{L_NEW_POSTS}" alt="{L_NEW_POSTS}" /></div> 
    19                 <div class="middleCell" style="width:73%;"><b><a href="{checkcomm_row.U_FILE}">{checkcomm_row.TORRENT_NAME}</a></b><br /> 
    20                 <i>{checkcomm_row.NAME}</i>&nbsp;|&nbsp;<i><a href="{checkcomm_row.U_CHECKOFF}">{L_CHECKOFF}</a></i> 
     18                <div class="leftCell" style="width:2%;"><img src="{TEMPLATE_IMAGE_INBOXNEW}" title="{L_NEW_POSTS}" alt="{L_NEW_POSTS}" /></div> 
     19                <div class="middleCell" style="width:73%;"><b><a href="{checkcomm_row.U_FILE}">{checkcomm_row.NAME}</a></b><br /> 
     20                <i>{checkcomm_row.TYPE_NAME}</i>&nbsp;|&nbsp;<i><a href="{checkcomm_row.U_CHECKOFF}" target="_blank">{L_CHECKOFF}</a></i> 
    2121                </div> 
    2222                <div class="rightCell" style="width:25%;">{L_FROM} <!-- IF checkcomm_row.U_LAST_POSTER --><a href="{checkcomm_row.U_LAST_POSTER}">{checkcomm_row.LAST_POSTER_NAME}</a><!-- ELSE -->{checkcomm_row.LAST_POSTER_NAME}<!-- ENDIF --> 
    23                         <a href="{checkcomm_row.U_COMMENTS}"><img src="{IMAGE_ARROW_RIGHT}" alt="{L_GO_TO_THE_LAST_POST}" title="{L_GO_TO_THE_LAST_POST}" /></a><br /> 
     23                        <a href="{checkcomm_row.U_COMMENTS}"><img src="{TEMPLATE_IMAGE_ARROW_RIGHT}" alt="{L_GO_TO_THE_LAST_POST}" title="{L_GO_TO_THE_LAST_POST}" /></a><br /> 
    2424                        <i>{checkcomm_row.ADDED}</i> 
    2525                </div> 
  • upload.php

    r308 r316  
    8686                $id = $db->sql_nextid(); 
    8787                if ( $userdata['commentpm'] ) { 
    88                         $sql = 'INSERT INTO ' . COMMENTS_NOTIFY_TABLE . ' (checkcomm_userid, checkcomm_for_id, checkcomm_type) VALUES (' . $userdata['uid'] . ', ' . $id . ', ' . TYPE_REQUEST . ')'; 
     88                        $sql = 'INSERT INTO ' . COMMENTS_NOTIFY_TABLE . ' (checkcomm_userid, checkcomm_for_id, checkcomm_type, checkcomm_view_status) VALUES (' . $userdata['uid'] . ', ' . $id . ', ' . TYPE_REQUEST . ', ' . VIEW_STATUS_VIEWED . ')'; 
    8989                        $db->sql_query($sql); 
    9090                } 
     
    110110 
    111111                if ( $userdata['commentpm'] ) { 
    112                         $sql = 'INSERT INTO ' . COMMENTS_NOTIFY_TABLE . ' (checkcomm_userid, checkcomm_for_id, checkcomm_type) VALUES (' . $userdata['uid'] . ', ' . $id . ', ' . TYPE_OFFER . ')'; 
     112                        $sql = 'INSERT INTO ' . COMMENTS_NOTIFY_TABLE . ' (checkcomm_userid, checkcomm_for_id, checkcomm_type, checkcomm_view_status) VALUES (' . $userdata['uid'] . ', ' . $id . ', ' . TYPE_OFFER . ', ' . VIEW_STATUS_VIEWED . ')'; 
    113113                        $db->sql_query($sql); 
    114114          } 
     
    205205                @rename($torrent_dir . DIRECTORY_SEPARATOR . $filename . '.torrent', $torrent_dir . DIRECTORY_SEPARATOR . $id . '.torrent'); 
    206206 
    207                 $sql = 'INSERT INTO ' . COMMENTS_NOTIFY_TABLE . ' (checkcomm_userid, checkcomm_for_id, checkcomm_type) VALUES (' . $userdata['uid'] . ', ' . $id . ', ' . TYPE_TORRENT . ')'; 
     207                $sql = 'INSERT INTO ' . COMMENTS_NOTIFY_TABLE . ' (checkcomm_userid, checkcomm_for_id, checkcomm_type, checkcomm_view_status) VALUES (' . $userdata['uid'] . ', ' . $id . ', ' . TYPE_TORRENT . ', ' . VIEW_STATUS_VIEWED . ')'; 
    208208                $db->sql_query($sql); 
    209209