diff --git a/Editor-Save.php b/Editor-Save.php index fcfee7d..4489cbf 100644 --- a/Editor-Save.php +++ b/Editor-Save.php @@ -1,3 +1,10 @@ + + '; diff --git a/ReadMe.md b/ReadMe.md new file mode 100644 index 0000000..e8602e8 --- /dev/null +++ b/ReadMe.md @@ -0,0 +1,5 @@ +# ImgAnnotations +Basic intergration of picture-annotation library for PHP and MySQL +Library link: https://github.com/mkalus/picture-annotation + +Inital setup can be done after cloning into a webroot with PHP, and then going to setup.php \ No newline at end of file diff --git a/Viewer.php b/Viewer.php index e5a4d9b..fb99882 100644 --- a/Viewer.php +++ b/Viewer.php @@ -1,4 +1,9 @@ .EditorDialog{display:none;}'; diff --git a/db.php.sample b/db.php.sample index 69f9d95..b36e735 100644 --- a/db.php.sample +++ b/db.php.sample @@ -1,4 +1,8 @@ + +"; + echo "DBName:

"; + echo "DBUser:

"; + echo "DBPassword:

"; + echo "
"; + echo ""; +} + +if ($step == '2') { + echo "If conection faild click here
"; + require_once "$configfilePath"; + mysqli_close($mysqli); + header("Location: setup.php?step=3"); +} + + +if ($step == '3') { +echo "Populating DB"; +require_once "$configfilePath"; + $templine = ''; + $lines = file($sqlfileName); + $error = ''; + foreach ($lines as $line){ + if(substr($line, 0, 2) == '--' || $line == ''){ + continue; + } + $templine .= $line; + if (substr(trim($line), -1, 1) == ';'){ + if(!$mysqli->query($templine)){ + $error .= 'Error performing query "' . $templine . '": ' . $mysqli->error . '

'; + } + $templine = ''; + } + } +header("Location: setup.php?step=4"); +} + +if ($step == '4') { + echo "Setup done,removed unnecessary setup files
Go to index"; + unlink("$sqlfileName"); + unlink("$sampleconfigfilePath"); + unlink('setup.php'); +} + +?> \ No newline at end of file