diff --git a/bl-plugins/hit-counter/languages/de_CH.json b/bl-plugins/hit-counter/languages/de_CH.json index d1d48c2f..b4a38bd3 100644 --- a/bl-plugins/hit-counter/languages/de_CH.json +++ b/bl-plugins/hit-counter/languages/de_CH.json @@ -1,8 +1,22 @@ { "plugin-data": { - "name": "Hit Counter", - "description": "Anzeige der Anzahl der Seitenaufrufe oder der Besuche der Website in der Seitenleiste." + "name": "Zähler schlagen", + "description": "Abhängig von einfachen Statistiken - Zeigt die Anzahl der Seitenzugriffe oder eindeutigen Besucher pro Tag in der Seitenleiste an." }, - "show-unique-visitors": "Anzahl der Besuche" + + "plugin-depends-on-warning": "Dieses Plugin hängt von den folgenden Plugins ab.", + "sidebar-label": "Seitenleiste Etikette", + "sidebar-label-tip": "Dieser Titel wird fast immer in der Seitenleiste der Site verwendet.", + + "show-running-total-lable": "Gesamtlaufzeit", + "show-daily-value-label": "Seite Schlagen Heute", + "show-daily-unique-value-label": "Heutige Besucher", + "show-weekly-value-label": "Seitenaufrufe Diese Woche", + "show-weekly-unique-value-label": "Diese Wochen Besucher", + "show-monthly-value-label": "Seitenzugriffe diesen Monat", + "show-monthly-unique-value-label": "Besucher dieses Monats", + + "Enabled": "aktiviert", + "Disabled": "Deaktiviert" } diff --git a/bl-plugins/hit-counter/languages/de_DE.json b/bl-plugins/hit-counter/languages/de_DE.json index d1d48c2f..b4a38bd3 100644 --- a/bl-plugins/hit-counter/languages/de_DE.json +++ b/bl-plugins/hit-counter/languages/de_DE.json @@ -1,8 +1,22 @@ { "plugin-data": { - "name": "Hit Counter", - "description": "Anzeige der Anzahl der Seitenaufrufe oder der Besuche der Website in der Seitenleiste." + "name": "Zähler schlagen", + "description": "Abhängig von einfachen Statistiken - Zeigt die Anzahl der Seitenzugriffe oder eindeutigen Besucher pro Tag in der Seitenleiste an." }, - "show-unique-visitors": "Anzahl der Besuche" + + "plugin-depends-on-warning": "Dieses Plugin hängt von den folgenden Plugins ab.", + "sidebar-label": "Seitenleiste Etikette", + "sidebar-label-tip": "Dieser Titel wird fast immer in der Seitenleiste der Site verwendet.", + + "show-running-total-lable": "Gesamtlaufzeit", + "show-daily-value-label": "Seite Schlagen Heute", + "show-daily-unique-value-label": "Heutige Besucher", + "show-weekly-value-label": "Seitenaufrufe Diese Woche", + "show-weekly-unique-value-label": "Diese Wochen Besucher", + "show-monthly-value-label": "Seitenzugriffe diesen Monat", + "show-monthly-unique-value-label": "Besucher dieses Monats", + + "Enabled": "aktiviert", + "Disabled": "Deaktiviert" } diff --git a/bl-plugins/hit-counter/languages/en.json b/bl-plugins/hit-counter/languages/en.json index c5928e12..dade69ab 100644 --- a/bl-plugins/hit-counter/languages/en.json +++ b/bl-plugins/hit-counter/languages/en.json @@ -2,6 +2,21 @@ "plugin-data": { "name": "Hit Counter", - "description": "Show the number of visits or unique visitors in the sidebar of your site." - } + "description": "Depends on SimpletStats - Shows the number of Page Hits or Unique Visitors per day in the sidebar." + }, + + "plugin-depends-on-warning": "This plugin depends on the following plugins.", + "sidebar-label": "Sidebar Label", + "sidebar-label-tip": "This title is almost always used in the sidebar of the site.", + + "show-running-total-lable": "Running Total:", + "show-daily-value-label": "Page Hits Today:", + "show-daily-unique-value-label": "Todays Vistors:", + "show-weekly-value-label": "Page Hits This Week:", + "show-weekly-unique-value-label": "This Weeks Vistors:", + "show-monthly-value-label": "Page Hits This Month:", + "show-monthly-unique-value-label": "This Months Visitors:", + + "Enabled": "Enabled", + "Disabled": "Disabled" } \ No newline at end of file diff --git a/bl-plugins/hit-counter/languages/es.json b/bl-plugins/hit-counter/languages/es.json index 7a7fe1aa..ee67da9e 100644 --- a/bl-plugins/hit-counter/languages/es.json +++ b/bl-plugins/hit-counter/languages/es.json @@ -2,6 +2,21 @@ "plugin-data": { "name": "Contador de visitas", - "description": "Muestra el número de visitas o visitantes únicos en la barra lateral de su sitio." - } -} \ No newline at end of file + "description": "Depende de las estadísticas de Simplet: muestra el número de visitas a la página o visitantes únicos por día en la barra lateral." + }, + + "plugin-depends-on-warning": "Este complemento depende de los siguientes complementos.", + "sidebar-label": "Etiqueta de la barra lateral", + "sidebar-label-tip": "Este título casi siempre se usa en la barra lateral del sitio.", + + "show-running-total-lable": "Total Corriente", + "show-daily-value-label": "Página golpeó hoy", + "show-daily-unique-value-label": "Visitantes de hoy", + "show-weekly-value-label": "La página llega esta semana", + "show-weekly-unique-value-label": "Esta semana los visitantes", + "show-monthly-value-label": "La página llega este mes", + "show-monthly-unique-value-label": "Los visitantes de este mes.", + + "Enabled": "Habilitado", + "Disabled": "Discapacitado" +} diff --git a/bl-plugins/hit-counter/languages/fa_IR.json b/bl-plugins/hit-counter/languages/fa_IR.json index fc906b57..cfd2a69c 100644 --- a/bl-plugins/hit-counter/languages/fa_IR.json +++ b/bl-plugins/hit-counter/languages/fa_IR.json @@ -3,5 +3,20 @@ { "name": "شمارشگر بازدیدها", "description": "تعداد بازدیدکنندگان یا بازدیدکنندگان منحصر به فرد در نوار کناری سایت خود را نمایش دهید." - } + }, + + "plugin-depends-on-warning": "شمارشگر بازدیدها وابسته است - تعداد بازدید های صفحه یا بازدید کنندگان منحصر به فرد در هر روز را در نوار کناری نشان می دهد.", + "sidebar-label": "برچسب چسب", + "sidebar-label-tip": "این عنوان تقریبا همیشه در نوار کناری سایت استفاده می شود.", + + "show-running-total-lable": "در حال اجرا مجموع", + "show-daily-value-label": "صفحه بازدید امروز", + "show-daily-unique-value-label": "امروزه ویستورها", + "show-weekly-value-label": "این صفحه بازدید این هفته است", + "show-weekly-unique-value-label": "این ویستورهای هفته", + "show-monthly-value-label": "بازدید این ماه در صفحه", + "show-monthly-unique-value-label": "این ماهها بازدیدکنندگان", + + "Enabled": "فعال شده است", + "Disabled": "معلول" } diff --git a/bl-plugins/hit-counter/languages/nl_NL.json b/bl-plugins/hit-counter/languages/nl_NL.json index 730ef4cf..d08dc686 100644 --- a/bl-plugins/hit-counter/languages/nl_NL.json +++ b/bl-plugins/hit-counter/languages/nl_NL.json @@ -1,7 +1,22 @@ { "plugin-data": { - "name": "Hit Counter", - "description": "Toont het aantal bezoeken of unieke bezoekers in de zijbalk." - } -} \ No newline at end of file + "name": "Hit teller", + "description": "Afhankelijk van Simplet-statistieken: geeft het aantal paginaramingen of unieke bezoekers per dag in de zijbalk weer." + }, + + "plugin-depends-on-warning": "Deze plug-in is afhankelijk van de volgende plug-ins.", + "sidebar-label": "Zijbalklabel", + "sidebar-label-tip": "Deze titel wordt bijna altijd gebruikt in de zijbalk van de site.", + + "show-running-total-lable": "Lopend totaal", + "show-daily-value-label": "Pagina hit vandaag", + "show-daily-unique-value-label": "De vistors van vandaag", + "show-weekly-value-label": "Pagina hits deze week", + "show-weekly-unique-value-label": "Deze weken bezoeken", + "show-monthly-value-label": "Pagina hits deze maand", + "show-monthly-unique-value-label": "De bezoekers van deze maand", + + "Enabled": "Ingeschakeld", + "Disabled": "invalide" +} diff --git a/bl-plugins/hit-counter/languages/ru_RU.json b/bl-plugins/hit-counter/languages/ru_RU.json index f854eaeb..8bd84882 100644 --- a/bl-plugins/hit-counter/languages/ru_RU.json +++ b/bl-plugins/hit-counter/languages/ru_RU.json @@ -2,6 +2,21 @@ "plugin-data": { "name": "Счётчик посещений", - "description": "Показывает количество посещений или уникальных посетителей на боковой панели вашего сайта." - } -} \ No newline at end of file + "description": "Зависит от простой статистики - показывает количество посещений страниц или уникальных посетителей в день на боковой панели." + }, + + "plugin-depends-on-warning": "Плагин-зависит-на-предупредительного-WASD", + "sidebar-label": "Боковая метка", + "sidebar-label-tip": "Этот заголовок почти всегда используется на боковой панели сайта.", + + "show-running-total-lable": "Промежуточный итог", + "show-daily-value-label": "Страница посещает сегодня", + "show-daily-unique-value-label": "Сегодняшние Висторы", + "show-weekly-value-label": "Страница попадет на этой неделе", + "show-weekly-unique-value-label": "Это недели висторы", + "show-monthly-value-label": "Число просмотров страницы в этом месяце", + "show-monthly-unique-value-label": "Посетители этого месяца", + + "Enabled": "Включено", + "Disabled": "инвалид" +} diff --git a/bl-plugins/hit-counter/plugin.php b/bl-plugins/hit-counter/plugin.php index b0e77a81..732c88f0 100644 --- a/bl-plugins/hit-counter/plugin.php +++ b/bl-plugins/hit-counter/plugin.php @@ -5,8 +5,14 @@ class pluginHitCounter extends Plugin { public function init() { $this->dbFields = array( - 'label'=>'Hit Counter', - 'showUniqueVisitors'=>false + 'sidebarLabel'=>'Hit Counter', + 'showRunningTotalValue'=>true, + 'showDailyValue'=>true, + 'showDailyUniqueValue'=>true, + 'showWeeklyValue'=>true, + 'showWeeklyUniqueValue'=>true, + 'showMonthlyValue'=>true, + 'showMonthlyUniqueValue'=>true ); } @@ -18,7 +24,7 @@ class pluginHitCounter extends Plugin { if (!pluginActivated('pluginSimpleStats')) { // Show an alert about the dependency of the plugin $html = ''; @@ -34,52 +40,158 @@ class pluginHitCounter extends Plugin { // Label of the plugin to show in the sidebar $html .= '
'; - $html .= ''; - $html .= ''; - $html .= ''.$L->get('This title is almost always used in the sidebar of the site').''; + $html .= ''; + $html .= ''; + $html .= ''.$L->get('sidebar-label-tip').''; $html .= '
'; - // Form "select" element for enable or disable Unique visitors properties + // Show ongoing running total $html .= '
'; - $html .= ''; - $html .= ''; + $html .= ''; + $html .= ''; $html .= ''; $html .= '
'; + // Show daily page hits/visits + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= '
'; + + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= '
'; + + // Show weekly page hits/visits + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= '
'; + + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= '
'; + + // Show monthly page hits/visits + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= '
'; + + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= '
'; + return $html; } public function siteSidebar() { - // Init counter to 0 - $counter = 0; + global $L; + $formatStyle=NumberFormatter::TYPE_INT32; + $formatter= new NumberFormatter($locale, $formatStyle); // Check if the plugin Simple Stats is activated if (pluginActivated('pluginSimpleStats')) { // Get the object of the plugin Simple Stats global $plugins; - $simpleStats = $plugins['all']['pluginSimpleStats']; - $currentDate = Date::current('Y-m-d'); - if ($this->getValue('showUniqueVisitors')) { - // Get the unique visitors from today - $counter = $simpleStats->uniqueVisitors($currentDate); - } else { - // Get the visits from today - $counter = $simpleStats->visits($currentDate); + IF ( ($this->getValue('showRunningTotalValue') ) + || ($this->getValue('showDailyValue')) + || ($this->getValue('showDailyUniqueValue')) + || ($this->getValue('showWeeklyValue')) + || ($this->getValue('showWeeklyUniqueValue')) + || ($this->getValue('showMonthlyValue')) + || ($this->getValue('showMonthlyUniqueValue')) ) + { + + $simpleStats = $plugins['all']['pluginSimpleStats']; + + $html = '
'; + $html .= '

'.$this->getValue('sidebarLabel').'

'; + + $html .= ''; } } - // Show in the sidebar the number of visitors - $html = '
'; - $html .= '

'.$this->getValue('label').'

'; - $html .= '
'; - $html .= '
'.$counter.'
'; $html .= '
'; - $html .= '
'; - return $html; } } \ No newline at end of file diff --git a/bl-plugins/simple-stats/css/style.css b/bl-plugins/simple-stats/css/style.css index 855af6b7..5b26ffdf 100644 --- a/bl-plugins/simple-stats/css/style.css +++ b/bl-plugins/simple-stats/css/style.css @@ -33,4 +33,34 @@ .simple-stats-plugin p.unique-today { color: #777777; -} \ No newline at end of file +} + +.simple-stats-plugin .divTable{ + display: table; + width: 100%; +} +.simple-stats-plugin .divTableRow { + display: table-row; +} +.simple-stats-plugin .divTableHeading { + background-color: #EEE; + display: table-header-group; +} +.simple-stats-plugin .divTableCell, .divTableHead { + border: 0px solid #999999; + display: table-cell; + padding: 3px 10px; +} +.simple-stats-plugin .divTableHeading { + background-color: #EEE; + display: table-header-group; + font-weight: bold; +} +.simple-stats-plugin .divTableFoot { + background-color: #EEE; + display: table-footer-group; + font-weight: bold; +} +.simple-stats-plugin .divTableBody { + display: table-row-group; +} diff --git a/bl-plugins/simple-stats/languages/de_CH.json b/bl-plugins/simple-stats/languages/de_CH.json index ed0cf4d1..589b8466 100644 --- a/bl-plugins/simple-stats/languages/de_CH.json +++ b/bl-plugins/simple-stats/languages/de_CH.json @@ -2,11 +2,57 @@ "plugin-data": { "name": "Simple Stats", - "description": "Anzeige der täglichen Anzahl Seitenaufrufe und Besucher." + "description": "Zeigt die Anzahl der Besucher pro Zeitraum in Ihrem Dashboard an." }, - "visits": "Seitenaufrufe", - "visits-today": "Seitenaufrufe heute", - "unique-visitors-today": "Besucher heute", - "chart": "Chart", - "table": "Table" + + "ongoing-counter-label": "Kontinuierlicher Zähler", + "ongoing-counter-tip": "Wenn aktiviert, wird eine laufende laufende Summe erfasst.", + "enable-section": "aktiviert", + "disable-section": "Deaktiviert", + + "reset-counter-label": "Legt den aktuellen Zählerwert fest", + "reset-counter-tip-one": "Denken Sie daran, wie -1 zu bleiben, was bedeutet, dass es nicht zurückgesetzt wird; 0 oder eine positiv Zahl setzen den Wert.", + "reset-counter-tip-two": "Um eine Null oder Positiv-Nummer zu speichern, rufen Sie die Website auf, um sie auszulösen. Ändern Sie diese Einstellung wieder in -1.", + + "chart-type-label": "Diagrammtyp", + "daily-chart": "Täglich", + "weekly-chart": "Wöchentlich", + "monthly-chart": "Monatlich", + "chart-type-tip": "Diese Option ändert die Anzeige des Diagramms standardmäßig.", + + "number-of-days-label": "Wie viele Tage aufbewahren?", + "number-of-days-tip": "Setzen Sie den Wert auf Null, um die Anzahl der täglichen Protokolle zu deaktivieren oder festzulegen.", + "number-of-weeks-label": "Wie viele Wochen aufbewahren?", + "number-of-weeks-tip": "Setzen Sie den Wert auf Null, um die Anzahl der wöchentlichen Protokolle zu deaktivieren oder festzulegen.", + "number-of-months-label": "Wie viele Monate aufbewahren?", + "number-of-months-tip": "Setzen Sie den Wert auf Null, um die Anzahl der monatlichen Protokolle zu deaktivieren oder zu speichern.", + + "show-content-stats-label": "Inhaltsstatistiken anzeigen", + "show-content-stats-tip": "Wenn diese Option aktiviert ist, werden ein Diagramm und eine Tabelle mit verschiedenen Seitentypen im Admin-Dashboard angezeigt.", + + "page-session-active-minutes": "Aktive Minuten der Sitzungssitzung:", + "page-session-active-minutes-tip": "Für jede Seite wird eine Sitzung gehalten, um die Aktualisierung von 'F5' zu verhindern, um die Anzahl falsch zu erhöhen.", + + "stats-title-label": "Seitenaufrufe und eindeutige Besucher", + + "page-view-today-label": "Heute aufgerufene Seiten", + "unique-visitors-today-label": "Einzigartige Besucher heute", + "page-view-this-week-label": "Diese Woche angesehene Seiten", + "unique-visitors-this-week-label": "Unique Visitors in dieser Woche", + "page-view-this-month-label": "Seit diesem Monat angesehene Seiten", + "unique-visitors-this-month-label": "Unique Visitors in diesem Monat", + + "content-statistics-label": "Inhaltsstatistik", + "tab-chart-label": "Diagramm", + "tab-table-label": "Tabelle", + "published-label": "Veröffentlicht", + "static-label": "statisch", + "drafts-label": "Entwurf", + "scheduled-label": "Geplant", + "sticky-label": "klebrig", + "categories-label": "Kategorien", + "tags-label": "Stichworte", + + "end-of-json": "Nicht verwendet, nur ein Kommentar" + } diff --git a/bl-plugins/simple-stats/languages/de_DE.json b/bl-plugins/simple-stats/languages/de_DE.json index c7b77a97..589b8466 100644 --- a/bl-plugins/simple-stats/languages/de_DE.json +++ b/bl-plugins/simple-stats/languages/de_DE.json @@ -2,11 +2,57 @@ "plugin-data": { "name": "Simple Stats", - "description": "Anzeige der täglichen Anzahl Seitenaufrufe und Besucher." + "description": "Zeigt die Anzahl der Besucher pro Zeitraum in Ihrem Dashboard an." }, - "visits": "Seitenaufrufe", - "visits-today": "Seitenaufrufe heute", - "unique-visitors-today": "Besucher heute", - "chart": "Chart", - "table": "Table" + + "ongoing-counter-label": "Kontinuierlicher Zähler", + "ongoing-counter-tip": "Wenn aktiviert, wird eine laufende laufende Summe erfasst.", + "enable-section": "aktiviert", + "disable-section": "Deaktiviert", + + "reset-counter-label": "Legt den aktuellen Zählerwert fest", + "reset-counter-tip-one": "Denken Sie daran, wie -1 zu bleiben, was bedeutet, dass es nicht zurückgesetzt wird; 0 oder eine positiv Zahl setzen den Wert.", + "reset-counter-tip-two": "Um eine Null oder Positiv-Nummer zu speichern, rufen Sie die Website auf, um sie auszulösen. Ändern Sie diese Einstellung wieder in -1.", + + "chart-type-label": "Diagrammtyp", + "daily-chart": "Täglich", + "weekly-chart": "Wöchentlich", + "monthly-chart": "Monatlich", + "chart-type-tip": "Diese Option ändert die Anzeige des Diagramms standardmäßig.", + + "number-of-days-label": "Wie viele Tage aufbewahren?", + "number-of-days-tip": "Setzen Sie den Wert auf Null, um die Anzahl der täglichen Protokolle zu deaktivieren oder festzulegen.", + "number-of-weeks-label": "Wie viele Wochen aufbewahren?", + "number-of-weeks-tip": "Setzen Sie den Wert auf Null, um die Anzahl der wöchentlichen Protokolle zu deaktivieren oder festzulegen.", + "number-of-months-label": "Wie viele Monate aufbewahren?", + "number-of-months-tip": "Setzen Sie den Wert auf Null, um die Anzahl der monatlichen Protokolle zu deaktivieren oder zu speichern.", + + "show-content-stats-label": "Inhaltsstatistiken anzeigen", + "show-content-stats-tip": "Wenn diese Option aktiviert ist, werden ein Diagramm und eine Tabelle mit verschiedenen Seitentypen im Admin-Dashboard angezeigt.", + + "page-session-active-minutes": "Aktive Minuten der Sitzungssitzung:", + "page-session-active-minutes-tip": "Für jede Seite wird eine Sitzung gehalten, um die Aktualisierung von 'F5' zu verhindern, um die Anzahl falsch zu erhöhen.", + + "stats-title-label": "Seitenaufrufe und eindeutige Besucher", + + "page-view-today-label": "Heute aufgerufene Seiten", + "unique-visitors-today-label": "Einzigartige Besucher heute", + "page-view-this-week-label": "Diese Woche angesehene Seiten", + "unique-visitors-this-week-label": "Unique Visitors in dieser Woche", + "page-view-this-month-label": "Seit diesem Monat angesehene Seiten", + "unique-visitors-this-month-label": "Unique Visitors in diesem Monat", + + "content-statistics-label": "Inhaltsstatistik", + "tab-chart-label": "Diagramm", + "tab-table-label": "Tabelle", + "published-label": "Veröffentlicht", + "static-label": "statisch", + "drafts-label": "Entwurf", + "scheduled-label": "Geplant", + "sticky-label": "klebrig", + "categories-label": "Kategorien", + "tags-label": "Stichworte", + + "end-of-json": "Nicht verwendet, nur ein Kommentar" + } diff --git a/bl-plugins/simple-stats/languages/en.json b/bl-plugins/simple-stats/languages/en.json index c343b890..3d4fe724 100644 --- a/bl-plugins/simple-stats/languages/en.json +++ b/bl-plugins/simple-stats/languages/en.json @@ -2,11 +2,57 @@ "plugin-data": { "name": "Simple Stats", - "description": "Show the number of visitors per day on your dashboard." + "description": "Show the number of visitors per period on your dashboard." }, - "visits": "Visits", - "visits-today": "Visits today", - "unique-visitors-today": "Unique visitors today", - "chart": "Chart", - "table": "Table" + + "ongoing-counter-label": "Ongoing Counter:", + "ongoing-counter-tip": "When enabled, an ongoing running total is collected.", + "enable-section": "Enabled", + "disable-section": "Disabled", + + "reset-counter-label": "Set the on-going counter value:", + "reset-counter-tip-one": "REMEMBER TO KEEP AS -1, which means it won't reset; 0 or positive number will set value.", + "reset-counter-tip-two": "To set - save as zero or positive number, go to website (new session) to trigger, change this back to -1.", + + "chart-type-label": "Chart Type:", + "daily-chart": "Daily", + "weekly-chart": "Weekly", + "monthly-chart": "Monthly", + "chart-type-tip": "This option changes what the chart displays by default.", + + "number-of-days-label": "Keep for how many days?", + "number-of-days-tip": "Set to zero to disable or set number of daily logs to keep.", + "number-of-weeks-label": "Keep for how many weeks?", + "number-of-weeks-tip": "Set to zero to disable or set number of weekly logs to keep.", + "number-of-months-label": "Keep for how many months?", + "number-of-months-tip": "Set to zero to disable or set number of monthly logs to keep.", + + "show-content-stats-label": "Show Content Stats:", + "show-content-stats-tip": "When enabled, a chart and table of different page types is displayed in the Admin Dashboard.", + + "page-session-active-minutes": "Page session active minutes:", + "page-session-active-minutes-tip": "A session is kept for each page to prevent F5 refreshing to increase counts falsely.", + + "stats-title-label": "Page Views & Unique Visitors", + + "page-view-today-label": "Pages viewed today", + "unique-visitors-today-label": "Unique visitors today", + "page-view-this-week-label": "Pages viewed this week", + "unique-visitors-this-week-label": "Unique visitors this week", + "page-view-this-month-label": "Pages viewed this month", + "unique-visitors-this-month-label": "Unique visitors this month", + + "content-statistics-label": "Content Statistics", + "tab-chart-label": "Chart", + "tab-table-label": "Table", + "published-label": "Published", + "static-label": "Static", + "drafts-label": "Drafts", + "scheduled-label": "Scheduled", + "sticky-label": "Sticky", + "categories-label": "Categories", + "tags-label": "Tags", + + "end-of-json": "not used, just a comment" + } diff --git a/bl-plugins/simple-stats/languages/es.json b/bl-plugins/simple-stats/languages/es.json index 362e865b..71a3df24 100644 --- a/bl-plugins/simple-stats/languages/es.json +++ b/bl-plugins/simple-stats/languages/es.json @@ -1,12 +1,58 @@ { "plugin-data": { - "name": "Simple Stats", - "description": "Muestra el número de visitantes por día en tu panel." + "name": "Estadísticas simples", + "description": "Muestra el número de visitantes por período en tu panel" }, - "visits": "Visitas", - "visits-today": "Visitas de hoy", - "unique-visitors-today": "Visitantes únicos de hoy", - "chart": "Gráfico", - "table": "Tabla" -} \ No newline at end of file + + "ongoing-counter-label": "Contador continuo", + "ongoing-counter-tip": "Cuando está habilitado, se recopila un total acumulado en curso", + "enable-section": "Habilitado", + "disable-section": "Discapacitado", + + "reset-counter-label": "Establezca el valor del contador actual", + "reset-counter-tip-one": "RECUERDE MANTENER COMO -1, lo que significa que no se reiniciará; 0 o el número posativo establecerá un valor", + "reset-counter-tip-two": "Para establecer, guardar como cero o número posativo, vaya al sitio web para activar, vuelva a cambiar esto a -1.", + + "chart-type-label": "Tipo de gráfico", + "daily-chart": "Diario", + "weekly-chart": "Semanal", + "monthly-chart": "Mensual", + "chart-type-tip": "Esta opción cambia lo que el gráfico muestra de forma predeterminada", + + "number-of-days-label": "¿Guardar por cuántos días?", + "number-of-days-tip": "Establecido en cero para deshabilitar o establecer el número de registros diarios para mantener.", + "number-of-weeks-label": "¿Mantener durante cuántas semanas?", + "number-of-weeks-tip": "Establecido en cero para deshabilitar o establecer el número de registros semanales para mantener.", + "number-of-months-label": "¿Guardar por cuántos meses?", + "number-of-months-tip": "Establecido en cero para deshabilitar o establecer el número de registros mensuales para mantener.", + + "show-content-stats-label": "Mostrar estadísticas de contenido", + "show-content-stats-tip-tip": "Cuando está habilitado, se muestra un gráfico y una tabla de diferentes tipos de páginas en el Panel de administración.", + + "page-session-active-minutes": "Página sesión minutos activos:", + "page-session-active-minutes-tip": "Se mantiene una sesión para cada página para evitar la actualización de 'F5' para aumentar los conteos falsamente.", + + "stats-title-label": "Vistas de página y visitantes únicos", + + "page-view-today-label": "Páginas vistas hoy", + "unique-visitors-today-label": "Visitantes únicos de hoy", + "page-view-this-week-label": "Páginas vistas esta semana", + "unique-visitors-this-week-label": "Visitantes únicos esta semana", + "page-view-this-month-label": "Páginas vistas este mes", + "unique-visitors-this-month-label": "Visitantes únicos este mes", + + "content-statistics-label": "Estadísticas de contenido", + "tab-chart-label": "Gráfico", + "tab-table-label": "Tabla", + "published-label": "Publicado", + "static-label": "Estático", + "drafts-label": "Eorrador", + "scheduled-label": "Programado", + "sticky-label": "Pegajosa", + "categories-label": "Categories", + "tags-label": "Etiquetas", + + "end-of-json": "No se usa, solo un comentario" + +} diff --git a/bl-plugins/simple-stats/languages/fa_IR.json b/bl-plugins/simple-stats/languages/fa_IR.json index 228c91d3..9f9075d8 100644 --- a/bl-plugins/simple-stats/languages/fa_IR.json +++ b/bl-plugins/simple-stats/languages/fa_IR.json @@ -2,11 +2,57 @@ "plugin-data": { "name": "آمار ساده", - "description": "نمایش روزانه بازدیدکنندگان در پیش خوان شما." + "description": "نمایش تعداد بازدیدکنندگان در هر دوره در داشبورد خود." }, - "visits": "بازدیدها", - "visits-today": "بازدیدهای امروز", - "unique-visitors-today": "بازدید کنندگان منحصر به فرد امروز", - "chart": "چارت", - "table": "جدول" + + "ongoing-counter-label": "شمارنده در حال اجرا", + "ongoing-counter-tip": "هنگامی که فعال شده است، مجموع در حال انجام در حال اجرا است", + "enable-section": "فعال", + "disable-section": "غیر فعال", + + "reset-counter-label": "تنظیم مقادیر فعلی تنظیم شده", + "reset-counter-tip-one": "یادآوری AS-1 را نگه دارید، بدین معناست که تنظیم مجدد تنظیم نمی شود؛ 0 یا عدد مثبت مقدار را تعیین می کند.", + "reset-counter-tip-two": "برای تنظیم، صرفه جویی در مقدار صفر یا مثبت، به وب سایت بروید تا باعث شود، این را به -1 تغییر دهید.", + + "chart-type-label": "نوع نمودار", + "daily-chart": "روزانه", + "weekly-chart": "هفتگی", + "monthly-chart": "ماهانه", + "chart-type-tip": "این گزینه تغییراتی را که نمودار به طور پیش فرض نمایش می دهد.", + + "number-of-days-label": "برای چند روز نگه دارید؟", + "number-of-days-tip": "مقدار صفر برای غیرفعال کردن یا تنظیم تعداد روزنامه ها برای نگهداری تنظیم شده است.", + "number-of-weeks-label": "برای چند هفته نگه دارید؟", + "number-of-weeks-tip": "برای غیرفعال کردن یا تنظیم تعداد روزنامههای هفتگی برای نگهداری، روی صفر تنظیم کنید.", + "number-of-months-label": "چند ماه نگه دارید؟", + "number-of-months-tip": "برای غیرفعال کردن یا تنظیم تعدادی از سیاهههای مربوط به ماهانه برای نگهداری، روی صفر تنظیم کنید.", + + "show-content-stats-label": "نمایش آمار محتوا", + "show-content-stats-tip": "هنگامی که فعال شد، یک نمودار و جدول انواع صفحه های مختلف در هیئت مدیره داش نمایش داده می شود.", + + "page-session-active-minutes": "دقیقه فعالانه صفحه", + "page-session-active-minutes-tip": "یک جلسه برای هر صفحه نگهداری می شود تا از فرمت F5 برای افزایش شمارش غلط جلوگیری شود.", + + "stats-title-label": "بازدید صفحات و بازدید کنندگان منحصر به فرد", + + "page-view-today-label": "صفحات مشاهده شده امروز", + "unique-visitors-today-label": "بازدید کنندگان منحصر به فرد امروز", + "page-view-this-week-label": "صفحات مشاهده شده در این هفته", + "unique-visitors-this-week-label": "بازدید کنندگان منحصر به فرد در این هفته", + "page-view-this-month-label": "صفحات مشاهده شده در این ماه", + "unique-visitors-this-month-label": "بازدید کنندگان منحصر به فرد در این ماه", + + "content-statistics-label": "آمار محتوا", + "tab-chart-label": "نمودار", + "tab-table-label": "جدول", + "published-label": "منتشر شده", + "static-label": "static", + "drafts-label": "پیش نویس", + "scheduled-label": "برنامه ریزی شده", + "sticky-label": "چسبنده", + "categories-label": "دسته ها", + "tags-label": "برچسب ها", + + "end-of-json": "استفاده نشده است، فقط یک نظر" + } diff --git a/bl-plugins/simple-stats/languages/fr_FR.json b/bl-plugins/simple-stats/languages/fr_FR.json index 1972173f..f33c5068 100644 --- a/bl-plugins/simple-stats/languages/fr_FR.json +++ b/bl-plugins/simple-stats/languages/fr_FR.json @@ -2,11 +2,57 @@ "plugin-data": { "name": "Statistiques", - "description": "Afficher le nombre de visiteurs par jour sur votre tableau de bord." + "description": "Affiche le nombre de visiteurs par période sur votre tableau de bord." }, - "visits": "Visites", - "visits-today": "Visites du jour", - "unique-visitors-today": "Visiteurs uniques du jour", - "chart": "Graphique", - "table": "Tableau" + + "ongoing-counter-label": "Compteur en cours", + "ongoing-counter-tip": "Lorsque cette option est activée, un total courant est collecté.", + "enable-section": "Enabled", + "disable-section": "Disabled", + + "reset-counter-label": "Définir la valeur du compteur en cours", + "reset-counter-tip-one": "N'OUBLIEZ PAS DE CONSERVER AS -1, ce qui signifie qu'elle ne sera pas réinitialisée; 0 ou le nombre positif définira la valeur.", + "reset-counter-tip-two": "Pour définir, enregistrer en tant que nombre zéro ou positif, accédez au site Web à déclencher, remettez-le à -1.", + + "chart-type-label": "Type de graphique", + "daily-chart": "Daily", + "weekly-chart": "hebdomadaire", + "monthly-chart": "mensuelle", + "chart-type-tip": "Cette option modifie ce que le graphique affiche par défaut.", + + "number-of-days-label": "Conserver pendant combien de jours?", + "number-of-days-tip": "Définissez à zéro pour désactiver ou définir le nombre de journaux quotidiens à conserver.", + "number-of-weeks-label": "Garder pendant combien de semaines?", + "number-of-weeks-tip": "Définissez à zéro pour désactiver ou définir le nombre de journaux hebdomadaires à conserver.", + "number-of-months-label": "Gardez pendant combien de mois?", + "number-of-months-tip": "Définissez à zéro pour désactiver ou définir le nombre de journaux mensuels à conserver.", + + "show-content-stats-label": "Afficher les statistiques du contenu", + "show-content-stats-tip": "Lorsque cette option est activée, un tableau et un tableau présentant différents types de page sont affichés dans le tableau de bord de l'administrateur.", + + "page-session-active-minutes": "Minutes de session actives:", + "page-session-active-minutes-tip": "Une session est conservée pour chaque page afin d’empêcher l’actualisation «F5» afin d’augmenter le nombre de fois.", + + "stats-title-label": "Pages vues & visiteurs uniques", + + "page-view-today-label": "Pages vues aujourd'hui", + "unique-visitors-today-label": "Visiteurs uniques aujourd'hui", + "page-view-this-week-label": "Pages vues cette semaine", + "unique-visitors-this-week-label": "Visiteurs uniques cette semaine", + "page-view-this-month-label": "Pages vues ce mois-ci", + "unique-visitors-this-month-label": "Visiteurs uniques ce mois-ci", + + "content-statistics-label": "Statistiques du contenu", + "tab-chart-label": "Graphique", + "tab-table-label": "Tableau", + "published-label": "publié", + "static-label": "statique", + "drafts-label": "drafts", + "scheduled-label": "programmé", + "sticky-label": "collant", + "categories-label": "catégories", + "tags-label": "tags", + + "end-of-json": "non utilisé, juste un commentaire" + } diff --git a/bl-plugins/simple-stats/languages/nl_NL.json b/bl-plugins/simple-stats/languages/nl_NL.json index 0a7071b0..7cf0b9e0 100644 --- a/bl-plugins/simple-stats/languages/nl_NL.json +++ b/bl-plugins/simple-stats/languages/nl_NL.json @@ -2,11 +2,57 @@ "plugin-data": { "name": "Statistieken", - "description": "Toont het aantal bezoeken per dag op het dashboard." + "description": "Toont het aantal bezoeken per periode op het dashboard." }, - "visits": "Aantal bezoeken", - "visits-today": "Aantal bezoeken vandaag", - "unique-visitors-today": "Unieke bezoekers vandaag", - "chart": "Grafiek", - "table": "Tabel" + + "ongoing-counter-label": "Lopende teller", + "ongoing-counter-tip": "Indien ingeschakeld, wordt een lopend lopend totaal verzameld.", + "enable-section": "Ingeschakeld", + "disable-section": "Uitgeschakeld", + + "reset-counter-label": "Stel de lopende tellerwaarde in", + "reset-counter-tip-one": "ONTHOUD OM ALS -1 TE BLIJVEN, wat betekent dat het niet zal resetten; 0 of positief getal zal de waarde instellen.", + "reset-counter-tip-two": "Om in te stellen, opslaan als nul of positief getal, ga naar website om te activeren, verander dit terug naar -1.", + + "chart-type-label": "Diagramtype", + "daily-chart": "Daily", + "weekly-chart": "Weekly", + "monthly-chart": "Maandelijks", + "chart-type-tip": "Deze optie verandert wat het diagram standaard weergeeft.", + + "number-of-days-label": "Houd voor hoeveel dagen?", + "number-of-days-tip": "Stel in op nul om het aantal te bewaren dagelijkse logs uit te schakelen of in te stellen.", + "number-of-weeks-label": "Hoeveel weken bewaren?", + "number-of-weeks-tip": "Stel in op nul om het aantal wekelijkse logboeken in te schakelen of in te stellen om te houden.", + "number-of-months-label": "Houd voor hoeveel maanden?", + "number-of-months-tip": "Stel in op nul om het aantal maandelijkse logboeken dat u wilt behouden uit te schakelen of in te stellen.", + + "show-content-stats-label": "Inhoudsstatistieken weergeven", + "show-content-stats-tip": "Indien ingeschakeld, worden een grafiek en een tabel met verschillende paginatypes weergegeven in het Admin Dashboard.", + + "page-session-active-minutes": "Actieve minuten van de sessie:", + "page-session-active-minutes-tip": "Voor elke pagina wordt een sessie gehouden om te voorkomen dat 'F5' wordt vernieuwd om het aantal vals te verhogen.", + + "stats-title-label": "Paginaweergaven en unieke bezoekers", + + "page-view-today-label": "Aantal bezoeken vandaag", + "unique-visitors-today-label": "Unieke bezoekers vandaag", + "page-view-this-week-label": "Pagina's die deze week zijn bekeken", + "unique-visitors-this-week-label": "Unieke bezoekers deze week", + "page-view-this-month-label": "Pagina's bekeken deze maand", + "unique-visitors-this-month-label": "Unieke bezoekers deze maand", + + "content-statistics-label": "Contentstatistieken", + "tab-chart-label": "Grafiek", + "tab-table-label": "Tabel", + "published-label": "gepubliceerd", + "static-label": "statisch", + "drafts-label": "dammen", + "scheduled-label": "scheduled", + "sticky-label": "plakkerig", + "categories-label": "categorieën", + "tags-label": "tags", + + "end-of-json": "niet gebruikt, alleen een opmerking" + } diff --git a/bl-plugins/simple-stats/languages/ru_RU.json b/bl-plugins/simple-stats/languages/ru_RU.json index 5f2bdb2f..7149e3f5 100644 --- a/bl-plugins/simple-stats/languages/ru_RU.json +++ b/bl-plugins/simple-stats/languages/ru_RU.json @@ -1,12 +1,58 @@ { "plugin-data": { - "name": "Простая статистика", - "description": "Показывает количество посетителей в панели управления." + "name": "простая статистика", + "description": "показывать количество посетителей за период на панели мониторинга." }, - "visits": "Посещения", - "visits-today": "Посещений сегодня", - "unique-visitors-today": "Уникальных посетителей сегодня", - "chart": "Диаграмма", - "table": "Таблица" + + "ongoing-counter-label": "постоянной счетчика", + "ongoing-counter-tip": "если включено, текущий итог собирается.", + "enable-section": "включена", + "disable-section": "отключен", + + "reset-counter-label": "установить текущее значение счетчика", + "reset-counter-tip-one": "не забудьте сохранить как -1, что означает, что он не будет сброшен; 0 или положительное число установит значение.", + "reset-counter-tip-two": "чтобы установить, сохранить как нулевое или позативное число, перейдите на веб-сайт, чтобы вызвать, измените это обратно на -1.", + + "chart-type-label": "тип диаграммы", + "daily-chart": "ежедневно", + "weekly-chart": "еженедельно", + "monthly-chart": "ежемесячно", + "chart-type-tip": "эта опция изменяет то, что отображается на графике по умолчанию.", + + "number-of-days-label": "хранить сколько дней?", + "number-of-days-tip": "установить на ноль, чтобы отключить или установить количество ежедневных журналов.", + "number-of-weeks-label": "сохранить за сколько недель?", + "number-of-weeks-tip": "установить на ноль, чтобы отключить или установить количество еженедельных журналов.", + "number-of-months-label": "держите на сколько месяцев?", + "number-of-months-tip": "установить на ноль, чтобы отключить или установить количество ежемесячных журналов.", + + "show-content-stats-label": "показать статистику контента", + "show-content-stats-tip": "при включении в админ панели отображается диаграмма и таблица различных типов страниц.", + + "page-session-active-minutes": "Активные минуты сеанса страницы:", + "page-session-active-minutes-tip": "Сессия сохраняется для каждой страницы, чтобы предотвратить обновление «F5» для ложного увеличения числа.", + + "stats-title-label": "Просмотры страниц и уникальные посетители", + + "page-view-today-label": "просмотрено страниц сегодня", + "unique-visitors-today-label": "уникальные посетители сегодня", + "page-view-this-week-label": "страниц, просмотренных на этой неделе", + "unique-visitors-this-week-label": "уникальные посетители на этой неделе", + "page-view-this-month-label": "просмотренные в этом месяце страницы", + "unique-visitors-this-month-label": "уникальные посетители в этом месяце", + + "content-statistics-label": "статистика контента", + "tab-chart-label": "график", + "tab-table-label": "таблица", + "published-label": "опубликовано", + "static-label": "статический", + "drafts-label": "черновики", + "scheduled-label": "запланировано", + "sticky-label": "липкий", + "categories-label": "категории", + "tags-label": "теги", + + "end-of-json": "не используется, просто комментарий" + } diff --git a/bl-plugins/simple-stats/languages/tr.json b/bl-plugins/simple-stats/languages/tr.json index ebb7ec99..e916e4f6 100644 --- a/bl-plugins/simple-stats/languages/tr.json +++ b/bl-plugins/simple-stats/languages/tr.json @@ -2,11 +2,57 @@ "plugin-data": { "name": "Basit İstatistikler", - "description": "Yönetici panelinde günlük ziyaretçi sayısını gösterir." + "description": "Panonuzda dönem başına ziyaretçi sayısını göster." }, - "visits": "Ziyaretler", - "visits-today": "Bugün yapılan ziyaretler", - "unique-visitors-today": "Bugün yapılan benzersiz ziyaretler", - "chart": "Grafik", - "table": "Tablo" + + "ongoing-counter-label": "Devam eden sayaç", + "ongoing-counter-tip": "Etkinleştirildiğinde, devam eden bir toplam çalışma toplanır.", + "enable-section": "Etkin", + "disable-section": "Devre dışı", + + "reset-counter-label": "Devam eden sayaç değerini ayarlayın", + "reset-counter-tip-one": "-1'DEN KEEP UNUTMAYIN, yani sıfırlanmayacak demektir; 0 veya pozitif sayı değeri ayarlayacaktır.", + "reset-counter-tip-two": "Ayarlamak, sıfır veya pozitif sayı olarak kaydetmek için, tetiklemek için web sitesine gidin, bunu -1 olarak değiştirin.", + + "chart-type-label": "Grafik Türü", + "daily-chart": "Günlük", + "weekly-chart": "Haftalık", + "monthly-chart": "Aylık", + "chart-type-tip": "Bu seçenek, grafiğin varsayılan olarak gösterme şeklini değiştirir.", + + "number-of-days-label": "Kaç günlüğüne saklayın?", + "number-of-days-tip": "Saklamak için sıfıra ayarlayın veya saklanacak günlük kayıt sayısını ayarlayın.", + "number-of-weeks-label": "Kaç hafta saklayın?", + "number-of-weeks-tip": "Devre dışı bırakmak için sıfıra ayarlayın veya saklanacak haftalık günlük sayısını ayarlayın.", + "number-of-months-label": "Kaç ay saklayın?", + "number-of-months-tip": "Saklamak için sıfıra ayarlayın veya saklanacak aylık günlük sayısını ayarlayın.", + + "show-content-stats-label": "İçerik İstatistiklerini Göster", + "show-content-stats-tip": "Etkinleştirildiğinde, Yönetici Kontrol Paneli'nde farklı sayfa türlerinde bir grafik ve tablo görüntülenir.", + + "page-session-active-minutes": "Sayfa oturumu aktif dakikaları:", + "page-session-active-minutes-tip": "Sayıları artırmak için 'F5' yenilemesini önlemek için her sayfa için bir oturum düzenlenir.", + + "stats-title-label": "Sayfa Görünümleri ve Benzersiz Ziyaretçiler", + + "page-view-today-label": "Bugün görüntülenen sayfalar", + "unique-visitors-today-label": "Bugün benzersiz ziyaretçiler", + "page-view-this-week-label": "Bu hafta görüntülenen sayfalar", + "unique-visitors-this-week-label": "Bu hafta benzersiz ziyaretçiler", + "page-view-this-month-label": "Bu ay görüntülenen sayfalar", + "unique-visitors-this-month-label": "Bu ay benzersiz ziyaretçiler", + + "content-statistics-label": "İçerik İstatistikleri", + "tab-chart-label": "Grafik", + "tab-table-label": "Tablo", + "published-label": "Yayınlandı", + "static-label": "statik", + "drafts-label": "taslaklar", + "scheduled-label": "Planlanmış", + "sticky-label": "yapışkan", + "categories-label": "Kategoriler", + "tags-label": "etiketler", + + "end-of-json": "kullanılmamış, sadece yorum" + } diff --git a/bl-plugins/simple-stats/plugin.php b/bl-plugins/simple-stats/plugin.php index 31848449..720d2c73 100644 --- a/bl-plugins/simple-stats/plugin.php +++ b/bl-plugins/simple-stats/plugin.php @@ -14,10 +14,15 @@ class pluginSimpleStats extends Plugin { // Fields and default values for the database of this plugin $this->dbFields = array( - 'label'=>$L->g('Visits'), - 'numberOfDays'=>7, - 'excludeAdmins'=>false, - 'showContentStats'=>false + 'enableOngoingCounter'=>false, + 'resetOngoingCounterValue'=>'-1', + 'chartType'=>'Weekly', + 'numberOfDaysToKeep'=>7, + 'numberOfWeeksToKeep'=>7, + 'numberOfMonthsToKeep'=>13, + 'showContentStats'=>false, + 'pageSessionActiveMinutes'=>60, + 'excludeAdmins'=>false ); } @@ -29,26 +34,76 @@ class pluginSimpleStats extends Plugin { $html .= $this->description(); $html .= '
'; + // Define ongoing running total counter $html .= '
'; - $html .= ''; - $html .= ''; - $html .= ''.$L->get('This title is almost always used in the sidebar of the site').''; - $html .= '
'; - - $html .= '
'; - $html .= ''; - $html .= ''; + $html .= ''; + $html .= ''; $html .= ''; + $html .= ''.$L->get('ongoing-counter-tip').''; $html .= '
'; + // Controls the resetting of the ongoing counter + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= ''.$L->get('reset-counter-tip-one').''; + $html .= ''.$L->get('reset-counter-tip-two').''; + $html .= '
'; + + // Define the chart type + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= ''.$L->get('chart-type-tip').''; + $html .= '
'; + + // Define how long to keep stats. Zero also turns unwanted collections off. + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= ''.$L->get('number-of-days-tip').''; + $html .= '
'; + + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= ''.$L->get('number-of-weeks-tip').''; + $html .= '
'; + + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= ''.$L->get('number-of-months-tip').''; + $html .= '
'; + + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= ''.$L->get('show-content-stats-tip').''; + $html .= '
'; + + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= ''.$L->get('page-session-active-minutes-tip').''; + $html .= '
'; + + // For uses of BLUDIT PRO if (defined('BLUDIT_PRO')) { $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; } @@ -56,6 +111,13 @@ class pluginSimpleStats extends Plugin { return $html; } + public function beforeSiteLoad() + { + if (session_status() == PHP_SESSION_NONE) { + session_start(); + } + } + public function adminHead() { if (!in_array($GLOBALS['ADMIN_CONTROLLER'], $this->loadOnController)) { @@ -75,34 +137,120 @@ class pluginSimpleStats extends Plugin { public function dashboard() { global $L; - $label = $this->getValue('label'); + $currentDate = Date::current('Y-m-d'); - $visitsToday = $this->visits($currentDate); - $uniqueVisitors = $this->uniqueVisitors($currentDate); + $mondayDateThisWeek = date("Y-m-d", strtotime('monday this week')); + $firstDateOfThisThisMonth = date("Y-m-d", strtotime('first day of this month')); + + $pageViewsToday = $this->getPageViewCount($currentDate, 'Daily'); + $uniqueVisitorsToday = $this->getUniqueVisitorCount($currentDate, 'Daily'); + $pageViewsThisWeek = $this->getPageViewCount($mondayDateThisWeek, 'Weekly'); + $uniqueVisitorsThisWeek = $this->getUniqueVisitorCount($mondayDateThisWeek, 'Weekly'); + $pageViewsThisMonth = $this->getPageViewCount($firstDateOfThisThisMonth, 'Monthly'); + $uniqueVisitorsThisMonth = $this->getUniqueVisitorCount($firstDateOfThisThisMonth, 'Monthly'); + $chartType = $this->getValue('chartType'); + + $runningTotals = json_decode(file_get_contents($this->workspace().'running-totals.json'),TRUE); + $pageCount = $runningTotals['runningTotals']['pageCounter']; + + IF ($chartType == 'Monthly') { + $offsetNumber = $numberOfMonthsToKeep = $this->getValue('numberOfMonthsToKeep'); + + $chartStartDate = date('Y-m-d' , strtotime ( '-'.$offsetNumber.' month' , strtotime ( $firstDateOfThisThisMonth ) ) ); + $chartEndDate = date("Y-m-d", strtotime ( $firstDateOfThisThisMonth ) ); + } + ELSEIF ($chartType == 'Weekly') { + $offsetNumber = $numberOfWeeksToKeep = $this->getValue('numberOfWeeksToKeep'); + $chartStartDate = date('Y-m-d' , strtotime ( '-'.$offsetNumber.' week' , strtotime ( $mondayDateThisWeek ) ) ); + $chartEndDate = date("Y-m-d", strtotime ( $mondayDateThisWeek ) ); + } + ELSE { // $chartType == 'Daily' + $offsetNumber = $numberOfDaysToKeep = $this->getValue('numberOfDaysToKeep'); + $chartStartDate = date('Y-m-d' , strtotime ( '-'.$offsetNumber.' week' , strtotime ( $currentDate ) ) ); + $chartEndDate = date("Y-m-d", strtotime ( $currentDate) ); + } $html = <<
-

{$L->get('Visits')}

+

$chartType {$L->get('stats-title-label')}
($chartStartDate - $chartEndDate)

+
Total Page Count: $pageCount
-

{$L->g('Visits today')}: $visitsToday

-

{$L->g('Unique visitors today')}: $uniqueVisitors

+ + +
+
+
+
+

{$L->get('page-view-today-label')}: $pageViewsToday

+

{$L->get('unique-visitors-today-label')}: $uniqueVisitorsToday

+
+
+

{$L->get('page-view-this-week-label')}: $pageViewsThisWeek

+

{$L->get('unique-visitors-this-week-label')}: $uniqueVisitorsThisWeek

+
+
+

{$L->get('page-view-this-month-label')}: $pageViewsThisMonth

+

{$L->get('unique-visitors-this-month-label')}: $uniqueVisitorsThisMonth

+
+
+
+
EOF; - $numberOfDays = $this->getValue('numberOfDays'); - $numberOfDays = $numberOfDays - 1; - for ($i=$numberOfDays; $i >= 0 ; $i--) { + IF ($chartType == 'Monthly') { + $numberOfMonthsToKeep = $this->getValue('numberOfMonthsToKeep'); + $numberOfMonthsToKeep = $numberOfMonthsToKeep - 1; + + for ($i=$numberOfMonthsToKeep; $i >= 0 ; $i--) { + + $dateWithOffset = date('Y-m-d' , strtotime ( '-'.$i.' month' , strtotime ( $firstDateOfThisThisMonth ) ) ); + + $visits[$i] = $this->getPageViewCount($dateWithOffset, 'Monthly'); + $unique[$i] = $this->getUniqueVisitorCount($dateWithOffset, 'Monthly'); + $days[$i] = Date::format($dateWithOffset, 'Y-m-d', 'M y'); /// M + } + + $labels = "'" . implode("','", $days) . "'"; + $seriesVisits = implode(',', $visits); + $seriesUnique = implode(',', $unique); + } + ELSEIF ($chartType == 'Weekly') { + $numberOfWeeksToKeep = $this->getValue('numberOfWeeksToKeep'); + $numberOfWeeksToKeep = $numberOfWeeksToKeep - 1; + + for ($i=$numberOfWeeksToKeep; $i >= 0 ; $i--) { + + $dateWithOffset = date('Y-m-d' , strtotime ( '-'.$i.' week' , strtotime ( $mondayDateThisWeek ) ) ); + + $visits[$i] = $this->getPageViewCount($dateWithOffset, 'Weekly'); + $unique[$i] = $this->getUniqueVisitorCount($dateWithOffset, 'Weekly'); + $days[$i] = Date::format($dateWithOffset, 'Y-m-d', 'd M'); + } + + $labels = "'" . implode("','", $days) . "'"; + $seriesVisits = implode(',', $visits); + $seriesUnique = implode(',', $unique); + } + ELSE { // $chartType == 'Daily' + $numberOfDaysToKeep = $this->getValue('numberOfDaysToKeep'); + $numberOfDaysToKeep = $numberOfDaysToKeep - 1; + + for ($i=$numberOfDaysToKeep; $i >= 0 ; $i--) { + $dateWithOffset = Date::currentOffset('Y-m-d', '-'.$i.' day'); - $visits[$i] = $this->visits($dateWithOffset); - $unique[$i] = $this->uniqueVisitors($dateWithOffset); + + $visits[$i] = $this->getPageViewCount($dateWithOffset, 'Daily'); + $unique[$i] = $this->getUniqueVisitorCount($dateWithOffset, 'Daily'); $days[$i] = Date::format($dateWithOffset, 'Y-m-d', 'D'); } $labels = "'" . implode("','", $days) . "'"; $seriesVisits = implode(',', $visits); $seriesUnique = implode(',', $unique); + } $script = << @@ -125,25 +273,27 @@ $script = << EOF; - $this->deleteOldLogs(); + $this->deleteOldLogs( 'Daily', $this->getValue('numberOfDaysToKeep') ); + $this->deleteOldLogs( 'Weekly', $this->getValue('numberOfWeeksToKeep') ); + $this->deleteOldLogs( 'Monthly',$this->getValue('numberOfMonthsToKeep') ); /** * Optional Content Stats Feature - */ + **/ if ($this->getValue('showContentStats')) { global $pages, $categories, $tags; - $data['title'] = $L->get('Statistics'); - $data['tabTitleChart'] = $L->get('Chart'); - $data['tabTitleTable'] = $L->get('Table'); - $data['data'][$L->get('published')] = count($pages->getPublishedDB()); - $data['data'][$L->get('static')] = count($pages->getStaticDB()); - $data['data'][$L->get('drafts')] = count($pages->getDraftDB()); - $data['data'][$L->get('scheduled')] = count($pages->getScheduledDB()); - $data['data'][$L->get('sticky')] = count($pages->getStickyDB()); - $data['data'][$L->get('categories')]= count($categories->keys()); - $data['data'][$L->get('tags')] = count($tags->keys()); + $data['title'] = $L->get('content-statistics-label'); + $data['tabTitleChart'] = $L->get('tab-chart-label'); + $data['tabTitleTable'] = $L->get('tab-table-label'); + $data['data'][$L->get('published-label')] = count($pages->getPublishedDB()); + $data['data'][$L->get('static-label')] = count($pages->getStaticDB()); + $data['data'][$L->get('drafts-label')] = count($pages->getDraftDB()); + $data['data'][$L->get('scheduled-label')] = count($pages->getScheduledDB()); + $data['data'][$L->get('sticky-label')] = count($pages->getStickyDB()); + $data['data'][$L->get('categories-label')]= count($categories->keys()); + $data['data'][$L->get('tags-label')] = count($tags->keys()); $html .= $this->renderContentStatistics($data); } @@ -152,30 +302,56 @@ EOF; public function siteBodyEnd() { - $this->addVisitor(); - } + global $page; + $pageTitleHash = hash(adler32,$page->title(),false); + $pageSessionLimit = (60*$this->getValue('pageSessionActiveMinutes')); // 60*60=360 - // Keep only 7 days of logs, remove the old ones - public function deleteOldLogs() + // Counters will be increased only once a page title session to prevent F5 increases. + if ( (!isset($_SESSION[$pageTitleHash])) || ((time()-$_SESSION[$pageTitleHash]) > $pageSessionLimit ) ) + { + //Set Variable for this session so user cannot increase counter by pressing F5 + $_SESSION[$pageTitleHash] = time(); + + IF ($this->getValue('numberOfDaysToKeep') > 0) { + $this->addVisitorDaily(); + } + + IF ($this->getValue('numberOfWeeksToKeep') > 0) { + $this->addVisitorWeekly(); + } + + IF ($this->getValue('numberOfMonthsToKeep') > 0) { + $this->addVisitorMonthly(); + } + + IF (enableOngoingCounter) { + $this->increaseCounter(); + } + } + } + + + // Keep only number of logs defined in numberOfDaysToKeep, numberOfWeeksToKeep & numberOfMonthsToKeep. + public function deleteOldLogs( $periodType, $numberToKeep ) { - $logs = Filesystem::listFiles($this->workspace(), '*', 'log', true); - $remove = array_slice($logs, 7); + $logs = Filesystem::listFiles($this->workspace(), '*-'.$periodType, 'log', true); + $remove = array_slice($logs, $numberToKeep); foreach ($remove as $log) { Filesystem::rmfile($log); } } - // Returns the amount of visits by date - public function visits($date) + // Returns the number of page visits by date per day + public function getPageViewCount($date, $periodType) { - $file = $this->workspace().$date.'.log'; + $file = $this->workspace().$date.'-'.$periodType.'.log'; $handle = @fopen($file, 'rb'); if ($handle===false) { return 0; } - // The amount of visits are the number of lines on the file + // The number of page visits are the number of lines on the file $lines = 0; while (!feof($handle)) { $lines += substr_count(fread($handle, 8192), PHP_EOL); @@ -184,10 +360,10 @@ EOF; return $lines; } - // Returns the amount of unique visitors by date - public function uniqueVisitors($date) + // Returns the number of unique visitors by date + public function getUniqueVisitorCount($date, $periodType) { - $file = $this->workspace().$date.'.log'; + $file = $this->workspace().$date.'-'.$periodType.'.log'; $lines = @file($file); if (empty($lines)) { return 0; @@ -202,22 +378,111 @@ EOF; return count($tmp); } - // Add a line to the current log + public function increaseCounter() + { + $runningTotals = array(); + $totalPageViews = 0; + $totalUniqueVisitors = 0; + $resetOngoingCounterValue = $this->getValue('resetOngoingCounterValue'); + try + { + + if (!file_exists($this->workspace().'running-totals.json') ) { + $runningTotals['runningTotals'] = array( + 'pageCounter' => 0, + 'uniqueCounter' => 0 // not used at the moment - would need to read today's log file to determin if visitor exists + ); + } + else { + $runningTotals = json_decode(file_get_contents($this->workspace().'running-totals.json'),TRUE); + } + + if ($resetOngoingCounterValue < 0 ) { + $runningTotals['runningTotals']['pageCounter']++; + } + else { + $runningTotals['runningTotals']['pageCounter'] = $resetOngoingCounterValue; + } + + //Encode the array back into a JSON string. + $json = json_encode($runningTotals); + + //Save the file. + file_put_contents($this->workspace().'running-totals.json', $json); + } + catch (Exception $e) { + echo 'Caught exception: '.$e->getMessage(); + } + +// $formatStyle=NumberFormatter::TYPE_INT32; +// $formatter= new NumberFormatter($locale, $formatStyle); +// echo "Running total = ".$formatter->format($runningTotals['runningTotals']['pageCounter']); + + } + + // Add a line to the current Daily log // The line is a json array with the hash IP of the visitor and the time - public function addVisitor() + public function addVisitorDaily() { if (Cookie::get('BLUDIT-KEY') && defined('BLUDIT_PRO') && $this->getValue('excludeAdmins')) { return false; } - $currentTime = Date::current('Y-m-d H:i:s'); + + $currentTime = Date::current('Y-m-d H:i:s'); $ip = TCP::getIP(); $hashIP = md5($ip); $line = json_encode(array($hashIP, $currentTime)); $currentDate = Date::current('Y-m-d'); - $logFile = $this->workspace().$currentDate.'.log'; + $logDailyFile = $this->workspace().$currentDate.'-Daily.log'; - return file_put_contents($logFile, $line.PHP_EOL, FILE_APPEND | LOCK_EX)!==false; + return file_put_contents($logDailyFile, $line.PHP_EOL, FILE_APPEND | LOCK_EX)!==false; + + } + + // Add a line to the current Weekly log + // The line is a json array with the hash IP of the visitor and the time + public function addVisitorWeekly() + { + if (Cookie::get('BLUDIT-KEY') && defined('BLUDIT_PRO') && $this->getValue('excludeAdmins')) { + return false; + } + + $mondayDateTimeThisWeek = date("Y-m-d", strtotime('monday this week')).' '. date('H:i:s', strtotime("now")); + + $ip = TCP::getIP(); + $hashIP = md5($ip); + + $line = json_encode(array($hashIP, $mondayDateTimeThisWeek)); + + $mondayDateThisWeek = date("Y-m-d", strtotime('monday this week')); + + $logWeeklyFile = $this->workspace().$mondayDateThisWeek.'-Weekly.log'; + + return file_put_contents($logWeeklyFile, $line.PHP_EOL, FILE_APPEND | LOCK_EX)!==false; + + } + + // Add a line to the current Monthly log + // The line is a json array with the hash IP of the visitor and the time + public function addVisitorMonthly() + { + if (Cookie::get('BLUDIT-KEY') && defined('BLUDIT_PRO') && $this->getValue('excludeAdmins')) { + return false; + } + + $firstDateTimeOfThisThisMonth = date("Y-m-d", strtotime('first day of this month')).' '. date('H:i:s', strtotime("now")); + + $ip = TCP::getIP(); + $hashIP = md5($ip); + + $line = json_encode(array($hashIP, $firstDateTimeOfThisThisMonth)); + + $firstDateOfThisThisMonth = date("Y-m-d", strtotime('first day of this month')); + + $logMonthyFile = $this->workspace().$firstDateOfThisThisMonth.'-Monthly.log'; + + return file_put_contents($logMonthyFile, $line.PHP_EOL, FILE_APPEND | LOCK_EX)!==false; } public function renderContentStatistics($data) @@ -267,5 +532,4 @@ EOF; return $html; } - -} +} \ No newline at end of file