Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added simple stat for quotes

  • Loading branch information...
commit 8575195d345511bc47eb5bbc13c5e1057d34890e 1 parent 1f7f83e
DerWaldschrat authored
Showing with 20 additions and 1 deletion.
  1. +2 −1  Stats/index.php
  2. +18 −0 js/app/statistica/statistica.js
3  Stats/index.php
View
@@ -13,7 +13,8 @@
"categories" => "SELECT categoryid AS id, title FROM " . CATEGORY,
"commentFrom" => "SELECT COUNT( fromid ) AS fc, fromid AS id FROM " . COMMENT . " GROUP BY fromid ORDER BY fromid ASC",
"commentTo" => "SELECT COUNT( toid ) AS tc, toid AS id FROM " . COMMENT . " GROUP BY toid ORDER BY toid ASC",
- "imagePreview" => "SELECT name FROM " . IMAGE . " ORDER BY imageid");
+ "imagePreview" => "SELECT name FROM " . IMAGE . " ORDER BY imageid",
+ "quotes" => "SELECT userid, content FROM " . QUOTE);
if (isset($allowed[$_GET["query"]])) {
$sql = $allowed[$_GET["query"]];
if (isset($_GET["param"]) && is_numeric($_GET["param"])) {
18 js/app/statistica/statistica.js
View
@@ -352,6 +352,23 @@ steal("js/highcharts").then(function () {
return this
}
})
+
+ Abi.View.QuoteResultView = Backbone.View.extend({
+ initialize: function () {
+ },
+ render: function () {
+ var self = this
+ $query("quotes").done(function (data) {
+ var html = ""
+ for (var i = 0, len = data.length, curr; i < len; i++) {
+ curr = data[i]
+ html += "<div class='well well-small'>" + _.escape(curr.content) + "</div>"
+ }
+ self.$el.html(html)
+ })
+ return this
+ }
+ })
// Main routing function
App.StatsRoute = function (page) {
@@ -369,6 +386,7 @@ steal("js/highcharts").then(function () {
view.addTab("imagePreview", "Bildervorschau", Abi.View.ImagePreview)
view.addTab("orderedUsers", "User alphabetisch", Abi.View.UserAlphabetic)
view.addTab("orderedCategories", "Awards alphabetisch", Abi.View.AwardsAlphabetic)
+ view.addTab("quotes", "Sprücheklopfer", Abi.View.QuoteResultView)
}
view.setActive(page)
Please sign in to comment.
Something went wrong with that request. Please try again.