setUserView(); // user use local DB settings Conf::i()->setDbConf(); // db options from DB, param type = "user / admin" - choose type of DB/MC connection /* if (in_array($_GET['action'], array("show_content", "category_list", "tag_list", "search"))){ // ---------------------- Om's API ----------------------- unset($_SESSION['log_identifier']); define('SITE_ID',20); $date = getdate(); if (isset($_COOKIE['unq'])){ $cookie_enabled = 1; $c_unq = 0; setcookie('interior', 1); }else{ setcookie('interior', 1); $c_unq = 1; setcookie('unq', 1, time()+86400); } $ip = $_SERVER['REMOTE_ADDR']; if (isset($_GET['wmid'])){ $pid = (int)$_GET['wmid']; }else{ $pid = (int)$_COOKIE['pid']; } if (isset($_GET['sid'])){ $sub = (int)$_GET['sid']; }else{ $sub = (int)$_COOKIE['sub']; } setcookie('pid', $pid, time()+86400, "/"); setcookie('sub', $sub, time()+86400, "/"); $unq = Reg::i()->mc()->get($ip."_talk"); if (!$unq){ Reg::i()->mc()->set($ip."_talk", 5, false, 86400); $unq = 1; $log_identifier = substr(md5(mt_rand(0,10000000)), 2,8); }else{ if (isset($_GET['wmid'])){ $unq = 0; }else{ $unq = 2; } $log_identifier = false; } $_SESSION['log_identifier'] = $log_identifier; $ref = getenv('HTTP_REFERER'); $string = $log_identifier."|".SITE_ID."|".$pid."|".$sub."|".strtolower(geoip_country_code_by_name($_SERVER['REMOTE_ADDR']))."|".$_SERVER['HTTP_USER_AGENT']."|".$ref."|".$c_unq."|".$unq."|".$ip."|".$cookie_enabled."|".$date[0]."\r\n"; if (!file_exists("logs/pstat/".$date['year']."/".$date['month']."/".$date['mday']."/".$date['hours'])){ @mkdir(APP_ROOT."/logs/pstat/".$date['year'],0777); @mkdir(APP_ROOT."/logs/pstat/".$date['year']."/".$date['month'],0777); @mkdir(APP_ROOT."/logs/pstat/".$date['year']."/".$date['month']."/".$date['mday'],0777); @mkdir(APP_ROOT."/logs/pstat/".$date['year']."/".$date['month']."/".$date['mday']."/".$date['hours'],0777); } $fp = fopen(APP_ROOT."/logs/pstat/".$date['year']."/".$date['month']."/".$date['mday']."/".$date['hours']."/logged", 'a'); fputs($fp, $string); fclose($fp); if (isset($_COOKIE['interior'])){ if (!isset($_COOKIE['pid'])){ $int_pid = $pid; }else{ $int_pid = $_COOKIE['pid']; } if (!isset($_COOKIE['sub'])){ $int_sub = $sub; }else{ $int_sub = $_COOKIE['sub']; } $int_prod = SITE_ID."|".$int_pid."|".$int_sub."|".$date[0]."\r\n"; $fp = fopen(APP_ROOT."/logs/pstat/".$date['year']."/".$date['month']."/".$date['mday']."/".$date['hours']."/int_productivity", 'a'); fputs($fp, $int_prod); fclose($fp); } // ------------------------ \ end Om's API ------------------ } */ $auth_obj = new Auth(); $user_data = $auth_obj->authUser(); if ($user_data) { if ((strpos($_GET['action'],'rss') === false)&&(strpos($_GET['action'],'sitemap') === false)) { $user_obj = new User_Model(); $user_data['friends_cnt'] = $user_obj->getFriendsCount($user_data['user_id']); $user_data['friends_requests_cnt'] = $user_obj->getFriendsRequestsCount($user_data['user_id']); } } $auth = ($user_data) ? 1 : 0; if (empty($_GET['action'])) { //include(APP_VIEWS."header.php"); //include(APP_VIEWS."footer.php"); } else { $action = trim( str_replace(array(".php", ".", "/"), "", $_GET['action']) ); $file = APP_ACTIONS.$action.".php"; if (!is_file($file)) { die("Action file do not exists!"); } else { include($file); } } ?>