public static function getInstance() { if (!isset(self::$instance)) { self::$instance = new AdmTemplate(); } return self::$instance; }
public function InitTemplateLang() { $data = Admin::readCSV(dirname(__FILE__) . '/../lang/' . SYS_LANG . '/lang.csv'); for ($i = 1; $i < count($data); $i++) { $langData[$data[$i][0]] = $data[$i][1]; } $template = AdmTemplate::getInstance(); $template->template->assign("langData", $langData); }
<?php /* * @author: Tomáš Mičulka * @version: 2.0 * @last_update: 7.1.2014 */ defined('IN_INNE') or die("Acces denied!"); $database = Mysql::getConnection(); $allVisits = array(); $allVisitsTitles = array(); $data = $database->Query("SELECT * FROM " . TABLE_PREFIX . "visits ORDER BY visitDate ASC;"); while ($row = $data->fetch_array()) { $day = date("j", $row["visitDate"]); $month = date("m", $row["visitDate"]); $year = date("Y", $row["visitDate"]); if (!isset($allVisits["{$year}-{$month}-{$day}"])) { $allVisits["{$year}-{$month}-{$day}"] = 0; $allVisitsTitles[] = "{$year}-{$month}-{$day}"; } $allVisits["{$year}-{$month}-{$day}"]++; } $template = AdmTemplate::getInstance(); $template->template->assign("allVisits", $allVisits); $template->template->assign("allVisitsTitles", $allVisitsTitles);