آموزش نصب ویبولتین 4.2.6 در هاست با نسخه php 8

Collapse
X
 
  • زمان
  • نمایش
Clear All
new posts
  • Admin
    مدیر کل
    • Jul 2025
    • 906
    • 13
    • 1

    #1

    آموزش نصب ویبولتین 4.2.6 در هاست با نسخه php 8

    برای رفع ارور:
    کد:
    Deprecated: Optional parameter $buffered declared before required parameter $link is implicitly treated as a required parameter in C:\xampp\htdocs\vb\includes\class_core.php on line 414



    فایل class_core.php رو باز کنید و کد زیر رو پیدا کنید:
    PHP Code:
    function execute_query($buffered = true, &$link)
        {
            $this->connection_recent =& $link;
            $this->querycount++;
    
            if ($queryresult = $this->functions[$buffered ? 'query' : 'query_unbuffered']($this->sql, $link))
            {
                // unset $sql to lower memory .. this isn't an error, so it's not needed
                $this->sql = '';
    
                return $queryresult;
            }
            else
            {
                $this->halt();
    
                // unset $sql to lower memory .. error will have already been thrown
                $this->sql = '';
            }
        } 
    

    تغییر بدید به:
    PHP Code:
    function execute_query(&$link, $buffered = true)
    {
        $this->connection_recent =& $link;
        $this->querycount++;
    
        if ($queryresult = $this->functions[$buffered ? 'query' : 'query_unbuffered']($this->sql, $link))
        {
            // unset $sql to lower memory .. this isn't an error, so it's not needed
            $this->sql = '';
    
            return $queryresult;
        }
        else
        {
            $this->halt();
    
            // unset $sql to lower memory .. error will have already been thrown
            $this->sql = '';
        }
    } 
    
    Copyright © coffeenetmavara, All Rights Reserved
  • Admin
    مدیر کل
    • Jul 2025
    • 906
    • 13
    • 1

    #2
    برای رفع ارور:
    کد:
    Deprecated: Optional parameter $buffered declared before required parameter $link is implicitly treated as a required parameter in C:\xampp\htdocs\vb\includes\class_core.php on line 1381





    فایل class_core.php رو باز کنید و کد زیر رو پیدا کنید:
    کد:
    function execute_query($buffered = true, &$link)
        {
            $this->connection_recent =& $link;
            $this->querycount++;
            if ($queryresult = mysqli_query($link, $this->sql, ($buffered ? MYSQLI_STORE_RESULT : MYSQLI_USE_RESULT)))
            {
                // unset $sql to lower memory .. this isn't an error, so it's not needed
                $this->sql = '';
                return $queryresult;
            }
            else
            {
                $this->halt();
                // unset $sql to lower memory .. error will have already been thrown
                $this->sql = '';
            }
        }​



    تغییر بدید به:
    کد:
    function execute_query($buffered, &$link)
    {
        $this->connection_recent =& $link;
        $this->querycount++;
    
        if ($queryresult = mysqli_query($link, $this->sql, ($buffered ? MYSQLI_STORE_RESULT : MYSQLI_USE_RESULT)))
        {
            // unset $sql to lower memory .. this isn't an error, so it's not needed
            $this->sql = '';
    
            return $queryresult;
        }
        else
        {
            $this->halt();
    
            // unset $sql to lower memory .. error will have already been thrown
            $this->sql = '';
        }
    }​
    Copyright © coffeenetmavara, All Rights Reserved

    نظر

    • Admin
      مدیر کل
      • Jul 2025
      • 906
      • 13
      • 1

      #3
      رفع ارور:
      کد:
      Fatal error: Declaration of vB_Database_MySQLi::execute_query($buffered, &$link) must be compatible with vB_Database::execute_query(&$link, $buffered = true) in C:\xampp\htdocs\vb\includes\class_core.php on line 1381


      فایل class_core.php رو باز کنید و کد قبلی رو به زیر تغییر بدید:
      کد:
      function execute_query(&$link, $buffered = true)
      {
          $this->connection_recent =& $link;
          $this->querycount++;
      
          if ($queryresult = mysqli_query($link, $this->sql, ($buffered ? MYSQLI_STORE_RESULT : MYSQLI_USE_RESULT)))
          {
              $this->sql = '';
      
              return $queryresult;
          }
          else
          {
              $this->halt();
      
              $this->sql = '';
          }
      }
      Copyright © coffeenetmavara, All Rights Reserved

      نظر

      • Admin
        مدیر کل
        • Jul 2025
        • 906
        • 13
        • 1

        #4
        برای رفع ارور:
        کد:
        PHP Warning: include(C:\xampp\htdocs\vb/includes/config.php): Failed to open stream: No such file or directory in C:\xampp\htdocs\vb\includes\class_core.php on line 3358


        پیدا کنید:
        کد:
        config.php.new

        تغییر بدید به:
        کد:
        config.php
        Copyright © coffeenetmavara, All Rights Reserved

        نظر

        • Admin
          مدیر کل
          • Jul 2025
          • 906
          • 13
          • 1

          #5
          رفع خطای:
          کد:
          PHP Warning: Undefined variable $isie in C:\xampp\htdocs\vb\includes\class_core.php on line 2205



          فایل class_core.php رو باز کنید و کد زیر رو پیدا کنید:
          فایل زیر پیدا کنید:
          PHP Code:
          function urlencode_query($url)
              {
                  $useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
                  if (strpos($useragent, 'opera') !== false)
                  {
                      preg_match('#opera(/| )([0-9\.]+)#', $useragent, $regs);
                      $isopera = $regs[2];
                  }
                  if (strpos($useragent, 'msie ') !== false AND !$isopera)
                  {
                      preg_match('#msie ([0-9\.]+)#', $useragent, $regs);
                      $isie = $regs[1];
                  }
                  if (!$isie)
                  {
                      return $url;
                  }
                  $querystring = array();
                  $bits = explode('?', $url);
                  if ($bits[1])
                  {
                      $bits[1] = urldecode($bits[1]);
                      $subbits = explode('&', $bits[1]);
                      foreach ($subbits AS $querypart)
                      {
                          $querybit = explode('=', $querypart);
                          if ($querybit[1])
                          {
                              $querystring[] = urlencode($querybit[0]) . '=' . urlencode($querybit[1]);
                          }
                          else
                          {
                              $querystring[] = urlencode($querybit[0]);
                          }
                      }
                      return $bits[0] . '?' . implode('&', $querystring);
                  }
                  return $url;
              } 
          

          تغییر بدید به:
          PHP Code:
          function urlencode_query($url)
          {
              $useragent = strtolower($_SERVER['HTTP_USER_AGENT'] ?? '');
          
              // Initialize variables
              $isie = false;
              $isopera = false;
          
              if (strpos($useragent, 'opera') !== false)
              {
                  preg_match('#opera(/| )([0-9\.]+)#', $useragent, $regs);
                  $isopera = $regs[2] ?? false;
              }
          
              if (strpos($useragent, 'msie ') !== false AND !$isopera)
              {
                  preg_match('#msie ([0-9\.]+)#', $useragent, $regs);
                  $isie = $regs[1] ?? false;
              }
          
              if (!$isie)
              {
                  return $url;
              }
          
              $querystring = array();
              $bits = explode('?', $url);
          
              if (!empty($bits[1]))
              {
                  $bits[1] = urldecode($bits[1]);
                  $subbits = explode('&', $bits[1]);
          
                  foreach ($subbits AS $querypart)
                  {
                      $querybit = explode('=', $querypart);
          
                      if (!empty($querybit[1]))
                      {
                          $querystring[] = urlencode($querybit[0]) . '=' . urlencode($querybit[1]);
                      }
                      else
                      {
                          $querystring[] = urlencode($querybit[0]);
                      }
                  }
          
                  return $bits[0] . '?' . implode('&', $querystring);
              }
          
              return $url;
          }​ 
          
          Copyright © coffeenetmavara, All Rights Reserved

          نظر

          • Admin
            مدیر کل
            • Jul 2025
            • 906
            • 13
            • 1

            #6
            رفع خطای:
            کد:
            PHP Warning: Undefined array key "query" in C:\xampp\htdocs\vb\includes\class_core.php on line 2122


            فایل class_core.php رو باز کنید و کد زیر رو پیدا کنید:
            کد:
            $url_info['query'] = $this->strip_sessionhash($url_info['query']);

            تغییر بدید به:
            PHP Code:
            $url_info['query'] = $this->strip_sessionhash($url_info['query'] ?? ''); 
            
            Copyright © coffeenetmavara, All Rights Reserved

            نظر

            • Admin
              مدیر کل
              • Jul 2025
              • 906
              • 13
              • 1

              #7
              رفع خطای:
              کد:
              PHP Warning: Undefined array key "HTTP_REFERER" in C:\xampp\htdocs\vb\includes\class_core.php on line 2018


              فایل class_core.php رو باز کنید و کد زیر رو پیدا کنید:
              کد:
              define('REFERRER',       $_SERVER['HTTP_REFERER']);

              تغییر بدید به:
              PHP Code:
              define('REFERRER', $_SERVER['HTTP_REFERER'] ?? ''); 
              
              Copyright © coffeenetmavara, All Rights Reserved

              نظر

              • Admin
                مدیر کل
                • Jul 2025
                • 906
                • 13
                • 1

                #8
                خطای:
                کد:
                PHP Warning: Undefined array key "HTTP_X_REQUESTED_WITH" in C:\xampp\htdocs\vb\includes\class_core.php on line 2022



                پیدا کنید:
                کد:
                if ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' OR (defined('VB_API') AND VB_API === true))
                        {
                            define('NEED_DECODE', true);
                        }

                تغییر بدید به:
                PHP Code:
                if (($_SERVER['HTTP_X_REQUESTED_WITH'] ?? '') == 'XMLHttpRequest' OR (defined('VB_API') AND VB_API === true))
                {
                    define('NEED_DECODE', true);
                }​ 
                
                Copyright © coffeenetmavara, All Rights Reserved

                نظر

                • Admin
                  مدیر کل
                  • Jul 2025
                  • 906
                  • 13
                  • 1

                  #9
                  رفع خطای:
                  PHP Code:
                  Fatal error: Uncaught Error: Undefined constant "SAPI_NAME" in C:\xampp\htdocs\vb\includes\class_core.php:6162 Stack trace: #0 [internal function]: vbulletin_exception_handler(Object(mysqli_sql_exception)) #1 {main} thrown in C:\xampp\htdocs\vb\includes\class_core.php on line 6162 
                  



                  پیدا کنید:
                  PHP Code:
                  if (!headers_sent())
                      {
                          if (SAPI_NAME == 'cgi' OR SAPI_NAME == 'cgi-fcgi')
                          {
                              header('Status: 500 Internal Server Error');
                          }
                          else
                          {
                              header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error');
                          }
                      }​ 
                  

                  تغییر بدید به:
                  PHP Code:
                  if (!headers_sent())
                  {
                      $sapi_name = PHP_SAPI;
                  
                      if ($sapi_name == 'cgi' OR $sapi_name == 'cgi-fcgi')
                      {
                          header('Status: 500 Internal Server Error');
                      }
                      else
                      {
                          $server_protocol = $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.1';
                          header($server_protocol . ' 500 Internal Server Error');
                      }
                  }​ 
                  
                  Copyright © coffeenetmavara, All Rights Reserved

                  نظر

                  • Admin
                    مدیر کل
                    • Jul 2025
                    • 906
                    • 13
                    • 1

                    #10
                    رفع خطای:
                    کد:
                    Warning: Undefined array key "version" in C:\xampp\htdocs\vb\install\install.php on line 20


                    فایل install.php را باز کنید و کد زیر را پیدا کنید:
                    کد:
                    if (in_array($_REQUEST['version'], array('', 'install')) AND (!$_REQUEST['step'] OR $_REQUEST['step'] <= 2))


                    با کد زیر جایگزین کنید:
                    کد:
                    if (in_array($_REQUEST['version'] ?? '', array('', 'install')) AND (!isset($_REQUEST['step']) OR $_REQUEST['step'] <= 2))
                    {
                        define('SKIPDB', true);
                    }
                    Copyright © coffeenetmavara, All Rights Reserved

                    نظر

                    • Admin
                      مدیر کل
                      • Jul 2025
                      • 906
                      • 13
                      • 1

                      #11
                      رفع خطای:
                      کد:
                      Deprecated: Optional parameter $glue1 declared before required parameter $array is implicitly treated as a required parameter in C:\xampp\htdocs\vb\includes\functions.php on line 7487





                      فایل functions.php رو باز کنید و پیدا کنید:
                      PHP Code:
                      /**
                       * Implodes an array using both values and keys
                       *
                       * @param string $glue1                         - Glue between key and value
                       * @param string $glue2                         - Glue between value and key
                       * @param mixed $array                          - Arr to implode
                       * @param boolean $skip_empty                   - Whether to skip empty elements
                       * @return string                               - The imploded result
                       */
                      function implode_both($glue1 = '', $glue2 = '', $array, $skip_empty = false)
                      {
                          if (!is_array($array))
                          {
                              return '';
                          }
                          $newarray = array();
                          foreach ($array as $key => $val)
                          {
                              if (!$skip_empty OR !empty($val))
                              {
                                  $newarray[$key] = $key . $glue1 . $val;
                              }
                          }
                          return implode($glue2, $newarray);
                      }​ 
                      



                      جایگزین کنید با:
                      PHP Code:
                      /**
                       * Implodes an array using both values and keys
                       *
                       * @param string $glue1 - Glue between key and value
                       * @param string $glue2 - Glue between value and key
                       * @param mixed $array - Arr to implode
                       * @param boolean $skip_empty - Whether to skip empty elements
                       * @return string - The imploded result
                       */
                      function implode_both($array, $glue1 = '', $glue2 = '', $skip_empty = false)
                      {
                          if (!is_array($array))
                          {
                              return '';
                          }
                      
                          $newarray = array();
                      
                          foreach ($array as $key => $val)
                          {
                              if (!$skip_empty OR !empty($val))
                              {
                                  $newarray[$key] = $key . $glue1 . $val;
                              }
                          }
                      
                          return implode($glue2, $newarray);
                      }​ 
                      
                      Copyright © coffeenetmavara, All Rights Reserved

                      نظر

                      • Admin
                        مدیر کل
                        • Jul 2025
                        • 906
                        • 13
                        • 1

                        #12
                        رفع خطای:
                        کد:
                        Deprecated: Optional parameter $tabid declared before required parameter $tabdata is implicitly treated as a required parameter in C:\xampp\htdocs\vb\includes\functions_navigation.php on line 779



                        فایل functions_navigation.php رو باز کنید و پیدا کنید:
                        کد:
                        function set_navigation_tab($tabid = 0, &$tabdata)
                        {
                            global $vbulletin;
                            if ($tabdata[$tabid]['type'] != 'tab')
                            {
                                /* No valid tab was given so we fallback to the forum root.
                                The fallback can be changed here if necessary, however products should use the 'set_navigation_tab_xxxx' hooks.
                                This fallback will only ever be called if something has gone wrong and we have ended up with an invalid tabid */
                                $root = 'vbtab_forum'; // Forum root tab, this should always exist.
                                $roots = get_navigation_roots(build_navigation_list());
                                ($hook = vBulletinHook::fetch_hook('set_navigation_tab_fallback')) ? eval($hook) : false;
                                $tabid = $roots[$root];
                                // Final fallback.
                                if ($tabdata[$tabid]['type'] != 'tab')
                                {
                                    $tabid = $roots['vbtab_forum'];
                                }
                            }
                            ($hook = vBulletinHook::fetch_hook('navigation_tab_complete')) ? eval($hook) : false;
                            return $tabid;
                        }

                        جایگزین کنید با:
                        PHP Code:
                        /**
                         * Set the current navigation tab
                         */
                        function set_navigation_tab(&$tabdata, $tabid = 0)
                        {
                            global $vbulletin;
                        
                            if ($tabdata[$tabid]['type'] != 'tab')
                            {
                                /* No valid tab was given so we fallback to the forum root.
                                The fallback can be changed here if necessary, however products should use the 'set_navigation_tab_xxxx' hooks.
                                This fallback will only ever be called if something has gone wrong and we have ended up with an invalid tabid */
                        
                                $root = 'vbtab_forum';
                                $roots = get_navigation_roots(build_navigation_list());
                        
                                ($hook = vBulletinHook::fetch_hook('set_navigation_tab_fallback')) ? eval($hook) : false;
                        
                                $tabid = $roots[$root];
                        
                                // Final fallback.
                                if ($tabdata[$tabid]['type'] != 'tab')
                                {
                                    $tabid = $roots['vbtab_forum'];
                                }
                            }
                        
                            ($hook = vBulletinHook::fetch_hook('navigation_tab_complete')) ? eval($hook) : false;
                        
                            return $tabid;
                        }​ 
                        
                        Copyright © coffeenetmavara, All Rights Reserved

                        نظر

                        • Admin
                          مدیر کل
                          • Jul 2025
                          • 906
                          • 13
                          • 1

                          #13
                          رفع خطای:
                          کد:
                          [B]Deprecated[/B]: Optional parameter $bold declared before required parameter $url is implicitly treated as a required parameter in [B]C:\xampp\htdocs\vb\includes\functions_navigation.php[/B] on line [B]979[/B]
                          
                          [B]Deprecated[/B]: Optional parameter $subtext declared before required parameter $url is implicitly treated as a required parameter in [B]C:\xampp\htdocs\vb\includes\functions_navigation.php[/B] on line [B]979[/B]
                          
                          [B]Deprecated[/B]: Optional parameter $link declared before required parameter $url is implicitly treated as a required parameter in [B]C:\xampp\htdocs\vb\includes\functions_navigation.php[/B] on line [B]979[/B]



                          فایل functions_navigation.php رو باز کنید و پیدا کنید:
                          کد:
                          function build_element_cell($name, $text, $depth, $bold = false, $subtext = '', $link = '', $url, $do = '', $session = '')
                          {
                              $cell = '<span title="'.$name.'">&nbsp;';
                              $cell .= $bold ? '<b>' : '';
                              $cell .= construct_depth_mark($depth, '- - ');
                              $cell .= $link ? '<a href="'.$link : '';
                              $cell .= ($link AND $session) ? '?'.$session : '';
                              $cell .= ($link AND $do AND $session) ? '&do=' . $do : '';
                              $cell .= ($link AND $do AND !$session) ? '?do=' . $do : '';
                              $cell .= $link ? '">' : '';
                              $cell .= $text;
                              $cell .= $link ? '</a>' : '';
                              $cell .= $bold ? '</b>' : '';
                              $cell .= '</span>';
                              $cell .= $subtext ? '&nbsp;&nbsp;<span class="smallfont" title = "'.$url.'">('.$subtext.')</span>' : '';
                              return $cell;
                          }​

                          جایگزین کنید با:
                          PHP Code:
                          function build_element_cell($name, $text, $depth, $url, $bold = false, $subtext = '', $link = '', $do = '', $session = '')
                          {
                              $cell = '<span title="'.$name.'">&nbsp;';
                              $cell .= $bold ? '<b>' : '';
                              $cell .= construct_depth_mark($depth, '- - ');
                              $cell .= $link ? '<a href="'.$link : '';
                              $cell .= ($link AND $session) ? '?'.$session : '';
                              $cell .= ($link AND $do AND $session) ? '&do=' . $do : '';
                              $cell .= ($link AND $do AND !$session) ? '?do=' . $do : '';
                              $cell .= $link ? '">' : '';
                              $cell .= $text;
                              $cell .= $link ? '</a>' : '';
                              $cell .= $bold ? '</b>' : '';
                              $cell .= '</span>';
                              $cell .= $subtext ? '&nbsp;&nbsp;<span class="smallfont" title = "'.$url.'">('.$subtext.')</span>' : '';
                          
                              return $cell;
                          }​ 
                          
                          Copyright © coffeenetmavara, All Rights Reserved

                          نظر

                          • Admin
                            مدیر کل
                            • Jul 2025
                            • 906
                            • 13
                            • 1

                            #14
                            رفع خطاهای:
                            کد:
                            [B]Warning[/B]: Constant TABLE_PREFIX already defined in [B]C:\xampp\htdocs\vb\includes\class_core.php[/B] on line [B]3513[/B]
                            
                            [B]Warning[/B]: Constant COOKIE_PREFIX already defined in [B]C:\xampp\htdocs\vb\includes\class_core.php[/B] on line [B]3514[/B]
                            
                            [B]Warning[/B]: Constant DEBUG already defined in [B]C:\xampp\htdocs\vb\includes\class_core.php[/B] on line [B]3518[/B]



                            فایل class_core.php رو باز کنید و پیدا کنید:
                            کد:
                                    define('TABLE_PREFIX', trim($this->config['Database']['tableprefix']));
                                    define('COOKIE_PREFIX', (empty($this->config['Misc']['cookieprefix']) ? 'bb' : $this->config['Misc']['cookieprefix']) . '_');
                                    // set debug mode
                                    $this->debug = !empty($this->config['Misc']['debug']);
                                    define('DEBUG', $this->debug);​


                            جایگزین کنید با:
                            PHP Code:
                            if (!defined('TABLE_PREFIX'))
                            {
                                define('TABLE_PREFIX', trim($this->config['Database']['tableprefix']));
                            }
                            
                            if (!defined('COOKIE_PREFIX'))
                            {
                                define('COOKIE_PREFIX', (empty($this->config['Misc']['cookieprefix']) ? 'bb' : $this->config['Misc']['cookieprefix']) . '_');
                            }
                            
                            // set debug mode
                            $this->debug = !empty($this->config['Misc']['debug']);
                            
                            if (!defined('DEBUG'))
                            {
                                define('DEBUG', $this->debug);
                            }​ 
                            
                            Copyright © coffeenetmavara, All Rights Reserved

                            نظر

                            • Admin
                              مدیر کل
                              • Jul 2025
                              • 906
                              • 13
                              • 1

                              #15
                              رفع خطای:
                              کد:
                              [B]Fatal error[/B]: Cannot declare class XMLparser, because the name is already in use in [B]C:\xampp\htdocs\vb\includes\class_xml.php[/B] on line [B]1002[/B]




                              فایل class_xml.php​ رو باز کنید و پیدا کنید:
                              کد:
                              class XMLparser extends vB_XML_Parser
                              {
                              }
                              class XMLexporter extends vB_XML_Builder
                              {
                              }​

                              جایگزین کنید با:
                              PHP Code:
                              if (!class_exists('XMLparser', false))
                              {
                                  class XMLparser extends vB_XML_Parser
                                  {
                                  }
                              }
                              
                              if (!class_exists('XMLexporter', false))
                              {
                                  class XMLexporter extends vB_XML_Builder
                                  {
                                  }
                              }​ 
                              
                              Copyright © coffeenetmavara, All Rights Reserved

                              نظر

                              اکانت ویژه
                              در حال کار...