Changeset 319

Show
Ignore:
Timestamp:
09/28/10 20:15:54 (2 years ago)
Author:
Nafania
Message:

Исправлена ошибка с аннонс урлами в download.php

Files:

Legend:

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

    r317 r319  
    105105                                'autodemote' => 0, 
    106106                                'title' => '', 
     107                                'autodemote' => 0, 
    107108                                'account_status' => 0, 
    108109                                'user_status' => 0, 
  • details.php

    r318 r319  
    351351        } 
    352352} 
     353//here we get all announce urls 
     354$base_url = generate_base_url(); 
     355 
     356$announce_urls = array(); 
     357if ( defined('USE_XBTT') ) { 
     358        $announce = $config['xbt_listen_url'] . ':' . $config['listen_port'] . '/' . ( $userdata['session_logged_in'] ? $userdata['torrent_pass'] . '/' : '' ) . 'announce/'; 
     359} 
     360else { 
     361        $announce = $base_url . '/announce.php' . ( $userdata['session_logged_in'] ? '?passkey=' . $userdata['torrent_pass'] : '' ); 
     362} 
     363 
     364$announce_urls[] = $announce; 
     365$announce_urls[] = 'http://retracker.local/announce'; 
     366//here we get all announce urls 
    353367 
    354368if ( $action ) { 
     
    518532                        } 
    519533                        //end tags allow 
    520  
    521                         $base_url = generate_base_url(); 
    522  
    523                         $announce_urls = array(); 
    524                         if ( defined('USE_XBTT') ) { 
    525                                 $announce = $config['xbt_listen_url'] . ':' . $config['listen_port'] . '/' . ( $userdata['session_logged_in'] ? $userdata['torrent_pass'] . '/' : '' ) . 'announce/'; 
    526                         } 
    527                         else { 
    528                                 $announce = $base_url . '/announce.php' . ( $userdata['session_logged_in'] ? '?passkey=' . $userdata['torrent_pass'] : '' ); 
    529                         } 
    530  
    531                         $announce_urls[] = $announce; 
    532                         $announce_urls[] = 'http://retracker.local/announce'; 
    533534 
    534535                        $info_hash = preg_replace_callback('/./s', create_function('$matches','return sprintf(\'%02x\', ord($matches[0]));'), str_pad($row['info_hash'], 20)); 
  • include/sessions.php

    r316 r319  
    13681368                case TYPE_FORUM_POST: 
    13691369 
    1370                         if ( $info_data['mode'] <> 'reply' ) { 
    1371                                 return; 
    1372                         } 
    1373  
    13741370                        $post_id = $info_data['post_id']; 
    13751371                        $topic_id = $info_data['topic_id']; 
     
    13781374                        $last_id = $post_id; 
    13791375                        $notifs_type = '[forum]'; 
     1376 
     1377                        if ( $info_data['mode'] <> 'reply' ) { 
     1378                                break; 
     1379                        } 
    13801380 
    13811381                        $email_template = 'topic_notify'; 
     
    14301430        } 
    14311431 
    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 ) 
     1432        if ( $info_data['mode'] == 'reply' ) { 
     1433 
     1434                $sql = "SELECT u.uid, u.email, u.language, u.notifs 
     1435                                FROM " . COMMENTS_NOTIFY_TABLE . " tw, " . USERS_TABLE . " u 
     1436                                WHERE tw.checkcomm_for_id = " . $for_id . " 
     1437                                AND tw.checkcomm_userid NOT IN (" . $userdata['uid'] . ", " . ANONYMOUS . ") 
     1438                                AND tw.checkcomm_notify_status = " . NOTIFY_STATUS_UN_NOTIFIED . " 
     1439                                AND u.uid = tw.checkcomm_userid 
     1440                                AND u.enabled = 1 
     1441                                AND tw.checkcomm_type = " . $notify_type; 
     1442                $result = $db->sql_query($sql); 
     1443 
     1444                $update_watched_sql = ''; 
     1445                $bcc_list_ary = array(); 
     1446 
     1447                if ( $row = $db->sql_fetchrow($result) ) { 
     1448                        // Sixty second limit 
     1449                        @set_time_limit(60); 
     1450 
     1451                        do 
    14531452                        { 
    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); 
     1453                                if ( strpos($row['notifs'], $notifs_type) !== false ) 
     1454                                { 
     1455                                        $bcc_list_ary[$row['language']][] = $row['email']; 
    14801456                                } 
    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); 
     1457                                $update_watched_sql .= ($update_watched_sql != '') ? ', ' . $row['uid'] : $row['uid']; 
     1458                        } 
     1459                        while ( $row = $db->sql_fetchrow($result) ); 
     1460 
     1461                        if ( sizeof($bcc_list_ary) ) 
     1462                        { 
     1463                                include_once($root_path . 'include/functions_messenger.php'); 
     1464                                $messenger = new messenger(true); 
     1465 
     1466                                foreach ( $bcc_list_ary AS $user_lang => $bcc_list ) { 
     1467 
     1468                                        foreach ( $bcc_list AS $_null => $email ) { 
     1469 
     1470                                                $messenger->template($email_template, $user_lang); 
     1471 
     1472                                                $messenger->to($email, $email); 
     1473 
     1474                                                $messenger->assign_vars(array( 
     1475                                                        'TITLE' => $title, 
     1476                                                        'U_VIEW_URL' => $u_view_url, 
     1477                                                        'U_STOP_WATCHING' => $u_stop_watching 
     1478                                                )); 
     1479 
     1480                                                $messenger->send(NOTIFY_EMAIL); 
     1481                                        } 
     1482                                } 
     1483                                $messenger->save_queue(); 
     1484                        } 
     1485                } 
     1486                $db->sql_freeresult($result); 
     1487 
     1488                if ( $update_watched_sql ) 
     1489                { 
     1490                        $sql = 'UPDATE ' . COMMENTS_NOTIFY_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array( 
     1491                                'checkcomm_notify_status' => NOTIFY_STATUS_NOTIFIED, 
     1492                                'checkcomm_last_comment_id' => $last_id, 
     1493                                'checkcomm_view_status' => VIEW_STATUS_NOT_VIEWED, 
     1494                                )) . ' 
     1495                                WHERE checkcomm_for_id = ' . $for_id . ' 
     1496                                AND checkcomm_type = ' . $notify_type . ' 
     1497                                AND checkcomm_userid IN (' . $update_watched_sql . ')'; 
     1498                        $db->sql_query($sql); 
     1499                } 
    14981500        } 
    14991501