Example #1
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');
     }
 }
Example #2
0
 /**
  * function to get website reports rank, backlinks, saturation and directory submission
  * @param id $websiteInfo		The information about website
  * @param int $fromTime			The time stamp of from time
  * @param int $toTime			The time stamp of to time
  * @return $websiteInfo			The formatted website info with position details
  */
 function getFormattedReport($websiteInfo, $fromTime, $toTime)
 {
     // create required controllers
     $rankCtrler = new RankController();
     $backlinlCtrler = new BacklinkController();
     $saturationCtrler = new SaturationCheckerController();
     $dirCtrler = new DirectoryController();
     // rank reports
     $report = $rankCtrler->__getWebsiteRankReport($websiteInfo['id'], $fromTime, $toTime);
     $report = $report[0];
     $toTimeDate = date('Y-m-d', $toTime);
     $websiteInfo['alexa']['alexarank']['rank'] = empty($report['alexa_rank']) ? "-" : $report['alexa_rank'];
     $websiteInfo['alexa']['alexarank']['diff'] = removeBraces($report['rank_diff_alexa']);
     $websiteInfo['alexa']['alexarank']['date'] = $toTimeDate;
     $websiteInfo['google']['pagerank']['rank'] = empty($report['google_pagerank']) ? "-" : $report['google_pagerank'];
     $websiteInfo['google']['pagerank']['diff'] = removeBraces($report['rank_diff_google']);
     $websiteInfo['google']['pagerank']['date'] = $toTimeDate;
     // back links reports
     $report = $backlinlCtrler->__getWebsitebacklinkReport($websiteInfo['id'], $fromTime, $toTime);
     $report = $report[0];
     $websiteInfo['google']['backlinks']['rank'] = empty($report['google']) ? "-" : $report['google'];
     $websiteInfo['google']['backlinks']['diff'] = $report['rank_diff_google'];
     $websiteInfo['google']['backlinks']['date'] = $toTimeDate;
     $websiteInfo['alexa']['backlinks']['rank'] = empty($report['alexa']) ? "-" : $report['alexa'];
     $websiteInfo['alexa']['backlinks']['diff'] = $report['rank_diff_alexa'];
     $websiteInfo['alexa']['backlinks']['date'] = $toTimeDate;
     $websiteInfo['bing']['backlinks']['rank'] = empty($report['msn']) ? "-" : $report['msn'];
     $websiteInfo['bing']['backlinks']['diff'] = $report['rank_diff_msn'];
     $websiteInfo['bing']['backlinks']['date'] = $toTimeDate;
     // saturaton rank reports
     $report = $saturationCtrler->__getWebsiteSaturationReport($websiteInfo['id'], $fromTime, $toTime);
     $report = $report[0];
     $websiteInfo['google']['indexed']['rank'] = empty($report['google']) ? "-" : $report['google'];
     $websiteInfo['google']['indexed']['diff'] = $report['rank_diff_google'];
     $websiteInfo['google']['indexed']['date'] = $toTimeDate;
     $websiteInfo['bing']['indexed']['rank'] = empty($report['msn']) ? "-" : $report['msn'];
     $websiteInfo['bing']['indexed']['diff'] = $report['rank_diff_msn'];
     $websiteInfo['bing']['indexed']['date'] = $toTimeDate;
     // directory submission stats
     $websiteInfo['dirsub']['total'] = $dirCtrler->__getTotalSubmitInfo($websiteInfo['id']);
     $websiteInfo['dirsub']['active'] = $dirCtrler->__getTotalSubmitInfo($websiteInfo['id'], true);
     $websiteInfo['dirsub']['date'] = $toTimeDate;
     return $websiteInfo;
 }
Example #3
0
 function backlinkCheckerCron($websiteId)
 {
     include_once SP_CTRLPATH . "/backlink.ctrl.php";
     $this->debugMsg("Starting Backlink Checker cron for website: {$this->websiteInfo['name']}....<br>\n");
     $backlinkCtrler = new BacklinkController();
     $websiteInfo = $this->websiteInfo;
     if (SP_MULTIPLE_CRON_EXEC && $backlinkCtrler->isReportsExists($websiteInfo['id'], $this->timeStamp)) {
         return;
     }
     $backlinkCtrler->url = $websiteUrl = addHttpToUrl($websiteInfo['url']);
     foreach ($backlinkCtrler->colList as $col => $dbCol) {
         $websiteInfo[$col] = $backlinkCtrler->__getBacklinks($col);
     }
     $backlinkCtrler->saveRankResults($websiteInfo, true);
     echo "Saved backlink results of <b>{$websiteUrl}</b>.....</br>\n";
 }
Example #4
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');
     }
 }
Example #5
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');
         }
     }
 }
Example #6
0
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
include_once "includes/sp-load.php";
checkLoggedIn();
include_once SP_CTRLPATH . "/backlink.ctrl.php";
$controller = new BacklinkController();
$controller->view->menu = 'seotools';
$controller->layout = 'ajax';
$controller->set('spTextTools', $controller->getLanguageTexts('seotools', $_SESSION['lang_code']));
$controller->spTextBack = $controller->getLanguageTexts('backlink', $_SESSION['lang_code']);
$controller->set('spTextBack', $controller->spTextBack);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    switch ($_POST['sec']) {
        case "generate":
            $controller->generateReports($_POST);
            break;
        case "reports":
            $controller->showReports($_POST);
            break;
        default:
            $controller->findBacklink($_POST);
Example #7
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');
     }
 }
Example #8
0
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
include_once "includes/sp-load.php";
checkLoggedIn();
include_once SP_CTRLPATH . "/backlink.ctrl.php";
$controller = new BacklinkController();
$controller->view->menu = 'seotools';
$controller->layout = 'ajax';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    switch ($_POST['sec']) {
        case "generate":
            $controller->generateReports($_POST);
            break;
        case "reports":
            $controller->showReports($_POST);
            break;
        default:
            $controller->findBacklink($_POST);
            break;
    }
} else {