<commit_before><h1>Edit Blog Configuration</h1>
<p><strong>WARNING:</strong> proper PHP syntax must be observed, or your edits will crash blog! These tools are very primitive and will not validate your settings or your input.</p>
<?php

if ( isset( $_POST['blogid'] ) ){

	$config = file_get_contents('../../'.$_POST['blogid'].'/class_blogdef.php');
	$lines = count( explode( "\n", $config) )+4;

	if ( ! is_writable('../../'.$_POST['blogid'].'/class_blogdef.php') )
		print '<p>Warning: Gnat cannot write to the configuration file selected, settings cannot be saved.</p>';

	print '<form action="index.php?id=saveconf" method="post">
		<input type="hidden" name="rcfile" value="../../'.$_POST['blogid'].'/class_blogdef.php"/>
		<br />
		<textarea name="content" rows="'.$lines.'" cols="100" >'.$config.'</textarea>
		<br />
		<input type="submit" value="Save and Apply" />
		</form>';

}
else{

	print '<form name="create" action="index.php?id=editblog" method="post">
	Please enter a blog name to edit: <input type="text" name="blogid" />
	<input type="submit" value="Continue" />
	</form>';

}


?>
<br />
<br />
<p><a href="index.php">Back to webadmin panel (discarding changes)</a></p><commit_msg>improvements to code style, ability to retrieve blogid via GET<commit_after><h1>Edit Blog Configuration</h1>
<p><strong>WARNING:</strong> proper PHP syntax must be observed, or your edits will crash blog! These tools are very primitive and will not validate your settings or your input.</p>
<?php

if ( isset( $_POST['blogid'] ) || isset( $_GET['blogid'] ) ){

	$config = file_get_contents('../../'.$_POST['blogid'].'/class_blogdef.php');
	$lines = count( explode( "\n", $config) )+4;

	if ( ! is_writable('../../'.$_POST['blogid'].'/class_blogdef.php') )
		print '<p>Warning: Gnat cannot write to the configuration file selected, settings cannot be saved.</p>';

	print '<form action="index.php?id=saveconf" method="post">
		<input type="hidden" name="rcfile" value="../../'.$_POST['blogid'].'/class_blogdef.php"/>
		<br />
		<textarea name="content" rows="'.$lines.'" cols="100" >'.$config.'</textarea>
		<br />
		<input type="submit" value="Save and Apply" />
		</form>';

}
else{

	print '<form name="create" action="index.php?id=editblog" method="post">
	Please enter a blog name to edit: <input type="text" name="blogid" />
	<input type="submit" value="Continue" />
	</form>';

}


?>
<br />
<br />
<p><a href="index.php">Back to webadmin panel (discarding changes)</a></p>
{'fraction_non_alphanumeric': 0.21120515920999597, 'fraction_numerical': 0.0048367593712212815, 'mean_word_length': 4.640909090909091, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 57, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2752469', 'n_tokens_mistral': 844, 'n_tokens_neox': 806, 'n_words': 230}