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

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

    #16
    رفع خطای:

    کد:
    Warning: Undefined variable $vbulletin in C:\xampp\htdocs\vb\includes\adminfunctions.php on line 17
    
    Warning: Attempt to read property "userinfo" on null in C:\xampp\htdocs\vb\includes\adminfunctions.php on line 17
    
    Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\vb\includes\adminfunctions.php on line 17
    
    Warning: Undefined variable $vbulletin in C:\xampp\htdocs\vb\includes\adminfunctions.php on line 17
    
    Warning: Attempt to read property "userinfo" on null in C:\xampp\htdocs\vb\includes\adminfunctions.php on line 17
    
    Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\vb\includes\adminfunctions.php on line 17





    فایل adminfunctions.php​رو باز کنید و پیدا کنید:
    کد HTML:
    if (!defined('ADMINHASH'))
    {
        define('ADMINHASH', md5(COOKIE_SALT . $vbulletin->userinfo['userid'] . $vbulletin->userinfo['salt']));
    }​



    جایگزین کنید با:
    PHP Code:
    global $vbulletin;
    
    if (!defined('ADMINHASH'))
    {
        $userid = isset($vbulletin->userinfo['userid'])
            ? $vbulletin->userinfo['userid']
            : 0;
    
        $salt = isset($vbulletin->userinfo['salt'])
            ? $vbulletin->userinfo['salt']
            : '';
    
        define('ADMINHASH', md5(COOKIE_SALT . $userid . $salt));
    }​ 
    
    Copyright © coffeenetmavara, All Rights Reserved

    نظر

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

      #17
      رفع خطاهای:
      کد:
      Warning: Undefined array key 8 in C:\xampp\htdocs\vb\install\includes\class_upgrade.php on line 766
      
      Warning: Undefined array key 8 in C:\xampp\htdocs\vb\install\includes\class_upgrade.php on line 766


      فایل class_upgrade.php رو باز کنید و پیدا کنید:
      کد:
      {
                  switch (strtolower($regs[6]))
                  {
                      case 'alpha':
                          $type = -5;
                          $regs[6] = 'a';
                          break;
                      case 'beta':
                          $type = -4;
                          $regs[6] = 'b';
                          break;
                      case 'gamma':
                          $type = -3;
                          $regs[6] = 'g';
                          break;
                      case 'release candidate':
                          $type = -2;
                          $regs[6] = 'rc';
                          break;
                      case 'patch level':
                          $type = 1;
                          $regs[6] = 'pl';
                          break;
                      case 'by vbs':
                          $type = 1;
                          $regs[6] = 'vbs';
                          break;
                      case 'gold':
                      case 'stable':
                      case 'final':
                          $type = -1;
                          $regs[6] = '';
                          break;
                      default:
                          $type = 0;
                          break;
                  }
                  if ($typeonly)
                  {
                      return $type;
                  }
                  else
                  {
                      return $regs[2] . $regs[3] . $regs[4] . $regs[6] . $regs[8];
                  }
              }​

      جایگزین کنید با:
      PHP Code:
      {
          switch (strtolower($regs[6] ?? ''))
          {
              case 'alpha':
                  $type = -5;
                  $regs[6] = 'a';
                  break;
      
              case 'beta':
                  $type = -4;
                  $regs[6] = 'b';
                  break;
      
              case 'gamma':
                  $type = -3;
                  $regs[6] = 'g';
                  break;
      
              case 'release candidate':
                  $type = -2;
                  $regs[6] = 'rc';
                  break;
      
              case 'patch level':
                  $type = 1;
                  $regs[6] = 'pl';
                  break;
      
              case 'by vbs':
                  $type = 1;
                  $regs[6] = 'vbs';
                  break;
      
              case 'gold':
              case 'stable':
              case 'final':
                  $type = -1;
                  $regs[6] = '';
                  break;
      
              default:
                  $type = 0;
                  break;
          }
      
          if ($typeonly)
          {
              return $type;
          }
          else
          {
              return ($regs[2] ?? '') .
                     ($regs[3] ?? '') .
                     ($regs[4] ?? '') .
                     ($regs[6] ?? '') .
                     ($regs[8] ?? '');
          }
      }​ 
      
      Copyright © coffeenetmavara, All Rights Reserved

      نظر

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

        #18
        رفع خطای:
        کد:
        Warning: Undefined array key "md5_sums_vbulletin.php" in C:\xampp\htdocs\vb\install\includes\class_upgrade.php on line 1083



        فایل class_upgrade.php رو باز کنید و پیدا کنید:
        کد:
        if ($md5_sums["$file"])
                                    {
                                        $check_md5 = true;
                                        if (is_readable(DIR . $directory . '/' . $file))
                                        {
                                            // valid, readable file -- try to match the contents and version
                                            if (in_array($ext, array('.php', '.js')) AND $fp = @fopen(DIR . $directory . '/' . $file, 'rb'))
                                            {
                                                $linenumber = 0;
                                                $finished = false;
                                                $matches = array();
                                                while ($line = fgets($fp, 4096) AND $linenumber <= 10)
                                                {
                                                    if ($ext == '.php' AND preg_match('#\|\| \# vBulletin[^0-9]* (\d.*?) -#si', $line, $matches))
                                                    {
                                                        $finished = true;
                                                    }
                                                    else if (preg_match('#^\|\| \# vBulletin[^0-9]* (\d.*)$#si', $line, $matches))
                                                    {
                                                        $finished = true;
                                                    }
                                                    $linenumber++;
                                                    if ($finished)
                                                    {
                                                        if (!empty($file_software_assoc["$directory/$file"]))
                                                        {
                                                            $version_check = $md5_sum_versions[$file_software_assoc["$directory/$file"]];
                                                        }
                                                        else
                                                        {
                                                            $version_check = $md5_sum_versions['vbulletin'];
                                                        }
                                                        if (strtolower(trim($matches[1])) != strtolower($version_check))
                                                        {
                                                            $check_md5 = false;
                                                            $errors["$directory"]["$file"][] = construct_phrase($this->phrase['core']['file_version_mismatch_x_expected_y'], htmlspecialchars_uni($matches[1]), htmlspecialchars_uni($version_check));
                                                        }
                                                        break;
                                                    }
                                                }
                                                fclose($fp);
                                            }
                                            if ($check_md5 AND md5(str_replace("\r\n", "\n", file_get_contents(DIR . $directory . '/' . $file))) != $md5_sums["$file"])
                                            {
                                                $errors["$directory"]["$file"][] = $this->phrase['core']['file_contents_mismatch'];
                                            }
                                        }
                                        else
                                        {
                                            // file exists, but we can't read it
                                            $errors["$directory"]["$file"][] = $this->phrase['core']['file_not_readable'];
                                        }
                                    }
                                    else
                                    {
                                        // file is not listed in the md5_sums files
                                        //$errors["$directory"]["$file"][] = $this->phrase['core']['file_not_recognized'];
                                    }
                                    $md5_sums["$file"] = true;
                                }

        جایگزین کنید با:
        PHP Code:
        if (isset($md5_sums[$file]) && $md5_sums[$file])
        {
            $check_md5 = true;
        
            if (is_readable(DIR . $directory . '/' . $file))
            {
                // valid, readable file -- try to match the contents and version
                if (in_array($ext, array('.php', '.js')) AND $fp = @fopen(DIR . $directory . '/' . $file, 'rb'))
                {
                    $linenumber = 0;
                    $finished = false;
                    $matches = array();
        
                    while ($line = fgets($fp, 4096) AND $linenumber <= 10)
                    {
                        if ($ext == '.php' AND preg_match('#\|\| \# vBulletin[^0-9]* (\d.*?) -#si', $line, $matches))
                        {
                            $finished = true;
                        }
                        else if (preg_match('#^\|\| \# vBulletin[^0-9]* (\d.*)$#si', $line, $matches))
                        {
                            $finished = true;
                        }
        
                        $linenumber++;
        
                        if ($finished)
                        {
                            if (!empty($file_software_assoc["$directory/$file"]))
                            {
                                $version_check = $md5_sum_versions[$file_software_assoc["$directory/$file"]];
                            }
                            else
                            {
                                $version_check = $md5_sum_versions['vbulletin'];
                            }
        
                            if (strtolower(trim($matches[1])) != strtolower($version_check))
                            {
                                $check_md5 = false;
                                $errors["$directory"]["$file"][] = construct_phrase($this->phrase['core']['file_version_mismatch_x_expected_y'], htmlspecialchars_uni($matches[1]), htmlspecialchars_uni($version_check));
                            }
                            break;
                        }
                    }
                    fclose($fp);
                }
        
                if ($check_md5 AND md5(str_replace("\r\n", "\n", file_get_contents(DIR . $directory . '/' . $file))) != $md5_sums["$file"])
                {
                    $errors["$directory"]["$file"][] = $this->phrase['core']['file_contents_mismatch'];
                }
            }
            else
            {
                $errors["$directory"]["$file"][] = $this->phrase['core']['file_not_readable'];
            }
        }
        else
        {
            // file is not listed in the md5_sums files
        }
        
        $md5_sums["$file"] = true;​ 
        
        Copyright © coffeenetmavara, All Rights Reserved

        نظر

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

          #19
          رفع خطای:
          کد HTML:
          Parse error: syntax error, unexpected token "else" in C:\xampp\htdocs\vb\install\includes\class_upgrade.php on line 1189


          پیدا کنید:
          کد:
          105 تا 1193:
          foreach ($md5_sums_array AS $directory => $md5_sums)
                      {
                          foreach ($ignored_dirs AS $ignored_dir)
                          {
                              if (substr($directory, 0, strlen($ignored_dir)) == $ignored_dir)
                              {
                                  // directory is an ignored directory, skip the contents
                                  continue 2;
                              }
                          }
          
                          $handle = @opendir(DIR . $directory);
          
          if ($handle)
          {
              $file_count["$directory"] = 0;
          
              while ($file = readdir($handle))
              {
                  if ($file == '.' OR $file == '..')
                  {
                      continue;
                  }
          
                  if (is_file(DIR . "$directory/$file") AND !in_array("$directory/$file", $ignored_files) AND substr($file, 0, 1) != '.' AND in_array($ext = '.' . file_extension($file), $extensions))
                  {
                      $file_count["$directory"]++;
          
                      if ($file == 'index.html' AND trim(file_get_contents(DIR . $directory . '/' . $file)) == '')
                      {
                          continue;
                      }
          
                      // Check if file has a record in the MD5 sums array
                      if (isset($md5_sums[$file]) AND $md5_sums[$file])
                      {
                          $check_md5 = true;
          
                          if (is_readable(DIR . $directory . '/' . $file))
                          {
                              if (in_array($ext, array('.php', '.js')) AND $fp = @fopen(DIR . $directory . '/' . $file, 'rb'))
                              {
                                  $linenumber = 0;
                                  $finished = false;
                                  $matches = array();
          
                                  while ($line = fgets($fp, 4096) AND $linenumber <= 10)
                                  {
                                      if ($ext == '.php' AND preg_match('#\|\| \# vBulletin[^0-9]* (\d.*?) -#si', $line, $matches))
                                      {
                                          $finished = true;
                                      }
                                      else if (preg_match('#^\|\| \# vBulletin[^0-9]* (\d.*)$#si', $line, $matches))
                                      {
                                          $finished = true;
                                      }
          
                                      $linenumber++;
          
                                      if ($finished)
                                      {
                                          if (!empty($file_software_assoc["$directory/$file"]))
                                          {
                                              $version_check = $md5_sum_versions[$file_software_assoc["$directory/$file"]];
                                          }
                                          else
                                          {
                                              $version_check = $md5_sum_versions['vbulletin'];
                                          }
          
                                          if (strtolower(trim($matches[1])) != strtolower($version_check))
                                          {
                                              $check_md5 = false;
                                              $errors["$directory"]["$file"][] = construct_phrase($this->phrase['core']['file_version_mismatch_x_expected_y'], htmlspecialchars_uni($matches[1]), htmlspecialchars_uni($version_check));
                                          }
          
                                          break;
                                      }
                                  }
          
                                  fclose($fp);
                              }
          
                              if ($check_md5 AND md5(str_replace("\r\n", "\n", file_get_contents(DIR . $directory . '/' . $file))) != $md5_sums[$file])
                              {
                                  $errors["$directory"]["$file"][] = $this->phrase['core']['file_contents_mismatch'];
                              }
                          }
                          else
                          {
                              $errors["$directory"]["$file"][] = $this->phrase['core']['file_not_readable'];
                          }
                      }
                      else
                      {
                          // File is not listed in the MD5 sums files
                          //$errors["$directory"]["$file"][] = $this->phrase['core']['file_not_recognized'];
                      }
          
                      $md5_sums["$file"] = true;
                  }
              }
          
              // Check for files listed in MD5 sums that were not found
              foreach ($md5_sums AS $file => $value)
              {
                  if ($value !== true AND !in_array("$directory/$file", $ignored_files))
                  {
                      $errors["$directory"]["$file"][] = $this->phrase['core']['file_not_found'];
                  }
              }
          
              closedir($handle);
          }
          
                      ksort($file_count);
          
                      if (!empty($errors))
                      {
                          $errorstring = $this->phrase['core']['suspect_files_detected'];
                      }
                      foreach ($file_count AS $directory => $file_count)
                      {
                          if (is_array($errors["$directory"]))
                          {
                              ksort($errors["$directory"]);
          
                              foreach ($errors["$directory"] AS $file => $error)
                              {
                                  $filename = $directory != '/' ? "$directory/$file" : "/$file";
                                  $errorstring .= "<br /><strong>$filename</strong> - " . implode('<br />', $error);
                              }
                          }
                      }
                      if ($errorstring)
                      {
                          $this->startup_file_errors[] = $errorstring;
                      }
                  }
                  else
                  {
                      $this->startup_file_errors[] = $this->phrase['core']['unable_to_read_md5_sums'];
                  }
              }


          جایگزین کنید با:
          PHP Code:
          foreach ($md5_sums_array AS $directory => $md5_sums)
          {
              foreach ($ignored_dirs AS $ignored_dir)
              {
                  if (substr($directory, 0, strlen($ignored_dir)) == $ignored_dir)
                  {
                      continue 2;
                  }
              }
          
              $handle = @opendir(DIR . $directory);
          
              if ($handle)
              {
                  $file_count[$directory] = 0;
          
                  while ($file = readdir($handle))
                  {
                      if ($file == '.' OR $file == '..')
                      {
                          continue;
                      }
          
                      if (
                          is_file(DIR . "$directory/$file")
                          AND !in_array("$directory/$file", $ignored_files)
                          AND substr($file, 0, 1) != '.'
                          AND in_array($ext = '.' . file_extension($file), $extensions)
                      )
                      {
                          $file_count[$directory]++;
          
                          if ($file == 'index.html' AND trim(file_get_contents(DIR . $directory . '/' . $file)) == '')
                          {
                              continue;
                          }
          
                          if (isset($md5_sums[$file]) AND $md5_sums[$file])
                          {
                              $check_md5 = true;
          
                              if (is_readable(DIR . $directory . '/' . $file))
                              {
                                  if (in_array($ext, array('.php', '.js')) AND $fp = @fopen(DIR . $directory . '/' . $file, 'rb'))
                                  {
                                      $linenumber = 0;
                                      $finished = false;
                                      $matches = array();
          
                                      while (($line = fgets($fp, 4096)) AND $linenumber <= 10)
                                      {
                                          if ($ext == '.php' AND preg_match('#\|\| \# vBulletin[^0-9]* (\d.*?) -#si', $line, $matches))
                                          {
                                              $finished = true;
                                          }
                                          else if (preg_match('#^\|\| \# vBulletin[^0-9]* (\d.*)$#si', $line, $matches))
                                          {
                                              $finished = true;
                                          }
          
                                          $linenumber++;
          
                                          if ($finished)
                                          {
                                              if (!empty($file_software_assoc["$directory/$file"]))
                                              {
                                                  $version_check = $md5_sum_versions[$file_software_assoc["$directory/$file"]];
                                              }
                                              else
                                              {
                                                  $version_check = $md5_sum_versions['vbulletin'];
                                              }
          
                                              if (strtolower(trim($matches[1])) != strtolower($version_check))
                                              {
                                                  $check_md5 = false;
                                                  $errors[$directory][$file][] = construct_phrase(
                                                      $this->phrase['core']['file_version_mismatch_x_expected_y'],
                                                      htmlspecialchars_uni($matches[1]),
                                                      htmlspecialchars_uni($version_check)
                                                  );
                                              }
          
                                              break;
                                          }
                                      }
          
                                      fclose($fp);
                                  }
          
                                  if ($check_md5 AND md5(str_replace("\r\n", "\n", file_get_contents(DIR . $directory . '/' . $file))) != $md5_sums[$file])
                                  {
                                      $errors[$directory][$file][] = $this->phrase['core']['file_contents_mismatch'];
                                  }
                              }
                              else
                              {
                                  $errors[$directory][$file][] = $this->phrase['core']['file_not_readable'];
                              }
                          }
          
                          $md5_sums[$file] = true;
                      }
                  }
          
                  foreach ($md5_sums AS $file => $value)
                  {
                      if ($value !== true AND !in_array("$directory/$file", $ignored_files))
                      {
                          $errors[$directory][$file][] = $this->phrase['core']['file_not_found'];
                      }
                  }
          
                  closedir($handle);
              }
          }
          
          ksort($file_count);
          
          if (!empty($errors))
          {
              $errorstring = $this->phrase['core']['suspect_files_detected'];
          }
          
          foreach ($file_count AS $directory => $file_count)
          {
              if (isset($errors[$directory]) AND is_array($errors[$directory]))
              {
                  ksort($errors[$directory]);
          
                  foreach ($errors[$directory] AS $file => $error)
                  {
                      $filename = $directory != '/' ? "$directory/$file" : "/$file";
                      $errorstring .= "<br /><strong>$filename</strong> - " . implode('<br />', $error);
                  }
              }
          }
          
          if (!empty($errorstring))
          {
              $this->startup_file_errors[] = $errorstring;
          }
          }
          else
          {
              $this->startup_file_errors[] = $this->phrase['core']['unable_to_read_md5_sums'];
          }
          }
          ​ 
          
          Copyright © coffeenetmavara, All Rights Reserved

          نظر

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

            #20
            رفع خطای:
            کد:
            Deprecated: Creation of dynamic property vB_Upgrade_skimlinks::$phrase is deprecated in C:\xampp\htdocs\vb\install\includes\class_upgrade.php on line 1430
            
            Deprecated: Creation of dynamic property vB_Upgrade_forumrunner::$phrase is deprecated in C:\xampp\htdocs\vb\install\includes\class_upgrade.php on line 1430
            
            Deprecated: Creation of dynamic property vB_Upgrade_final::$phrase is deprecated in C:\xampp\htdocs\vb\install\includes\class_upgrade.php on line 1430
            
            Deprecated: Creation of dynamic property vB_Upgrade_vbblog::$phrase is deprecated in C:\xampp\htdocs\vb\install\includes\class_upgrade.php on line 1430
            
            Deprecated: Creation of dynamic property vB_Upgrade_vbcms::$phrase is deprecated in C:\xampp\htdocs\vb\install\includes\class_upgrade.php on line 1430
            Deprecated: Creation of dynamic property vB_Upgrade_install::$phrase is deprecated in C:\xampp\htdocs\vb\install\includes\class_upgrade.php on line 1430



            فایل class_upgrade.php رو باز کنید و پیدا کنید:
            کد:
            همون خطا کد کامل:
            public function __construct(&$registry, $phrase, $maxversion)
                {
                    if (is_object($registry))
                    {
                        $this->registry =& $registry;
                        $this->db =& $this->registry->db;
                        if (VB_AREA == 'Upgrade')
                        {
                            if (!isset($this->registry->options['upgrade_from']) OR empty($this->registry->options['upgrade_from']))
                            {
                                $this->set_new_option('upgrade_from', 'version', $this->registry->options['templateversion'], 'string', '' );
                                $this->registry->options['upgrade_from'] =  $this->registry->options['templateversion'];
                            }
                        }
                    }
                    else
                    {
                        trigger_error('vB_Upgrade: $this->registry is not an object.', E_USER_ERROR);
                    }
            
                    $this->phrase =& $phrase;
                    $this->maxversion = $maxversion;
            
                    foreach(get_class_methods($this) AS $method_name)
                    {
                        if (preg_match('#^step_(\d+)$#', $method_name, $matches))
                        {
                            $this->stepcount++;
                        }
                    }
            
                    // Maintain backwards compatibility with install system
                    require_once(DIR . '/install/functions_installupgrade.php');
                    $this->hightrafficengine = get_high_concurrency_table_engine($this->db);
                    require_once(DIR . '/includes/class_dbalter.php');
            
            
                }​

            تغییر بدید به:
            کد:
            public function __construct(&$registry, $phrase, $maxversion)
            {
                if (is_object($registry))
                {
                    $this->registry =& $registry;
                    $this->db =& $this->registry->db;
            
                    if (VB_AREA == 'Upgrade')
                    {
                        if (!isset($this->registry->options['upgrade_from']) OR empty($this->registry->options['upgrade_from']))
                        {
                            $this->set_new_option(
                                'upgrade_from',
                                'version',
                                $this->registry->options['templateversion'],
                                'string',
                                ''
                            );
            
                            $this->registry->options['upgrade_from'] = $this->registry->options['templateversion'];
                        }
                    }
                }
                else
                {
                    trigger_error('vB_Upgrade: $this->registry is not an object.', E_USER_ERROR);
                }
            
                $this->phrase =& $phrase;
                $this->maxversion = $maxversion;
            
                foreach (get_class_methods($this) AS $method_name)
                {
                    if (preg_match('#^step_(\d+)$#', $method_name, $matches))
                    {
                        $this->stepcount++;
                    }
                }
            
                // Maintain backwards compatibility with install system
                require_once(DIR . '/install/functions_installupgrade.php');
                $this->hightrafficengine = get_high_concurrency_table_engine($this->db);
                require_once(DIR . '/includes/class_dbalter.php');
            }​
            Copyright © coffeenetmavara, All Rights Reserved

            نظر

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

              #21
              رفع خطای:
              کد:
              Deprecated: Creation of dynamic property vB_Upgrade_install::$phrase is deprecated in C:\xampp\htdocs\vb\install\includes\class_upgrade.php on line 1438
              
              Deprecated: Creation of dynamic property vB_Upgrade_skimlinks::$phrase is deprecated in C:\xampp\htdocs\vb\install\includes\class_upgrade.php on line 1438
              
              Deprecated: Creation of dynamic property vB_Upgrade_forumrunner::$phrase is deprecated in C:\xampp\htdocs\vb\install\includes\class_upgrade.php on line 1438
              
              Deprecated: Creation of dynamic property vB_Upgrade_final::$phrase is deprecated in C:\xampp\htdocs\vb\install\includes\class_upgrade.php on line 1438
              
              Deprecated: Creation of dynamic property vB_Upgrade_vbblog::$phrase is deprecated in C:\xampp\htdocs\vb\install\includes\class_upgrade.php on line 1438
              
              Deprecated: Creation of dynamic property vB_Upgrade_vbcms::$phrase is deprecated in C:\xampp\htdocs\vb\install\includes\class_upgrade.php on line 1438


              پیدا کنید:
              کد:
              ```
              abstract class vB_Upgrade_Version
              {
                  /*Constants=====================================================================*/
                  const MYSQL_ERROR_CANT_CREATE_TABLE       = 1005;
                  const MYSQL_ERROR_TABLE_EXISTS            = 1050;
                  const MYSQL_ERROR_COLUMN_EXISTS           = 1060;
                  const MYSQL_ERROR_KEY_EXISTS              = 1061;
                  const MYSQL_ERROR_UNIQUE_CONSTRAINT       = 1062;
                  const MYSQL_ERROR_PRIMARY_KEY_EXISTS      = 1068;
                  const MYSQL_ERROR_DROP_KEY_COLUMN_MISSING = 1091;
                  const MYSQL_ERROR_TABLE_MISSING           = 1146;
                  const FIELD_DEFAULTS                      = '__use_default__';
                  const PHP_TRIGGER_ERROR                   = 1;
                  const MYSQL_HALT                          = 2;
                  const MYSQL_ERROR                         = 3;
                  const APP_CREATE_TABLE_EXISTS             = 4;
              
                  /*Properties====================================================================*/
                  /**
                  * Number of substeps in this step
                  *
                  * @var int;
                  */
                  public $stepcount = 0;
              
                  /**
                  * The vBulletin registry object
                  *
                  * @var    vB_Registry
                  */
                  protected $registry = null;
              
                  /**
                  * The object that will be used to execute queries
                  *
                  * @var    vB_Database
                  */
                  protected $db = null;
              
                  /**
                  * A list of modifications to be made when execute is called.
                  *
                  * @var    array
                  */
                  protected $modifications = array();
              
                  /**
                  * List of various messages to send back to the delegate class
                  *
                  * @var    array
                  */
                  protected $response = array();
              
                  /**
                  * A cache of table alter objects, to reduce the amount of overhead
                  * when there are multiple alters to a single table.
                  *
                  * @var    array
                  */
                  public $alter_cache = array();
              
                  /**
                  *    Do we support innodb?
                  *
                  * @var string
                  */
                  protected $hightrafficengine = 'MyISAM';
              
                  /**
                  * Identifier of library that called this script - cli and ajax at present
                  *
                  * @var     string
                  */
                  public $caller = '';
              
                  /**
                  * Set to true if step queries are to be $perpage limited, yes for Ajax, no for CLI
                  *
                  * @var     boolean
                  */
                  public $limitqueries = true;
              
                      /**
                  * Identifier of max upgrade version for library scripts
                  *
                  * @var     string
                  */
                  public $maxversion = '';
              
                  /**
                  * Constructor.
                  *
                  * @param    vB_Registry    Reference to registry object
                  * @param    Array        Phrases
                  * @param    string    Max upgrade version
                  */
                  public function __construct(&$registry, $phrase, $maxversion)
              {
                  if (is_object($registry))
                  {
                      $this->registry =& $registry;
                      $this->db =& $this->registry->db;
              
                      if (VB_AREA == 'Upgrade')
                      {
                          if (!isset($this->registry->options['upgrade_from']) OR empty($this->registry->options['upgrade_from']))
                          {
                              $this->set_new_option(
                                  'upgrade_from',
                                  'version',
                                  $this->registry->options['templateversion'],
                                  'string',
                                  ''
                              );
              
                              $this->registry->options['upgrade_from'] = $this->registry->options['templateversion'];
                          }
                      }
                  }
                  else
                  {
                      trigger_error('vB_Upgrade: $this->registry is not an object.', E_USER_ERROR);
                  }
              
                  $this->phrase =& $phrase;
                  $this->maxversion = $maxversion;
              
                  foreach (get_class_methods($this) AS $method_name)
                  {
                      if (preg_match('#^step_(\d+)$#', $method_name, $matches))
                      {
                          $this->stepcount++;
                      }
                  }
              
                  // Maintain backwards compatibility with install system
                  require_once(DIR . '/install/functions_installupgrade.php');
                  $this->hightrafficengine = get_high_concurrency_table_engine($this->db);
                  require_once(DIR . '/includes/class_dbalter.php');
              }
              ```​


              تغییر بدید به:
              کد:
              #[\AllowDynamicProperties]
              abstract class vB_Upgrade_Version
              {
                  /*Constants=====================================================================*/
                  const MYSQL_ERROR_CANT_CREATE_TABLE       = 1005;
                  const MYSQL_ERROR_TABLE_EXISTS            = 1050;
                  const MYSQL_ERROR_COLUMN_EXISTS           = 1060;
                  const MYSQL_ERROR_KEY_EXISTS              = 1061;
                  const MYSQL_ERROR_UNIQUE_CONSTRAINT       = 1062;
                  const MYSQL_ERROR_PRIMARY_KEY_EXISTS      = 1068;
                  const MYSQL_ERROR_DROP_KEY_COLUMN_MISSING = 1091;
                  const MYSQL_ERROR_TABLE_MISSING           = 1146;
                  const FIELD_DEFAULTS                      = '__use_default__';
                  const PHP_TRIGGER_ERROR                   = 1;
                  const MYSQL_HALT                          = 2;
                  const MYSQL_ERROR                         = 3;
                  const APP_CREATE_TABLE_EXISTS             = 4;
              
                  /*Properties====================================================================*/
                  /**
                  * Number of substeps in this step
                  *
                  * @var int
                  */
                  public $stepcount = 0;
              
                  /**
                  * The vBulletin registry object
                  *
                  * @var    vB_Registry
                  */
                  protected $registry = null;
              
                  /**
                  * The object that will be used to execute queries
                  *
                  * @var    vB_Database
                  */
                  protected $db = null;
              
                  /**
                  * A list of modifications to be made when execute is called.
                  *
                  * @var    array
                  */
                  protected $modifications = array();
              
                  /**
                  * List of various messages to send back to the delegate class
                  *
                  * @var    array
                  */
                  protected $response = array();
              
                  /**
                  * A cache of table alter objects, to reduce the amount of overhead
                  * when there are multiple alters to a single table.
                  *
                  * @var    array
                  */
                  public $alter_cache = array();
              
                  /**
                  *    Do we support innodb?
                  *
                  * @var string
                  */
                  protected $hightrafficengine = 'MyISAM';
              
                  /**
                  * Identifier of library that called this script - cli and ajax at present
                  *
                  * @var     string
                  */
                  public $caller = '';
              
                  /**
                  * Set to true if step queries are to be $perpage limited, yes for Ajax, no for CLI
                  *
                  * @var     boolean
                  */
                  public $limitqueries = true;
              
                  /**
                  * Identifier of max upgrade version for library scripts
                  *
                  * @var     string
                  */
                  public $maxversion = '';
              
                  /**
                  * Phrases array (was previously undeclared dynamic property)
                  *
                  * @var    array
                  */
                  protected $phrase = array();
              
                  /**
                  * Constructor.
                  *
                  * @param    vB_Registry    Reference to registry object
                  * @param    Array        Phrases
                  * @param    string    Max upgrade version
                  */
                  public function __construct(&$registry, $phrase, $maxversion)
                  {
                      if (is_object($registry))
                      {
                          $this->registry =& $registry;
                          $this->db =& $this->registry->db;
              
                          if (defined('VB_AREA') && VB_AREA == 'Upgrade')
                          {
                              $options = (isset($this->registry->options) && is_array($this->registry->options))
                                  ? $this->registry->options
                                  : array();
              
                              $templateversion = $options['templateversion'] ?? '';
                              $upgrade_from = $options['upgrade_from'] ?? '';
              
                              if ($upgrade_from === '' || $upgrade_from === null)
                              {
                                  $this->set_new_option(
                                      'upgrade_from',
                                      'version',
                                      $templateversion,
                                      'string',
                                      ''
                                  );
              
                                  if (isset($this->registry->options) && is_array($this->registry->options))
                                  {
                                      $this->registry->options['upgrade_from'] = $templateversion;
                                  }
                              }
                          }
                      }
                      else
                      {
                          trigger_error('vB_Upgrade: $this->registry is not an object.', E_USER_ERROR);
                      }
              
                      $this->phrase =& $phrase;
                      $this->maxversion = $maxversion;
              
                      foreach (get_class_methods($this) AS $method_name)
                      {
                          if (preg_match('#^step_(\d+)$#', $method_name, $matches))
                          {
                              $this->stepcount++;
                          }
                      }
              
                      // Maintain backwards compatibility with install system
                      require_once(DIR . '/install/functions_installupgrade.php');
                      $this->hightrafficengine = get_high_concurrency_table_engine($this->db);
                      require_once(DIR . '/includes/class_dbalter.php');
                  }​
              Copyright © coffeenetmavara, All Rights Reserved

              نظر

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

                #22
                رفع خطای :
                کد:
                Warning: Undefined array key "step" in C:\xampp\htdocs\vb\install\includes\class_upgrade_ajax.php on line 252



                پیدا کنید:
                کد:
                protected function begin_upgrade($version, $only = false)
                    {
                        if ($this->registry->GPC['ajax'])
                        {
                            return;
                        }
                        $script = $this->load_script($version);
                        $this->registry->input->clean_array_gpc('p', array(
                            'version' => TYPE_NOHTML,
                        ));
                        if (!$this->verify_version($version, $script) AND !in_array($this->registry->GPC['version'], array($version, $this->registry->options['templateversion'])))
                        {
                            $this->htmloptions['mismatch'] = true;
                            $this->htmloptions['version'] = $version;
                        }
                        else
                        {
                            $this->htmloptions['processlog'] = true;
                            if ($this->registry->GPC['version'])
                            {
                                //$this->scriptinfo = $this->get_upgrade_start($this->fetch_short_version($this->registry->GPC['version']));
                                $this->scriptinfo = array(
                                    'version' => $this->fetch_short_version($this->registry->GPC['version']),
                                    'only'    => $only,
                                );
                                $script = $this->load_script($this->scriptinfo['version']);
                            }
                            $process = false;
                            $totalsteps = ($script->stepcount ? $script->stepcount : 1);
                            if ($this->scriptinfo['step'])
                            {
                                $totalsteps = $totalsteps - $this->scriptinfo['step'] + 1;
                            }
                            if (!$only)
                            {
                                foreach ($this->versions AS $version => $longversion)
                                {
                                    $version = strval($version);
                                    if ($this->scriptinfo['version'] === $version)
                                    {
                                        $process = true;
                                        continue;
                                    }
                                    if ($process AND strpos($version, '*') === false)
                                    {
                                        $tempscript = $this->load_script($version);
                                        $totalsteps += $tempscript->stepcount ? $tempscript->stepcount : 1;
                                        unset($tempscript);
                                    }
                                }
                            }
                            $addscripts = array();
                            if (!in_array($script->SHORT_VERSION, $this->endscripts))
                            {
                                $addscripts = array('skimlinks', 'forumrunner', 'final');
                                if ($this->install_suite())
                                {
                                    foreach($this->products AS $product)
                                    {
                                        $addscripts[] = $product;
                                    }
                                }
                                if ($this->setuptype == 'install')
                                {
                                    $this->htmloptions['upgrademessage'] = sprintf($this->phrase['core']['press_button_to_begin_install'], end($this->versions));
                                }
                                else
                                {
                                    $display_version = ($this->registry->GPC['version']) ? $script->LONG_VERSION : $this->registry->options['templateversion'];
                                    $this->htmloptions['upgrademessage'] = sprintf($this->phrase['core']['press_button_to_begin_upgrade'], $display_version, end($this->versions));
                                    $this->htmloptions['suggestconsole'] = $this->is_big_forum();
                                }
                            }
                            else
                            {
                                $addscripts = $this->fetch_additional_scripts($script->SHORT_VERSION);
                                $this->htmloptions['upgrademessage'] = $this->phrase['core']['press_button_to_begin_' . $script->SHORT_VERSION . '_upgrade'];
                            }
                            if (!$only)
                            {
                                foreach ($addscripts AS $scriptname)
                                {
                                    $tempscript = $this->load_script($scriptname);
                                    $totalsteps += $tempscript->stepcount;
                                    unset($tempscript);
                                }
                            }
                            $this->htmloptions['progress'] = $this->phrase['core'][$this->setuptype . '_progress'];
                            $this->htmloptions['upgrading_to_x'] = sprintf($this->phrase['core'][$this->setuptype . 'ing_to_x'], $this->htmloptions['finalversion']);
                            $this->htmloptions['begin_setup'] = $this->phrase['core']['begin_' . $this->setuptype];
                            $this->htmloptions['totalsteps'] = $totalsteps;
                            $this->htmloptions['version'] = $this->scriptinfo['version'];
                            $this->htmloptions['longversion'] = $script->LONG_VERSION;
                            $this->htmloptions['step'] = $this->scriptinfo['step'] ? $this->scriptinfo['step'] : 1;
                            $this->htmloptions['startat'] = intval($this->scriptinfo['startat']);
                            $this->htmloptions['only'] = $this->scriptinfo['only'];
                            $this->htmloptions['status'] =
                                $script->stepcount
                                    ? $this->fetch_status($script->LONG_VERSION, $this->htmloptions['step'], $script->stepcount)
                                    : $this->fetch_status($script->LONG_VERSION);
                            if ($this->startup_errors OR $this->startup_file_errors)
                            {
                                if ($this->startup_file_errors)
                                {
                                    $this->startup_errors = array_merge($this->startup_errors, $this->startup_file_errors);
                                    $this->htmloptions['startup_continue'] = true;
                                }
                              
                                $this->htmloptions['startup_errors'] = '';
                                foreach ($this->startup_errors AS $error)
                                {
                                    $this->htmloptions['startup_errors'] .= "<li>$error</li>";
                                }
                                $this->htmloptions['login'] = false;
                                $this->htmloptions['mismatch'] = false;
                                $this->htmloptions['processlog'] = false;
                            }
                        }
                    }


                تغییر بدید به:
                PHP Code:
                protected function begin_upgrade($version, $only = false)
                {
                    if (!empty($this->registry->GPC['ajax']))
                    {
                        return;
                    }
                    $script = $this->load_script($version);
                
                    $this->registry->input->clean_array_gpc('p', array(
                        'version' => TYPE_NOHTML,
                    ));
                
                    $gpc_version = $this->registry->GPC['version'] ?? '';
                    $templateversion = $this->registry->options['templateversion'] ?? '';
                
                    if (!$this->verify_version($version, $script) AND !in_array($gpc_version, array($version, $templateversion), true))
                    {
                        $this->htmloptions['mismatch'] = true;
                        $this->htmloptions['version'] = $version;
                    }
                    else
                    {
                        $this->htmloptions['processlog'] = true;
                        if ($gpc_version)
                        {
                            $this->scriptinfo = array(
                                'version' => $this->fetch_short_version($gpc_version),
                                'only'    => $only,
                                'step'    => 1,
                                'startat' => 0,
                            );
                            $script = $this->load_script($this->scriptinfo['version']);
                        }
                
                        // Ensure scriptinfo keys always exist
                        if (!isset($this->scriptinfo['step']))
                        {
                            $this->scriptinfo['step'] = 1;
                        }
                        if (!isset($this->scriptinfo['startat']))
                        {
                            $this->scriptinfo['startat'] = 0;
                        }
                        if (!isset($this->scriptinfo['only']))
                        {
                            $this->scriptinfo['only'] = $only;
                        }
                        if (!isset($this->scriptinfo['version']))
                        {
                            $this->scriptinfo['version'] = $version;
                        }
                
                        $process = false;
                        $totalsteps = (!empty($script->stepcount) ? $script->stepcount : 1);
                        if (!empty($this->scriptinfo['step']))
                        {
                            $totalsteps = $totalsteps - $this->scriptinfo['step'] + 1;
                        }
                
                        if (!$only)
                        {
                            foreach ($this->versions AS $ver => $longversion)
                            {
                                $ver = strval($ver);
                                if ($this->scriptinfo['version'] === $ver)
                                {
                                    $process = true;
                                    continue;
                                }
                                if ($process AND strpos($ver, '*') === false)
                                {
                                    $tempscript = $this->load_script($ver);
                                    $totalsteps += !empty($tempscript->stepcount) ? $tempscript->stepcount : 1;
                                    unset($tempscript);
                                }
                            }
                        }
                
                        $addscripts = array();
                        $short_version = $script->SHORT_VERSION ?? '';
                
                        if (!in_array($short_version, $this->endscripts))
                        {
                            $addscripts = array('skimlinks', 'forumrunner', 'final');
                            if ($this->install_suite())
                            {
                                foreach ($this->products AS $product)
                                {
                                    $addscripts[] = $product;
                                }
                            }
                            $core = (isset($this->phrase['core']) && is_array($this->phrase['core'])) ? $this->phrase['core'] : array();
                
                            if ($this->setuptype == 'install')
                            {
                                $this->htmloptions['upgrademessage'] = sprintf(
                                    $core['press_button_to_begin_install'] ?? 'Press button to begin install to %s',
                                    end($this->versions)
                                );
                            }
                            else
                            {
                                $display_version = $gpc_version ? ($script->LONG_VERSION ?? '') : $templateversion;
                                $this->htmloptions['upgrademessage'] = sprintf(
                                    $core['press_button_to_begin_upgrade'] ?? 'Press button to begin upgrade from %s to %s',
                                    $display_version,
                                    end($this->versions)
                                );
                                $this->htmloptions['suggestconsole'] = $this->is_big_forum();
                            }
                        }
                        else
                        {
                            $addscripts = $this->fetch_additional_scripts($short_version);
                            $core = (isset($this->phrase['core']) && is_array($this->phrase['core'])) ? $this->phrase['core'] : array();
                            $key = 'press_button_to_begin_' . $short_version . '_upgrade';
                            $this->htmloptions['upgrademessage'] = $core[$key] ?? ('Press button to begin ' . $short_version . ' upgrade');
                        }
                
                        if (!$only)
                        {
                            foreach ($addscripts AS $scriptname)
                            {
                                $tempscript = $this->load_script($scriptname);
                                $totalsteps += intval($tempscript->stepcount ?? 0);
                                unset($tempscript);
                            }
                        }
                
                        $core = (isset($this->phrase['core']) && is_array($this->phrase['core'])) ? $this->phrase['core'] : array();
                
                        $this->htmloptions['progress'] = $core[$this->setuptype . '_progress'] ?? 'Progress';
                        $this->htmloptions['upgrading_to_x'] = sprintf(
                            $core[$this->setuptype . 'ing_to_x'] ?? '%s to %s',
                            $this->htmloptions['finalversion'] ?? ''
                        );
                        $this->htmloptions['begin_setup'] = $core['begin_' . $this->setuptype] ?? ('Begin ' . $this->setuptype);
                        $this->htmloptions['totalsteps'] = $totalsteps;
                        $this->htmloptions['version'] = $this->scriptinfo['version'];
                        $this->htmloptions['longversion'] = $script->LONG_VERSION ?? '';
                        $this->htmloptions['step'] = !empty($this->scriptinfo['step']) ? $this->scriptinfo['step'] : 1;
                        $this->htmloptions['startat'] = intval($this->scriptinfo['startat'] ?? 0);
                        $this->htmloptions['only'] = $this->scriptinfo['only'] ?? false;
                        $this->htmloptions['status'] =
                            !empty($script->stepcount)
                                ? $this->fetch_status($script->LONG_VERSION ?? '', $this->htmloptions['step'], $script->stepcount)
                                : $this->fetch_status($script->LONG_VERSION ?? '');
                
                        if (!empty($this->startup_errors) OR !empty($this->startup_file_errors))
                        {
                            if (!empty($this->startup_file_errors))
                            {
                                $this->startup_errors = array_merge(
                                    is_array($this->startup_errors) ? $this->startup_errors : array(),
                                    $this->startup_file_errors
                                );
                                $this->htmloptions['startup_continue'] = true;
                            }
                
                            $this->htmloptions['startup_errors'] = '';
                            foreach ((array)$this->startup_errors AS $error)
                            {
                                $this->htmloptions['startup_errors'] .= "<li>$error</li>";
                            }
                            $this->htmloptions['login'] = false;
                            $this->htmloptions['mismatch'] = false;
                            $this->htmloptions['processlog'] = false;
                        }
                    }
                }​ 
                
                Copyright © coffeenetmavara, All Rights Reserved

                نظر

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

                  #23
                  رفع خطای:
                  کد:
                  Warning: Undefined array key "templateversion" in C:\xampp\htdocs\vb\install\includes\class_upgrade_ajax.php on line 756



                  پیدا کنید:
                  کد:
                  private function print_html()
                      {
                          header('Expires: ' . gmdate('D, d M Y H:i:s', TIMENOW) . ' GMT');
                          header('Last-Modified: ' . gmdate('D, d M Y H:i:s', TIMENOW) . ' GMT');
                          $hiddenfields = '';
                          if ($this->registry->GPC['version'])
                          {
                              $hiddenfields = "<input type=\"hidden\" name=\"version\" value=\"{$this->registry->GPC['version']}\" />";
                          }
                          $hiddenfields .= "
                              <input type=\"hidden\" name=\"step\" value=\"{$this->registry->GPC['step']}\" />
                              <input type=\"hidden\" name=\"startat\" value=\"{$this->registry->GPC['startat']}\" />
                              <input type=\"hidden\" name=\"only\" value=\"{$this->registry->GPC['only']}\" />
                          ";
                          if ($this->htmloptions['startup_errors'])
                          {
                              $this->htmloptions['startup_errors'] = preg_replace('#(?<!\<)/(?!\>)#s', '<img src="" alt="" />/', $this->htmloptions['startup_errors']);
                          }
                            
                          $output_version = defined('ADMIN_VERSION_VBULLETIN') ? ADMIN_VERSION_VBULLETIN : ($this->registry->options['templateversion'] ? $this->registry->options['templateversion'] : $this->htmloptions['finalversion']);
                          ?>
                          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                          <html xmlns="http://www.w3.org/1999/xhtml" dir="<?php echo vB_Template_Runtime::fetchStyleVar('textdirection'); ?>" lang="<?php echo vB_Template_Runtime::fetchStyleVar('languagecode'); ?>">
                          <head>
                              <meta http-equiv="Content-Type" content="text/html; charset=<?php echo vB_Template_Runtime::fetchStyleVar('charset'); ?>" />
                              <meta http-equiv="Expires" content="Sat, 26 Jul 1997 05:00:00 GMT" />
                              <meta http-equiv="Pragma" content="no-cache, must-revalidate" />
                              <title><?php echo $this->htmloptions['setuptypetitle'] . " " . $steptitle; ?></title>
                              <link rel="stylesheet" href="<?php echo "../cpstyles/{$this->registry->options['cpstylefolder']}/controlpanel.css"; ?>" />
                              <style type="text/css">
                              body {
                                  margin:0;
                              }
                              #vb_overlay_background {
                                  opacity:0.50;
                                  -moz-opacity:0.50;
                                  filter:alpha(opacity=50);
                                  background-color:#000000;
                                  z-index:10;
                                  position:fixed;
                                  top:0px;
                                  <?php echo vB_Template_Runtime::fetchStyleVar('left'); ?>:0px;
                                  width:100%;
                                  height:100%;
                              }
                              #header {
                                  border:outset 2px;
                                  display:block;
                                  padding:5px;
                              }
                              .floatcontainer:after {
                                  content: ".";
                                  display: block;
                                  height: 0;
                                  clear: both;
                                  visibility: hidden;
                              }
                              .floatcontainer {
                                  display:inline-block;
                              }
                              /* IE-Mac hide \*/
                              * html .floatcontainer {
                                  height:1%;
                              }
                              .floatcontainer {
                                  display:block;
                              }
                              .floatcontainer.hidden {
                                  display:none;
                              }
                              /* End IE-Mac hide */
                              #header div.logo {
                                  width:160px;
                                  float:<?php echo vB_Template_Runtime::fetchStyleVar('left'); ?>;
                              }
                              #header div.notice {
                                  padding-<?php echo vB_Template_Runtime::fetchStyleVar('left'); ?>:220px;
                                  padding-top:18px;
                              }
                              #header div.xml1 {
                                  float:<?php echo vB_Template_Runtime::fetchStyleVar('right'); ?>;
                                  text-align:<?php echo vB_Template_Runtime::fetchStyleVar('right'); ?>;
                                  padding-top:5px;
                              }
                              #header div.xml2 {
                                  float:<?php echo vB_Template_Runtime::fetchStyleVar('right'); ?>;
                                  text-align:<?php echo vB_Template_Runtime::fetchStyleVar('left'); ?>;
                                  padding-top:5px;
                                  padding-<?php echo vB_Template_Runtime::fetchStyleVar('right'); ?>:10px;
                                  margin-<?php echo vB_Template_Runtime::fetchStyleVar('left'); ?>:15px;
                              }
                              #header div.xml1 ul, #header div.xml2 ul {
                                  list-style-type:none;
                                  margin:0;
                                  padding:0;
                                  font-size: 11px;
                                  font-family: tahoma, verdana, arial, helvetica, sans-serif;
                              }
                              #all {
                                  margin: 10px;
                              }
                              #all p, #all td, #all li, #all div {
                                  font-size: 11px;
                                  font-family: verdana, arial, helvetica, sans-serif;
                              }
                              #confirm, #prompt {
                                  z-index:11;
                                  position:absolute;
                              }
                              #prompt div.input {
                                  display:block;
                              }
                              #progressbox, #mismatch, #authenticate, #prompt, #confirm, #startup_errors {
                                  width:375px;
                                  text-align:center;
                                  margin-left:auto;
                                  margin-right:auto;
                                  margin-top:20px;
                              }
                              #startup_errors {
                                  overflow:hidden;
                                  max-height:400px;
                                  _height:400px;              
                              }
                            
                              #startup_errors .messagebody
                              {
                                  text-align:<?php echo vB_Template_Runtime::fetchStyleVar('left'); ?>;
                                  padding:10px;
                                  overflow:auto;
                                  max-height:330px;
                                  _height:330px;
                              }
                              #startup_errors form {
                                  margin:0;
                                  padding:5px;
                              }
                            
                              #startup_errors input[type="submit"] {
                                  margin:0;
                              }
                            
                              #startup_errors li img {
                                  width:0;
                              }
                            
                              #promptmessage, #confirmmessage {
                                  padding:10px;
                                  text-align:<?php echo vB_Template_Runtime::fetchStyleVar('left'); ?>;
                                  overflow:auto;
                                  max-height:400px;
                              }
                              #progresssection .buttons {
                                  text-align:<?php echo vB_Template_Runtime::fetchStyleVar('left'); ?>;
                              }
                              .messageheader {
                                  padding:5px;
                                  font-weight:bold;
                                  text-align:center;
                              }
                              .submit, .messagebody {
                                  padding:5px;
                              }
                              .advancedconfirmbody {
                                  padding-left:10px;
                                  padding-right:10px;
                              }
                              .advancedconfirm .messagebody{
                                  padding:0;
                              }
                              .advancedconfirm #confirmmessage {
                                  padding:0;
                              }
                              .list_no_decoration {
                                  list-style-type:none;
                                  margin:0px;
                                  padding:0px;
                              }
                              #detailbox {
                                  margin: 20px auto;
                                  width:375px;
                              }
                              #promptresponse {
                                  width:90%;
                              }
                              #mainmessage {
                                  height:300px;
                                  overflow:auto;
                                  padding-bottom:10px;
                              }
                              #mainmessage > ul > li {
                                  margin-<?php echo vB_Template_Runtime::fetchStyleVar('left'); ?>:25px;
                                  text-indent:-25px;
                              }
                              #mainmessage > ul > li ol,
                              #mainmessage > ul > li.noindent {
                                  margin-<?php echo vB_Template_Runtime::fetchStyleVar('left'); ?>:0;
                                  text-indent:0;
                              }
                              #mainmessage li.querystatus {}
                              #upgradeprogress {
                                  margin-<?php echo vB_Template_Runtime::fetchStyleVar('right'); ?>:10px;
                                  margin-top:4px;
                                  float:<?php echo vB_Template_Runtime::fetchStyleVar('right'); ?>;
                                  vertical-align:middle;
                              }
                              #progressbar_container {
                                  border:1px outset;
                                  height:16px;
                                  width:95%;
                                  margin:10px auto;
                                  background-color:#FFFFFF;
                                  text-align:<?php echo vB_Template_Runtime::fetchStyleVar('left'); ?>;
                              }
                              #progressbar {
                                  width:0;
                                  height:15px;
                                  padding-top:1px;
                                  background-color:#CCCCCC;
                                  text-align:<?php echo vB_Template_Runtime::fetchStyleVar('right'); ?>;
                                  overflow:auto;
                                  float:<?php echo vB_Template_Runtime::fetchStyleVar('left'); ?>;
                              }
                              #progressbar span {
                                  margin-<?php echo vB_Template_Runtime::fetchStyleVar('right'); ?>: 2px;
                              }
                              #percentageout {
                                  margin-<?php echo vB_Template_Runtime::fetchStyleVar('left'); ?>: 2px;
                                  padding-top:1px;
                                  float:left;
                              }
                              #showdetails, #hidedetails {
                                  margin-<?php echo vB_Template_Runtime::fetchStyleVar('left'); ?>: 7px;
                              }
                              #beginsection {
                                  #padding-bottom:10px;
                              }
                              #confirmform, #promptform {
                                  padding:0;
                                  margin:0;
                              }
                              #optionsbox {
                                  text-align:<?php echo vB_Template_Runtime::fetchStyleVar('left'); ?>
                              }
                            
                              .hidden {
                                  display:none;
                              }
                              .usererror {
                                  display:block;
                                  color:red;
                              }
                              .usererror.hidden {
                                  display:none;
                              }
                              .lbinstallselect {
                                  max-width:180px;
                                  _width:180px;
                              }
                              div.consolemsg {
                                  text-align:<?php echo vB_Template_Runtime::fetchStyleVar('left'); ?>;
                                  padding:10px;
                              }
                              div.consolemsg ul li {
                                  font-weight:bold;
                                  list-style-type:none;
                              }
                  }
                              </style>
                              <script type="text/javascript">
                              <!--
                                  var IMGDIR_MISC = "../cpstyles/<?php echo $this->registry->options['cpstylefolder']; ?>";
                                  var CLEARGIFURL = "./clear.gif";
                                  var VERSION = "<?php echo $this->htmloptions['version']; ?>";
                                  var SCRIPTINFO = {
                                      version: "<?php echo $this->htmloptions['version']; ?>",
                                      startat: "<?php echo $this->htmloptions['startat']; ?>",
                                      step   : "<?php echo $this->htmloptions['step']; ?>",
                                      only   : "<?php echo $this->htmloptions['only']; ?>"
                                  };
                                  var ADMINDIR = "../<?php echo $this->registry->config['Misc']['admincpdir']; ?>";
                                  var TOTALSTEPS = <?php echo intval($this->htmloptions['totalsteps']); ?>;
                                  var ABORTMSG = "<?php echo $this->phrase['core']['status_aborted']; ?>";
                                  var UNEXPECTED_TEXT = "<?php echo $this->phrase['core']['unexpected_text']; ?>";
                                  var SETUPTYPE = "<?php echo $this->setuptype; ?>";
                                  var STEP_X_Y = "<?php echo $this->phrase['core']['step_x_y']; ?>";
                                  var SERVER_NO_RESPONSE = "<?php echo $this->phrase['core']['server_no_response'] ?>";
                              //-->
                              </script>
                              <script type="text/javascript" src="../clientscript/yui/yuiloader-dom-event/yuiloader-dom-event.js"></script>
                              <script type="text/javascript" src="../clientscript/yui/connection/connection-min.js"></script>
                              <script type="text/javascript" src="../clientscript/vbulletin-core.js"></script>
                          </head>
                          <body>
                          <div id="vb_overlay_background" class="hidden"></div>
                          <div id="header" class="navbody floatcontainer">
                              <div class="xml2">
                                  <ul>
                                      <li id="vb_style_version"><?php echo $this->xml_versions['style']; ?></li>
                                      <li id="vb_mobile_style_version"><?php echo $this->xml_versions['mobile-style']; ?></li>
                                      <li id="vb_settings_version"><?php echo $this->xml_versions['settings']; ?></li>
                                      <li id="vb_language_version"><?php echo $this->xml_versions['language']; ?></li>
                                      <li id="vb_navigation_version"><?php echo $this->xml_versions['navigation']; ?></li>
                                      <li id="vb_admin_help_version"><?php echo $this->xml_versions['adminhelp']; ?></li>
                                  </ul>
                              </div>
                              <div class="xml1">
                                  <ul>
                                      <li>vbulletin-style.xml:</li>
                                      <li>vbulletin-mobile-style.xml:</li>                    
                                      <li>vbulletin-settings.xml:</li>
                                      <li>vbulletin-language.xml:</li>
                                      <li>vbulletin-navigation.xml:</li>
                                      <li>vbulletin-adminhelp.xml:</li>
                                  </ul>
                              </div>
                              <div class="logo">
                                  <img src="../cpstyles/<?php echo $this->registry->options['cpstylefolder']; ?>/cp_logo.gif" alt="" title="vBulletin 4 &copy; <?php echo date('Y'); ?> vBulletin Solutions Inc. All rights reserved." />
                              </div>
                              <div class="notice">
                                  <strong><?php echo $this->htmloptions['setuptype']; ?></strong><br />
                                  <?php echo $this->phrase['core']['may_take_some_time']; ?>
                              </div>
                          </div>
                          <div id="all">
                              <div class="tborder<?php if (!$this->htmloptions['startup_errors']) { echo " hidden"; } ?>" id="startup_errors">
                                  <div class="navbody messageheader"><?php echo $this->phrase['core']['startup_errors']; ?></div>
                                  <div class="messagebody logincontrols">
                                      <?php echo $this->phrase['core']['startup_errors_desc']; ?>
                                      <ul>
                                          <li class="hidden"></li>
                                          <?php echo $this->htmloptions['startup_errors']; ?>
                                      </ul>              
                                  </div>
                                  <form action="<?php echo $this->setuptype; ?>.php" method="post" id="submitconfirmform" class="status<?php if (!$this->htmloptions['startup_continue']) { echo ' hidden'; } ?>">
                                      <input class="button" type="submit" name="submit" tabindex="1" accesskey="s" id="submitconfirmok" value="<?php echo $this->phrase['core']['ignore_and_continue']; ?>" />
                                  </form>                
                              </div>
                            
                            
                              <div class="tborder<?php if (!$this->htmloptions['mismatch']) { echo " hidden"; } ?>" id="mismatch">
                                  <div class="navbody messageheader"><?php echo $this->phrase['core']['version_mismatch']; ?></div>
                                  <div class="messagebody logincontrols">
                                      <?php echo construct_phrase($this->phrase['core']['wrong_version'], $this->versions[$this->htmloptions['version']], $this->registry->options['templateversion']); ?>
                                      <form action="upgrade.php" method="post">
                                          <input type="hidden" name="mismatch" value="1" />
                                          <label for="version1"><input id="version1" type="radio" name="version" value="<?php echo htmlspecialchars_uni($this->htmloptions['version']); ?>" /><?php echo construct_phrase($this->phrase['core']['upgrade_from_x'], $this->versions[$this->htmloptions['version']]); ?></label>
                                          <label for="version2"><input id="version2" type="radio" name="version" value="<?php echo htmlspecialchars_uni($this->registry->options['templateversion']); ?>" /><?php echo construct_phrase($this->phrase['core']['upgrade_from_x'], $this->registry->options['templateversion']); ?></label>
                                          <input class="button" type="submit" tabindex="1" accesskey="s" name="" value="<?php echo $this->htmloptions['enter_system'] ?>" />
                                          <?php echo $hiddenfields ?>
                                      </form>
                                  </div>
                              </div>
                              <div class="tborder<?php if (!$this->htmloptions['processlog']) { echo " hidden"; } ?>" id="progressbox">
                                  <div class="navbody messageheader"><?php echo $this->htmloptions['upgrading_to_x']; ?></div>
                                  <div class="messagebody logincontrols">
                                      <div class="hidden" id="progresssection">
                                          <div id="progressmessage"><?php echo $this->htmloptions['status'] ?></div>
                                          <div id="progressbar_container">
                                              <div id="progressbar"></div>
                                              <div id="percentageout"></div>
                                          </div>
                                          <div id="progressnotice"></div>
                                          <div class="buttons floatcontainer">
                                              <img id="upgradeprogress" class="hidden" src="../cpstyles/<?php echo $this->registry->options['cpstylefolder']; ?>/progress.gif" alt="" />
                                              <input class="button" type="button" id="showdetails" tabindex="1" name="" value="<?php echo $this->phrase['core']['show_details'] ?>" />
                                              <input class="button hidden" type="button" id="hidedetails" tabindex="1" name="" value="<?php echo $this->phrase['core']['hide_details'] ?>" />
                                              <input class="button hidden" type="button" id="admincp" tabindex="1" name="" value="<?php echo $this->phrase['core']['admin_cp'] ?>" />
                                              <input class="button hidden" type="button" id="querystatus" tabindex="1" name="" value="<?php echo $this->phrase['core']['query_status'] ?>" />
                                          </div>
                                      </div>
                                      <div id="beginsection">
                                          <form action="<?php echo $this->setuptype; ?>.php" id="optionsform" method="post">
                                              <?php if ($this->htmloptions['suggestconsole']) { echo '<div class="consolemsg">' . construct_phrase($this->phrase['core']['console_upgrade_steps'], $this->htmloptions['suggestconsole']) . '</div>'; } ?>
                                              <p><?php echo $this->htmloptions['upgrademessage']; ?></p>
                                              <input type="hidden" name="jsfail" value="1" />
                                              <div class="hidden" id="optionsbox">
                                                  <table cellspacing="0" cellpadding="4" border="0" align="center" width="100%" id="cpform_table" class="" style="border-collapse: separate;">
                                                  <tbody>
                                                      <tr>
                                                          <td class="alt1">
                                                              <?php echo $this->phrase['core']['merge_template_updates'] ?>
                                                          </td>
                                                          <td class="alt1">
                                                              <?php echo $this->phrase['vbphrase']['yes'] ?> <input id="rb_merge1" type="radio" name="options[skiptemplatemerge]" value="0" checked="checked" />
                                                              <?php echo $this->phrase['vbphrase']['no'] ?> <input id="rb_merge2" type="radio" name="options[skiptemplatemerge]" value="1" />
                                                          </td>
                                                      </tr>
                                                  </tbody>
                                                  </table>
                                              </div>
                                              <input class="button" type="submit" id="beginupgrade" tabindex="1" name="" value="<?php echo $this->htmloptions['begin_setup'] ?>" />
                                              <input class="button" type="submit" id="options" tabindex ="2" name="" value="<?php echo $this->phrase['core']['options'] ?>" />
                                      </form>
                                      </div>
                                  </div>
                              </div>
                              <div id="detailbox" class="tborder hidden">
                                  <div class="navbody messageheader"><?php echo $this->htmloptions['progress']; ?></div>
                                  <div id="mainmessage" class="messagebody logincontrols"></div>
                                  <div class="status">
                                      <span id="statusmessage"><?php echo $this->htmloptions['status'] ?></span>
                                  </div>
                              </div>
                              <div class="tborder hidden" id="prompt">
                                  <div class="navbody messageheader" id="prompttitle"><?php echo $this->phrase['core']['action_required']; ?></div>
                                  <div class="messagebody logincontrols">
                                      <div id="promptmessage"></div>
                                      <form action="upgrade.php" method="post" id="promptform">
                                          <input type="text" tabindex="1" value="" name="promptresponse" id="promptresponse" />
                                          <div class="submit">
                                              <input class="button" type="submit" name="submit" tabindex="1" accesskey="s" id="promptsubmit" value="<?php echo $this->phrase['vbphrase']['ok']; ?>" />
                                              <input class="button hidden" type="reset" name="reset" tabindex="1" id="promptreset" value="<?php echo $this->phrase['vbphrase']['reset']; ?>" />
                                              <input class="button hidden" type="submit" name="submit" tabindex="1" accesskey="s" id="promptcancel" value="<?php echo $this->phrase['vbphrase']['cancel']; ?>" />
                                          </div>
                                      </form>
                                  </div>
                              </div>
                              <div class="tborder hidden" id="confirm">
                                  <div class="navbody messageheader" id="confirmtitle"><?php echo $this->phrase['core']['action_required']; ?></div>
                                  <div class="messagebody logincontrols">
                                      <form action="<?php echo $this->setuptype; ?>.php" method="post" id="confirmform">
                                          <div id="confirmmessage"></div>
                                          <div class="submit">
                                              <input class="button" type="submit" name="submit" tabindex="1" accesskey="s" id="confirmok" value="<?php echo $this->phrase['vbphrase']['ok']; ?>" />
                                              <input class="button hidden" type="reset" name="reset" tabindex="1" id="confirmreset" value="<?php echo $this->phrase['vbphrase']['reset']; ?>" />
                                              <input class="button" type="button" name="cancel" tabindex="1" accesskey="s" id="confirmcancel" value="<?php echo $this->phrase['vbphrase']['cancel']; ?>" />
                                          </div>
                                      </form>
                                  </div>
                              </div>
                          </div>
                          <p align="center">
                          <?php echo construct_phrase($this->phrase['vbphrase']['vbulletin_copyright_orig'], $output_version, date('Y')); ?>
                          </p>
                          <script type="text/javascript" src="vbulletin-upgrade.js"></script>
                          </body>
                          </html>
                          <?php
                      }

                  تغییر بدید به:
                  PHP Code:
                  private function print_html()
                  {
                      $timenow = defined('TIMENOW') ? TIMENOW : time();
                      header('Expires: ' . gmdate('D, d M Y H:i:s', $timenow) . ' GMT');
                      header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $timenow) . ' GMT');
                  
                      // Safe GPC access
                      $gpc = (isset($this->registry->GPC) && is_array($this->registry->GPC))
                          ? $this->registry->GPC
                          : array();
                      $gpc_version = $gpc['version'] ?? '';
                      $gpc_step    = $gpc['step'] ?? '';
                      $gpc_startat = $gpc['startat'] ?? '';
                      $gpc_only    = $gpc['only'] ?? '';
                  
                      $hiddenfields = '';
                      if ($gpc_version !== '' && $gpc_version !== null)
                      {
                          $hiddenfields = '<input type="hidden" name="version" value="' . htmlspecialchars($gpc_version, ENT_QUOTES, 'UTF-8') . '" />';
                      }
                      $hiddenfields .= '
                          <input type="hidden" name="step" value="' . htmlspecialchars((string)$gpc_step, ENT_QUOTES, 'UTF-8') . '" />
                          <input type="hidden" name="startat" value="' . htmlspecialchars((string)$gpc_startat, ENT_QUOTES, 'UTF-8') . '" />
                          <input type="hidden" name="only" value="' . htmlspecialchars((string)$gpc_only, ENT_QUOTES, 'UTF-8') . '" />
                      ';
                  
                      // Safe htmloptions
                      $html = (isset($this->htmloptions) && is_array($this->htmloptions)) ? $this->htmloptions : array();
                      $html += array(
                          'startup_errors'   => '',
                          'startup_continue' => false,
                          'mismatch'         => false,
                          'processlog'       => false,
                          'version'          => '',
                          'step'             => 1,
                          'startat'          => 0,
                          'only'             => false,
                          'status'           => '',
                          'progress'         => '',
                          'upgrading_to_x'   => '',
                          'upgrademessage'   => '',
                          'begin_setup'      => '',
                          'setuptype'        => $this->setuptype ?? '',
                          'setuptypetitle'   => '',
                          'finalversion'     => '',
                          'totalsteps'       => 0,
                          'enter_system'     => '',
                          'suggestconsole'   => false,
                      );
                  
                      if (!empty($html['startup_errors']))
                      {
                          $html['startup_errors'] = preg_replace('#(?<!\<)/(?!\>)#s', '<img src="" alt="" />/', $html['startup_errors']);
                      }
                  
                      // Safe options / phrases
                      $options = (isset($this->registry->options) && is_array($this->registry->options))
                          ? $this->registry->options
                          : array();
                      $cpstyle = $options['cpstylefolder'] ?? 'vBulletin_4_Default';
                      $templateversion = $options['templateversion'] ?? '';
                  
                      $core = (isset($this->phrase['core']) && is_array($this->phrase['core']))
                          ? $this->phrase['core']
                          : array();
                      $vbphrase = (isset($this->phrase['vbphrase']) && is_array($this->phrase['vbphrase']))
                          ? $this->phrase['vbphrase']
                          : array();
                  
                      $xml_versions = (isset($this->xml_versions) && is_array($this->xml_versions))
                          ? $this->xml_versions
                          : array(
                              'style' => '', 'mobile-style' => '', 'settings' => '',
                              'language' => '', 'navigation' => '', 'adminhelp' => '',
                          );
                  
                      $config_admincp = (isset($this->registry->config['Misc']['admincpdir']))
                          ? $this->registry->config['Misc']['admincpdir']
                          : 'admincp';
                  
                      $output_version = defined('ADMIN_VERSION_VBULLETIN')
                          ? ADMIN_VERSION_VBULLETIN
                          : ($templateversion !== '' ? $templateversion : ($html['finalversion'] ?? ''));
                  
                      // $steptitle was used but never defined in original code
                      $steptitle = $html['setuptypetitle'] ?? '';
                  
                      // Expose safe vars for the HTML section below
                      $this->htmloptions = $html;
                      ?>
                      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                      <html xmlns="http://www.w3.org/1999/xhtml" dir="<?php echo vB_Template_Runtime::fetchStyleVar('textdirection'); ?>" lang="<?php echo vB_Template_Runtime::fetchStyleVar('languagecode'); ?>">
                      <head>
                          <meta http-equiv="Content-Type" content="text/html; charset=<?php echo vB_Template_Runtime::fetchStyleVar('charset'); ?>" />
                          <meta http-equiv="Expires" content="Sat, 26 Jul 1997 05:00:00 GMT" />
                          <meta http-equiv="Pragma" content="no-cache, must-revalidate" />
                          <title><?php echo htmlspecialchars($html['setuptypetitle'] . ' ' . $steptitle); ?></title>
                          <link rel="stylesheet" href="<?php echo '../cpstyles/' . htmlspecialchars($cpstyle) . '/controlpanel.css'; ?>" />
                          <style type="text/css">
                          /* ... same CSS as before ... */
                          </style>
                          <script type="text/javascript">
                          <!--
                              var IMGDIR_MISC = "../cpstyles/<?php echo htmlspecialchars($cpstyle); ?>";
                              var CLEARGIFURL = "./clear.gif";
                              var VERSION = "<?php echo htmlspecialchars($html['version']); ?>";
                              var SCRIPTINFO = {
                                  version: "<?php echo htmlspecialchars($html['version']); ?>",
                                  startat: "<?php echo htmlspecialchars((string)$html['startat']); ?>",
                                  step   : "<?php echo htmlspecialchars((string)$html['step']); ?>",
                                  only   : "<?php echo htmlspecialchars((string)$html['only']); ?>"
                              };
                              var ADMINDIR = "../<?php echo htmlspecialchars($config_admincp); ?>";
                              var TOTALSTEPS = <?php echo intval($html['totalsteps']); ?>;
                              var ABORTMSG = "<?php echo htmlspecialchars($core['status_aborted'] ?? 'Aborted'); ?>";
                              var UNEXPECTED_TEXT = "<?php echo htmlspecialchars($core['unexpected_text'] ?? ''); ?>";
                              var SETUPTYPE = "<?php echo htmlspecialchars($this->setuptype ?? ''); ?>";
                              var STEP_X_Y = "<?php echo htmlspecialchars($core['step_x_y'] ?? ''); ?>";
                              var SERVER_NO_RESPONSE = "<?php echo htmlspecialchars($core['server_no_response'] ?? ''); ?>";
                          //-->
                          </script>
                          <script type="text/javascript" src="../clientscript/yui/yuiloader-dom-event/yuiloader-dom-event.js"></script>
                          <script type="text/javascript" src="../clientscript/yui/connection/connection-min.js"></script>
                          <script type="text/javascript" src="../clientscript/vbulletin-core.js"></script>
                      </head>
                      <body>
                      <!-- بقیه HTML را با جایگزینی موارد زیر نگه دارید:
                  
                      $this->registry->options['cpstylefolder']  →  $cpstyle
                      $this->htmloptions['...']                  →  $html['...']
                      $this->phrase['core']['...']               →  $core['...'] ?? ''
                      $this->phrase['vbphrase']['...']           →  $vbphrase['...'] ?? ''
                      $this->xml_versions['...']                 →  $xml_versions['...'] ?? ''
                      $this->registry->options['templateversion']→  $templateversion
                      $hiddenfields                              →  همان $hiddenfields
                  
                      -->
                      <?php
                      // برای سادگی، می‌توانید بقیه قالب HTML اصلی را نگه دارید
                      // فقط مطمئن شوید متغیرهای بالا در scope هستند.
                  }​
                  Copyright © coffeenetmavara, All Rights Reserved

                  نظر

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