<?php 
require_once('scripts/sb_functions.php');
global $logged_in;
$logged_in = logged_in( true, true );
	
read_config();
		
if ( isset( $_GET[ 'blog_language' ] ) ) {	
    $blog_config[ 'blog_language' ] = $_GET[ 'blog_language' ];
}
sb_language( 'info' );
		
// "CGI" Functions
if ( array_key_exists( 'info_keywords', $_POST ) && array_key_exists( 'info_description', $_POST ) && array_key_exists( 'info_copyright', $_POST ) ) {	
    $ok = write_metainfo( 	sb_stripslashes( $_POST[ 'info_keywords' ] ),
				sb_stripslashes( $_POST[ 'info_description' ] ),
				sb_stripslashes( $_POST[ 'info_copyright' ] ) );
								
    if ( $ok === true ) {	
	redirect_to_url( 'index.php' );
    }
}


$extra_header = '
	<script type="text/javascript">
		<!--
		function validate(theform) {
			if (theform.blog_title.value=="" || theform.blog_author.value=="" || theform.blog_footer.value=="" ) {
				alert("<?php echo( $lang_string[ "form_error" ] ); ?>");
				return false;
			} else {
				return true;
			}
		}
		//-->
	</script>
';

html_header($extra_header,false);




function page_content() {
    global $lang_string, $user_colors, $blog_config;
		
    if ( array_key_exists( "info_keywords", $_POST ) && array_key_exists( "info_description", $_POST ) && array_key_exists( "info_copyright", $_POST ) ) {	
	// Check to see if we're posting data...
	global $ok;
	if ( $ok !== true ) {
	    echo( $lang_string[ 'error' ] . $ok . '<p />' );
	}
	echo( '<a href="index.php">' . $lang_string[ 'home' ] . '</a><br /><br />' );
    } else {
    ?>
			
<h2><?php echo( $lang_string[ 'title' ] ); ?></h2>
<?php echo( $lang_string[ 'instructions' ] ); ?><p />
			
<div class="hr"><hr /></div>
			
<form accept-charset="<?php echo( $lang_string[ 'html_charset' ] ); ?>,iso-8859-1,utf-8" action="info.php" method="post" name="info">
				
<label for="info_keywords"><?php echo( $lang_string[ 'info_keywords' ] ); ?></label><br />
<textarea style="width: <?php global $theme_vars; echo( $theme_vars[ 'max_image_width' ] ); ?>px;" id="info_keywords" name="info_keywords" rows="5" cols="50"><?php echo($blog_config[ 'info_keywords' ]); ?></textarea><br /><br />
				
<label for="info_description"><?php echo( $lang_string[ 'info_description' ] ); ?></label><br />
<textarea style="width: <?php global $theme_vars; echo( $theme_vars[ 'max_image_width' ] ); ?>px;" id="info_description" name="info_description" rows="5" cols="50"><?php echo($blog_config[ 'info_description' ]); ?></textarea><br /><br />
	
<label for="info_copyright"><?php echo( $lang_string[ 'info_copyright' ] ); ?></label><br />
<textarea style="width: <?php global $theme_vars; echo( $theme_vars[ 'max_image_width' ] ); ?>px;" id="info_copyright" name="info_copyright" rows="5" cols="50"><?php echo($blog_config[ 'info_copyright' ]); ?></textarea><br />
			
<div class="hr"><hr /></div>
		
<input type="submit" name="submit" value="<?php echo( $lang_string[ 'submit_btn' ] ); ?>" /><br /><br />
</form>
			
<?php 

	}
}
theme_pagelayout();
html_footer();


?>
