require_once 'link_client.php'; include 'vendor/simplepie/simplepie/autoloader.php'; set_time_limit(0); ini_set('user_agent', 'NameOfAgent (http://www.newsline.world)'); $dom; $input; $root; $host; $links; $ds; $categoryid; $logService; $level; $start; $error; $logService = new LogDataService(); require_once '..\\d4server\\nodemanager_data_service.php'; $ds = new PovDataService($conf['dsn'], $conf['dbname'], $conf['dbpassword'], array(PDO::ATTR_PERSISTENT => false)); //$lastTimestamp=$ds->getD4CrawlerTimestamp(); $nmDataService = new NodemanagerDataService($conf['d4nmdsn'], $conf['d4nmdbname'], $conf['d4nmdbpassword'], array(PDO::ATTR_PERSISTENT => false)); $forums = $ds->getAllForums(); $logService->log('D4CRAWLER', 'Forums length=' . sizeof($forums), var_log($forums, '$forums'), 'd4crawler'); foreach ($forums as $forum) { $logService->log('D4CRAWLER', 'Starting forum=' . $forum['forum'], var_log($forum, '$forum'), 'd4crawler'); $forumid = $forum['forumid']; $categoryid = $forum['categoryid']; $lastCrawled = $forum['last_crawled']; $d4ds = $nmDataService->getForumHubDataService($forumid); $threads = $d4ds->getNewThreads($forumid, $lastCrawled); $createdat = 0; foreach ($threads as $t) {
if (isset($_GET['threadid'])) { $threadid = $_GET['threadid']; $threadid_was_set = true; } if (!$threadid) { if (isset($_COOKIE['threadid'])) { $threadid = $_COOKIE['threadid']; } } $lang = ''; $lang_was_set = false; if (isset($_GET['lang'])) { $lang = substr($_GET['lang'], 0, 2); $lang_was_set = true; } $logService = new LogDataService(); $user_agent = $_SERVER['HTTP_USER_AGENT']; $server = $_SERVER['SERVER_NAME']; if (stripos($server, 'newsline') !== FALSE) { $productname = "Newsline World"; } else { $productname = "Qwiket"; } //$logService->log('TRACE','LANDING PAGE',$user_agent,'start'); if (isset($_GET['logout'])) { setcookie('identity', '', time() - 3600, '/'); setcookie('ti', '', time() - 24 * 3600, '/'); $logService->log('TRACE', 'LANDING PAGE LOGOUT ', var_log($_GET, '$_GET') . var_log($_COOKIE, '$_COOKIE'), ''); header('Location:/'); exit; }
$clubid = 0; if (isset($_GET['clubid'])) { $clubid = $_GET['clubid']; } $threadid = 0; if (isset($_GET['threadid'])) { $threadid = $_GET['threadid']; } $lang = ''; if (isset($_GET['lang'])) { $lang = $_GET['lang']; } $error = ''; $root = ''; $user_agent = $_SERVER['HTTP_USER_AGENT']; $logService = new LogDataService(); $ds = new PovDataService($conf['dsn'], $conf['dbname'], $conf['dbpassword'], array(PDO::ATTR_PERSISTENT => false)); $identity = ''; if (isset($_COOKIE['identity'])) { $identity = $_COOKIE['identity']; } /* if(!$identity){ $identity = $_COOKIE['ti']; }*/ $l = ''; /*if (isset($_COOKIE['lang'])) $l = $_COOKIE['lang']; */ if ($l && !$lang) { $lang = $l;
require_once 'user_manager.php'; require_once 'd4rum_data_service.php'; require_once 'hub_data_service.php'; require_once 'disqus_client.php'; $view = 0; if (isset($_GET['view'])) { $view = $_GET['view']; } $lang = 'en'; $lang_was_set = false; if (isset($_GET['lang'])) { $lang = substr($_GET['lang'], 0, 2); $lang_was_set = true; $lang = strtolower($lang); } $logService = new LogDataService(); $user_agent = $_SERVER['HTTP_USER_AGENT']; $server = $_SERVER['SERVER_NAME']; if (isset($_GET['logout'])) { setcookie('identity', '', time() - 3600, '/'); setcookie('nodeid', '', time() - 3600, '/'); $logService->log('D4TRACE', 'LANDING PAGE LOGOUT ', var_log($_GET, '$_GET') . var_log($_COOKIE, '$_COOKIE'), ''); header('Location:/'); exit; } $dynamic_script = ' <script id="newsline" type="text/javascript"> var server={ identity:"" };
<?php /** To login into google API and refresh tokens **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../google-api-php-client/src/Google'); include 'config.php'; require_once 'log_data_service.php'; require_once 'pov_data_service.php'; $error = ''; $logService = new LogDataService(); $ds = new PovDataService($conf['dsn'], $conf['dbname'], $conf['dbpassword'], array(PDO::ATTR_PERSISTENT => false)); $ret = $ds->getCurrentSitemap(); if (!$ret) { return; } try { $name = $ret['name']; $urls = $ret['urls']; $xml_header = '<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> '; $file = fopen('..\\sitemaps\\' . $name, "w") or die("Unable to open file!"); fwrite($file, $xml_header); foreach ((array) $urls as $u) { $url = $u['url']; $xml = ' <url> <loc>' . $url . '</loc> </url>'; fwrite($file, $xml); }