Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed showing more than 1 image, and fixed preg_splits

  • Loading branch information...
commit b416f36e23ddd12fcb947b7c2dd67eead58649b7 1 parent 9b0a5f9
ionstorm66 ionstorm66 authored
Showing with 7 additions and 9 deletions.
  1. +7 −9 SuperSimpleBlogScriptV2_5_7/index.php
16 SuperSimpleBlogScriptV2_5_7/index.php
View
@@ -151,7 +151,7 @@ function escape_data ($data) {
//****UPLOAD IMAGES************************************************************************
//split the filenames into an array
- $filesArray = preg_split(", ", $filename);
+ $filesArray = preg_split("/, /", $filename);
if ($result) {
//Move file(s) over
@@ -288,16 +288,14 @@ function cleanEntry($_entry_str){
echo "<a id=\"{$row[4]}\"></a><p class=\"time\">$dateTime</p>"; //anchor tag set for easier linking
echo "<h1 class=\"title\">{$row[2]}</h1>\n";
-$ima = preg_split(", ", $row[1]); //build array out of images list
+$ima = preg_split("/, /", $row[1]); //build array out of images list
for($i=0; $i<count($ima); $i++){
- if($imagesPerEntry == 1){
- if(!empty($ima[$i])) {
- if(substr($ima[$i],-4) != '.pdf'){ //filter out PDFs
- echo "<img src=\"blogImages/$ima[$i]\" class=\"im\" alt=\"$ima[$i]\" />\n";
- }else{ //handle PDFs
+ if(!empty($ima[$i])) {
+ if(substr($ima[$i],-4) != '.pdf'){ //filter out PDFs
+ echo "<img src=\"blogImages/$ima[$i]\" class=\"im\" alt=\"$ima[$i]\" />\n</br>\n";
+ }else{ //handle PDFs
echo "<a href=\"blogImages/$ima[$i]\" target=\"_blank\"><img src=\"im/pdfIcon.gif\" border=\"0\" class=\"im\" alt=\"PDF\" /> $ima[$i]</a>";
- }
- }
+ }
}
}
//****************************************************************************************
Please sign in to comment.
Something went wrong with that request. Please try again.