Talk:Table configuration

From Zen Cart(tm) Wiki
Jump to: navigation, search

This page is going to be a bear to complete. There are a WHOPPING 457 configuration options installed with a stock install of Zen. I still feel for documentation purposes though that they should all be listed in the Default Entries section. I'll pop back in from time to time to add some more.

--APurpleMonkey.com 12:30, 15 December 2005 (MST)

Script to take care of those defaults

I can write 490.000 characters in just a few minutes.. with the help of php of course :D
Here's the script I wrote, which can easily be used for other tables as well. Just be sure to use it on a default database which hasn't been touched, or you'll naturally get wrong settings somewhere.

<pre>
<?php

$table = 'configuration';

$column_replace_array = array(
'last_modified' => "''NULL''",
'date_added' => "''This configuration value will always be the date and time that the database was setup.''",
);


define('DB_SERVER', 'localhost');
define('DB_SERVER_USERNAME', '');
define('DB_SERVER_PASSWORD', '');
define('DB_DATABASE', '');

mysql_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD);
mysql_select_db(DB_DATABASE);

$result = mysql_query('SELECT * FROM ' . $table);
$output = '';

while ($row = mysql_fetch_assoc($result))
{
	$separator = '';
$output .= '<BLOCKQUOTE>
{| 
';
foreach ($row as $key => $val)
{
	$output .= $separator;
	if (array_key_exists($key, $column_replace_array))
	{
		$val = $column_replace_array[$key];
	}
	elseif ($val === null)
	{
		$val = "''NULL''";
	}
	$output .= "|  [[Table $table#$key|$key]]: || $val\n";
	$separator = "|- \n";
}
$output .= '|}
</BLOCKQUOTE>


';
}

$output = str_replace($time_db_created, $time_replacement_text, $output);

echo htmlentities($output);
?>
</pre>

--Dwno 15:37, 15 December 2005 (MST)

Move default data to another page?

Perhaps its a good idea to move the defaults data for this page to a separate page since it's all so much?
--Dwno 15:39, 15 December 2005 (MST)


HOT DAMN!!!!! Just saved me days of work! WooooHoooooo!!!!!!!

BTW...believe it or not I think it should stay all on one page. Just take a peek at some of the wikisource pages if you want to see some monsters. Seems to work for them though.

--APurpleMonkey.com 15:54, 15 December 2005 (MST)