Beispiel #1
0
 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");
 }
    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 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>";
        }
    }
Beispiel #4
0
 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");
 }