;
			}
		}
	}
	
	function backup_error($err) {
		if(count($this->backup_errors) < 20) {
			$this->backup_errors[] = $err;
		} elseif(count($this->backup_errors) == 20) {
			$this->backup_errors[] = __('Subsequent errors have been omitted from this log.');
		}
	}
	
	/////////////////////////////
	function backup_table($table, $segment = 'none') {
		global $wpdb;
		
		/*
		Taken partially from phpMyAdmin and partially from
		Alain Wolf, Zurich - Switzerland
		Website: http://restkultur.ch/personal/wolf/scripts/db_backup/
		
		Modified by Scott Merril (http://www.skippy.net/) 
		to use the WordPress $wpdb object
		*/

		$table_structure = $wpdb->get_results("DESCRIBE $table");
		if (! $table_structure) {
			backup_errors(__('Error getting table details') . ": $table");
			return FALSE;
		}
	
		if(($segment == 'none') || ($segment == 0)) {
			//
			// Add SQL statement to drop existing table
			$this->stow("\n\n");
			$this->stow("#\n");
			$this->stow("# Delete any existing table " . $this->backquote($table) . "\n");
			$this->stow("#\n");
			$this->stow("\n");
			$this->stow("DROP TABLE IF EXISTS " . $this->backquote($table) . ";\n");
			
			// 
			//Table structure
			// Comment in SQL-file
			$this->stow("\n\n");
			$this->stow("#\n");
			$this->stow("# Table structure of table " . $this->backquote($table) . "\n");
			$this->stow("#\n");
			$this->stow("\n");
			
			$create_table = $wpdb->get_results("SHOW CREATE TABLE $table", ARRAY_N);
			if (FALSE === $create_table) {
				$this->backup_error(sprintf(__("Error with SHOW CREATE TABLE for %s."), $table));
				$this->stow("#\n# Error with SHOW CREATE TABLE for $table!\n#\n");
			}
			$this->stow($create_table[0][1] . ' ;');
			
			if (FALSE === $table_structure) {
				$this->backup_error(sprintf(__("Error getting table structure of %s"), $table));
				$this->stow("#\n# Error getting table structure of $table!\n#\n");
			}
		
			//
			// Comment in SQL-file
			$this->stow("\n\n");
			$this->stow("#\n");
			$this->stow('# Data contents of table ' . $this->backquote($table) . "\n");
			$this->stow("#\n");
		}
		
		if(($segment == 'none') || ($segment >= 0)) {
			$ints = array();
			foreach ($table_structure as $struct) {
				if ( (0 === strpos($struct->Type, 'tinyint')) ||
					(0 === strpos(strtolower($struct->Type), 'smallint')) ||
					(0 === strpos(strtolower($struct->Type), 'mediumint')) ||
					(0 === strpos(strtolower($struct->Type), 'int')) ||
					(0 === strpos(strtolower($struct->Type), 'bigint')) ||
					(0 === strpos(strtolower($struct->Type), 'timestamp')) ) {
						$ints[strtolower($struct->Field)] = "1";
				}
			}
			
			
			// Batch by $row_inc
			
			if($segment == 'none') {
				$row_start = 0;
				$row_inc = ROWS_PER_SEGMENT;
			} else {
				$row_start = $segment * ROWS_PER_SEGMENT;
				$row_inc = ROWS_PER_SEGMENT;
			}
			
			do {	
				if ( !ini_get('safe_mode')) @set_time_limit(15*60);
				$table_data = $wpdb->get_results("SELECT * FROM $table LIMIT {$row_start}, {$row_inc}", ARRAY_A);

				/*
				if (FALSE === $table_data) {
					$wp_backup_error .= "Error getting table contents from $table\r\n";
					fwrite($fp, "#\n# Error getting table contents fom $table!\n#\n");
				}
				*/
					
				$entries = 'INSERT INTO ' . $this->backquote($table) . ' VALUES (';	
				//    \x08\\x09, not required
				$search = array("\x00", "\x0a", "\x0d", "\x1a");
				$replace = array('\0', '\n', '\r', '\Z');
				if($table_data) {
					foreach ($table_data as $row) {
						$values = array();
						foreach ($row as $key => $value) {
							if ($ints[strtolower($key)]) {
								$values[] = $value;
							} else {
								$values[] = "'" . str_replace($search, $replace, $this->sql_addslashes($value)) . "'";
							}
						}
						$this->stow(" \n" . $entries . implode(', ', $values) . ') ;');
					}
					$row_start += $row_inc;
				}
			} while((count($table_data) > 0) and ($segment=='none'));
		}
		
		
		if(($segment == 'none') || ($segment < 0)) {
			// Create footer/closing comment in SQL-file
			$this->stow("\n");
			$this->stow("#\n");
			$this->stow("# End of data conten>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/ultra-lean-extreme.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/vasopro-ephedrine.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/resources.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/addictions.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/nursing.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/alternative_medicine.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/nutrition.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/dental_health.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/pharmacy.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/fitness.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/public_health_safety.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/recipes.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/health_beauty.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/weight_issues.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/mental_health.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/weight_loss.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/alternative_medicine_1.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/alternative_medicine_2.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/alternative_medicine_3.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/alternative_medicine_4.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/alternative_medicine_5.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/alternative_medicine_6.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/alternative_medicine_7.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/alternative_medicine_8.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/nutrition_1.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/nutrition_2.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/dental_health_1.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/pharmacy_1.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/pharmacy_2.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/pharmacy_3.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/pharmacy_4.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/fitness_1.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/fitness_2.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_1.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_2.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_3.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_4.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_5.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_6.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_7.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_8.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_9.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_10.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_11.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_12.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_13.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_14.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_15.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_16.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_17.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_18.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_19.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_20.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_21.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_22.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_23.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_24.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_25.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/general_health_26.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/health_beauty_1.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/health_beauty_2.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/weight_loss_1.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
<url>
	<loc>http://www.cheap-metabolife.com/partners/weight_loss_2.html</loc>
	<priority>0.5</priority>
	<changefreq>monthly</changefreq>
</url>
</urlset>