$1'; // Check for [quote] text $Text = preg_replace("/\[quote\](.*?)\[\/quote\]/ism","$QuoteLayout", $Text); - + + // Check for [quote=Author] text + + $t_wrote = t('$1 wrote:'); + + $Text = preg_replace("/\[quote=[\"\']*(.*?)[\"\']*\](.*?)\[\/quote\]/ism", + "
" . $t_wrote . " $2", + $Text); + // [img=widthxheight]image source[/img] $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '
Memory used: | $mem_used MB |
Peak memory used: | $peak_mem_used MB |
Time taken: | $time_taken sec |
\n";
+
+ echo "Checking database file name … ";
+
+ if($dbfile == "") {
+ echo "Please provide the name of the database file!
\n";
+ $failed = TRUE;
+ }
+ else
+ echo "$dbfile
\n";
+
+ if(!$failed) {
+
+ echo "Touching/Creating " . htmlentities($dbfile) . " … ";
+
+ if(touch($dbfile) === FALSE) {
+ echo "Failed to touch the database file. Please check the given filename and/or fix the permissions of $dbfile_directory.
\n";
+ $failed = TRUE;
+ }
+ else
+ echo "done
\n";
+
+ }
+
+ if(!$failed) {
+
+ echo "Setting file permissions to 0666 &hellip ";
+
+ if(chmod($dbfile, 0666) === FALSE) {
+ echo "Failed to change the permissions of $dbfile_directory/$dbfile. Please adjust them manually.
\n";
+ $failed = TRUE;
+ }
+ else
+ echo "done
\n";
+
+ }
+
+ if(!$failed) {
+
+ echo "Checking if the given file is empty &hellip ";
+
+ if(filesize($dbfile) > 0) {
+ echo "$dbfile_directory/$dbfile is not empty. Can't create a new database. Please delete/empty this file or give another filename.
\n";
+ $failed = TRUE;
+ }
+ else
+ echo "it is
\n";
+
+ }
+
+ if(!$failed) {
+
+ echo "Connecting to $dbfile … ";
+
+ $db = dba_open($dbfile, "c", $_POST['handler']);
+
+ if($db === FALSE) {
+ echo "Could not connect to the database!
\n";
+ $failed = TRUE;
+ }
+ else
+ echo "done
\n";
+
+ }
+
+ if(!$failed) {
+
+ echo "Storing necessary internal variables &hellip ";
+
+ $internals = array(
+ "bayes*dbversion" => "2",
+ "bayes*texts.ham" => "0",
+ "bayes*texts.spam" => "0"
+ );
+
+ foreach($internals as $key => $value) {
+ if(dba_insert($key, $value, $db) === FALSE) {
+ echo "Failed to insert data!
\n";
+ $failed = TRUE;
+ break;
+ }
+ }
+
+ if(!$failed)
+ echo "done
\n";
+
+ }
+
+ if(!$failed) {
+
+ echo "Trying to read data from the database &hellip ";
+
+ $dbversion = dba_fetch("bayes*dbversion", $db);
+
+ if($dbversion != "2") {
+ echo "Failed to read data!
\n";
+ $failed = TRUE;
+ }
+ else
+ echo "success
\n";
+ }
+
+ if(!$failed) {
+
+ dba_close($db);
+
+ echo "
Successfully created a new b8 database!
\n\n"; + echo "Filename: | $dbfile_directory/$dbfile |
DBA handler: | {$_POST['handler']} |
Move this file to it's destination directory (default: the base directory of b8) to use it with b8. Be sure to use the right DBA handler in b8's configuration."; + + } + + echo "
\n\n"; + +} + +if($failed === TRUE or !isset($_POST['handler'])) { + +echo <<+The following table shows all available DBA handlers. Please choose the "Berkeley DB" one. +
+ +Handler | Description | |
$name | $version |