1

Update index.php

This commit is contained in:
Evan Pratten 2017-09-10 12:08:08 -04:00 committed by GitHub
parent 069a40f5f6
commit ebe84b057f

View File

@ -62,7 +62,16 @@
<div class="rantlist-bg"> <div class="rantlist-bg">
<ul class="rantlist"> <ul class="rantlist">
<?php <?php
$url = './content/test.json'; $path = "./content/";
if ($handle = opendir($path)) {
while (false !== ($file = readdir($handle))) {
if ('.' === $file) continue;
if ('..' === $file) continue;
// do something with the file
$url = $file;
$content = file_get_contents($url); $content = file_get_contents($url);
$json = json_decode($content, true); $json = json_decode($content, true);
echo '<li class="rant-comment-row-widget" data-id="829770" data-type="rant"><div class="rantlist-title-text">'; echo '<li class="rant-comment-row-widget" data-id="829770" data-type="rant"><div class="rantlist-title-text">';
@ -72,7 +81,10 @@
echo ' src="'; echo ' src="';
echo $json{src}; echo '" href="'; echo $json{src}; echo '" href="';
echo $json{href}; echo $json{href};
echo '" width=100%></ul></div>' echo '" width=100%></ul></div>';
}
closedir($handle);
}
?> ?>