From 94f344146f688c245fe3a6abfe2827f59cee3fbc Mon Sep 17 00:00:00 2001
From: Florian Bieringer <florian.bieringer@uni-passau.de>
Date: Sun, 12 Jul 2015 11:00:01 +0200
Subject: [PATCH] Show latest plugins in overview

---
 controllers/presenting.php          | 2 ++
 views/presenting/overview_tiles.php | 9 ++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/controllers/presenting.php b/controllers/presenting.php
index 4cf17d6..c0058cb 100644
--- a/controllers/presenting.php
+++ b/controllers/presenting.php
@@ -89,6 +89,8 @@ class PresentingController extends MarketController
         }
 
         $this->plugins = MarketPlugin::findBySQL("publiclyvisible = 1 AND approved = 1 ORDER BY RAND() LIMIT 3");
+        
+        $this->latest_plugins = MarketPlugin::findBySQL("publiclyvisible = 1 AND approved = 1 ORDER BY mkdate DESC LIMIT 5");
 
         $this->best_plugins = MarketPlugin::findBySQL("publiclyvisible = 1 AND approved = 1 ORDER BY rating DESC LIMIT 6");
 
diff --git a/views/presenting/overview_tiles.php b/views/presenting/overview_tiles.php
index 5fec087..175e15e 100644
--- a/views/presenting/overview_tiles.php
+++ b/views/presenting/overview_tiles.php
@@ -1,5 +1,5 @@
 <? if ($show_all) : ?>
-    <h2><?=count($plugins)?>&nbsp;<?= _('Plugins') ?></h2>
+    <h2><?= count($plugins) ?>&nbsp;<?= _('Plugins') ?></h2>
     <div class="plugins_shortview">
         <? foreach ($plugins as $marketplugin) : ?>
             <?= $this->render_partial("presenting/_plugin_short.php", compact("marketplugin", "plugin")) ?>
@@ -15,6 +15,13 @@
         </div>
     <? endif ?>
 
+    <h2><?= _("Neueste Plugins") ?></h2>
+    <div class="plugins_shortview">
+        <? foreach ($latest_plugins as $marketplugin) : ?>
+            <?= $this->render_partial("presenting/_plugin_short.php", compact("marketplugin", "plugin")) ?>
+        <? endforeach ?>
+    </div>
+
     <h2><?= _("Zuf�llige Plugins") ?></h2>
     <div class="plugins_shortview">
         <? foreach ($plugins as $marketplugin) : ?>
-- 
GitLab