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("config.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'); | | |||
17 | require_once('aetherlibs/functions.php'); | 13 | require_once('aetherlibs/functions.php'); | ||
18 | require_once("aetherlibs/feeds.php"); | 14 | require_once("aetherlibs/feeds.php"); | ||
19 | } | 15 | } | ||
20 | 16 | | |||
21 | ?> | 17 | ?> | ||
22 | 18 | | |||
23 | 19 | | |||
24 | <section id="headerCarousel" class="heroDisplay carousel slide overlay" data-ride="carousel"> | 20 | <section id="headerCarousel" class="heroDisplay carousel slide overlay" data-ride="carousel"> | ||
▲ Show 20 Lines • Show All 119 Lines • ▼ Show 20 Line(s) | 115 | <h2 class="mb-3">Announcements</h2> | |||
144 | </ul> | 140 | </ul> | ||
145 | 141 | | |||
146 | <a href="announcements/" class="learn-more" style="font-weight: bold;">📢 View all announcements</a> | 142 | <a href="announcements/" class="learn-more" style="font-weight: bold;">📢 View all announcements</a> | ||
147 | </section> | 143 | </section> | ||
148 | 144 | | |||
149 | <section id="homeFeedList" class="col-md"> | 145 | <section id="homeFeedList" class="col-md"> | ||
150 | <?php if (defined("FRONTPAGE_LIVE_FEED")): ?> | 146 | <?php if (defined("FRONTPAGE_LIVE_FEED")): ?> | ||
151 | <h2 class="mb-3">News</h2> | 147 | <h2 class="mb-3">News</h2> | ||
152 | <ul style="list-style-type: none; padding: 0px; margin: 0px;"> | 148 | <ul class="list-unstyled p-0 m-0"> | ||
153 | <?php | 149 | <?php | ||
150 | $feeds = new Feeds($dbConnection); | ||||
154 | 151 | | |||
155 | $items = Feeds::news(20); | 152 | $items = $feeds->news(20); | ||
156 | //$items = array_merge($items, Feeds::blog(8)); | 153 | //$items = array_merge($items, Feeds::blog(8)); | ||
157 | 154 | | |||
158 | svsort($items, 'timestamp'); | 155 | svsort($items, 'timestamp'); | ||
159 | 156 | | |||
160 | foreach ($items as $i) { | 157 | foreach ($items as $i) { | ||
161 | $i['url'] = htmlspecialchars($i['url']); | 158 | $i['url'] = htmlspecialchars($i['url']); | ||
162 | $i['title'] = htmlspecialchars($i['title']); | 159 | $i['title'] = htmlspecialchars($i['title']); | ||
163 | $i['user'] = htmlspecialchars( | 160 | $i['user'] = htmlspecialchars( | ||
164 | isset($kde_contributors[$i['user']]) && isset($kde_contributors[$i['user']]['name']) ? | 161 | isset($kde_contributors[$i['user']]) && isset($kde_contributors[$i['user']]['name']) ? | ||
165 | $kde_contributors[$i['user']]['name'] : | 162 | $kde_contributors[$i['user']]['name'] : | ||
166 | $i['user'] | 163 | $i['user'] | ||
167 | ); | 164 | ); | ||
168 | 165 | | |||
169 | echo '<li><a href="'.$i['url'].'" class="learn-more">'.$i['title'].'</a></li>'; | 166 | echo '<li><a href="'.$i['url'].'" class="learn-more">'.$i['title'].'</a></li>'; | ||
170 | } | 167 | } | ||
171 | 168 | | |||
172 | ?> | 169 | ?> | ||
173 | </ul> | 170 | </ul> | ||
174 | 171 | | |||
175 | <a href="https://dot.kde.org/" class="learn-more" style="font-weight: bold;">📰 Read more news</a> | 172 | <a href="https://dot.kde.org/" class="learn-more" style="font-weight: bold;">📰 Read more news</a> | ||
176 | <?php endif; ?> | 173 | <?php endif; ?> | ||
177 | 174 | | |||
178 | <h2 class="mb-3">Community Blog Posts</h2> | 175 | <h2 class="mb-3">Community Blog Posts</h2> | ||
179 | 176 | <ul class="list-unstyled m-0 p-0"> | |||
180 | <?php | 177 | <?php | ||
181 | 178 | $items = Feeds::planet(3); | |||
182 | $feed = simplexml_load_file('https://planet.kde.org/rss20.xml'); | 179 | foreach ($items as $item) { | ||
183 | if ($feed !== FALSE) { | | |||
184 | print '<ul class="list-unstyled m-0 p-0">'; | | |||
185 | for( $i= 0 ; $i <= 3 ; $i++ ) { | | |||
186 | $item = $feed->channel->item[$i]; | | |||
187 | $title = (string) $item->title; | | |||
188 | $url = (string) $item->link; | | |||
189 | | ||||
190 | printf( | 180 | printf( | ||
191 | '<li><a href="%s" class="learn-more">%s</a></li>', | 181 | '<li><a href="%s" class="learn-more">%s</a></li>', | ||
192 | $url, | 182 | htmlspecialchars($item['url']), | ||
193 | $title | 183 | htmlspecialchars($item['title']) | ||
194 | ); | 184 | ); | ||
195 | }; | | |||
196 | print '</ul>'; | | |||
197 | } | 185 | } | ||
198 | ?> | 186 | ?> | ||
187 | </ul> | ||||
199 | <a href="https://planet.kde.org/" class="learn-more" style="font-weight: bold;">🌍 Read our blogs on Planet KDE</a> | 188 | <a href="https://planet.kde.org/" class="learn-more" style="font-weight: bold;">🌍 Read our blogs on Planet KDE</a> | ||
200 | </section> | 189 | </section> | ||
201 | </div> | 190 | </div> | ||
202 | </main> | 191 | </main> | ||
203 | 192 | | |||
204 | <?php | 193 | <?php | ||
205 | 194 | | |||
206 | require('aether/footer.php'); | 195 | require('aether/footer.php'); | ||
207 | 196 | | |||
208 | ?> | 197 | ?> |