-
+content);
+
+ foreach ($img_array as $img) {
+ echo '
'.$img[0].'';
+ }
+
+/*
+ $doc = new DOMDocument();
+ $doc->loadHTML($twt->content);
+ $img_array = $doc->getElementsByTagName('img');
+
+ foreach ($img_array as $img) {
+ $url = $img->getAttribute('src');
+ $alt = $img->getAttribute('alt');
+ //echo "
Title:" . $img->getAttribute('title');
+
+ echo "
})
";
+ }
+
+/*
+ foreach ($img_array as $img) {
+ echo $img[0];
+ $extension = pathinfo($img, PATHINFO_EXTENSION);
+ if (in_array(strtolower($extension), $allowedExtensions)) {
+ $imageURL = $galleryDir . $img;
+ $thumbURL = $thumbDir . $img;
+
+ if (!file_exists($thumbURL)) {
+ createThumbnail($imageURL, $thumbURL, 200); // The thumbnail will have a height of 200 pixels.
+ }
+
+ echo '
+
+ ';
+ }
+
+
+ }
+*/
+
+
+}
+?>
-
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/views/home.php b/views/home.php
index abf6d9b..7456ea2 100644
--- a/views/home.php
+++ b/views/home.php
@@ -1,32 +1,39 @@
-mainURL] = $parsedTwtxtFile;
include 'partials/profile.php';
}
-} ?>
-
+}
+?>
@@ -34,4 +41,3 @@ if( isset($_SESSION['password'])) {
-
diff --git a/views/new_twt.php b/views/new_twt.php
index 78754cf..1fafe3f 100644
--- a/views/new_twt.php
+++ b/views/new_twt.php
@@ -84,12 +84,11 @@ if (isset($_POST['submit'])) {
exit;
} else {
+ require_once("partials/base.php");
-require_once("partials/base.php");
+ $title = "New post - ".$title;
-$title = "New post - ".$title;
-
-include_once 'partials/header.php';
+ include_once 'partials/header.php';
?>