// populate settings table, templates first
$query = "INSERT INTO `$db_settings` VALUES ('affiliates_template', " .
"'Collective affiliates template', '<a href=\"enth3-url\"><img " .
"src=\"enth3-image\" width=\"enth3-width\" height=\"enth3-height\" " .
"border=\"0\" alt=\" enth3-title\" /></a> ', 'Template for showing " .
"collective affiliates.')";
$success = mysql_query( $query ) or die( '<p class="error">Error ' .
'executing query: ' . mysql_error() . ';
' . $query . '</p>' );
if( !$success )
echo '<p class="error">Query unsuccessful: ' . mysql_error() . ' ' .
$query . '</p>';
$query = "INSERT INTO `$db_settings` VALUES ( " .
"'affiliates_template_footer', 'Affiliates template footer', '</p>', " .
"'Text that is inserted directly after the collective affiliates are " .
"shown.')";
$success = mysql_query( $query ) or die( '<p class="error">Error ' .
'executing query: ' . mysql_error() . ';
' . $query . '</p>' );
if( !$success )
echo '<p class="error">Query unsuccessful: ' . mysql_error() . ' ' .
$query . '</p>';
$query = "INSERT INTO `$db_settings` VALUES ( " .
"'affiliates_template_header', 'Affiliates template header', " .
"'<p class=\"center\">', 'Text inserted directly before collective " .
"affiliates are shown.')";
$success = mysql_query( $query ) or die( '<p class="error">Error ' .
'executing query: ' . mysql_error() . ';
' . $query . '</p>' );
if( !$success )
echo '<p class="error">Query unsuccessful: ' . mysql_error() . ' ' .
$query . '</p>';
$query = "INSERT INTO `$db_settings` VALUES ('joined_template', " .
"'Joined fanlistings template', '<a href=\"enth3-url\"><img " .
"src=\"enth3-image\" width=\"enth3-width\" height=\"enth3-height\" " .
"border=\"0\" alt=\" enth3-subject: enth3-desc\" /></a> ', " .
"'Template for showing joined fanlistings.')";
$success = mysql_query( $query ) or die( '<p class="error">Error ' .
'executing query: ' . mysql_error() . ';
' . $query . '</p>' );
if( !$success )
echo '<p class="error">Query unsuccessful: ' . mysql_error() . ' ' .
$query . '</p>';
$query = "INSERT INTO `$db_settings` VALUES ('joined_template_footer', " .
"'Joined template footer', '</p>', 'Text that is inserted directly " .
"after the joined listings are shown.')";
$success = mysql_query( $query ) or die( '<p class="error">Error ' .
'executing query: ' . mysql_error() . ';
' . $query . '</p>' );
if( !$success )
echo '<p class="error">Query unsuccessful: ' . mysql_error() . ' ' .
$query . '</p>';
$query = "INSERT INTO `$db_settings` VALUES ('joined_template_header', " .
"'Joined template header', '<p class=\"center\">', " .
"'Text inserted directly before joined listings are shown.')";
$success = mysql_query( $query ) or die( '<p class="error">Error ' .
'executing query: ' . mysql_error() . ';
' . $query . '</p>' );
if( !$success )
echo '<p class="error">Query unsuccessful: ' . mysql_error() . ' ' .
$query . '</p>';
$query = "INSERT INTO `$db_settings` VALUES ('owned_template', " .
"'Owned fanlistings template', '<p class=\"center\"><a " .
"href=\"enth3-url\"><img src=\"enth3-image\" width=\"enth3-width\" " .
"height=\"enth3-height\" border=\"0\" alt=\" enth3-title\" " .
"/></a>
\r\n
enth3-title: enth3-subject
\r\n
<a " .
"href=\"enth3-url\">enth3-url</a>
\r\nenth3-desc</p>', " .
"'Template for showing owned fanlistings.')";
$success = mysql_query( $query ) or die( '<p class="error">Error ' .
'executing query: ' . mysql_error() . ';
' . $query . '</p>' );
if( !$success )
echo '<p class="error">Query unsuccessful: ' . mysql_error() . ' ' .
$query . '</p>';
$query = "INSERT INTO `$db_settings` VALUES ('owned_template_footer', " .
"'Owned template footer', '</p>', 'owned listings are shown.')";
$success = mysql_query( $query ) or die( '<p class="error">Error ' .
'executing query: ' . mysql_error() . ';
' . $query . '</p>' );
if( !$success )
echo '<p class="error">Query unsuccessful: ' . mysql_error() . ' ' .
$query . '</p>';
$query = "INSERT INTO `$db_settings` VALUES ('owned_template_header', " .
"'Owned template header', '<p class=\"center\">', 'Text inserted " .
"directly before owned listings are shown.')";
$success = mysql_query( $query ) or die( '<p class="error">Error ' .
'executing query: ' . mysql_error() . ';
' . $query . '</p>' );
if( !$success )
echo '<p class="error">Query unsuccessful: ' . mysql_error() . ' ' .
$query . '</p>';
foreach( $_POST as $field => $value ) {
if( $field != 'install' && $field != 'passwordv' &&
$field != 'login_password' ) {
$title = '';
$help = '';
switch( $field ) {
case 'affiliates_dir' :
$title = 'Collective Affiliates Directory';
$help = 'Directory where your collective affiliates images ' .
'(if any) are stored.';
break;
case 'collective_title' :
$title = 'Collective Title';
$help = 'Your collective title.';
break;
case 'collective_url' :
$title = 'Collective URL';
$help = 'Web address of your collective.';
break;
case 'date_format' :
$title = 'Date format';
$help = 'Date format (same as PHP variables).';
break;
case 'installation_path' :
$title = 'Installation Path (Absolute)';
$help = 'Installation path (absolute path) for this ' .
'installation of Enthusiast 3.';
break;
case 'joined_images_dir' :
$title = 'Joined images directory';
$help = 'Directory where your joined images will be stored. ' .
'This should be an absolute path, and a trailing slash is ' .
'important.';
break;
case 'link_target' :
$title = 'Link targets';
$help = 'Your link target (_blank, _top, _self, etc.)';
break;
case 'owned_images_dir';
$title = 'Owned images directory';
$help = 'Directory where your owned listing images will be ' .
'stored. This should be an absolute path, and a trailing ' .
'slash is important.';
break;
case 'owner_email' :
$title = 'Your email';
$help = 'Your email address for outgoing emails.';
break;
case 'owner_name' :
$title = 'Your name';
$help = 'Your name for outgoing emails.';
break;
case 'password' :
$title = 'Password';
$help = 'The password used to log into this installation of ' .
'Enthusiast 3.';
break;
case 'per_page' :
$title = 'Number of items per page';
$help = 'Number of items shown per page on any given view.';
break;
case 'root_path_absolute' :
$title = 'Root absolute path';
$help = 'Absolute path of your root directory (i.e., ' .
'/home/username/public_html/)';
break;
case 'root_path_web' :
$title = 'Root web address';
$help = 'Web address of your root directory ' .
'(i.e.,
http://yourdomain.com)';
break;
case 'log_errors' :
$title = 'Log errors?';
$help = 'Turn error logging on or off.';
break;
case 'mail_settings' :
$title = 'Mail interface setting';
$help = 'Which mail interface to use (or PHP\\\'s native ' .
'mail() function)';
break;
case 'sendmail_path' :
$title = 'Sendmail path';
$help = 'The location of the sendmail program on the filesystem. ';
break;
case 'sendmail_args' :
$title = 'Additional sendmail arguments';
$help = 'Additional parameters to pass to the sendmail.';
break;
case 'smtp_host' :
$title = 'SMTP host';
$help = 'The SMTP server to connect to.';
break;
case 'smtp_port' :
$title = 'SMTP port';
$help = 'The port to connect to on the SMTP server.';
break;
case 'smtp_auth' :
$title = 'Use SMTP authentication?';
$help = 'Whether or not to use SMTP authentication.';
break;
case 'smtp_username' :
$title = 'SMTP username';
$help = 'The username to use for SMTP authentication.';
break;
case 'smtp_password' :
$title = 'SMTP password';
$help = 'The password to use for SMTP authentication.';
break;
default :
break;
}
$query = "INSERT INTO `$db_settings` VALUES ('$field', " .
"'$title', '$value', '$help')";
if( $field == 'password' ) {
$query = "INSERT INTO `$db_settings` VALUES ('$field', " .
"'$title', MD5( '$value' ), '$help')";
}
if( $field != 'passwordv' ) {
$success = mysql_query( $query ) or die( '<p class="error">' .
'Error executing query: ' . mysql_error() . ';
' . $query .
'</p>' );
if( !$success )
echo '<p class="error">Query unsuccessful: ' .
mysql_error() . ' ' . $query . '</p>';
}
}
}
?>