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'); } }
/** * 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; }
public function actionGetRank() { $rankLista = array(); $rankUser = array(); $Criteria = new CDbCriteria(); $Criteria->order = "id"; $modelAposta = User::model()->findAll($Criteria); $total = 0; $id_user = 0; foreach ($modelAposta as $item) { $rankUser = array("acertos" => RankController::GetAcertos($item->id), "nome" => $item->username, "pontos" => RankController::actionGetTotal($item->id), "resultados" => RankController::GetResultados($item->id)); array_push($rankLista, $rankUser); } $rankLista = RankController::ordenarRank($rankLista, 'pontos', 'acertos'); $this->render('GetRank', array('dataProvider' => $rankLista)); }
function rankCheckerCron($websiteId) { include_once SP_CTRLPATH . "/rank.ctrl.php"; $this->debugMsg("Starting Rank Checker cron for website: {$this->websiteInfo['name']}....<br>\n"); $rankCtrler = new RankController(); $websiteInfo = $this->websiteInfo; if (SP_MULTIPLE_CRON_EXEC && $rankCtrler->isReportsExists($websiteInfo['id'], $this->timeStamp)) { return; } $websiteUrl = addHttpToUrl($websiteInfo['url']); $websiteInfo['googlePagerank'] = $rankCtrler->__getGooglePageRank($websiteUrl); $websiteInfo['alexaRank'] = $rankCtrler->__getAlexaRank($websiteUrl); $rankCtrler->saveRankResults($websiteInfo, true); $this->debugMsg("Saved rank results of <b>{$websiteUrl}</b>.....<br>\n"); }
* (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 . "/rank.ctrl.php"; $controller = new RankController(); $controller->view->menu = 'seotools'; $controller->layout = 'ajax'; $controller->set('spTextTools', $controller->getLanguageTexts('seotools', $_SESSION['lang_code'])); $controller->spTextRank = $controller->getLanguageTexts('rank', $_SESSION['lang_code']); $controller->set('spTextRank', $controller->spTextRank); if ($_SERVER['REQUEST_METHOD'] == 'POST') { switch ($_POST['sec']) { case "quickrank": $controller->findQuickRank($_POST); break; case "generate": $controller->generateReports($_POST); break; case "reports": $controller->showReports($_POST);
,<?php echo RankController::GetErros($id_user); ?> </div> </div> <ul class="list-group no-radius"> <li class="list-group-item"><span class="pull-right"><?php echo RankController::GetAcertos($id_user); ?> </span> <span class="label bg-primary">1</span>Placar Exatos</li> <li class="list-group-item"><span class="pull-right"><?php echo RankController::GetResultados($id_user); ?> </span> <span class="label bg-dark">2</span> Acerto de Resultado </li> <li class="list-group-item"><span class="pull-right"><?php echo RankController::GetErros($id_user); ?> </span> <span class="label bg-light">3</span> Não Pontuadas </li> </ul> </section> </div> </div> </div> <div class="col-lg-4"> <section class="panel panel-default"> <div class="panel-body"> <div class="clearfix text-center m-t"> <div class="inline"> <div class="easypiechart" data-percent="75" data-line-width="5" data-bar-color="#4cc0c1" data-track-color="#f5f5f5" data-scale-color="false" data-size="130" data-line-cap='butt' data-animate="1000"> <div class="thumb-lg"> <img src="images/<?php
* (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 . "/rank.ctrl.php"; $controller = new RankController(); $controller->view->menu = 'seotools'; $controller->layout = 'ajax'; if ($_SERVER['REQUEST_METHOD'] == 'POST') { switch ($_POST['sec']) { case "quickrank": $controller->findQuickRank($_POST); break; case "generate": $controller->generateReports($_POST); break; case "reports": $controller->showReports($_POST); break; default: $controller->findQuickRank($_POST);
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'); } }
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 checkDirectoryStatus($dirId, $nodebug = 0) { $dirId = intval($dirId); $dirInfo = $this->getDirectoryInfo($dirId); $active = 0; $captcha = 0; $spider = new Spider(); $ret = $spider->getContent(addHttpToUrl($dirInfo['submit_url'])); $prUpdate = ''; $searchUpdate = ''; $extraValUpdate = ''; if (empty($ret['error']) && !empty($ret['page'])) { $page = $ret['page']; $matches = $this->isCategoryExists($page, $dirInfo['category_col']); $active = empty($matches[0]) ? 0 : 1; $captcha = stristr($page, $dirInfo['captcha_script']) ? 1 : 0; // to check search script if (stristr($page, 'name="search"')) { $searchUpdate = ",search_script='index.php?search=[--keyword--]'"; } // to check the value of the LINK_TYPE if phpld directory if ($dirInfo['script_type_id'] == 1 && preg_match('/name="LINK_TYPE" value="(\\d)"/s', $page)) { $subject = array('LINK_TYPE=reciprocal', 'LINK_TYPE=normal', 'LINK_TYPE=free'); $replace = array('reciprocal=1&LINK_TYPE=1', 'LINK_TYPE=2', 'LINK_TYPE=3'); $dirInfo['extra_val'] = str_replace($subject, $replace, $dirInfo['extra_val']); $extraValUpdate = ",extra_val='{$dirInfo['extra_val']}'"; } if ($this->checkPR) { include_once SP_CTRLPATH . "/rank.ctrl.php"; $rankCtrler = new RankController(); $pagerank = $rankCtrler->__getGooglePageRank($dirInfo['domain']); $prUpdate = ",google_pagerank={$pagerank}"; } } $sql = "update directories set working={$active},is_captcha={$captcha},checked=1 {$prUpdate} {$searchUpdate} {$extraValUpdate} where id={$dirId}"; $this->db->query($sql); if ($nodebug) { $captchaLabel = $captcha ? $_SESSION['text']['common']['Yes'] : $_SESSION['text']['common']['No']; ?> <script type="text/javascript"> document.getElementById('captcha_<?php echo $dirId; ?> ').innerHTML = '<?php echo $captchaLabel; ?> '; </script> <?php if ($this->checkPR) { ?> <script type="text/javascript"> document.getElementById('pr_<?php echo $dirId; ?> ').innerHTML = '<?php echo $pagerank; ?> '; </script> <?php } echo $this->getStatusLink($dirId, $active); } else { echo "<p class='note notesuccess'>Saved status of directory <b>{$dirInfo['domain']}</b>.....</p>"; } }
function checkDirectoryStatus($dirId, $nodebug = 0) { $dirId = intval($dirId); $dirInfo = $this->getDirectoryInfo($dirId); $active = 0; $captcha = 0; $spider = new Spider(); $ret = $spider->getContent(addHttpToUrl($dirInfo['submit_url'])); $prUpdate = ''; if (empty($ret['error']) && !empty($ret['page'])) { $page = $ret['page']; $matches = $this->isCategoryExists($page, $dirInfo['category_col']); $active = empty($matches[0]) ? 0 : 1; $captcha = stristr($page, $dirInfo['captcha_script']) ? 1 : 0; if ($this->checkPR) { include_once SP_CTRLPATH . "/rank.ctrl.php"; $rankCtrler = new RankController(); $pagerank = $rankCtrler->__getGooglePageRank($dirInfo['domain']); $prUpdate = ",google_pagerank={$pagerank}"; } } $sql = "update directories set working={$active},is_captcha={$captcha},checked=1 {$prUpdate} where id={$dirId}"; $this->db->query($sql); if ($nodebug) { $captchaLabel = $captcha ? $_SESSION['text']['common']['Yes'] : $_SESSION['text']['common']['No']; ?> <script type="text/javascript"> document.getElementById('captcha_<?php echo $dirId; ?> ').innerHTML = '<?php echo $captchaLabel; ?> '; </script> <?php if ($this->checkPR) { ?> <script type="text/javascript"> document.getElementById('pr_<?php echo $dirId; ?> ').innerHTML = '<?php echo $pagerank; ?> '; </script> <?php } echo $this->getStatusLink($dirId, $active); } else { echo "<p class='note notesuccess'>Saved status of directory <b>{$dirInfo['domain']}</b>.....</p>"; } }
function rankCheckerCron($websiteId) { include_once SP_CTRLPATH . "/rank.ctrl.php"; $this->debugMsg("Starting Rank Checker cron for website: {$this->websiteInfo['name']}....<br>\n"); $rankCtrler = new RankController(); $websiteInfo = $this->websiteInfo; $websiteUrl = addHttpToUrl($websiteInfo['url']); $websiteInfo['googlePagerank'] = $rankCtrler->__getGooglePageRank($websiteUrl); $websiteInfo['alexaRank'] = $rankCtrler->__getAlexaRank($websiteUrl); $rankCtrler->saveRankResults($websiteInfo, true); $this->debugMsg("Saved rank results of <b>{$websiteUrl}</b>.....<br>\n"); }
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'); } }