dbFields = array( 'label' => 'Hit Counter', 'showUniqueVisitors' => false ); } public function form() { global $L; // Check if the plugin Visits Stats is activated if (!pluginActivated('pluginVisitsStats')) { $html = ''; $this->formButtons = false; return $html; } $html = ''; $html .= '
'; $html .= ''; $html .= ''; $html .= '' . $L->get('This title is almost always used in the sidebar of the site') . ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; return $html; } public function siteSidebar() { $counter = 0; if (pluginActivated('pluginVisitsStats')) { global $plugins; $visitsStats = $plugins['all']['pluginVisitsStats']; $currentDate = Date::current('Y-m-d'); if ($this->getValue('showUniqueVisitors')) { $counter = $visitsStats->uniqueVisitors($currentDate); } else { $counter = $visitsStats->visits($currentDate); } } $html = '
'; $html .= '

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

'; $html .= '
'; $html .= '
' . $counter . '
'; $html .= '
'; $html .= '
'; return $html; } }