]> git.mxchange.org Git - friendica.git/blob - library/simplepie/demo/minimalistic.php
added index to config and pconfig table
[friendica.git] / library / simplepie / demo / minimalistic.php
1 <?php
2
3 function microtime_float()
4 {
5         if (version_compare(phpversion(), '5.0.0', '>='))
6         {
7                 return microtime(true);
8         }
9         else
10         {
11                 list($usec, $sec) = explode(' ', microtime());
12                 return ((float) $usec + (float) $sec);
13         }
14 }
15
16 $start = microtime_float();
17
18 include('../simplepie.inc');
19
20 // Parse it
21 $feed = new SimplePie();
22 if (!empty($_GET['feed']))
23 {
24         if (get_magic_quotes_gpc())
25         {
26                 $_GET['feed'] = stripslashes($_GET['feed']);
27         }
28         $feed->set_feed_url($_GET['feed']);
29         $feed->init();
30 }
31 $feed->handle_content_type();
32
33 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
34
35 <html xmlns="http://www.w3.org/1999/xhtml">
36 <head>
37 <title><?php echo (empty($_GET['feed'])) ? 'SimplePie' : 'SimplePie: ' . $feed->get_title(); ?></title>
38
39 <!-- META HTTP-EQUIV -->
40 <meta http-equiv="content-type" content="text/html; charset=<?php echo ($feed->get_encoding()) ? $feed->get_encoding() : 'UTF-8'; ?>" />
41 <meta http-equiv="imagetoolbar" content="false" />
42
43 <style type="text/css">
44 html, body {
45         height:100%;
46         margin:0;
47         padding:0;
48 }
49
50 h1 {
51         background-color:#333;
52         color:#fff;
53         font-size:3em;
54         margin:0;
55         padding:5px 15px;
56         text-align:center;
57 }
58
59 div#footer {
60         padding:5px 0;
61 }
62
63 div#footer,
64 div#footer a {
65         text-align:center;
66         font-size:0.7em;
67 }
68
69 div#footer a {
70         text-decoration:underline;
71 }
72
73 code {
74         background-color:#f3f3ff;
75         color:#000;
76 }
77
78 pre {
79         background-color:#f3f3ff;
80         color:#000080;
81         border:1px dotted #000080;
82         padding:3px 5px;
83 }
84
85 form {
86         margin:0;
87         padding:0;
88 }
89
90 div.chunk {
91         border-bottom:1px solid #ccc;
92 }
93
94 form#sp_form {
95         text-align:center;
96         margin:0;
97         padding:0;
98 }
99
100 form#sp_form input.text {
101         width:85%;
102 }
103 </style>
104
105 </head>
106
107 <body>
108         <h1><?php echo (empty($_GET['feed'])) ? 'SimplePie' : 'SimplePie: ' . $feed->get_title(); ?></h1>
109
110         <form action="" method="get" name="sp_form" id="sp_form">
111                 <p><input type="text" name="feed" value="<?php echo ($feed->subscribe_url()) ? htmlspecialchars($feed->subscribe_url()) : 'http://'; ?>" class="text" id="feed_input" />&nbsp;<input type="submit" value="Read" class="button" /></p>
112         </form>
113
114         <div id="sp_results">
115                 <?php if ($feed->data): ?>
116                         <?php $items = $feed->get_items(); ?>
117                         <p align="center"><span style="background-color:#ffc;">Displaying <?php echo $feed->get_item_quantity(); ?> most recent entries.</span></p>
118                         <?php foreach($items as $item): ?>
119                                 <div class="chunk" style="padding:0 5px;">
120                                         <h4><a href="<?php echo $item->get_permalink(); ?>"><?php echo $item->get_title(); ?></a> <?php echo $item->get_date('j M Y'); ?></h4>
121                                         <?php echo $item->get_content(); ?>
122                                         <?php
123                                         if ($enclosure = $item->get_enclosure(0))
124                                                 echo '<p><a href="' . $enclosure->get_link() . '" class="download"><img src="./for_the_demo/mini_podcast.png" alt="Podcast" title="Download the Podcast" border="0" /></a></p>';
125                                         ?>
126                                 </div>
127                         <?php endforeach; ?>
128                         </div>
129                 <?php endif; ?>
130         </div>
131
132         <div id="footer">
133                 Powered by <?php echo SIMPLEPIE_LINKBACK; ?>, a product of <a href="http://www.skyzyx.com">Skyzyx Technologies</a>.<br />
134                 Page created in <?php echo round(microtime_float()-$start, 3); ?> seconds.
135         </div>
136 </body>
137 </html>