Browse Source

Installed laminas-feed

pull/5/head
parent
commit
5259bd422a
Signed by: aayla GPG Key ID: B9ECA7B2228FC760
3 changed files with 16 additions and 28 deletions
  1. +3
    -1
      composer.json
  2. +2
    -1
      index.php
  3. +11
    -26
      news/index.php

+ 3
- 1
composer.json View File

@ -26,6 +26,8 @@
"ext-openssl": "*",
"stripe/stripe-php": "^7.51",
"socialconnect/auth": "^3.0",
"socialconnect/http-client": "*"
"socialconnect/http-client": "*",
"laminas/laminas-feed": "^2.14",
"laminas/laminas-http": "^2.14"
}
}

+ 2
- 1
index.php View File

@ -410,7 +410,8 @@
</div>
<div id="banner">
<?php
// $blogfeed = new SimpleXMLElement('https://blog.socialistra.org/rss', true);
// var_dump($blogfeed);
?>
<div id="overlay"></div>


+ 11
- 26
news/index.php View File

@ -15,6 +15,11 @@
//
// You should have received a copy of the GNU General Public License
// along with website. If not, see <http://www.gnu.org/licenses/>.
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
?>
<!DOCTYPE html>
<html lang="en">
@ -122,33 +127,13 @@
<hr>
<!-- Content Goes Here -->
<?php
// Read folders from stories
$iterator = new DirectoryIterator('./stories');
$stories = array();
foreach ($iterator as $file) {
if ($file->isDot()) {
continue;
require "../vendor/autoload.php";
$feed = Laminas\Feed\Reader\Reader::import('http://blog.socialistra.org/rss');
foreach ($feed as $entry) {
echo 'Title: ' . $entry->getTitle() . "\n";
echo 'Description: ' . $entry->getDescription() . "\n";
echo 'URL: ' . $entry->getLink() . "\n\n";
}
$stories[] = $file->getFilename();
}
// Invert the array to get into correct order
arsort($stories);
foreach ($stories as $story) {
$data = json_decode(
file_get_contents("./stories/$story/meta.json"), true
);
echo '<a href="./story.php?id='.$story.'">
<div id="biotext"><img src="https://srastatic.nyc3.cdn.digitaloceanspaces.com/web/img/news/' . $story . '/' . $data['thumb'].'" class="bio">
<div id="biodesk">
<div id="chaplist">
<h1>'.$data['title'].'</h1>
<h2>'.$data['subtitle'].'</h2>
</div>
</div>
</div>
</a><hr>
';
}
?>
<?php include("../res/php/bottom.php") ?>
</body>

Loading…
Cancel
Save