Changeset 159

Show
Ignore:
Timestamp:
11/25/08 11:12:37 (3 years ago)
Author:
Nafania
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/functions_delete.php

    r142 r159  
    1818          $sql = 'DELETE FROM ' . BOOKMARKS_TABLE . ' WHERE torrentid IN (' . implode(',', $arr_ids) . ')'; 
    1919          $db->sql_query($sql); 
    20           $sql = 'DELETE FROM ' . COMMENTS_NOTIFY_TABLE . ' WHERE torrent IN (' . implode(',', $arr_ids) . ')'
     20          $sql = 'DELETE FROM ' . COMMENTS_NOTIFY_TABLE . ' WHERE checkcomm_for_id IN (' . implode(',', $arr_ids) . ') AND checkcomm_type = ' . COMMENT_TYPE_TORRENT
    2121          $db->sql_query($sql); 
    2222          $sql = 'DELETE FROM ' . REPORTS_TABLE . ' WHERE type = 2 AND votedfor IN (' . implode(',', $arr_ids) . ')'; 
     
    7979                $sql = 'DELETE FROM ' . BOOKMARKS_TABLE . ' WHERE userid IN (' . implode(',', $arr_ids) . ')'; 
    8080                $db->sql_query($sql); 
    81                 $sql = 'DELETE FROM ' . COMMENTS_NOTIFY_TABLE . ' WHERE userid IN (' . implode(',', $arr_ids) . ')'; 
     81                $sql = 'DELETE FROM ' . COMMENTS_NOTIFY_TABLE . ' WHERE checkcomm_userid IN (' . implode(',', $arr_ids) . ')'; 
    8282                $db->sql_query($sql); 
    8383                $sql = 'DELETE FROM ' . OFFERS_VOTES_TABLE . ' WHERE userid IN (' . implode(',', $arr_ids) . ')'; 
     
    192192                $sql = 'DELETE FROM ' . COMMENTS_TABLE . ' WHERE comment_for_id IN (' . implode(', ', $ids) . ') AND comment_type = ' . COMMENT_TYPE_REQUEST; 
    193193                $db->sql_query($sql); 
    194                 $sql = 'DELETE FROM ' . COMMENTS_NOTIFY_TABLE . ' WHERE request IN (' . implode(', ', $ids) . ')'
     194                $sql = 'DELETE FROM ' . COMMENTS_NOTIFY_TABLE . ' WHERE checkcomm_for_id IN (' . implode(', ', $ids) . ') AND checkcomm_type = ' . COMMENT_TYPE_REQUEST
    195195                $db->sql_query($sql); 
    196196                $sql = 'DELETE FROM ' . SIMPATY_TABLE . ' WHERE simpid IN (' . implode(', ', $ids) . ') AND type = 3'; 
     
    210210                $sql = 'DELETE FROM ' . COMMENTS_TABLE . ' WHERE comment_for_id IN (' . implode(', ', $ids) . ') AND comment_type = ' . COMMENT_TYPE_OFFER; 
    211211                $db->sql_query($sql); 
    212                 $sql = 'DELETE FROM ' . COMMENTS_NOTIFY_TABLE . ' WHERE offer IN (' . implode(', ', $ids) . ')'
     212                $sql = 'DELETE FROM ' . COMMENTS_NOTIFY_TABLE . ' WHERE checkcomm_for_id IN (' . implode(', ', $ids) . ') AND checkcomm_type = ' . COMMENT_TYPE_OFFER
    213213                $db->sql_query($sql); 
    214214                $sql = 'DELETE FROM ' . SIMPATY_TABLE . ' WHERE simpid IN (' . implode(', ', $ids) . ') AND type = 4'; 
  • log.php

    r148 r159  
    11<?php 
    22$tracker_root_path = './'; 
    3 require($tracker_root_path . 'include/config.php'); 
    4 @include ($tracker_root_path . 'include/overall_header.php'); 
    5 @include ($tracker_root_path . 'include/overall_footer.php'); 
    6 @include ($tracker_root_path . 'languages/lang_' . $config['default_lang'] . '/lang_modcomment_log.php'); 
     3require_once ($tracker_root_path . 'include/config.php'); 
     4require_once ($tracker_root_path . 'include/overall_header.php'); 
     5require_once ($tracker_root_path . 'include/overall_footer.php'); 
     6require_once ($tracker_root_path . 'include/functions_search.php'); 
     7require_once ($tracker_root_path . 'languages/lang_' . $config['default_lang'] . '/lang_modcomment_log.php'); 
    78$userdata = session_pagestart($user_ip); 
    89init_userprefs($userdata); 
  • upload.php

    r154 r159  
    7979                $id = $db->sql_nextid(); 
    8080                if ( $userdata['commentpm'] ) { 
    81                         $sql = 'INSERT INTO ' . COMMENTS_NOTIFY_TABLE . ' (userid, request) VALUES (' . $userdata['uid'] . ', ' . $id . ')'; 
     81                        $sql = 'INSERT INTO ' . COMMENTS_NOTIFY_TABLE . ' (checkcomm_userid, checkcomm_for_id, checkcomm_type) VALUES (' . $userdata['uid'] . ', ' . $id . ', ' . COMMENT_TYPE_REQUEST . ')'; 
    8282                        $db->sql_query($sql); 
    8383                } 
     
    9292                         'descr'    => $descr, 
    9393                         'added'    => time() 
    94                 ); 
    95                 $sql = 'INSERT INTO ' . OFFERS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); 
    96                 $db->sql_query($sql); 
    97                 $id = $db->sql_nextid(); 
    98                 if ( $userdata['commentpm'] ) { 
    99                         $sql = 'INSERT INTO ' . COMMENTS_NOTIFY_TABLE . ' (userid, offer) VALUES (' . $userdata['uid'] . ', ' . $id . ')'; 
    100                         $db->sql_query($sql); 
    101                 } 
    102                 redirect( append_sid('offers.php?id=' . $id)); 
     94                ); 
     95 
     96                $sql = 'INSERT INTO ' . OFFERS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); 
     97          $db->sql_query($sql); 
     98 
     99                $id = $db->sql_nextid(); 
     100 
     101                if ( $userdata['commentpm'] ) { 
     102                        $sql = 'INSERT INTO ' . COMMENTS_NOTIFY_TABLE . ' (checkcomm_userid, checkcomm_for_id, checkcomm_type) VALUES (' . $userdata['uid'] . ', ' . $id . ', ' . COMMENT_TYPE_OFFER . ')'; 
     103                        $db->sql_query($sql); 
     104          } 
     105          redirect( append_sid('offers.php?id=' . $id)); 
    103106        } 
    104107        else { 
     
    171174                $id = $db->sql_nextid(); 
    172175                $config['torrent_dir'] = ( !empty($config['torrent_dir']) ? $config['torrent_dir'] : $tracker_root_path . 'torrents'); 
    173                 if ( @move_uploaded_file($tmpname, $config['torrent_dir'] . DIRECTORY_SEPARATOR . $id . '.torrent') !== FALSE ) { 
    174                         $sql = 'INSERT INTO ' . COMMENTS_NOTIFY_TABLE . ' (userid, torrent) VALUES (' . $userdata['uid'] . ', ' . $id . ')'; 
     176                if ( @move_uploaded_file($tmpname, $config['torrent_dir'] . DIRECTORY_SEPARATOR . $id . '.torrent') !== false ) { 
     177 
     178                        $sql = 'INSERT INTO ' . COMMENTS_NOTIFY_TABLE . ' (checkcomm_userid, checkcomm_for_id, checkcomm_type) VALUES (' . $userdata['uid'] . ', ' . $id . ', ' . COMMENT_TYPE_TORRENT . ')'; 
    175179                        $db->sql_query($sql); 
     180 
    176181                        $sql = 'DELETE FROM ' . FILES_TABLE . ' WHERE torrent = ' . $id; 
    177182                        $db->sql_query($sql);