PHP.SU

Программирование на PHP, MySQL и другие веб-технологии
PHP.SU Портал     На главную страницу форума Главная     Помощь Помощь     Поиск Поиск     Поиск Яндекс Поиск Яндекс     Вакансии  Пользователи Пользователи

Страниц (4): « 1 2 [3] 4 »

> Найдено сообщений: 48
serj12331 Отправлено: 24 Января, 2013 - 20:32:59 • Тема: Выдаёт ошибку • Форум: Вопросы новичков

Ответов: 15
Просмотров: 443
Не помогло
(Добавление)
ну всмысле ошибка исчезла, но на экран ничего не выводится
serj12331 Отправлено: 24 Января, 2013 - 20:00:14 • Тема: Выдаёт ошибку • Форум: Вопросы новичков

Ответов: 15
Просмотров: 443
Я понимаю что проблема в 443 строке
(Добавление)
Вот проблему решить и не могу
serj12331 Отправлено: 24 Января, 2013 - 19:53:14 • Тема: Выдаёт ошибку • Форум: Вопросы новичков

Ответов: 15
Просмотров: 443
Всем доброго времени суток, столкнулся с такой проблемой:
Parse error: syntax error, unexpected ')' in /var/www/test/data/www/maxi-pane l.ru/code/base.php on line 443
я так понимаю проблема в синтаксесе, но как бы не исправлял всё равно не хочет.

CODE (htmlphp):
скопировать код в буфер обмена
  1.  
  2.  
  3. <?php
  4. /*********************/
  5. /*                   */
  6. /*  Dezend for PHP5  */
  7. /*         NWS       */
  8. /*      Nulled.WS    */
  9. /*                   */
  10. /*********************/
  11.  
  12. class Recaptcha
  13. {
  14.  
  15.    private static $me;
  16.    private $privateKey;
  17.    private $publicKey;
  18.  
  19.    public function __construct( )
  20.    {
  21.        $this->publicKey = RECAPTCHA_PUBLIC;
  22.        $this->privateKey = RECAPTCHA_PRIVATE;
  23.    }
  24.  
  25.    public static function get( )
  26.    {
  27.        if ( is_null( self::$me ) )
  28.        {
  29.            self::$me = new Recaptcha( );
  30.        }
  31.        return self::$me;
  32.    }
  33.  
  34.    public function getCode( )
  35.    {
  36.        return recaptcha_get_html( $this->publicKey );
  37.    }
  38.  
  39.    public function verify( $resp, $chal )
  40.    {
  41.        $resp = recaptcha_check_answer( $this->privateKey, base( )->getRealIpAddr( ), $chal, $resp );
  42.        return $resp->is_valid;
  43.    }
  44.  
  45. }
  46.  
  47. class Assign
  48. {
  49.  
  50.    private static $me;
  51.    public $arr;
  52.  
  53.    public function __construct( )
  54.    {
  55.        self::$me = NULL;
  56.        $this->arr = array( );
  57.    }
  58.  
  59.    public static function get( )
  60.    {
  61.        if ( is_null( self::$me ) )
  62.        {
  63.            self::$me = new Assign( );
  64.        }
  65.        return self::$me;
  66.    }
  67.  
  68.    public function getData( )
  69.    {
  70.        return $this->arr;
  71.    }
  72.  
  73.    public function append( $name, $value )
  74.    {
  75.        $this->arr = array_merge( $this->arr, array( $name => $value ) );
  76.    }
  77.  
  78. }
  79.  
  80. class Base
  81. {
  82.  
  83.    private static $me;
  84.  
  85.    public static function get( )
  86.    {
  87.        if ( is_null( self::$me ) )
  88.        {
  89.            self::$me = new Base( );
  90.        }
  91.        return self::$me;
  92.    }
  93.  
  94.    public function sendEmail( $to, $subject, $msg, $from, $plaintext = "" )
  95.    {
  96.        if ( is_array( $to ) )
  97.        {
  98.            $to = array( $to );
  99.        }
  100.        foreach ( $to as $address )
  101.        {
  102.            $boundary = uniqid( rand( ), TRUE );
  103.            $headers = "From: ".$from."\n";
  104.            $headers .= "MIME-Version: 1.0\n";
  105.            $headers .= "Content-Type: multipart/alternative; boundary = ".$boundary."\n";
  106.            $headers .= "This is a MIME encoded message.\n\n";
  107.            $headers .= "--".$boundary."\n"."Content-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: base64\n\n";
  108.            $headers .= chunk_split( base64_encode( $plaintext ) );
  109.            $headers .= "--".$boundary."\n"."Content-Type: text/html; charset=UTF-8\nContent-Transfer-Encoding: base64\n\n";
  110.            $headers .= chunk_split( base64_encode( $msg ) );
  111.            $headers .= "--".$boundary."--\n".mail( $address, iconv( "utf-8", "cp1251", EVO_SITE.": ".$subject ), "", $headers );
  112.        }
  113.    }
  114.  
  115.    public function sendTemplateEmail( $templ, $params )
  116.    {
  117.        $contents = file_get_contents( "templates/mail/mail_header.tpl" );
  118.        $contents .= file_get_contents( "templates/mail/".$templ.".tpl" );
  119.        $contents .= file_get_contents( "templates/mail/mail_footer.tpl" );
  120.        foreach ( $params as $key => $val )
  121.        {
  122.            $contents = str_replace( "{".$key."}", $val, $contents );
  123.        }
  124.        $contents = str_replace( "{site}", EVO_SITE, $contents );
  125.        base( )->sendEmail( $params['to'], $params['subj'], $contents, "noreply@".EVO_SITE );
  126.    }
  127.  
  128.    public function isMailValid( $addr )
  129.    {
  130.        if ( filter_var( $addr, FILTER_VALIDATE_EMAIL ) )
  131.        {
  132.            return FALSE;
  133.        }
  134.        list( , $domain ) = explode( "@", $addr );
  135.        return getmxrr( $domain, $mxrecords );
  136.    }
  137.  
  138.    public function isPhoneValid( $number )
  139.    {
  140.        $pattern = array( "#^\\+([0-9]{1,1})\\s?\\(([0-9]{1,4})\\)\\s?([0-9\\-]{1,11})$#", "/^8(.|-)?\\d{3}\\1?\\d{3}\\1?\\d{2}\\1?\\d{2}$/" );
  141.        $i = 0;
  142.        for ( ; $i < count( $pattern ); ++$i )
  143.        {
  144.            if ( preg_match( $pattern[$i], $number ) )
  145.            {
  146.                return TRUE;
  147.            }
  148.        }
  149.        return FALSE;
  150.    }
  151.  
  152.    public function isValidIP( $ip )
  153.    {
  154.        if ( preg_match( "/^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$/", $ip ) )
  155.        {
  156.            return FALSE;
  157.        }
  158.        return TRUE;
  159.    }
  160.  
  161.    public function isIPAllowed( $lines, $ip )
  162.    {
  163.        $found = FALSE;
  164.        $explodeIP = explode( ".", $ip );
  165.        $ip = "1".sprintf( "%03d", $explodeIP[0] ).sprintf( "%03d", $explodeIP[1] ).sprintf( "%03d", $explodeIP[2] ).sprintf( "%03d", $explodeIP[3] );
  166.        foreach ( $lines as $line )
  167.        {
  168.            if ( strlen( $line ) < 4 )
  169.            {
  170.                $line = chop( $line );
  171.                $line = str_replace( "x", "*", $line );
  172.                $line = preg_replace( "|[A-Za-z#/]|", "", $line );
  173.                $max = $line;
  174.                $min = $line;
  175.                if ( strpos( $line, "*", 0 ) != "" )
  176.                {
  177.                    $max = str_replace( "*", "999", $line );
  178.                    $min = str_replace( "*", "000", $line );
  179.                }
  180.                if ( strpos( $line, "?", 0 ) != "" )
  181.                {
  182.                    $max = str_replace( "?", "9", $line );
  183.                    $min = str_replace( "?", "0", $line );
  184.                }
  185.                if ( $max == "" )
  186.                {
  187.                    if ( strpos( $max, " - ", 0 ) != "" )
  188.                    {
  189.                        $explodeIP = explode( " - ", $max );
  190.                        if ( preg_match( "|\\d{1,3}\\.|", $explodeIP[1] ) )
  191.                        {
  192.                            $max = $explodeIP[0];
  193.                        }
  194.                        else
  195.                        {
  196.                            $max = $explodeIP[1];
  197.                        }
  198.                    }
  199.                    if ( strpos( $min, " - ", 0 ) != "" )
  200.                    {
  201.                        $explodeIP = explode( " - ", $min );
  202.                        $min = $explodeIP[0];
  203.                    }
  204.                    $explodeIP = explode( ".", $max );
  205.                    $i = 0;
  206.                    for ( ; $i < 4; ++$i )
  207.                    {
  208.                        if ( $i == 0 )
  209.                        {
  210.                            $max = 1;
  211.                        }
  212.                        if ( strpos( $explodeIP[$i], "-", 0 ) != "" )
  213.                        {
  214.                            $anotherexplode = explode( "-", $explodeIP[$i] );
  215.                            $explodeIP[$i] = $anotherexplode[1];
  216.                        }
  217.                        $max .= sprintf( "%03d", $explodeIP[$i] );
  218.                    }
  219.                    $explodeIP = explode( ".", $min );
  220.                    $i = 0;
  221.                    for ( ; $i < 4; ++$i )
  222.                    {
  223.                        if ( $i == 0 )
  224.                        {
  225.                            $min = 1;
  226.                        }
  227.                        if ( strpos( $explodeIP[$i], "-", 0 ) != "" )
  228.                        {
  229.                            $anotherexplode = explode( "-", $explodeIP[$i] );
  230.                            $explodeIP[$i] = $anotherexplode[0];
  231.                        }
  232.                        $min .= sprintf( "%03d", $explodeIP[$i] );
  233.                    }
  234.                    if ( !( $ip <= $max ) || !( $min <= $ip ) )
  235.                    {
  236.                        $found = TRUE;
  237.                        break;
  238.                    }
  239.                }
  240.            }
  241.        }
  242.        return $found;
  243.    }
  244.  
  245.    public function getRealIpAddr( )
  246.    {
  247.        if ( @empty( $_SERVER['HTTP_CLIENT_IP'] ) )
  248.        {
  249.            return $_SERVER['HTTP_CLIENT_IP'];
  250.        }
  251.        if ( @empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) )
  252.        {
  253.            return $_SERVER['HTTP_X_FORWARDED_FOR'];
  254.        }
  255.        return $_SERVER['REMOTE_ADDR'];
  256.    }
  257.  
  258.    public function getUniqueStr( )
  259.    {
  260.        return sha1( uniqid( rand( ), TRUE ) );
  261.    }
  262.  
  263.    public function cp1251( $str )
  264.    {
  265.        return iconv( "utf8", "cp1251", $str );
  266.    }
  267.  
  268.    public function time2str( $ts )
  269.    {
  270.        if ( ctype_digit( $ts ) )
  271.        {
  272.            $ts = strtotime( $ts );
  273.        }
  274.        $diff = time( ) - $ts;
  275.        if ( $diff == 0 )
  276.        {
  277.            return "now";
  278.        }
  279.        if ( 0 < $diff )
  280.        {
  281.            $day_diff = floor( $diff / 86400 );
  282.            if ( $day_diff == 0 )
  283.            {
  284.                if ( $diff < 60 )
  285.                {
  286.                    return "только что";
  287.                }
  288.                if ( $diff < 120 )
  289.                {
  290.                    return "минуту назад";
  291.                }
  292.                if ( $diff < 3600 )
  293.                {
  294.                    return floor( $diff / 60 )." минут назад";
  295.                }
  296.                if ( $diff < 7200 )
  297.                {
  298.                    return "1 hour ago";
  299.                }
  300.                if ( $diff < 86400 )
  301.                {
  302.                    return floor( $diff / 3600 )." часов назад";
  303.                }
  304.            }
  305.            if ( $day_diff == 1 )
  306.            {
  307.                return "Вчера";
  308.            }
  309.            if ( $day_diff < 7 )
  310.            {
  311.                return $day_diff." дней назад";
  312.            }
  313.            if ( $day_diff < 31 )
  314.            {
  315.                return ceil( $day_diff / 7 )." недель назад";
  316.            }
  317.            if ( $day_diff < 60 )
  318.            {
  319.                return "В посл. Месяц";
  320.            }
  321.            $ret = date( "F Y", $ts );
  322.            if ( $ret == "December 1969" )
  323.            {
  324.                return "";
  325.            }
  326.            return $ret;
  327.        }
  328.        $diff = abs( $diff );
  329.        $day_diff = floor( $diff / 86400 );
  330.        if ( $day_diff == 0 )
  331.        {
  332.            if ( $diff < 120 )
  333.            {
  334.                return "Несколько минут";
  335.            }
  336.            if ( $diff < 3600 )
  337.            {
  338.                return "Через ".floor( $diff / 60 )." минут";
  339.            }
  340.            if ( $diff < 7200 )
  341.            {
  342.                return "В течение часа";
  343.            }
  344.            if ( $diff < 86400 )
  345.            {
  346.                return "Через ".floor( $diff / 3600 )." часов";
  347.            }
  348.        }
  349.        if ( $day_diff == 1 )
  350.        {
  351.            return "Завтра";
  352.        }
  353.        if ( $day_diff < 4 )
  354.        {
  355.            return date( "l", $ts );
  356.        }
  357.        if ( $day_diff < 7 + ( 7 - date( "w" ) ) )
  358.        {
  359.            return "На следущей неделе";
  360.        }
  361.        if ( ceil( $day_diff / 7 ) < 4 )
  362.        {
  363.            return "через ".ceil( $day_diff / 7 )." недель";
  364.        }
  365.        if ( date( "n", $ts ) == date( "n" ) + 1 )
  366.        {
  367.            return "В След. Месяце";
  368.        }
  369.        $ret = date( "F Y", $ts );
  370.        if ( $ret == "December 1969" )
  371.        {
  372.            return "";
  373.        }
  374.        return $ret;
  375.    }
  376.  
  377.    public function sortArray( $array, $on, $order = SORT_ASC )
  378.    {
  379.        $sortArray = array( );
  380.        $sortableArray = array( );
  381.        if ( 0 < count( $array ) )
  382.        {
  383.            foreach ( $array as $k => $v )
  384.            {
  385.                if ( is_array( $v ) )
  386.                {
  387.                    foreach ( $v as $k2 => $v2 )
  388.                    {
  389.                        if ( $k2 == $on )
  390.                        {
  391.                            $sortableArray[$k] = $v2;
  392.                        }
  393.                    }
  394.                }
  395.                else
  396.                {
  397.                    $sortableArray[$k] = $v;
  398.                }
  399.            }
  400.            switch ( $order )
  401.            {
  402.                case SORT_ASC :
  403.                    asort( &$sortableArray );
  404.                    break;
  405.                case SORT_DESC :
  406.                    arsort( &$sortableArray );
  407.            }
  408.            foreach ( $sortableArray as $k => $v )
  409.            {
  410.                $sortArray[$k] = $array[$k];
  411.            }
  412.        }
  413.        return $sortArray;
  414.    }
  415.  
  416.    public function inArray( $elem, $array )
  417.    {
  418.        $top = sizeof( $array ) - 1;
  419.        $bot = 0;
  420.        while ( $bot <= $top )
  421.        {
  422.            $p = floor( ( $top + $bot ) / 2 );
  423.            if ( $array[$p] < $elem )
  424.            {
  425.                $bot = $p + 1;
  426.            }
  427.            else if ( $elem < $array[$p] )
  428.            {
  429.                $top = $p - 1;
  430.            }
  431.        }
  432.        return TRUE;
  433.        return FALSE;
  434.    }
  435.  
  436.    public function getGeneratedText( )
  437.    {
  438.        return "generated by evopanel v".GLOBAL_VERSION." on ".date( "Y-m-d H:i:s" ).".\n\n";
  439.    }
  440.  
  441. }
  442.  
  443. function assign( )
  444. {
  445.    return ( );
  446. }
  447.  
  448. function db( )
  449. {
  450.    return ( );
  451. }
  452.  
  453. function user( )
  454. {
  455.    return ( );
  456. }
  457.  
  458. function agent( )
  459. {
  460.    return ( );
  461. }
  462.  
  463. function panel( )
  464. {
  465.    return ( );
  466. }
  467.  
  468. function recaptcha( )
  469. {
  470.    return ( );
  471. }
  472.  
  473. function base( )
  474. {
  475.    return ( );
  476. }
  477.  
  478. function pay( )
  479. {
  480.    return ( );
  481. }
  482.  
  483. function ticket( )
  484. {
  485.    return ( );
  486. }
  487.  
  488. function serverMgr( )
  489. {
  490.    return ( );
  491. }
  492.  
  493. function server( )
  494. {
  495.    return ( );
  496. }
  497.  
  498. function config( )
  499. {
  500.    return ( );
  501. }
  502.  
  503. function loadObject( $className, $fileName )
  504. {
  505.    require( "code/".$fileName.".php" );
  506.    return new $className( );
  507. }
  508.  
  509. define( "GLOBAL_VERSION", "1.0r211" );
  510. if ( defined( "EVOPANEL_CODE" ) )
  511. {
  512.    exit( );
  513.    return header( "location: /" );
  514. }
  515. require( EVOPANEL_PATH."frame/Framework.php" );
  516. require( EVOPANEL_PATH."frame/TwigView.php" );
  517. require( EVOPANEL_PATH."code/libs/recaptchalib.php" );
  518. require( EVOPANEL_PATH."code/config.php" );
  519. require( EVOPANEL_PATH."code/database.php" );
  520. require( EVOPANEL_PATH."code/simple.php" );
  521. require( EVOPANEL_PATH."code/client.php" );
  522. require( EVOPANEL_PATH."code/ticket.php" );
  523. require( EVOPANEL_PATH."code/payment.php" );
  524. require( EVOPANEL_PATH."code/webhost.php" );
  525. ?>
  526.  
  527.  
  528.  
  529.  
serj12331 Отправлено: 04 Января, 2013 - 12:54:04 • Тема: Репозиторий • Форум: Вопросы новичков

Ответов: 16
Просмотров: 635
Получилось всё плохо http://rghost[dot]ru/42724756[dot]view
serj12331 Отправлено: 04 Января, 2013 - 12:15:30 • Тема: Ошибка в скрипте • Форум: Вопросы новичков

Ответов: 12
Просмотров: 368
tato пишет:
Код фуекции decod() в студию.

Я же скрипт вроде выложил сюда, или ещё что то нужно?
serj12331 Отправлено: 04 Января, 2013 - 00:08:14 • Тема: Ошибка в скрипте • Форум: Вопросы новичков

Ответов: 12
Просмотров: 368
Не помогло(
serj12331 Отправлено: 03 Января, 2013 - 23:59:32 • Тема: Ошибка в скрипте • Форум: Вопросы новичков

Ответов: 12
Просмотров: 368
Может ещё будут мысли по решению проблемы?
(Добавление)
http://maxi-servak[dot]ru/support
serj12331 Отправлено: 03 Января, 2013 - 23:58:51 • Тема: Ошибка в скрипте • Форум: Вопросы новичков

Ответов: 12
Просмотров: 368
Ну да там так и высвечивается \n
serj12331 Отправлено: 03 Января, 2013 - 23:47:03 • Тема: Ошибка в скрипте • Форум: Вопросы новичков

Ответов: 12
Просмотров: 368
tato пишет:
Тут каша из декодов/энкодов, разберетесь с ней решите проблему.

Как говорится легко сказать =) Я в php как сказать плоховато разбираюсь, поэтому прошу помощи =(
(Добавление)
Убрал в 104 строке кодирование и декодирование, не помогло
serj12331 Отправлено: 03 Января, 2013 - 23:26:11 • Тема: Ошибка в скрипте • Форум: Вопросы новичков

Ответов: 12
Просмотров: 368
Всем доброго времени суток, возникла проблема. У меня на сайте стоит система тикетов, и когда пользователь пишеть письмо и переносит текст на другую строку нажатием клавиши Enter, то межту текстом выявляются такие инициалы /n а текст не переносится вот скрин
http://rghost[dot]ru/42716362[dot]view
(Добавление)
Вот содержание скрипта:

CODE (htmlphp):
скопировать код в буфер обмена
  1. <?php
  2. if(!defined('gamepl')) { die("Hacking attempt!"); }
  3. $act = $_POST['act'];
  4. if($act){
  5.         if($act == "h"){
  6.                 if($logingo != "1"){exit;}
  7.                 if(decod($logininfo['p11']) == "1"){
  8.                         $key = @$m->get('ticket_a');
  9.                 }else{
  10.                         $key = @$m->get('ticket_h_'.$logininfo['id']);
  11.                 }
  12.                 if(empty($key)){exit;}else{echo '<i class="icon-envelope icon-white"></i>';exit;}
  13.         }elseif($act == "new"){
  14.                 if($logingo != "1"){ajax_e('15');}
  15.                 $title = clear($_POST['title']);
  16.                 if(!$title){ajax_e('306');}
  17.                 if(mb_strlen($title,"utf-8") < 3 ){ajax_e('307');}
  18.                 if(mb_strlen($title,"utf-8") > 24 ){ajax_e('308');}
  19.                 $ticket = clear($_POST['text']);
  20.                 if(!$ticket){ajax_e('309');}
  21.                 if(mb_strlen($ticket,"utf-8") < 10 ){ajax_e('310');}
  22.                 if(mb_strlen($ticket,"utf-8") > 3000 ){ajax_e('311');}
  23.                 $cat = (int)$_POST['cat'];
  24.                 if($cat != "0"){
  25.                         $db->query('SELECT * FROM tabl2 where p4="'.cod($logininfo['id']).'" and id="'.$cat.'"');
  26.                         if($db->num_rows() != "1"){ajax_e('313');}
  27.                 }
  28.                 $m->set('ticket_a', '1', false, 3600*24*7);
  29.                 $db->query( "INSERT INTO tabl29 set p1='".cod($logininfo['id'])."',p2='".base64_encode(cod($title))."',p3='".cod($cat)."',p4='".cod('1')."',p5='".cod(time())."'");
  30.                 $m->set('ticket_admin_'.mysql_insert_id(), '1', false, 3600);
  31.                 $db->query( "INSERT INTO tabl30 set p1='".cod(mysql_insert_id())."',p2='".cod($logininfo['id'])."',p3='".base64_encode(cod($ticket))."',p4='".cod(time())."'");
  32.                 ajax_r('312');
  33.         }elseif($act == "new_mes"){
  34.                 if($logingo != "1"){ajax_e('15');}
  35.                 $ticket = clear(trim($_POST['text']));
  36.                 $id = clear((int)$_POST['id']);
  37.                 if(!$ticket){ajax_e('309');}
  38.                 if(mb_strlen($ticket,"utf-8") < 10 ){ajax_e('310');}
  39.                 if(mb_strlen($ticket,"utf-8") > 3000 ){ajax_e('311');}
  40.                 if(decod($logininfo['p11']) == "1"){
  41.                         $db->query('SELECT * FROM tabl29 where id="'.$id.'"');
  42.                 }else{
  43.                         $db->query('SELECT * FROM tabl29 where p1="'.cod($logininfo['id']).'" and id="'.$id.'"');
  44.                 }
  45.                 if($db->num_rows() == "1"){
  46.                         $row1 = $db->get_row();
  47.                         if(decod($logininfo['p11']) == "1"){
  48.                                 $m->set('ticket_h_'.decod($row1['p1']), '1', false, 3600*24*7);
  49.                                 $m->set('ticket_'.$id, '1', false, 3600*24*7);
  50.                         }else{
  51.                                 $m->set('ticket_a', '1', false, 3600*24*7);
  52.                                 $m->set('ticket_admin_'.$id, '1', false, 3600*24*7);
  53.                         }
  54.                         $db->query( "INSERT INTO tabl30 set p1='".cod($id)."',p2='".cod($logininfo['id'])."',p3='".base64_encode(cod($ticket))."',p4='".cod(time())."'");
  55.                         ajax_r('320');
  56.                 }else{ajax_e('321');}
  57.         }elseif($act == "del"){
  58.                 if($logingo != "1"){ajax_e('15');}
  59.                 $id = clear((int)$_POST['id']);
  60.                 if(decod($logininfo['p11']) == "1"){
  61.                         $m->delete('ticket_a');
  62.                         $db->query('delete from tabl29 where id="'.$id.'"');
  63.                         $db->query('delete from tabl30 where p1="'.cod($id).'"');
  64.                         ajax_r('322');
  65.                 }else{ajax_e('13');}
  66.         }
  67. }
  68. if($logingo == "1"){
  69.         if($_GET['act'] == "ticket"){
  70.                 $id = (int)$_GET['id'];
  71.                 if(decod($logininfo['p11']) == "1"){
  72.                         $m->delete('ticket_a');
  73.                         $db->query('SELECT * FROM tabl29 where id="'.$id.'"');
  74.                 }else{
  75.                         $db->query('SELECT * FROM tabl29 where p1="'.cod($logininfo['id']).'" and id="'.$id.'"');
  76.                         $m->delete('ticket_h_'.$logininfo['id']);
  77.                 }
  78.                 if($db->num_rows() == "1"){
  79.                         if(decod($logininfo['p11']) == "1"){
  80.                                 $m->delete('ticket_admin_'.$id);
  81.                         }else{
  82.                                 $m->delete('ticket_'.$id);
  83.                         }
  84.                         $row = $db->get_row();
  85.                         $sql = $db->query('SELECT * FROM tabl30 where p1="'.cod($id).'" order by id asc');
  86.                         while ( $row2 = $db->get_row($sql) ) {
  87.                                 $tpl->load_template ( 'ticket_mes.tpl' );
  88.                                 $sql3 = $db->query('SELECT * FROM tabl1 where id="'.decod($row2['p2']).'"');
  89.                                 $row3 = $db->get_row($sql3);
  90.                                 $tpl->set ( '{name}', decod($row3['p1']));
  91.                                 $tpl->set ( '{mes}', base64_decode(decod($row2['p3'])));
  92.                                 $tpl->set ( '{date}', langdate( "j F Y - H:i", decod($row2['p4'])) );
  93.                                 $tpl->compile ( 'tickets' );
  94.                         }
  95.                         $tpl->load_template ( 'ticket.tpl' );
  96.                         if(decod($row['p4']) == "1"){
  97.                                 $tpl->set_block ( "'\\[open\\](.*?)\\[/open\\]'si", "\\1" );
  98.                         }else{
  99.                                 $tpl->set_block ( "'\\[open\\](.*?)\\[/open\\]'si", "" );
  100.                         }
  101.                         $tpl->set ( '{tickets}', $tpl->result['tickets']);
  102.                         $tpl->set ( '{id}', $row['id']);
  103.                         $tpl->set ( '{cat}', decod($row['p3']));
  104.                         $tpl->set ( '{title}', base64_encode(decod($row['p2'])));
  105.                         $tpl->compile ( 'content' );
  106.                         if(decod($logininfo['p11']) == "1"){nav("/admin","Администрирование");}
  107.                         nav("/servers","Cерверы");
  108.                         if(decod($logininfo['p11']) == "1"){
  109.                                 if(decod($row['p3']) != 0){
  110.                                         nav("/server&id=".decod($row['p3']),decod($row['p3']));
  111.                                 }
  112.                         }
  113.                         nav("/support","Центр поддержки");
  114.                         nav("","#".$row['id'],'1');
  115.                 }else{error($lang['321']);}
  116.         }else{
  117.                 $sql_result = $db->query('SELECT * FROM tabl2 where p4="'.cod($logininfo['id']).'"  order by id desc');
  118.                 while ( $row = $db->get_row( $sql_result ) ) {
  119.                         $server .= '<option value="'.$row['id'].'">Сервер #'.$row['id'].'</option>';
  120.                 }
  121.                 if(decod($logininfo['p11']) == "1"){
  122.                         $m->delete('ticket_a');
  123.                         $sql_result = $db->query('SELECT * FROM tabl29 order by id desc');
  124.                 }else{
  125.                         $m->delete('ticket_h_'.$logininfo['id']);
  126.                         $sql_result = $db->query('SELECT * FROM tabl29 where p1="'.cod($logininfo['id']).'" order by id desc');
  127.                 }
  128.                 while ( $row = $db->get_row( $sql_result ) ) {
  129.                         $tpl->load_template ( 'ticket_get.tpl' );
  130.                         $tpl->set ( '{id}', $row['id']);
  131.                         $db->query('SELECT * FROM tabl1 where id="'.decod($row['p1']).'"');
  132.                         $row3 = $db->get_row();
  133.                         $tpl->set ( '{login}', decod($row3['p1']));
  134.                         $tpl->set ( '{name}', base64_decode(decod($row['p2'])));
  135.                         if(decod($logininfo['p11']) == "1"){
  136.                                 $key = @$m->get('ticket_admin_'.$row['id']);
  137.                                 if(empty($key)){
  138.                                         $stats = '';
  139.                                 }else{
  140.                                         $stats = '<i class="icon-envelope"></i>';
  141.                                 }
  142.                         }else{
  143.                                 $key = @$m->get('ticket_'.$row['id']);
  144.                                 if(empty($key)){
  145.                                         $stats = '';
  146.                                 }else{
  147.                                         $stats = '<i class="icon-envelope"></i>';
  148.                                 }
  149.                         }
  150.                         $tpl->set ( '{stats}', $stats);
  151.                         $tpl->set ( '{date}', langdate( "j F Y - H:i", decod($row['p5'])) );
  152.                         $tpl->compile ( 'tickets' );
  153.                 }
  154.                 $tpl->load_template ( 'support.tpl' );
  155.                 $tpl->set ( '{servers}', $server);
  156.                 $tpl->set ( '{tickets}', $tpl->result['tickets']);
  157.                 $tpl->compile ( 'content' );
  158.                 if(decod($logininfo['p11']) == "1"){nav($conf['url']."admin","Администрирование");}
  159.                 nav("/servers","Cерверы");
  160.                 nav("","Центр поддержки",'1');
  161.         }
  162. }else{error($lang['221']);}
  163. ?>
serj12331 Отправлено: 03 Января, 2013 - 20:22:51 • Тема: Репозиторий • Форум: Вопросы новичков

Ответов: 16
Просмотров: 635
Стоило только сменить 84 строку на 1.if(!empty($tpl->result['error'])) { как сразу легло всё Недовольство, огорчение
serj12331 Отправлено: 03 Января, 2013 - 20:16:57 • Тема: Репозиторий • Форум: Вопросы новичков

Ответов: 16
Просмотров: 635
нечаянно захватил, что ошибка в 84 строке я это уже понял =)
serj12331 Отправлено: 03 Января, 2013 - 20:11:46 • Тема: Репозиторий • Форум: Вопросы новичков

Ответов: 16
Просмотров: 635
Muxa пишет:


ну так и исправляйте
Если с английским плохо - в переводчик..
PHP:
скопировать код в буфер обмена
if($tpl->result['error'] != "") {
PHP:
скопировать код в буфер обмена
if(!empty($tpl->result['error'])) {

Да нет, скорее всего в php у меня плохо =)
serj12331 Отправлено: 03 Января, 2013 - 19:52:54 • Тема: Репозиторий • Форум: Вопросы новичков

Ответов: 16
Просмотров: 635
Muxa пишет:
пропишите в начале кода строчки
PHP:
скопировать код в буфер обмена
ini_set('display_errors', 'On');error_reporting ( E_ALL | E_STRICT );
и исправьте для начала эти ошибки

Да вот сделал, выдало:

Notice: Undefined index: error in /var/www/serj12331/data/www/dome n.ru/engine/init.php on line 84 Notice: Undefined index: nChat in /var/www/serj12331/data/www/dome n.ru/engine/init.php on line 96 Notice: Undefined index: error in /var/www/serj12331/data/www/dome n.ru/engine/init.php on line 105
(Добавление)
Вот содержание файла /var/www/serj12331/data/www/dome n.ru/engine/init.php

CODE (htmlphp):
скопировать код в буфер обмена
  1. <?php
  2. if(!defined('gamepl')) {
  3.    die("Hacking attempt!");
  4. }
  5. include (ROOT_DIR.'/engine/data/conf.php');
  6. include (ROOT_DIR.'/engine/function.php');
  7. include (ROOT_DIR.'/engine/classes/mysql.class.php');
  8. include (ROOT_DIR.'/langs/'.$conf['lang'].'.php');
  9. $m = new Memcache;
  10. $m->connect($conf['m_ip'],$conf['m_port']);
  11. $conf['url'] = "http://".clear($_SERVER['HTTP_HOST'])."/";
  12. $ajax_f = clear(@$_POST['ajax_f']);
  13. $speedbar = "0";
  14. $in = (int)@$_GET['in'];
  15. if($in != "") {
  16.    if(preg_match("/[^0-9]/",$in)) {
  17.    } else {
  18.        $db->query('SELECT * FROM tabl1 where id="'.$in.'"');
  19.        if($db->num_rows() == "1") {
  20.            set_cookie("invite",$in,7);
  21.        }
  22.    }
  23.    header('location:'.$conf['url']);
  24. }
  25. $logingo = "0";
  26. $logininfo = array();
  27. $login = cod(clear(decod(@$_COOKIE['login'])));
  28. $pass = cod(clear(decod(@$_COOKIE['pass'])));
  29. if($login != "" and $pass != "") {
  30.    $db->query('SELECT * FROM tabl1 where p1="'.$login.'" and p2="'.$pass.'"');
  31.    if($db->num_rows() == "1") {
  32.        $logininfo = $db->get_row();
  33.        $logingo = "1";
  34.        $db->query('update tabl1 set p8="'.cod($_SERVER['REMOTE_ADDR']).'" where id="'.
  35.            $logininfo['id'].'"');
  36.    }
  37. }
  38. include (ROOT_DIR.'/engine/classes/tpl.class.php');
  39. $tpl->dir = ROOT_DIR.'/tpl/4/';
  40. define('TEMPLATE_DIR',$tpl->dir);
  41. $do = @$_GET['do'];
  42. if(preg_match ("/[^a-z,A-Z_]/", $do)){error($lang['2']);$do=false;}
  43. if($do) {
  44.    $module = @file(ROOT_DIR."/engine/modules/".$do.".php");
  45.    if(!$module) {
  46.        error($lang['2']);
  47.    } else {
  48.        include (ROOT_DIR."/engine/modules/".$do.".php");
  49.    }
  50. }
  51.  
  52. $tpl->load_template('header.tpl');
  53. if($logingo == "1") {
  54.    $tpl->set('{balance}',decod($logininfo['p7']).' руб.');
  55. } else {
  56. }
  57. $tpl->compile('header');
  58. $tpl->load_template('nav.tpl');
  59. $tpl->set('{data}',$tpl->result['nav_get']);
  60. $tpl->compile('nav');
  61. include (ROOT_DIR.'/engine/modules/speedbar.php');
  62. if(!$do) {
  63.         $tpl->result['news'] = @$m->get('index_news');
  64.         if(empty($tpl->result['news'])){
  65.                 $sql_result = $db->query('SELECT * FROM tabl10 order by id desc');
  66.                 while ( $row_news = $db->get_row( $sql_result ) ) {
  67.                         $tpl->load_template ( 'news.tpl' );
  68.                         if(decod($row_news['p4']) != ""){
  69.                                 $tpl->set ( '{text}', '<a href="'.decod($row_news['p4']).'">'.decod($row_news['p3']).'</a>' );
  70.                         }else{
  71.                                 $tpl->set ( '{text}', decod($row_news['p3']) );
  72.                         }
  73.                         $tpl->set ( '{time}', langdate( "j F Y - H:i", decod($row_news['p2'])) );
  74.                         $tpl->compile ( 'news' );
  75.                 }
  76.                 $m->set('index_news', $tpl->result['news'], false, 3600);
  77.         }
  78.    $tpl->load_template ( 'index.tpl' );
  79.    $tpl->compile ( 'content' );
  80.         $tpl->result['content'] = str_replace('{news}', $tpl->result['news'],$tpl->result['content']);
  81. }
  82. $tpl->load_template('main.tpl');
  83. $tpl->set('{title}',$title.$conf['title']);
  84. if($tpl->result['error'] != "") {
  85.    $tpl->set('{content}',$tpl->result['error'].$tpl->result['content']);
  86. } else {
  87.    $tpl->set('{content}',$tpl->result['content']);
  88. }
  89. $tpl->set('{header}',$tpl->result['header']);
  90. if($tpl->result['nav_get'] != "") {
  91.    $tpl->set('{sidebar}',$tpl->result['nav']);
  92. } else {
  93.    $tpl->set('{sidebar}','');
  94. }
  95. $tpl->set('{speedbar}',$tpl->result['speedbar']);
  96. $tpl->set('{nChat}',$tpl->result['nChat']);
  97. $tpl->compile('main');
  98. if($_POST['ajax'] != "1") {
  99.    echo $tpl->result['main'];
  100. } else {
  101.    $sb = '';
  102.    if($tpl->result['nav_get'] != "") {
  103.        $sb = $tpl->result['nav'];
  104.    }
  105.    if($tpl->result['error'] != "") {
  106.        echo $tpl->result['error'].$tpl->result['content'].
  107.            '<div style="display:none;"><div id="nurl_title">'.$title.$conf['title'].
  108.            '</div><div id="nurl_nav">'.$sb.'</div><div id="nurl_speedbar">'.$tpl->result['speedbar'].
  109.            '</div></div>';
  110.    } else {
  111.        echo $tpl->result['content'].'<div style="display:none;"><div id="nurl_title">'.
  112.            $title.$conf['title'].'</div><div id="nurl_nav">'.$sb.
  113.            '</div><div id="nurl_speedbar">'.$tpl->result['speedbar'].'</div></div>';
  114.    }
  115. }
  116. ;
  117. ?>
  118.  
serj12331 Отправлено: 03 Января, 2013 - 12:48:42 • Тема: Репозиторий • Форум: Вопросы новичков

Ответов: 16
Просмотров: 635
Может проблеиа в скрипте?

Страниц (4): « 1 2 [3] 4 »
Powered by PHP  Powered By MySQL  Powered by Nginx  Valid CSS  RSS

 
Powered by ExBB FM 1.0 RC1. InvisionExBB