diff --git a/ground/controllers/FeedController.php b/ground/controllers/FeedController.php new file mode 100644 index 0000000..8afd6a0 --- /dev/null +++ b/ground/controllers/FeedController.php @@ -0,0 +1,71 @@ +getAll(array( + 'order' => '`pubDate` DESC', + 'limit' => 5, + )); + foreach ($news as $new) { + $feed[$new->date] = array( + 'title' => $new->name, + 'text' => $new->description, + 'img' => '', + 'type' => 'news', + ); + } + + // --------- POINTS + $points = Point::model()->getAll(array( + 'order' => '`date` DESC', + 'limit' => 5, + )); + foreach ($points as $point) { + $feed[$point->date] = array( + 'title' => $point->name, + 'text' => $point->description, + 'img' => $point->getImg(), + 'type' => 'point', + ); + } + + // --------- ARTICLES + $articles = Article::model()->getAll(array( + 'order' => '`id` DESC', + 'limit' => 5, + )); + foreach ($articles as $article) { + $feed[$article->pubDate] = array( + 'title' => $article->title, + 'text' => $article->text, + 'img' => $article->getImg(), + 'type' => 'article', + ); + } + + // --------- SORT + + krsort($feed); + + self::$layout = 'layouts/page.php'; + self::addScript('/js/jquery-2.1.0.min.js'); + self::addScript('/js/jquery-ui-1.10.4.custom.min.js'); + self::addScript('/js/bootstrap.min.js'); + self::addScript('/js/jquery.cookie.js'); + self::addStyle('/css/style.css?ver=' . App::getConfig('version')); + self::addStyle('/css/pageStyle.css?ver=' . App::getConfig('version')); + self::addStyle('/css/bootstrap.min.css'); + self::addStyle('/css/bootstrap-theme.min.css'); + + self::render('feed/index.php', array( + 'news' => $news, + 'articles' => $articles, + 'points' => $points, + )); + } +} diff --git a/ground/models/News.php b/ground/models/News.php new file mode 100644 index 0000000..8282a02 --- /dev/null +++ b/ground/models/News.php @@ -0,0 +1,18 @@ +_tableName_ = 'news'; + parent::__construct($fromArray); + $this->setRelation('RefUser', 'userId', 'User', 'id', self::TO_ONE); + } + + static function model() + { + return new self(); + } + +} diff --git a/ground/views/feed/index.php b/ground/views/feed/index.php new file mode 100644 index 0000000..05722ff --- /dev/null +++ b/ground/views/feed/index.php @@ -0,0 +1,43 @@ +
+
+
+
+ +
+
+
+
+

Новости

+ +
+

title ?>

+ text, 0, 400, 'UTF-8') ?>… +
+ +
+
+

Точки

+ +
+

name ?>

+
+ description, 0, 400, 'UTF-8') ?>… +
+ +
+
+

Статьи

+ +
+

title ?>

+ + text, 0, 400, 'UTF-8') ?>… +
+
+ +
+
+
+ diff --git a/source/wikipoints.svg b/source/wikipoints.svg index 1c9440e..12b6733 100644 --- a/source/wikipoints.svg +++ b/source/wikipoints.svg @@ -121,8 +121,8 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="0.40351059" - inkscape:cx="849.60265" - inkscape:cy="-613.68848" + inkscape:cx="2172.8549" + inkscape:cy="-267.53782" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" @@ -160,6 +160,18 @@ orientation="1,0" position="2885.1724,880.34794" id="guide4281" /> + + + @@ -169,7 +181,7 @@ image/svg+xml - + @@ -177,6 +189,21 @@ inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1"> + + + d="m 1564.125,1120.25 c -14.886,0 -26.875,11.989 -26.875,26.875 l 0,7.0625 -12.7188,0 c -14.8858,0 -26.8749,11.989 -26.875,26.875 l 0,161.2187 c 0,14.8863 11.989,26.875 26.875,26.875 l 294.0626,0 c 14.8858,0 26.8749,-11.9887 26.875,-26.875 l 0,-161.2187 c 0,-14.886 -11.989,-26.875 -26.875,-26.875 l -168.2188,0 0,-7.0625 c 0,-14.886 -11.9577,-26.875 -26.8438,-26.875 z m 10.4375,10.125 38.8437,0 c 13.6276,0 24.5938,2.3236 24.5938,24.625 l 0,10.3438 c 0,21.9511 -10.9662,24.5937 -24.5938,24.5937 l -38.8437,0 c -13.6275,0 -24.5937,-3.5188 -24.5937,-24.5937 l 0,-10.3438 c 0,-20.1329 10.9662,-24.625 24.5937,-24.625 z m 137.3437,45.7188 c 49.596,-1e-4 89.8126,40.2166 89.8126,89.8124 -1e-4,49.596 -40.2166,89.8126 -89.8126,89.8126 -49.5958,-1e-4 -89.8124,-40.2166 -89.8124,-89.8126 0,-49.5957 40.2166,-89.8124 89.8124,-89.8124 z m 0,22.2187 c -37.3245,0 -67.5937,30.2692 -67.5937,67.5937 0,37.3248 30.2692,67.5938 67.5937,67.5938 37.3247,10e-5 67.5938,-30.2691 67.5938,-67.5938 0,-37.3245 -30.2691,-67.5937 -67.5938,-67.5937 z" + id="rect3264" + inkscape:connector-curvature="0" + sodipodi:nodetypes="sscsssssssscssssssssssssssssssssss" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +