A free, self-hostable news aggregator…
Problematic MySQL reserved keyword
Alexandre Alapetitebee833bf524e
diff --git a/app/Models/StatsDAO.php b/app/Models/StatsDAO.phpindex e18ba4748..3f5bf8515 100644--- a/app/Models/StatsDAO.php+++ b/app/Models/StatsDAO.php@@ -38,9 +38,9 @@ class FreshRSS_StatsDAO extends Minz_ModelPdo {}$sql = <<<SQLSELECT COUNT(1) AS total,-COUNT(1) - SUM(e.is_read) AS unread,-SUM(e.is_read) AS read,-SUM(e.is_favorite) AS favorite+COUNT(1) - SUM(e.is_read) AS count_unreads,+SUM(e.is_read) AS count_reads,+SUM(e.is_favorite) AS count_favoritesFROM {$this->prefix}entry AS e, {$this->prefix}feed AS fWHERE e.id_feed = f.iddiff --git a/app/views/stats/index.phtml b/app/views/stats/index.phtmlindex 0a2fbdb10..a36f812a8 100644--- a/app/views/stats/index.phtml+++ b/app/views/stats/index.phtml@@ -23,18 +23,18 @@</tr><tr><th><?php echo _t('admin.stats.status_read'); ?></th>- <td class="numeric"><?php echo format_number($this->repartition['main_stream']['read']); ?></td>- <td class="numeric"><?php echo format_number($this->repartition['all_feeds']['read']); ?></td>+ <td class="numeric"><?php echo format_number($this->repartition['main_stream']['count_reads']); ?></td>+ <td class="numeric"><?php echo format_number($this->repartition['all_feeds']['count_reads']); ?></td></tr><tr><th><?php echo _t('admin.stats.status_unread'); ?></th>- <td class="numeric"><?php echo format_number($this->repartition['main_stream']['unread']); ?></td>- <td class="numeric"><?php echo format_number($this->repartition['all_feeds']['unread']); ?></td>+ <td class="numeric"><?php echo format_number($this->repartition['main_stream']['count_unreads']); ?></td>+ <td class="numeric"><?php echo format_number($this->repartition['all_feeds']['count_unreads']); ?></td></tr><tr><th><?php echo _t('admin.stats.status_favorites'); ?></th>- <td class="numeric"><?php echo format_number($this->repartition['main_stream']['favorite']); ?></td>- <td class="numeric"><?php echo format_number($this->repartition['all_feeds']['favorite']); ?></td>+ <td class="numeric"><?php echo format_number($this->repartition['main_stream']['count_favorites']); ?></td>+ <td class="numeric"><?php echo format_number($this->repartition['all_feeds']['count_favorites']); ?></td></tr></tbody></table>diff --git a/app/views/stats/repartition.phtml b/app/views/stats/repartition.phtmlindex ffb2c361e..5ebcdce5a 100644--- a/app/views/stats/repartition.phtml+++ b/app/views/stats/repartition.phtml@@ -12,7 +12,7 @@if (!empty($feeds)) {echo '<optgroup label="', $category->name(), '">';foreach ($feeds as $feed) {- if ($this->feed && $feed->id() == $this->feed->id()){+ if ($this->feed && $feed->id() == $this->feed->id()) {echo '<option value="', $feed->id(), '" selected="selected" data-url="', _url('stats', 'repartition', 'id', $feed->id()), '">', $feed->name(), '</option>';} else {echo '<option value="', $feed->id(), '" data-url="', _url('stats', 'repartition', 'id', $feed->id()), '">', $feed->name(), '</option>';@@ -39,9 +39,9 @@</tr><tr><td class="numeric"><?php echo $this->repartition['total']; ?></td>- <td class="numeric"><?php echo $this->repartition['read']; ?></td>- <td class="numeric"><?php echo $this->repartition['unread']; ?></td>- <td class="numeric"><?php echo $this->repartition['favorite']; ?></td>+ <td class="numeric"><?php echo $this->repartition['count_reads']; ?></td>+ <td class="numeric"><?php echo $this->repartition['count_unreads']; ?></td>+ <td class="numeric"><?php echo $this->repartition['count_favorites']; ?></td></tr></table></div>