HEX
Server: Apache/2.4.59 (Debian)
System: Linux skycube.cz 4.19.0-25-amd64 #1 SMP Debian 4.19.289-2 (2023-08-08) x86_64
User: ilya (534)
PHP: 7.3.31-1~deb10u7
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: /var/www/ilya/data/www/kamforum.ru/gsitemap_install.php
<?php

/*
+--------------------------------------------------------------------------
|                    Google Sitemap Generator for IPB 2.1
|                              Installer
|                                v1.3.1
|                         Coded by: CheetahShrk
+--------------------------------------------------------------------------
*/

error_reporting(E_ERROR);
set_magic_quotes_runtime(0);

define( 'THIS_ROOT_PATH', './' );

define( 'ROOT_PATH', './' );

define( 'KERNEL_PATH', ROOT_PATH.'ips_kernel/' );
define( 'CACHE_PATH' , ROOT_PATH );

define ( 'IN_ACP', 1 );
define ( 'IN_IPB', 1 );
define ( 'IN_DEV', 0 );

$INFO = array();

//-----------------------------------------------
// INIT CLASSES
//-----------------------------------------------

require ROOT_PATH   . "sources/ipsclass.php";

$ipsclass           = new ipsclass();
$ipsclass->vars     = $INFO;
$ipsclass->template = new template();
echo $ipsclass->vars['mysql_tbl_type'];
//-----------------------------------------------
// PARSE INCOMING
//-----------------------------------------------

$ipsclass->parse_incoming();

$ipsclass->initiate_ipsclass();

new install;

class install
{
  var $xml;
  var $task_functions;

function install()
{
  global $ipsclass;
  
    switch($ipsclass->input['p'])
    {
	       case '1':
		   $this->do_install();
	       break;
	       case '2':
		   $this->do_tasks();
		   break;
	       case '3':
	       $this->do_rebuildcache();
	       break;
	       case 'un1':
	       $this->do_removesettings();
	       break;
	       case 'un2':
	       $this->do_removetasks();
	       break;
	       case 'un3':
	       $this->do_rebuildcache();
	       break;	  	       	       	       
	       default:
           $this->do_intro();
           break;
   }
}



function do_tasks()
{
	global $ipsclass;

	//-----------------------------------
	// IMPORT $INFO!
	//-----------------------------------

	$require = ROOT_PATH."conf_global.php";

	include($require);

    $INFO['sql_driver'] = strtolower($INFO['sql_driver']);

	//-----------------------------------
	// Get SQL engine
	//-----------------------------------

    require_once( KERNEL_PATH.'class_db_'.$INFO['sql_driver'].".php" );

	$ipsclass->DB = new db_driver();

	$ipsclass->DB->obj['sql_database']     = $INFO['sql_database'];
	$ipsclass->DB->obj['sql_user']         = $INFO['sql_user'];
	$ipsclass->DB->obj['sql_pass']         = $INFO['sql_pass'];
	$ipsclass->DB->obj['sql_host']         = $INFO['sql_host'];
	$ipsclass->DB->obj['sql_tbl_prefix']   = $INFO['sql_tbl_prefix'];
	$ipsclass->DB->obj['query_cache_file'] = ROOT_PATH.'sources/sql/'.$INFO['sql_driver'].'_admin_queries.php';
	$ipsclass->DB->obj['use_shutdown']     = 0;
	
	//-----------------------------------
	// Required vars?
	//-----------------------------------

	if ( is_array( $ipsclass->DB->connect_vars ) and count( $ipsclass->DB->connect_vars ) )
	{
		foreach( $ipsclass->DB->connect_vars as $k => $v )
		{
			$ipsclass->DB->connect_vars[ $k ] = $INFO[ $k ];
		}
	}

	//-----------------------------------
	// Attempt a connect
	//-----------------------------------

	if ( ! $ipsclass->DB->connect() )
	{
		install_error( "Connection error:<br /><br />".$ipsclass->DB->error );
	}

	
	//-----------------------------------
	// Get XML
	//-----------------------------------
	
	require_once( KERNEL_PATH.'class_xml.php' );
	
	$this->xml = new class_xml();
	$this->xml->lite_parser = 1;
	
	//-----------------------------------
	// Get XML file
	//-----------------------------------
	
	$xmlfile = THIS_ROOT_PATH.'gsitemap_data.xml';
	
	$setting_content = implode( "", file($xmlfile) );
	
	require_once( ROOT_PATH.'sources/lib/func_taskmanager.php' );

	$this->task_functions            = new func_taskmanager();
	$this->task_functions->ipsclass  =& $ipsclass;
	
	//-------------------------------
	// Unpack the datafile
	//-------------------------------
	
	$this->xml->xml_parse_document( $setting_content );
	
	if ( ! is_array( $this->xml->xml_array['installdata']['taskdata']['tasks']['task'] ) )
	{
		install_error("Error with gsitemap_data.xml - could not process XML properly for tasks");
	}

	//-------------------------------
	// pArse
	//-------------------------------

	$fields = array( 'task_title', 'task_file', 'task_next_run', 'task_week_day', 'task_month_day', 'task_hour', 'task_minute', 'task_cronkey', 'task_log', 'task_description', 'task_enabled', 'task_key', 'task_safemode', 'task_locked' );


	if ( ! is_array( $this->xml->xml_array['installdata']['taskdata']['tasks']['task'][0]  ) )
	{
		//-----------------------------------------
		// Ensure [0] is populated
		//-----------------------------------------

		$tmp = $this->xml->xml_array['installdata']['taskdata']['tasks']['task'];

		unset($this->xml->xml_array['installdata']['taskdata']['tasks']['task']);

		$this->xml->xml_array['installdata']['taskdata']['tasks']['task'][0] = $tmp;
	}


	foreach( $this->xml->xml_array['installdata']['taskdata']['tasks']['task'] as $id => $entry )
	{
		$newrow = array();

		foreach( $fields as $f )
		{
			$newrow[$f] = $entry[ $f ]['VALUE'];
		}

		$newrow['task_next_run'] = $this->task_functions->generate_next_run( $newrow );
		$newrow['task_cronkey'] = md5(microtime());

		$db_string = $ipsclass->DB->compile_db_insert_string($newrow);
		$query = "INSERT INTO ".$INFO['sql_tbl_prefix']."task_manager (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")";

		if ( ! $ipsclass->DB->query($query) )
		{
			install_error($query."<br /><br />".$DB->error);
		}

		$this->task_functions->save_next_run_stamp();
	}
	
		
	$ipsclass->template->print_top();
	
	$ipsclass->template->contents .= "
	<tr><td class='alt1'><div align='center'>
					Install Step 2 out of 3 Complete!
                              </div><br /><br /><div align='center'><form method='post' action='?p=3'><input type='submit' name='skins' value='Rebuild Caches'></form></div></td></tr></table>";
	$ipsclass->template->output();
	
	
	
}

//+---------------------------------------


function do_install()
{
	global $ipsclass;
	
	//-----------------------------------
	// IMPORT $INFO!
	//-----------------------------------

	$require = ROOT_PATH."conf_global.php";

	include($require);

    $INFO['sql_driver'] = strtolower($INFO['sql_driver']);

	//-----------------------------------
	// Get SQL engine
	//-----------------------------------

    require_once( KERNEL_PATH.'class_db_'.$INFO['sql_driver'].".php" );

	$ipsclass->DB = new db_driver();

	$ipsclass->DB->obj['sql_database']     = $INFO['sql_database'];
	$ipsclass->DB->obj['sql_user']         = $INFO['sql_user'];
	$ipsclass->DB->obj['sql_pass']         = $INFO['sql_pass'];
	$ipsclass->DB->obj['sql_host']         = $INFO['sql_host'];
	$ipsclass->DB->obj['sql_tbl_prefix']   = $INFO['sql_tbl_prefix'];
	$ipsclass->DB->obj['query_cache_file'] = ROOT_PATH.'sources/sql/'.$INFO['sql_driver'].'_admin_queries.php';
	$ipsclass->DB->obj['use_shutdown']     = 0;

	//-----------------------------------
	// Required vars?
	//-----------------------------------

	if ( is_array( $ipsclass->DB->connect_vars ) and count( $ipsclass->DB->connect_vars ) )
	{
		foreach( $ipsclass->DB->connect_vars as $k => $v )
		{
			$ipsclass->DB->connect_vars[ $k ] = $INFO[ $k ];
		}
	}

	//-----------------------------------
	// Attempt a connect
	//-----------------------------------

	if ( ! $ipsclass->DB->connect() )
	{
		install_error( "Connection error:<br /><br />".$ipsclass->DB->error );
	}

	//-----------------------------------
	// Get XML
	//-----------------------------------
	
	require_once( KERNEL_PATH.'class_xml.php' );
	
	$this->xml = new class_xml();
	$this->xml->lite_parser = 1;
	
	//-----------------------------------
	// Get XML file
	//-----------------------------------
	
	$xmlfile = THIS_ROOT_PATH.'gsitemap_data.xml';
	
	$setting_content = implode( "", file($xmlfile) );
	
	//-------------------------------
	// Unpack the datafile
	//-------------------------------
	
	$this->xml->xml_parse_document( $setting_content );
    
	if ( ! is_array( $this->xml->xml_array['installdata']['settingdata']['settinggroup']['setting'] ) )
	{
		install_error("Error with gsitemap_data.xml - could not process XML properly for settings");
	}

	//-------------------------------
	// pArse
	//-------------------------------

	$fields = array( 'conf_title', 'conf_description', 'conf_group', 'conf_type', 'conf_key', 'conf_value', 'conf_default',
					 'conf_extra', 'conf_evalphp', 'conf_protected', 'conf_position', 'conf_start_group', 'conf_end_group',
					 'conf_help_key', 'conf_add_cache' );


	if ( ! is_array( $this->xml->xml_array['installdata']['settingdata']['settinggroup']['setting'][0]  ) )
	{
		//-----------------------------------------
		// Ensure [0] is populated
		//-----------------------------------------

		$tmp = $this->xml->xml_array['installdata']['settingdata']['settinggroup']['setting'];

		unset($this->xml->xml_array['installdata']['settingdata']['settinggroup']['setting']);

		$this->xml->xml_array['installdata']['settingdata']['settinggroup']['setting'][0] = $tmp;
	}

	$ipsclass->DB->do_insert('conf_settings_titles', array('conf_title_title' => 'Google Sitemap Generator', 'conf_title_desc' => 'Settings for the Google Sitemap Generator Task', 'conf_title_count' => 0, 'conf_title_noshow' => 0, 'conf_title_keyword' => 'gsitemap'));

	$set_group = $ipsclass->DB->get_insert_id();

	foreach( $this->xml->xml_array['installdata']['settingdata']['settinggroup']['setting'] as $id => $entry )
	{
		if ( ! $entry['conf_key']['VALUE'] )
		{
			continue;
		}

		$newrow = array();

		$entry['conf_value']['VALUE'] = "";

		$entry['conf_group']['VALUE'] = $set_group;

		$entry['conf_evalphp']['VALUE'] = str_replace( '\\', '\\\\', $entry['conf_evalphp']['VALUE'] );

		foreach( $fields as $f )
		{
			$newrow[$f] = $entry[ $f ]['VALUE'];
		}

		$db_string = $ipsclass->DB->compile_db_insert_string($newrow);
		$query = "INSERT INTO ".$INFO['sql_tbl_prefix']."conf_settings (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")";

		if ( ! $ipsclass->DB->query($query) )
		{
			install_error($query."<br /><br />".$DB->error);
		}
	}

    $conf = $ipsclass->DB->simple_exec_query(array('select' => 'count(*) as count', 'from' => 'conf_settings', 'where' => 'conf_group='.$set_group));
	$count = intval($conf['count']);
	$ipsclass->DB->do_update('conf_settings_titles', array('conf_title_count' => $count), 'conf_title_id='.$set_group);
	//-----------------------------------
	// ARE WE DONE? REALLY? COOL!!
	//-----------------------------------
	
	$ipsclass->template->print_top();
	
	$ipsclass->template->contents .= "
	<tr><td class='alt1'><div align='center'>
					Install Step 1 out of 3 Complete!
                              </div><br /><br /><div align='center'><form method='post' action='?p=2'><input type='submit' name='rebuildcoms' value='Install Task'></form></div></td></tr></table>";
						 
	$ipsclass->template->output();
}

function do_removesettings()
{
	global $ipsclass;

	//-----------------------------------
	// IMPORT $INFO!
	//-----------------------------------

	$require = ROOT_PATH."conf_global.php";

	include($require);

    $INFO['sql_driver'] = strtolower($INFO['sql_driver']);

	//-----------------------------------
	// Get SQL engine
	//-----------------------------------

    require_once( KERNEL_PATH.'class_db_'.$INFO['sql_driver'].".php" );

	$ipsclass->DB = new db_driver();

	$ipsclass->DB->obj['sql_database']     = $INFO['sql_database'];
	$ipsclass->DB->obj['sql_user']         = $INFO['sql_user'];
	$ipsclass->DB->obj['sql_pass']         = $INFO['sql_pass'];
	$ipsclass->DB->obj['sql_host']         = $INFO['sql_host'];
	$ipsclass->DB->obj['sql_tbl_prefix']   = $INFO['sql_tbl_prefix'];
	$ipsclass->DB->obj['query_cache_file'] = ROOT_PATH.'sources/sql/'.$INFO['sql_driver'].'_admin_queries.php';
	$ipsclass->DB->obj['use_shutdown']     = 0;

	//-----------------------------------
	// Required vars?
	//-----------------------------------

	if ( is_array( $ipsclass->DB->connect_vars ) and count( $ipsclass->DB->connect_vars ) )
	{
		foreach( $ipsclass->DB->connect_vars as $k => $v )
		{
			$ipsclass->DB->connect_vars[ $k ] = $INFO[ $k ];
		}
	}

	//-----------------------------------
	// Attempt a connect
	//-----------------------------------

	if ( ! $ipsclass->DB->connect() )
	{
		install_error( "Connection error:<br /><br />".$ipsclass->DB->error );
	}

	//-----------------------------------
	// Get XML
	//-----------------------------------

	require_once( KERNEL_PATH.'class_xml.php' );

	$this->xml = new class_xml();
	$this->xml->lite_parser = 1;

	//-----------------------------------
	// Get XML file
	//-----------------------------------

	$xmlfile = THIS_ROOT_PATH.'gsitemap_data.xml';

	$setting_content = implode( "", file($xmlfile) );

	//-------------------------------
	// Unpack the datafile
	//-------------------------------

	$this->xml->xml_parse_document( $setting_content );

	if ( ! is_array( $this->xml->xml_array['installdata']['settingdata']['settinggroup']['setting'] ) )
	{
		install_error("Error with gsitemap_data.xml - could not process XML properly for settings");
	}

	//-------------------------------
	// pArse
	//-------------------------------

	$fields = array( 'conf_title', 'conf_description', 'conf_group', 'conf_type', 'conf_key', 'conf_value', 'conf_default',
					 'conf_extra', 'conf_evalphp', 'conf_protected', 'conf_position', 'conf_start_group', 'conf_end_group',
					 'conf_help_key', 'conf_add_cache' );


	if ( ! is_array( $this->xml->xml_array['installdata']['settingdata']['settinggroup']['setting'][0]  ) )
	{
		//-----------------------------------------
		// Ensure [0] is populated
		//-----------------------------------------

		$tmp = $this->xml->xml_array['installdata']['settingdata']['settinggroup']['setting'];

		unset($this->xml->xml_array['installdata']['settingdata']['settinggroup']['setting']);

		$this->xml->xml_array['installdata']['settingdata']['settinggroup']['setting'][0] = $tmp;
	}
	
	$ipsclass->DB->simple_exec_query( array( 'delete' => 'conf_settings_titles', 'where' => "conf_title_keyword='gsitemap'" ) );

	foreach( $this->xml->xml_array['installdata']['settingdata']['settinggroup']['setting'] as $id => $entry )
	{

		$row = $ipsclass->DB->simple_exec_query( array( 'select' => 'conf_id',
																  'from'   => 'conf_settings',
																  'where'  => "conf_key='{$entry[ 'conf_key' ]['VALUE']}'"
														 )      );
														 
		if ( $row['conf_id'] )
		{
			$ipsclass->DB->simple_exec_query( array( 'delete' => 'conf_settings', 'where' => "conf_id={$row['conf_id']}" ) );
		}
	}
	//-----------------------------------
	// ARE WE DONE? REALLY? COOL!!
	//-----------------------------------

	$ipsclass->template->print_top();

	$ipsclass->template->contents .= "
	<tr><td class='alt1'><div align='center'>
					Uninstall Step 1 out of 3 Complete!
                              </div><br /><br /><div align='center'><form method='post' action='?p=un2'><input type='submit' name='removetask' value='Remove Task'></form></div></td></tr></table>";

	$ipsclass->template->output();
}

function do_removetasks()
{
	global $ipsclass;

	//-----------------------------------
	// IMPORT $INFO!
	//-----------------------------------

	$require = ROOT_PATH."conf_global.php";

	include($require);

    $INFO['sql_driver'] = strtolower($INFO['sql_driver']);

	//-----------------------------------
	// Get SQL engine
	//-----------------------------------

    require_once( KERNEL_PATH.'class_db_'.$INFO['sql_driver'].".php" );

	$ipsclass->DB = new db_driver();

	$ipsclass->DB->obj['sql_database']     = $INFO['sql_database'];
	$ipsclass->DB->obj['sql_user']         = $INFO['sql_user'];
	$ipsclass->DB->obj['sql_pass']         = $INFO['sql_pass'];
	$ipsclass->DB->obj['sql_host']         = $INFO['sql_host'];
	$ipsclass->DB->obj['sql_tbl_prefix']   = $INFO['sql_tbl_prefix'];
	$ipsclass->DB->obj['query_cache_file'] = ROOT_PATH.'sources/sql/'.$INFO['sql_driver'].'_admin_queries.php';
	$ipsclass->DB->obj['use_shutdown']     = 0;

	//-----------------------------------
	// Required vars?
	//-----------------------------------

	if ( is_array( $ipsclass->DB->connect_vars ) and count( $ipsclass->DB->connect_vars ) )
	{
		foreach( $ipsclass->DB->connect_vars as $k => $v )
		{
			$ipsclass->DB->connect_vars[ $k ] = $INFO[ $k ];
		}
	}

	//-----------------------------------
	// Attempt a connect
	//-----------------------------------

	if ( ! $ipsclass->DB->connect() )
	{
		install_error( "Connection error:<br /><br />".$ipsclass->DB->error );
	}

	//-----------------------------------
	// Get XML
	//-----------------------------------

	require_once( KERNEL_PATH.'class_xml.php' );

	$this->xml = new class_xml();
	$this->xml->lite_parser = 1;

	//-----------------------------------
	// Get XML file
	//-----------------------------------

	$xmlfile = THIS_ROOT_PATH.'gsitemap_data.xml';

	$setting_content = implode( "", file($xmlfile) );

	//-------------------------------
	// Unpack the datafile
	//-------------------------------

	$this->xml->xml_parse_document( $setting_content );

	if ( ! is_array( $this->xml->xml_array['installdata']['settingdata']['settinggroup']['setting'] ) )
	{
		install_error("Error with gsitemap_data.xml - could not process XML properly for settings");
	}

	//-------------------------------
	// pArse
	//-------------------------------

	$fields = array( 'task_title', 'task_file', 'task_next_run', 'task_week_day', 'task_month_day', 'task_hour', 'task_minute', 'task_cronkey', 'task_log', 'task_description', 'task_enabled', 'task_key', 'task_safemode', 'task_locked' );


	if ( ! is_array( $this->xml->xml_array['installdata']['taskdata']['tasks']['task'][0]  ) )
	{
		//-----------------------------------------
		// Ensure [0] is populated
		//-----------------------------------------

		$tmp = $this->xml->xml_array['installdata']['taskdata']['tasks']['task'];

		unset($this->xml->xml_array['installdata']['taskdata']['tasks']['task']);

		$this->xml->xml_array['installdata']['taskdata']['tasks']['task'][0] = $tmp;
	}


	foreach( $this->xml->xml_array['installdata']['taskdata']['tasks']['task'] as $id => $entry )
	{

		$row = $ipsclass->DB->simple_exec_query( array( 'select' => 'task_id',
																  'from'   => 'task_manager',
																  'where'  => "task_key='{$entry[ 'task_key' ]['VALUE']}'"
														 )      );

		if ( $row['task_id'] )
		{
			$ipsclass->DB->simple_exec_query( array( 'delete' => 'task_manager', 'where' => "task_id={$row['task_id']}" ) );
		}
	}
	//-----------------------------------
	// ARE WE DONE? REALLY? COOL!!
	//-----------------------------------

	$ipsclass->template->print_top();

	$ipsclass->template->contents .= "
	<tr><td class='alt1'><div align='center'>
					Uninstall Step 2 out of 3 Complete!
                              </div><br /><br /><div align='center'><form method='post' action='?p=un3'><input type='submit' name='removetask' value='Rebuild Caches'></form></div></td></tr></table>";

	$ipsclass->template->output();
}

function do_rebuildcache()
{
	global $ipsclass;
	
	//-----------------------------------
	// IMPORT $INFO!
	//-----------------------------------

	$require = ROOT_PATH."conf_global.php";

	include($require);

    $INFO['sql_driver'] = strtolower($INFO['sql_driver']);

	//-----------------------------------
	// Get SQL engine
	//-----------------------------------

    require_once( KERNEL_PATH.'class_db_'.$INFO['sql_driver'].".php" );

	$ipsclass->DB = new db_driver();

	$ipsclass->DB->obj['sql_database']     = $INFO['sql_database'];
	$ipsclass->DB->obj['sql_user']         = $INFO['sql_user'];
	$ipsclass->DB->obj['sql_pass']         = $INFO['sql_pass'];
	$ipsclass->DB->obj['sql_host']         = $INFO['sql_host'];
	$ipsclass->DB->obj['sql_tbl_prefix']   = $INFO['sql_tbl_prefix'];
	$ipsclass->DB->obj['query_cache_file'] = ROOT_PATH.'sources/sql/'.$INFO['sql_driver'].'_admin_queries.php';
	$ipsclass->DB->obj['use_shutdown']     = 0;

	//-----------------------------------
	// Required vars?
	//-----------------------------------

	if ( is_array( $ipsclass->DB->connect_vars ) and count( $ipsclass->DB->connect_vars ) )
	{
		foreach( $ipsclass->DB->connect_vars as $k => $v )
		{
			$ipsclass->DB->connect_vars[ $k ] = $INFO[ $k ];
		}
	}

	//-----------------------------------
	// Attempt a connect
	//-----------------------------------

	if ( ! $ipsclass->DB->connect() )
	{
		install_error( "Connection error:<br /><br />".$ipsclass->DB->error );
	}

	require_once( ROOT_PATH.'sources/action_admin/settings.php' );
	$lib           =  new ad_settings();
	$lib->ipsclass =& $ipsclass;
	$lib->setting_rebuildcache();
	unset( $lib );
	
	//-----------------------------------
	// ARE WE DONE? REALLY? COOL!!
	//-----------------------------------
	
	$ipsclass->template->print_top();
	
	$ipsclass->template->contents .= "
<tr><td class='alt1'><div align='center'>
     <b>Install Completed!</b><br /> Please Delete This File and gsitemap_data.xml!
                              </div><br /><br /><div align='center'><form method='post' action='index.php'><input type='submit' name='backtoipb' value='Back to IPB'></form></div></td></tr></table>";

	$ipsclass->template->output();
}


//---------------------------------------

function do_intro()
{
	global $ipsclass;
	
	$ipsclass->template->print_top('Welcome');
	
	$ipsclass->template->contents .= "<tr><td class='alt1'><div align='center'>
					Welcome to the Google Sitemap Generator Installer v1.3.1 For IPB 2.1.x<br />This will make the needed database modifications for the modification.</div>
                              ";

	
	$warnings   = array();
	
	$checkfiles = array(THIS_ROOT_PATH."gsitemap_data.xml",
                         );
					  
	foreach ( $checkfiles as $cf )
	{
		if ( ! file_exists($cf) )
		{
			$warnings[] = "Cannot locate the file '$cf'.";
		}
	}
	
	//----------------------------------
	// Got error?
	//----------------------------------
	
	if ( count($warnings) > 0 )
	{
	
		$err_string = '&middot;'.implode( "<br /><br />&middot;", $warnings );
	
		$ipsclass->template->contents .= "<br /><br />
							    <div class='warnbox' align='center'>
							     <strong>Warning!</strong>
							     <b>The following errors must be fixed before continuing!</b>
								 <br><br>
								 $err_string
							    </div>";
	}
	else
	{
		$ipsclass->template->contents .= "<br /><br /><div align='center'><form method='post' action='?p=1'><input type='submit' name='startinstall' value='Start Install'></form></div>
		<br /><div align='center'><form method='post' action='?p=un1'><input type='submit' name='uninstall' value='Uninstall'></form></div>";
	}
	
	$ipsclass->template->contents .= " </td></tr></table>";
	
	$ipsclass->template->output();
}



function install_error($msg="")
{
	global $ipsclass;
	
	$ipsclass->template->print_top();
	

	
	$ipsclass->template->contents .= "<div class='warnbox' align='center'>
						     <strong style='font-size:16px;color:#F00'>Warning!</strong>
						     <br /><br />
						     <b>The following errors must be fixed before continuing!</b>
						     <br><br>
						     $msg
						    </div>";
	
	
	
	$ipsclass->template->output();
}
}

//+--------------------------------------------------------------------------
// CLASSES
//+--------------------------------------------------------------------------

class template
{
	var $contents = "";
	
	function output()
	{
		echo $this->contents;
		echo "   
				 
<br />
</div>
</div>
</div>
    <table cellpadding='6' cellspacing='0' border='0' width='810' class='page' align='center'>
<tr>
	<td width='409' align='left' class='tfoot'>
	<div class='smallfont'> Google Sitemap Generator v1.3.1 IPB 2.1.x &copy; 2005 <a href='http://forums.invisionize.com/index.php?showuser=133540'>CheetahShrk</a></div>
	</td>
	<td width='327' align='right' class='tfoot'>
		<div class='smallfont'>
		</div>
	</td>
</tr>
</table>
				 
				 </body>
				 </html>";
		exit();
	}
	
	//--------------------------------------

	function print_top()
	{
	
		$this->contents = "
<html>
<head>
	<title>Google Sitemap Generator v1.3.1 For IPB 2.1.x Installer</title>
<style>
body
{
	background-color: #40435A;
	color: #464646;
	font: 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
}

a:link,
a:visited,
a:active
{
   text-decoration: none;
   color: #1D347A;
}

a:hover
{
    text-decoration: underline
}
.page
{
	background: #D1D1D1;
}
td, th, p, li
{
	font: 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
}
.tborder
{
	background-color: #EEEEEE;
	color: #E2E2E2;
	border: 1px solid #1D347A;
}
.tcat
{
	background: #2A4694;
	color: #FFFFFF;
	font: 11px verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
}

.thead
{
	background: #DCE0E5;
	color: #1D347A;
	font: bold 11px tahoma, verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
}
.tfoot
{
	background: #DCE0E5;
	color: #1D347A;
}

.alt1, .alt1Active
{
	background-color: #FFFFFF;
	color: #464646;
}
.alt2, .alt2Active
{
	background-color: #FFFFFF;
	color: #464646;
}
.alt3
{
	background-color: #F6F6F6;
	color: #464646;
}

.smallfont
{
	font: 11px verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
}

legend
{
	color: #22229C;
	font: 11px tahoma, verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
}

.warnbox
{
	background-color: #F6F6F6;
	color: #464646;
	border: 1px solid #1D347A;
}
  
td.thead, div.thead { padding: 4px; }

.fieldset { margin-bottom: 6px; }
.fieldset, .fieldset td, .fieldset p, .fieldset li { font-size: 11px; }
-->
</style>
</head>
<body>
<table border='0' width='760' cellpadding='0' cellspacing='0' align='center'>
<tr valign='top'>
	<td align='left'>&nbsp;</td>
	<td align='right'>

	  <div style='font:14pt verdana; color: #3E5787'>	  </div>

	</td>
</tr>
</table>
	<div align='center'>
		<div class='page' style='width:760px; text-align:left'>
		  <div style='padding:0px 25px 0px 25px'><br />

<table class='tborder' cellpadding='6' cellspacing='1' border='0' width='100%' align='center'>
<tr>
<td class='tcat'><b>Google Sitemap Generator v1.3.1 Installer for IPB 2.1.x</b></td>
</tr>
				 ";
				  	   
	}
}



?>