function showSitemapGenerator()
 {
     $userId = isLoggedIn();
     $websiteController = new WebsiteController();
     $websiteList = $websiteController->__getAllWebsites($userId, true);
     $this->set('websiteList', $websiteList);
     $websiteId = empty($searchInfo['website_id']) ? $websiteList[0]['id'] : $searchInfo['website_id'];
     $this->set('websiteId', $websiteId);
     $this->render('sitemap/showsitemap');
 }
 function index()
 {
     $this->set('sectionHead', 'Meta Tag Generator');
     $userId = isLoggedIn();
     $websiteController = new WebsiteController();
     $this->set('websiteList', $websiteController->__getAllWebsites($userId, true));
     $this->set('websiteNull', true);
     $this->set('onChange', pluginPOSTMethod('search_form', 'subcontent', 'action=show'));
     $this->pluginRender('index');
 }
Beispiel #3
0
 function index()
 {
     if (isLoggedIn()) {
         $userId = isLoggedIn();
         /*$userCtrler = New UserController();
         		$userInfo = $userCtrler->__getUserInfo($userId);
         		$this->set('userInfo', $userInfo);*/
         $websiteCtrler = new WebsiteController();
         $list = $websiteCtrler->__getAllWebsites($userId, true);
         include_once SP_CTRLPATH . "/saturationchecker.ctrl.php";
         include_once SP_CTRLPATH . "/rank.ctrl.php";
         include_once SP_CTRLPATH . "/backlink.ctrl.php";
         $rankCtrler = new RankController();
         $backlinlCtrler = new BacklinkController();
         $saturationCtrler = new SaturationCheckerController();
         $dirCtrler = new DirectoryController();
         $websiteList = array();
         foreach ($list as $listInfo) {
             # rank reports
             $report = $rankCtrler->__getWebsiteRankReport($listInfo['id']);
             $report = $report[0];
             $listInfo['alexarank'] = empty($report['alexa_rank']) ? "-" : $report['alexa_rank'] . " " . $report['rank_diff_alexa'];
             $listInfo['googlerank'] = empty($report['google_pagerank']) ? "-" : $report['google_pagerank'] . " " . $report['rank_diff_google'];
             # back links reports
             $report = $backlinlCtrler->__getWebsitebacklinkReport($listInfo['id']);
             $report = $report[0];
             $listInfo['google']['backlinks'] = empty($report['google']) ? "-" : $report['google'] . " " . $report['rank_diff_google'];
             $listInfo['yahoo']['backlinks'] = empty($report['yahoo']) ? "-" : $report['yahoo'] . " " . $report['rank_diff_yahoo'];
             $listInfo['msn']['backlinks'] = empty($report['msn']) ? "-" : $report['msn'] . " " . $report['rank_diff_msn'];
             # rank reports
             $report = $saturationCtrler->__getWebsiteSaturationReport($listInfo['id']);
             $report = $report[0];
             $listInfo['google']['indexed'] = empty($report['google']) ? "-" : $report['google'] . " " . $report['rank_diff_google'];
             $listInfo['yahoo']['indexed'] = empty($report['yahoo']) ? "-" : $report['yahoo'] . " " . $report['rank_diff_yahoo'];
             $listInfo['msn']['indexed'] = empty($report['msn']) ? "-" : $report['msn'] . " " . $report['rank_diff_msn'];
             $listInfo['dirsub']['total'] = $dirCtrler->__getTotalSubmitInfo($listInfo['id']);
             $listInfo['dirsub']['active'] = $dirCtrler->__getTotalSubmitInfo($listInfo['id'], true);
             $websiteList[] = $listInfo;
         }
         $this->set('websiteList', $websiteList);
         $this->render('user/userhome');
     } else {
         $this->render('home');
     }
 }
Beispiel #4
0
 function executeCron($includeList = array())
 {
     $this->loadCronJobTools($includeList);
     $lastGenerated = date('Y-m-d 00:00:00');
     $userCtrler = new UserController();
     $userList = $userCtrler->__getAllUsers();
     foreach ($userList as $userInfo) {
         // create report controller
         $reportCtrler = new ReportController();
         $lastGenerated = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
         // check for user report schedule
         $repSetInfo = $reportCtrler->isGenerateReportsForUser($userInfo['id']);
         if (!empty($repSetInfo['generate_report'])) {
             $websiteCtrler = new WebsiteController();
             $websiteList = $websiteCtrler->__getAllWebsites($userInfo['id']);
             // if websites are available
             if (count($websiteList) > 0) {
                 foreach ($websiteList as $websiteInfo) {
                     $this->websiteInfo = $websiteInfo;
                     $this->routeCronJob($websiteInfo['id'], '', true);
                 }
                 // save report generated time
                 $reportCtrler->updateUserReportSetting($userInfo['id'], 'last_generated', $lastGenerated);
                 // send email notification if enabled
                 if (SP_REPORT_EMAIL_NOTIFICATION && $repSetInfo['email_notification']) {
                     $reportCtrler->sentEmailNotificationForReportGen($userInfo, $repSetInfo['last_generated'], $lastGenerated);
                 }
             }
         }
     }
 }
 function showReports($searchInfo = '')
 {
     $userId = isLoggedIn();
     if (!empty($searchInfo['from_time'])) {
         $fromTime = strtotime($searchInfo['from_time'] . ' 00:00:00');
     } else {
         $fromTime = @mktime(0, 0, 0, date('m'), date('d') - 30, date('Y'));
     }
     if (!empty($searchInfo['to_time'])) {
         $toTime = strtotime($searchInfo['to_time'] . ' 23:59:59');
     } else {
         $toTime = @mktime();
     }
     $this->set('fromTime', date('Y-m-d', $fromTime));
     $this->set('toTime', date('Y-m-d', $toTime));
     $websiteController = new WebsiteController();
     $websiteList = $websiteController->__getAllWebsites($userId, true);
     $this->set('websiteList', $websiteList);
     $websiteId = empty($searchInfo['website_id']) ? $websiteList[0]['id'] : intval($searchInfo['website_id']);
     $this->set('websiteId', $websiteId);
     $conditions = empty($websiteId) ? "" : " and s.website_id={$websiteId}";
     $sql = "select s.* ,w.name\r\n\t\t\t\t\t\t\t\tfrom backlinkresults s,websites w \r\n\t\t\t\t\t\t\t\twhere s.website_id=w.id \r\n\t\t\t\t\t\t\t\tand result_time>= {$fromTime} and result_time<={$toTime} {$conditions}  \r\n\t\t\t\t\t\t\t\torder by result_time";
     $reportList = $this->db->select($sql);
     $i = 0;
     $colList = $this->colList;
     foreach ($colList as $col => $dbCol) {
         $prevRank[$col] = 0;
     }
     # loop throgh rank
     foreach ($reportList as $key => $repInfo) {
         foreach ($colList as $col => $dbCol) {
             $rankDiff[$col] = '';
         }
         foreach ($colList as $col => $dbCol) {
             if ($i > 0) {
                 $rankDiff[$col] = ($prevRank[$col] - $repInfo[$dbCol]) * -1;
                 if ($rankDiff[$col] > 0) {
                     $rankDiff[$col] = "<font class='green'>({$rankDiff[$col]})</font>";
                 } elseif ($rankDiff[$col] < 0) {
                     $rankDiff[$col] = "<font class='red'>({$rankDiff[$col]})</font>";
                 }
             }
             $reportList[$key]['rank_diff_' . $col] = empty($rankDiff[$col]) ? '' : $rankDiff[$col];
         }
         foreach ($colList as $col => $dbCol) {
             $prevRank[$col] = $repInfo[$dbCol];
         }
         $i++;
     }
     $websiteInfo = $websiteController->__getWebsiteInfo($websiteId);
     $websiteUrl = @Spider::removeTrailingSlash(formatUrl($websiteInfo['url']));
     $websiteUrl = urldecode($websiteUrl);
     $this->set('directLinkList', array('google' => $this->backUrlList['google'] . $websiteUrl, 'msn' => $this->backUrlList['msn'] . $websiteUrl, 'alexa' => $this->backUrlList['alexa'] . $websiteUrl));
     $this->set('list', array_reverse($reportList, true));
     $this->render('backlink/backlinkreport');
 }
Beispiel #6
0
 function __changeStatus($userId, $status)
 {
     $userId = intval($userId);
     $sql = "update users set status={$status} where id={$userId}";
     $this->db->query($sql);
     # deaactivate all websites under this user
     if (empty($status)) {
         $websiteCtrler = new WebsiteController();
         $websiteList = $websiteCtrler->__getAllWebsites($userId);
         foreach ($websiteList as $websiteInfo) {
             $websiteCtrler->__changeStatus($websiteInfo['id'], 0);
         }
     }
 }
Beispiel #7
0
 function showReports($searchInfo = '')
 {
     $this->set('sectionHead', 'Google and Alexa Rank Reports');
     $userId = isLoggedIn();
     if (!empty($searchInfo['from_time'])) {
         $fromTime = strtotime($searchInfo['from_time'] . ' 00:00:00');
     } else {
         $fromTime = mktime(0, 0, 0, date('m'), date('d') - 30, date('Y'));
     }
     if (!empty($searchInfo['to_time'])) {
         $toTime = strtotime($searchInfo['to_time'] . ' 23:59:59');
     } else {
         $toTime = mktime();
     }
     $this->set('fromTime', date('Y-m-d', $fromTime));
     $this->set('toTime', date('Y-m-d', $toTime));
     $websiteController = new WebsiteController();
     $websiteList = $websiteController->__getAllWebsites($userId, true);
     $this->set('websiteList', $websiteList);
     $websiteId = empty($searchInfo['website_id']) ? $websiteList[0]['id'] : $searchInfo['website_id'];
     $this->set('websiteId', $websiteId);
     $conditions = empty($websiteId) ? "" : " and s.website_id={$websiteId}";
     $sql = "select s.* ,w.name\r\n\t\t\t\t\t\t\t\tfrom rankresults s,websites w \r\n\t\t\t\t\t\t\t\twhere s.website_id=w.id \r\n\t\t\t\t\t\t\t\tand result_time>= {$fromTime} and result_time<={$toTime} {$conditions}  \r\n\t\t\t\t\t\t\t\torder by result_time";
     $reportList = $this->db->select($sql);
     $i = 0;
     $colList = array('google' => 'google_pagerank', 'alexa' => 'alexa_rank');
     foreach ($colList as $col => $dbCol) {
         $prevRank[$col] = 0;
     }
     # loop throgh rank
     foreach ($reportList as $key => $repInfo) {
         foreach ($colList as $col => $dbCol) {
             $rankDiff[$col] = '';
         }
         foreach ($colList as $col => $dbCol) {
             if ($i > 0) {
                 $signVal = -1;
                 $greaterClass = 'green';
                 $lessClass = 'red';
                 if ($col == 'alexa') {
                     $signVal = 1;
                     $greaterClass = 'green';
                     $lessClass = 'red';
                 }
                 $rankDiff[$col] = ($prevRank[$col] - $repInfo[$dbCol]) * $signVal;
                 if ($rankDiff[$col] > 0) {
                     $rankDiff[$col] = "<font class='{$greaterClass}'>({$rankDiff[$col]})</font>";
                 } elseif ($rankDiff[$col] < 0) {
                     $rankDiff[$col] = "<font class='{$lessClass}'>({$rankDiff[$col]})</font>";
                 }
             }
             $reportList[$key]['rank_diff_' . $col] = empty($rankDiff[$col]) ? '' : $rankDiff[$col];
         }
         foreach ($colList as $col => $dbCol) {
             $prevRank[$col] = $repInfo[$dbCol];
         }
         $i++;
     }
     $this->set('list', array_reverse($reportList, true));
     $this->render('rank/rankreport');
 }
 function editKeyword($keywordId, $listInfo = '')
 {
     $userId = isLoggedIn();
     $websiteController = new WebsiteController();
     $this->set('websiteList', $websiteController->__getAllWebsites($userId, true));
     $langController = new LanguageController();
     $this->set('langList', $langController->__getAllLanguages());
     $this->set('langNull', true);
     $countryController = new CountryController();
     $this->set('countryList', $countryController->__getAllCountries());
     $this->set('countryNull', true);
     $seController = new SearchEngineController();
     $this->set('seList', $seController->__getAllSearchEngines());
     if (!empty($keywordId)) {
         if (empty($listInfo)) {
             $listInfo = $this->__getKeywordInfo($keywordId);
             $listInfo['oldName'] = $listInfo['name'];
             $listInfo['searchengines'] = explode(':', $listInfo['searchengines']);
         }
         $this->set('post', $listInfo);
         $this->render('keyword/edit');
         exit;
     }
     $this->listKeywords();
 }
 function editProject($projectId, $listInfo = '')
 {
     $userId = isLoggedIn();
     $projectId = intval($projectId);
     if (!empty($projectId)) {
         if (empty($listInfo)) {
             $listInfo = $this->__getProjectInfo($projectId);
             $listInfo['oldName'] = $listInfo['keyword'];
         }
         $this->set('post', $listInfo);
         $websiteController = new WebsiteController();
         $websiteList = $websiteController->__getAllWebsites($userId, true);
         $this->set('websiteList', $websiteList);
         $websiteId = empty($listInfo['website_id']) ? $websiteList[0]['id'] : intval($listInfo['website_id']);
         $this->set('websiteId', $websiteId);
         $langController = new LanguageController();
         $this->set('langList', $langController->__getAllLanguages());
         $this->render('siteauditor/edit');
         exit;
     }
 }
Beispiel #10
0
 function index($searchInfo = '')
 {
     $spTextHome = $this->getLanguageTexts('home', $_SESSION['lang_code']);
     $this->set('spTextHome', $spTextHome);
     if (isLoggedIn()) {
         $userId = isLoggedIn();
         $exportVersion = false;
         switch ($searchInfo['doc_type']) {
             case "export":
                 $exportVersion = true;
                 $exportContent = "";
                 break;
             case "print":
                 $this->set('printVersion', true);
                 break;
         }
         $websiteCtrler = new WebsiteController();
         $list = $websiteCtrler->__getAllWebsites($userId, true);
         include_once SP_CTRLPATH . "/saturationchecker.ctrl.php";
         include_once SP_CTRLPATH . "/rank.ctrl.php";
         include_once SP_CTRLPATH . "/backlink.ctrl.php";
         $rankCtrler = new RankController();
         $backlinlCtrler = new BacklinkController();
         $saturationCtrler = new SaturationCheckerController();
         $dirCtrler = new DirectoryController();
         $websiteList = array();
         foreach ($list as $listInfo) {
             # rank reports
             $report = $rankCtrler->__getWebsiteRankReport($listInfo['id']);
             $report = $report[0];
             $listInfo['alexarank'] = empty($report['alexa_rank']) ? "-" : $report['alexa_rank'] . " " . $report['rank_diff_alexa'];
             $listInfo['googlerank'] = empty($report['google_pagerank']) ? "-" : $report['google_pagerank'] . " " . $report['rank_diff_google'];
             # back links reports
             $report = $backlinlCtrler->__getWebsitebacklinkReport($listInfo['id']);
             $report = $report[0];
             $listInfo['google']['backlinks'] = empty($report['google']) ? "-" : $report['google'] . " " . $report['rank_diff_google'];
             $listInfo['yahoo']['backlinks'] = empty($report['yahoo']) ? "-" : $report['yahoo'] . " " . $report['rank_diff_yahoo'];
             $listInfo['msn']['backlinks'] = empty($report['msn']) ? "-" : $report['msn'] . " " . $report['rank_diff_msn'];
             $listInfo['altavista']['backlinks'] = empty($report['altavista']) ? "-" : $report['altavista'] . " " . $report['rank_diff_altavista'];
             $listInfo['alltheweb']['backlinks'] = empty($report['alltheweb']) ? "-" : $report['alltheweb'] . " " . $report['rank_diff_alltheweb'];
             # rank reports
             $report = $saturationCtrler->__getWebsiteSaturationReport($listInfo['id']);
             $report = $report[0];
             $listInfo['google']['indexed'] = empty($report['google']) ? "-" : $report['google'] . " " . $report['rank_diff_google'];
             $listInfo['yahoo']['indexed'] = empty($report['yahoo']) ? "-" : $report['yahoo'] . " " . $report['rank_diff_yahoo'];
             $listInfo['msn']['indexed'] = empty($report['msn']) ? "-" : $report['msn'] . " " . $report['rank_diff_msn'];
             $listInfo['dirsub']['total'] = $dirCtrler->__getTotalSubmitInfo($listInfo['id']);
             $listInfo['dirsub']['active'] = $dirCtrler->__getTotalSubmitInfo($listInfo['id'], true);
             $websiteList[] = $listInfo;
         }
         if ($exportVersion) {
             $exportContent .= createExportContent(array());
             $exportContent .= createExportContent(array());
             $exportContent .= createExportContent(array('', $spTextHome['Website Statistics'], ''));
             $exportContent .= createExportContent(array());
             $headList = array('Id', 'Website', 'Google Pagerank', 'Alexa Rank', 'Google Backlinks', 'Yahoo Backlinks', 'MSN Backlinks', 'Altavista Backlinks', 'Alltheweb Backlinks', 'Google Indexed', 'Yahoo Indexed', 'MSN Indexed', 'Total Submission', 'Active Submission');
             $exportContent .= createExportContent($headList);
             foreach ($websiteList as $websiteInfo) {
                 $valueList = array($websiteInfo['id'], $websiteInfo['url'], strip_tags($websiteInfo['googlerank']), strip_tags($websiteInfo['alexarank']), strip_tags($websiteInfo['google']['backlinks']), strip_tags($websiteInfo['yahoo']['backlinks']), strip_tags($websiteInfo['msn']['backlinks']), strip_tags($websiteInfo['altavista']['backlinks']), strip_tags($websiteInfo['alltheweb']['backlinks']), strip_tags($websiteInfo['google']['indexed']), strip_tags($websiteInfo['yahoo']['indexed']), strip_tags($websiteInfo['msn']['indexed']), $websiteInfo['dirsub']['total'], $websiteInfo['dirsub']['active']);
                 $exportContent .= createExportContent($valueList);
             }
             exportToCsv('website_statistics', $exportContent);
         } else {
             $this->set('websiteList', $websiteList);
             $layout = $searchInfo['doc_type'] == "print" ? "ajax" : "";
             $this->render('user/userhome', $layout);
         }
     } else {
         $this->render('home');
     }
 }
Beispiel #11
0
 function showOverallReportSummary($searchInfo = '', $cronUserId = false)
 {
     $spTextHome = $this->getLanguageTexts('home', $_SESSION['lang_code']);
     $this->set('spTextHome', $spTextHome);
     $this->set('cronUserId', $cronUserId);
     $exportVersion = false;
     switch ($searchInfo['doc_type']) {
         case "export":
             $exportVersion = true;
             $exportContent = "";
             break;
         case "print":
             $this->set('printVersion', true);
             break;
     }
     $this->set('sectionHead', 'Overall Report Summary');
     $userId = empty($cronUserId) ? isLoggedIn() : $cronUserId;
     $isAdmin = isAdmin();
     $websiteCtrler = new WebsiteController();
     $websiteList = $websiteCtrler->__getAllWebsites($userId, true);
     $this->set('siteList', $websiteList);
     $websiteId = isset($searchInfo['website_id']) ? $searchInfo['website_id'] : $websiteList[0]['id'];
     $websiteId = intval($websiteId);
     $this->set('websiteId', $websiteId);
     $urlarg = "website_id={$websiteId}";
     $websiteUrl = "";
     foreach ($websiteList as $websiteInfo) {
         if ($websiteInfo['id'] == $websiteId) {
             $websiteUrl = $websiteInfo['url'];
             break;
         }
     }
     $this->set('websiteUrl', $websiteUrl);
     $reportTypes = array('keyword-position' => $this->spTextTools["Keyword Position Summary"], 'website-stats' => $spTextHome["Website Statistics"]);
     $this->set('reportTypes', $reportTypes);
     $urlarg .= "&report_type=" . $searchInfo['report_type'];
     if (!empty($searchInfo['from_time'])) {
         $fromTime = strtotime($searchInfo['from_time'] . ' 00:00:00');
     } else {
         $fromTime = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
     }
     if (!empty($searchInfo['to_time'])) {
         $toTime = strtotime($searchInfo['to_time'] . ' 00:00:00');
     } else {
         $toTime = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
     }
     $fromTimeShort = date('Y-m-d', $fromTime);
     $this->set('fromTime', $fromTimeShort);
     $toTimeShort = date('Y-m-d', $toTime);
     $this->set('toTime', $toTimeShort);
     $urlarg .= "&from_time={$fromTimeShort}&to_time={$toTimeShort}";
     $seController = new SearchEngineController();
     $this->seLIst = $seController->__getAllSearchEngines();
     $this->set('seList', $this->seLIst);
     $this->set('isAdmin', $isAdmin);
     $this->set('urlarg', $urlarg);
     # keyword position report section
     if (empty($searchInfo['report_type']) || $searchInfo['report_type'] == 'keyword-position') {
         // to find order col
         if (!empty($searchInfo['order_col'])) {
             $orderCol = $searchInfo['order_col'];
             $orderVal = $searchInfo['order_val'];
         } else {
             $orderCol = $this->seLIst[0]['id'];
             $orderVal = 'ASC';
         }
         $this->set('orderCol', $orderCol);
         $this->set('orderVal', $orderVal);
         $keywordController = new KeywordController();
         $list = $keywordController->__getAllKeywords($userId, $websiteId, true, true, $orderVal);
         $indexList = array();
         foreach ($list as $keywordInfo) {
             $positionInfo = $this->__getKeywordSearchReport($keywordInfo['id'], $fromTime, $toTime);
             // check whether the sorting search engine is there
             $indexList[$keywordInfo['id']] = empty($positionInfo[$orderCol]) ? 10000 : $positionInfo[$orderCol]['rank'];
             $keywordInfo['position_info'] = $positionInfo;
             $keywordList[$keywordInfo['id']] = $keywordInfo;
         }
         // sort array according the value
         if ($orderCol != 'keyword') {
             if ($orderVal == 'DESC') {
                 arsort($indexList);
             } else {
                 asort($indexList);
             }
         }
         $this->set('indexList', $indexList);
         if ($exportVersion) {
             $spText = $_SESSION['text'];
             $reportHeading = $this->spTextTools['Keyword Position Summary'] . "({$fromTimeShort} - {$toTimeShort})";
             $exportContent .= createExportContent(array('', $reportHeading, ''));
             $exportContent .= createExportContent(array());
             $headList = array($spText['common']['Website'], $spText['common']['Keyword']);
             foreach ($this->seLIst as $seInfo) {
                 $headList[] = $seInfo['domain'];
             }
             $exportContent .= createExportContent($headList);
             foreach ($indexList as $keywordId => $rankValue) {
                 $listInfo = $keywordList[$keywordId];
                 $positionInfo = $listInfo['position_info'];
                 $valueList = array($listInfo['weburl'], $listInfo['name']);
                 foreach ($this->seLIst as $index => $seInfo) {
                     $rank = empty($positionInfo[$seInfo['id']]['rank']) ? '-' : $positionInfo[$seInfo['id']]['rank'];
                     $rankDiff = empty($positionInfo[$seInfo['id']]['rank_diff']) ? '' : $positionInfo[$seInfo['id']]['rank_diff'];
                     $valueList[] = $rank . strip_tags($rankDiff);
                 }
                 $exportContent .= createExportContent($valueList);
             }
         } else {
             $this->set('list', $keywordList);
             $this->set('keywordPos', true);
         }
     }
     # website report section
     if (empty($searchInfo['report_type']) || $searchInfo['report_type'] == 'website-stats') {
         include_once SP_CTRLPATH . "/saturationchecker.ctrl.php";
         include_once SP_CTRLPATH . "/rank.ctrl.php";
         include_once SP_CTRLPATH . "/backlink.ctrl.php";
         include_once SP_CTRLPATH . "/directory.ctrl.php";
         $rankCtrler = new RankController();
         $backlinlCtrler = new BacklinkController();
         $saturationCtrler = new SaturationCheckerController();
         $dirCtrler = new DirectoryController();
         $websiteRankList = array();
         foreach ($websiteList as $listInfo) {
             // if only needs to show onewebsite selected
             if (!empty($websiteId) && $listInfo['id'] != $websiteId) {
                 continue;
             }
             # rank reports
             $report = $rankCtrler->__getWebsiteRankReport($listInfo['id'], $fromTime, $toTime);
             $report = $report[0];
             $listInfo['alexarank'] = empty($report['alexa_rank']) ? "-" : $report['alexa_rank'] . " " . $report['rank_diff_alexa'];
             $listInfo['googlerank'] = empty($report['google_pagerank']) ? "-" : $report['google_pagerank'] . " " . $report['rank_diff_google'];
             # back links reports
             $report = $backlinlCtrler->__getWebsitebacklinkReport($listInfo['id'], $fromTime, $toTime);
             $report = $report[0];
             $listInfo['google']['backlinks'] = empty($report['google']) ? "-" : $report['google'] . " " . $report['rank_diff_google'];
             $listInfo['alexa']['backlinks'] = empty($report['alexa']) ? "-" : $report['alexa'] . " " . $report['rank_diff_alexa'];
             $listInfo['msn']['backlinks'] = empty($report['msn']) ? "-" : $report['msn'] . " " . $report['rank_diff_msn'];
             # rank reports
             $report = $saturationCtrler->__getWebsiteSaturationReport($listInfo['id'], $fromTime, $toTime);
             $report = $report[0];
             $listInfo['google']['indexed'] = empty($report['google']) ? "-" : $report['google'] . " " . $report['rank_diff_google'];
             $listInfo['msn']['indexed'] = empty($report['msn']) ? "-" : $report['msn'] . " " . $report['rank_diff_msn'];
             $listInfo['dirsub']['total'] = $dirCtrler->__getTotalSubmitInfo($listInfo['id']);
             $listInfo['dirsub']['active'] = $dirCtrler->__getTotalSubmitInfo($listInfo['id'], true);
             $websiteRankList[] = $listInfo;
         }
         // if export function called
         if ($exportVersion) {
             $exportContent .= createExportContent(array());
             $exportContent .= createExportContent(array());
             $exportContent .= createExportContent(array('', $spTextHome['Website Statistics'] . "({$fromTimeShort} - {$toTimeShort})", ''));
             if (isAdmin() && !empty($webUserId)) {
                 $exportContent .= createExportContent(array());
                 $exportContent .= createExportContent(array());
                 $userInfo = $userCtrler->__getUserInfo($webUserId);
                 $exportContent .= createExportContent(array($_SESSION['text']['common']['User'], $userInfo['username']));
             }
             $exportContent .= createExportContent(array());
             $headList = array($_SESSION['text']['common']['Id'], $_SESSION['text']['common']['Website'], 'Google Pagerank', 'Alexa Rank', 'Google ' . $spTextHome['Backlinks'], 'alexa ' . $spTextHome['Backlinks'], 'Bing ' . $spTextHome['Backlinks'], 'Google ' . $spTextHome['Indexed'], 'Bing ' . $spTextHome['Indexed'], $_SESSION['text']['common']['Total'] . ' Submission', $_SESSION['text']['common']['Active'] . ' Submission');
             $exportContent .= createExportContent($headList);
             foreach ($websiteRankList as $websiteInfo) {
                 $valueList = array($websiteInfo['id'], $websiteInfo['url'], strip_tags($websiteInfo['googlerank']), strip_tags($websiteInfo['alexarank']), strip_tags($websiteInfo['google']['backlinks']), strip_tags($websiteInfo['alexa']['backlinks']), strip_tags($websiteInfo['msn']['backlinks']), strip_tags($websiteInfo['google']['indexed']), strip_tags($websiteInfo['msn']['indexed']), $websiteInfo['dirsub']['total'], $websiteInfo['dirsub']['active']);
                 $exportContent .= createExportContent($valueList);
             }
         } else {
             $this->set('websiteRankList', $websiteRankList);
             $this->set('websiteStats', true);
         }
     }
     if ($exportVersion) {
         exportToCsv('archived_report', $exportContent);
     } else {
         $this->set('searchInfo', $searchInfo);
         // if execution through cron job then just return teh content to send through mail
         if (!empty($cronUserId)) {
             return $this->getViewContent('report/archive');
         } else {
             $this->render('report/archive');
         }
     }
 }
 function checkSubmissionReports($searchInfo)
 {
     $userId = isLoggedIn();
     $websiteController = new WebsiteController();
     $this->set('websiteList', $websiteController->__getAllWebsites($userId, true));
     $this->set('websiteNull', true);
     $this->set('onClick', "scriptDoLoadPost('directories.php', 'search_form', 'subcontent', '&sec=checksub')");
     $this->render('directory/checksubmission');
 }
Beispiel #13
0
 function showGenerateReports($searchInfo = '')
 {
     $userId = isLoggedIn();
     $websiteController = new WebsiteController();
     $websiteList = $websiteController->__getAllWebsites($userId, true);
     $this->set('websiteList', $websiteList);
     $websiteId = empty($searchInfo['website_id']) ? '' : $searchInfo['website_id'];
     $this->set('websiteId', $websiteId);
     $keywordController = new KeywordController();
     $keywordList = $keywordController->__getAllKeywords($userId, $websiteId, true);
     $this->set('keywordList', $keywordList);
     $this->set('keyNull', true);
     $keywordId = empty($searchInfo['keyword_id']) ? '' : $searchInfo['keyword_id'];
     $this->set('keywordId', $keywordId);
     $seController = new SearchEngineController();
     $seList = $seController->__getAllSearchEngines();
     $this->set('seList', $seList);
     $seId = empty($searchInfo['se_id']) ? '' : $searchInfo['se_id'];
     $this->set('seId', $seId);
     $this->set('seNull', true);
     $this->set('seStyle', 170);
     $this->render('report/generatereport');
 }
Beispiel #14
0
 function executeCron($includeList = array())
 {
     $this->loadCronJobTools($includeList);
     $userCtrler = new UserController();
     $userList = $userCtrler->__getAllUsers();
     $websiteCtrler = new WebsiteController();
     foreach ($userList as $userInfo) {
         $websiteList = $websiteCtrler->__getAllWebsites($userInfo['id']);
         foreach ($websiteList as $websiteInfo) {
             $this->websiteInfo = $websiteInfo;
             $this->routeCronJob($websiteInfo['id'], '', true);
         }
     }
 }
Beispiel #15
0
 function index($searchInfo = '')
 {
     $spTextHome = $this->getLanguageTexts('home', $_SESSION['lang_code']);
     $this->set('spTextHome', $spTextHome);
     if (isLoggedIn()) {
         isHavingWebsite();
         $userId = isLoggedIn();
         $exportVersion = false;
         switch ($searchInfo['doc_type']) {
             case "export":
                 $exportVersion = true;
                 $exportContent = "";
                 break;
             case "pdf":
                 $this->set('pdfVersion', true);
                 break;
             case "print":
                 $this->set('printVersion', true);
                 break;
         }
         if (isAdmin()) {
             $userCtrler = new UserController();
             $userList = $userCtrler->__getAllUsersHavingWebsite();
             if (isset($_POST['user_id']) || isset($_GET['user_id'])) {
                 $webUserId = intval($_POST['user_id']) ? intval($_POST['user_id']) : intval($_GET['user_id']);
             } else {
                 $webUserId = $userList[0]['id'];
             }
             $this->set('userList', $userList);
             // if print method called
             if ($searchInfo['doc_type'] == 'print' && !empty($webUserId)) {
                 $userInfo = $userCtrler->__getUserInfo($webUserId);
                 $this->set('userName', $userInfo['username']);
             }
         } else {
             $webUserId = $userId;
         }
         $this->set('webUserId', $webUserId);
         $websiteCtrler = new WebsiteController();
         $adminCheck = isAdmin() && empty($webUserId) ? true : false;
         $list = $websiteCtrler->__getAllWebsites($webUserId, $adminCheck, $searchInfo['search_name']);
         include_once SP_CTRLPATH . "/saturationchecker.ctrl.php";
         include_once SP_CTRLPATH . "/rank.ctrl.php";
         include_once SP_CTRLPATH . "/backlink.ctrl.php";
         $rankCtrler = new RankController();
         $backlinlCtrler = new BacklinkController();
         $saturationCtrler = new SaturationCheckerController();
         $dirCtrler = new DirectoryController();
         $fromTime = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
         $toTime = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
         $websiteList = array();
         foreach ($list as $listInfo) {
             # rank reports
             $report = $rankCtrler->__getWebsiteRankReport($listInfo['id'], $fromTime, $toTime);
             $report = $report[0];
             $listInfo['alexarank'] = empty($report['alexa_rank']) ? "-" : $report['alexa_rank'] . " " . $report['rank_diff_alexa'];
             $listInfo['googlerank'] = empty($report['google_pagerank']) ? "-" : $report['google_pagerank'] . " " . $report['rank_diff_google'];
             # back links reports
             $report = $backlinlCtrler->__getWebsitebacklinkReport($listInfo['id'], $fromTime, $toTime);
             $report = $report[0];
             $listInfo['google']['backlinks'] = empty($report['google']) ? "-" : $report['google'] . " " . $report['rank_diff_google'];
             $listInfo['alexa']['backlinks'] = empty($report['alexa']) ? "-" : $report['alexa'] . " " . $report['rank_diff_alexa'];
             $listInfo['msn']['backlinks'] = empty($report['msn']) ? "-" : $report['msn'] . " " . $report['rank_diff_msn'];
             # rank reports
             $report = $saturationCtrler->__getWebsiteSaturationReport($listInfo['id'], $fromTime, $toTime);
             $report = $report[0];
             $listInfo['google']['indexed'] = empty($report['google']) ? "-" : $report['google'] . " " . $report['rank_diff_google'];
             $listInfo['msn']['indexed'] = empty($report['msn']) ? "-" : $report['msn'] . " " . $report['rank_diff_msn'];
             $listInfo['dirsub']['total'] = $dirCtrler->__getTotalSubmitInfo($listInfo['id']);
             $listInfo['dirsub']['active'] = $dirCtrler->__getTotalSubmitInfo($listInfo['id'], true);
             $websiteList[] = $listInfo;
         }
         // if export function called
         if ($exportVersion) {
             $exportContent .= createExportContent(array());
             $exportContent .= createExportContent(array());
             $exportContent .= createExportContent(array('', $spTextHome['Website Statistics'], ''));
             if (isAdmin() && !empty($webUserId)) {
                 $exportContent .= createExportContent(array());
                 $exportContent .= createExportContent(array());
                 $userInfo = $userCtrler->__getUserInfo($webUserId);
                 $exportContent .= createExportContent(array($_SESSION['text']['common']['User'], $userInfo['username']));
             }
             $exportContent .= createExportContent(array());
             $headList = array($_SESSION['text']['common']['Id'], $_SESSION['text']['common']['Website'], 'Google Pagerank', 'Alexa Rank', 'Google ' . $spTextHome['Backlinks'], 'alexa ' . $spTextHome['Backlinks'], 'Bing ' . $spTextHome['Backlinks'], 'Google ' . $spTextHome['Indexed'], 'Bing ' . $spTextHome['Indexed'], $_SESSION['text']['common']['Total'] . ' Submission', $_SESSION['text']['common']['Active'] . ' Submission');
             $exportContent .= createExportContent($headList);
             foreach ($websiteList as $websiteInfo) {
                 $valueList = array($websiteInfo['id'], $websiteInfo['url'], strip_tags($websiteInfo['googlerank']), strip_tags($websiteInfo['alexarank']), strip_tags($websiteInfo['google']['backlinks']), strip_tags($websiteInfo['alexa']['backlinks']), strip_tags($websiteInfo['msn']['backlinks']), strip_tags($websiteInfo['google']['indexed']), strip_tags($websiteInfo['msn']['indexed']), $websiteInfo['dirsub']['total'], $websiteInfo['dirsub']['active']);
                 $exportContent .= createExportContent($valueList);
             }
             exportToCsv('website_statistics', $exportContent);
         } else {
             $this->set('websiteList', $websiteList);
             // if pdf export
             if ($searchInfo['doc_type'] == "pdf") {
                 $fromTimeTxt = date('Y-m-d', $fromTime);
                 $toTimeTxt = date('Y-m-d', $toTime);
                 exportToPdf($this->getViewContent('user/userhome'), "account_summary_{$fromTimeTxt}-{$toTimeTxt}.pdf");
             } else {
                 $layout = $searchInfo['doc_type'] == "print" ? "ajax" : "";
                 $this->set('searchInfo', $searchInfo);
                 $this->render('user/userhome', $layout);
             }
         }
     } else {
         $this->render('home');
     }
 }