From 4824587b459ffff1bdf2911113ca386845b3fc5d Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Tue, 12 Sep 2017 19:48:05 -0400 Subject: [PATCH] Add files via upload --- community/getrss.php | 39 ++++++++++++++++++++++++++ community/index.php | 56 +++++++++++++++++-------------------- community/phpjsonloader.php | 27 ++++++++++++++++++ 3 files changed, 91 insertions(+), 31 deletions(-) create mode 100644 community/getrss.php create mode 100644 community/phpjsonloader.php diff --git a/community/getrss.php b/community/getrss.php new file mode 100644 index 0000000..180577e --- /dev/null +++ b/community/getrss.php @@ -0,0 +1,39 @@ +load($xml); + +//get elements from "" +$channel=$xmlDoc->getElementsByTagName('channel')->item(0); +$channel_title = $channel->getElementsByTagName('title') +->item(0)->childNodes->item(0)->nodeValue; +$channel_link = $channel->getElementsByTagName('link') +->item(0)->childNodes->item(0)->nodeValue; +$channel_desc = $channel->getElementsByTagName('description') +->item(0)->childNodes->item(0)->nodeValue; + +//output elements from "" +echo("

" . $channel_title . ""); +echo("
"); +echo($channel_desc . "

"); + + +//get and output "" elements +$x=$xmlDoc->getElementsByTagName('item'); +for ($i=0; $i<=2; $i++) { + $item_title=$x->item($i)->getElementsByTagName('title') + ->item(0)->childNodes->item(0)->nodeValue; + $item_link=$x->item($i)->getElementsByTagName('link') + ->item(0)->childNodes->item(0)->nodeValue; + $item_desc=$x->item($i)->getElementsByTagName('description') + ->item(0)->childNodes->item(0)->nodeValue; + echo ("

" . $item_title . ""); + echo ("
"); + echo ($item_desc . "

"); +} +?> \ No newline at end of file diff --git a/community/index.php b/community/index.php index d512135..7380567 100644 --- a/community/index.php +++ b/community/index.php @@ -79,7 +79,7 @@
- Subscribe to RetryLife Official + Subscribe to Nathan Desjardins

@@ -97,36 +97,30 @@
    - -
    '; - echo $json{title}; - echo " - "; - echo $json{author}; - echo '
    <'; - echo $json{type}; - echo ' src="'; - echo $json{src}; echo '" href="'; - echo $json{href}; - echo '" width=100%>'; - echo $json{body}; - echo ''; - echo ''; - } - ?> - - - + + +
    RSS-feed will be listed here...
    +
diff --git a/community/phpjsonloader.php b/community/phpjsonloader.php new file mode 100644 index 0000000..dcfef7c --- /dev/null +++ b/community/phpjsonloader.php @@ -0,0 +1,27 @@ +
'; + echo $json{title}; + echo " - "; + echo $json{author}; + echo '
<'; + echo $json{type}; + echo ' src="'; + echo $json{src}; echo '" href="'; + echo $json{href}; + echo '" width=100%>'; + echo $json{body}; + echo ''; + echo ''; + } + ?> \ No newline at end of file