Changeset View
Changeset View
Standalone View
Standalone View
index.php
1 | <?php | 1 | <?php | ||
---|---|---|---|---|---|
2 | require('aether/config.php'); | 2 | require('aether/config.php'); | ||
3 | 3 | | |||
4 | $pageConfig = array_merge($pageConfig, [ | 4 | $pageConfig = array_merge($pageConfig, [ | ||
5 | 'title' => "KDE Community Home", | 5 | 'title' => "KDE Community Home", | ||
6 | 'cssFile' => 'content/home/portal.css?ver=1.2' | 6 | 'cssFile' => 'content/home/portal.css?ver=1.2' | ||
7 | ]); | 7 | ]); | ||
8 | 8 | | |||
9 | require('aether/header.php'); | 9 | require('aether/header.php'); | ||
10 | 10 | | |||
11 | if (@include_once("libs/class_db.php")) { | 11 | if (@include_once("aetherlibs/DB.php")) { | ||
12 | define("FRONTPAGE_LIVE_FEED", true); | 12 | define("FRONTPAGE_LIVE_FEED", true); | ||
13 | } | | |||
14 | | ||||
15 | if (defined("FRONTPAGE_LIVE_FEED")) { | | |||
16 | require_once('users_conf.php'); | 13 | require_once('users_conf.php'); | ||
17 | require_once('aetherlibs/functions.php'); | 14 | require_once('aetherlibs/functions.php'); | ||
18 | require_once("aetherlibs/feeds.php"); | 15 | require_once("aetherlibs/feeds.php"); | ||
19 | } | 16 | } | ||
20 | 17 | | |||
21 | ?> | 18 | ?> | ||
22 | 19 | | |||
23 | 20 | | |||
▲ Show 20 Lines • Show All 126 Lines • ▼ Show 20 Line(s) | 117 | <h2 class="mb-3">Announcements</h2> | |||
150 | </ul> | 147 | </ul> | ||
151 | 148 | | |||
152 | <a href="announcements/" class="learn-more" style="font-weight: bold;">📢 View all announcements</a> | 149 | <a href="announcements/" class="learn-more" style="font-weight: bold;">📢 View all announcements</a> | ||
153 | </section> | 150 | </section> | ||
154 | 151 | | |||
155 | <section id="homeFeedList" class="col-md"> | 152 | <section id="homeFeedList" class="col-md"> | ||
156 | <?php if (defined("FRONTPAGE_LIVE_FEED")): ?> | 153 | <?php if (defined("FRONTPAGE_LIVE_FEED")): ?> | ||
157 | <h2 class="mb-3">News</h2> | 154 | <h2 class="mb-3">News</h2> | ||
158 | <ul style="list-style-type: none; padding: 0px; margin: 0px;"> | 155 | <ul class="list-unstyled p-0 m-0"> | ||
159 | <?php | 156 | <?php | ||
160 | 157 | | |||
161 | $items = Feeds::news(20); | 158 | $items = Feeds::news(20); | ||
162 | //$items = array_merge($items, Feeds::blog(8)); | 159 | //$items = array_merge($items, Feeds::blog(8)); | ||
163 | 160 | | |||
164 | svsort($items, 'timestamp'); | 161 | svsort($items, 'timestamp'); | ||
165 | 162 | | |||
166 | foreach ($items as $i) { | 163 | foreach ($items as $i) { | ||
Show All 10 Lines | |||||
177 | 174 | | |||
178 | ?> | 175 | ?> | ||
179 | </ul> | 176 | </ul> | ||
180 | 177 | | |||
181 | <a href="https://dot.kde.org/" class="learn-more" style="font-weight: bold;">📰 Read more news</a> | 178 | <a href="https://dot.kde.org/" class="learn-more" style="font-weight: bold;">📰 Read more news</a> | ||
182 | <?php endif; ?> | 179 | <?php endif; ?> | ||
183 | 180 | | |||
184 | <h2 class="mb-3">Community Blog Posts</h2> | 181 | <h2 class="mb-3">Community Blog Posts</h2> | ||
185 | 182 | <ul class="list-unstyled m-0 p-0"> | |||
186 | <?php | 183 | <?php | ||
187 | 184 | $items = Feeds::planet(3); | |||
188 | $feed = simplexml_load_file('https://planet.kde.org/rss20.xml'); | 185 | foreach ($items as $item) { | ||
189 | if ($feed !== FALSE) { | | |||
190 | print '<ul class="list-unstyled m-0 p-0">'; | | |||
191 | for( $i= 0 ; $i <= 3 ; $i++ ) { | | |||
192 | $item = $feed->channel->item[$i]; | | |||
193 | $title = (string) $item->title; | | |||
194 | $url = (string) $item->link; | | |||
195 | | ||||
196 | printf( | 186 | printf( | ||
197 | '<li><a href="%s" class="learn-more">%s</a></li>', | 187 | '<li><a href="%s" class="learn-more">%s</a></li>', | ||
198 | $url, | 188 | htmlspecialchars($item['url']), | ||
199 | $title | 189 | htmlspecialchars($item['title']) | ||
200 | ); | 190 | ); | ||
201 | }; | | |||
202 | print '</ul>'; | | |||
203 | } | 191 | } | ||
204 | ?> | 192 | ?> | ||
193 | </ul> | ||||
205 | <a href="https://planet.kde.org/" class="learn-more" style="font-weight: bold;">🌍 Read our blogs on Planet KDE</a> | 194 | <a href="https://planet.kde.org/" class="learn-more" style="font-weight: bold;">🌍 Read our blogs on Planet KDE</a> | ||
206 | </section> | 195 | </section> | ||
207 | </div> | 196 | </div> | ||
208 | </main> | 197 | </main> | ||
209 | 198 | | |||
210 | <?php | 199 | <?php | ||
211 | 200 | | |||
212 | require('aether/footer.php'); | 201 | require('aether/footer.php'); | ||
213 | 202 | | |||
214 | ?> | 203 | ?> |