function executeReportGenerationScript($info = '') { if (count($info['repTools']) <= 0) { showErrorMsg('Please select atleast one Seo Tools!'); } $websiteCtrler = new WebsiteController(); if (!empty($info['website_id'])) { $allWebsiteList[] = $websiteCtrler->__getWebsiteInfo($info['website_id']); } else { $userCtrler = new UserController(); $userList = $userCtrler->__getAllUsers(); $allWebsiteList = array(); foreach ($userList as $userInfo) { $websiteList = $websiteCtrler->__getAllWebsites($userInfo['id']); foreach ($websiteList as $websiteInfo) { $allWebsiteList[] = $websiteInfo; } } } if (count($allWebsiteList) <= 0) { showErrorMsg('No websites found!'); } $this->set('allWebsiteList', $allWebsiteList); $this->set('repTools', implode(':', $info['repTools'])); $this->render('report/reportgenerator'); }
function selectDatabase($dbName) { $res = @mysql_select_db($dbName, $this->connectionId); $this->showError(); if (mysql_errno() != 0) { showErrorMsg("<p style='color:red'>Database connection failed!<br>Please check your database settings!</p>"); } return $res; }
function connectToMySQLDatabaseAsAdmin($adminUserName, $adminPassword) { global $hostName; // these variables are specified in 'db.inc.php' global $databaseName; global $connection; // Establish a *new* connection that has admin permissions // (1) OPEN the database connection: if (!($connection = @mysql_connect($hostName, $adminUserName, $adminPassword))) { if (mysql_errno() != 0) { // this works around a stupid(?) behaviour of the Roxen webserver that returns 'errno: 0' on success! ?:-( showErrorMsg("The following error occurred while trying to connect to the host:", ""); } } // (2) SELECT the database: if (!mysql_select_db($databaseName, $connection)) { if (mysql_errno() != 0) { // this works around a stupid(?) behaviour of the Roxen webserver that returns 'errno: 0' on success! ?:-( showErrorMsg("The following error occurred while trying to connect to the database:", ""); } } }
function generateSitemapFile($sitemapInfo) { $sitemapInfo['website_id'] = intval($sitemapInfo['website_id']); if (!empty($sitemapInfo['website_id'])) { # check whether the sitemap directory is writable if (!is_writable(SP_TMPPATH . "/" . $this->sitemapDir)) { hideDiv('message'); showErrorMsg("Directory '<b>" . SP_TMPPATH . "/" . $this->sitemapDir . "</b>' is not <b>writable</b>. Please change its <b>permission</b> !"); } $websiteController = new WebsiteController(); $websiteInfo = $websiteController->__getWebsiteInfo($sitemapInfo['website_id']); $baseUrl = $websiteInfo['url']; $this->section = formatFileName($websiteInfo['name']); if (!preg_match('/\\/$/', $baseUrl)) { $baseUrl = $baseUrl . "/"; } $this->baseUrl = $baseUrl; $urlInfo = parse_url($this->baseUrl); $this->hostName = str_replace('www.', '', $urlInfo['host']); $this->smType = $sitemapInfo['sm_type']; $this->excludeUrl = $sitemapInfo['exclude_url']; if (!empty($sitemapInfo['freq'])) { $this->changefreq = $sitemapInfo['freq']; } if (!empty($sitemapInfo['priority'])) { $this->priority = $sitemapInfo['priority']; } $this->createSitemap(); } else { hideDiv('message'); showErrorMsg("No Website Found!"); } }
<?php $headLabel = empty($headLabel) ? $spTextPanel['System Settings'] : $headLabel; echo showSectionHead($headLabel); // if saved successfully if (!empty($saved)) { showSuccessMsg($spTextSettings['allsettingssaved'], false); } // save process failed if (!empty($errorMsg)) { echo showErrorMsg($errorMsg, false); } ?> <form id="updateSettings"> <input type="hidden" value="update" name="sec"> <input type="hidden" value="<?php echo $category; ?> " name="category"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="list"> <tr class="listHead"> <td class="left" width='30%'><?php echo $headLabel; ?> </td> <td class="right"> </td> </tr> <?php foreach ($list as $i => $listInfo) { $class = $i % 2 ? "blue_row" : "white_row"; switch ($listInfo['set_type']) {
function checkVersion() { $content = $this->spider->getContent(SP_VERSION_PAGE); $content['page'] = str_replace('Version:', '', $content['page']); $latestVersion = str_replace('.', '', $content['page']); $installVersion = str_replace('.', '', SP_INSTALLED); if ($latestVersion > $installVersion) { echo showErrorMsg($this->spTextSettings['versionnotuptodatemsg'] . "({$content['page']}) from <a href='" . SP_DOWNLOAD_LINK . "' target='_blank'>" . SP_DOWNLOAD_LINK . "</a>", false); } else { echo showSuccessMsg($this->spTextSettings["Your Seo Panel installation is up to date"], false); } }
<?php echo showSectionHead($spTextTools['Auditor Reports']); if (empty($projectId)) { showErrorMsg($spTextSA['No active projects found'] . '!'); } $submitJsFunc = "scriptDoLoadPost('siteauditor.php', 'search_form', 'subcontent', '&sec=showreport')"; ?> <form id='search_form' onsubmit="<?php echo $submitJsFunc; ?> ; return false;"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="search"> <tr> <th><?php echo $spText['label']['Project']; ?> : </th> <td> <select id="project_id" name="project_id" onchange="<?php echo $submitJsFunc; ?> " style="width: 180px;"> <?php foreach ($projectList as $list) { ?> <?php if ($list['id'] == $projectId) { ?> <option value="<?php echo $list['id'];
function checkUserIsObjectOwner($objId, $objName = 'website') { if (!isAdmin()) { $userId = isLoggedIn(); switch ($objName) { case "keyword": $sql = "select k.id from keywords k,websites w where k.website_id=w.id and w.user_id='" . intval($userId) . "' and k.id='" . intval($objId) . "'"; break; case "website": $sql = "select id from websites where id='" . intval($objId) . "' and user_id='" . intval($userId) . "'"; break; } $info = $this->db->select($sql, true); if (empty($info['id'])) { showErrorMsg("You are not allowed to access this page!"); } } }
function getContent($url, $enableProxy = true) { curl_setopt($this->_CURL_RESOURCE, CURLOPT_URL, $url); curl_setopt($this->_CURL_RESOURCE, CURLOPT_FAILONERROR, $this->_CURLOPT_FAILONERROR); @curl_setopt($this->_CURL_RESOURCE, CURLOPT_FOLLOWLOCATION, $this->_CURLOPT_FOLLOWLOCATION); curl_setopt($this->_CURL_RESOURCE, CURLOPT_RETURNTRANSFER, $this->_CURLOPT_RETURNTRANSFER); curl_setopt($this->_CURL_RESOURCE, CURLOPT_TIMEOUT, $this->_CURLOPT_TIMEOUT); curl_setopt($this->_CURL_RESOURCE, CURLOPT_COOKIEJAR, $this->_CURLOPT_COOKIEJAR); curl_setopt($this->_CURL_RESOURCE, CURLOPT_COOKIEFILE, $this->_CURLOPT_COOKIEFILE); curl_setopt($this->_CURL_RESOURCE, CURLOPT_HEADER, $this->_CURLOPT_HEADER); if (!empty($this->_CURLOPT_COOKIE)) { curl_setopt($this->_CURL_RESOURCE, CURLOPT_COOKIE, $this->_CURLOPT_COOKIE); } if (!empty($this->_CURLOPT_REFERER)) { curl_setopt($this->_CURL_RESOURCE, CURLOPT_REFERER, $this->_CURLOPT_REFERER); } if (strlen($this->_CURLOPT_POSTFIELDS) > 1) { curl_setopt($this->_CURL_RESOURCE, CURLOPT_POST, $this->_CURLOPT_POST); curl_setopt($this->_CURL_RESOURCE, CURLOPT_POSTFIELDS, $this->_CURLOPT_POSTFIELDS); } // user agent assignment $this->_CURLOPT_USERAGENT = defined('SP_USER_AGENT') ? SP_USER_AGENT : $this->_CURLOPT_USERAGENT; if (strlen($this->_CURLOPT_USERAGENT) > 0) { curl_setopt($this->_CURL_RESOURCE, CURLOPT_USERAGENT, $this->_CURLOPT_USERAGENT); } if (strlen($this->_CURLOPT_USERPWD) > 2) { curl_setopt($this->_CURL_RESOURCE, CURLOPT_USERPWD, $this->_CURLOPT_USERPWD); } // to use proxy if proxy enabled if (SP_ENABLE_PROXY && $enableProxy) { $proxyCtrler = new ProxyController(); if ($proxyInfo = $proxyCtrler->getRandomProxy()) { curl_setopt($this->_CURL_RESOURCE, CURLOPT_PROXY, $proxyInfo['proxy'] . ":" . $proxyInfo['port']); curl_setopt($this->_CURL_RESOURCE, CURLOPT_HTTPPROXYTUNNEL, CURLOPT_HTTPPROXYTUNNEL_VAL); if (!empty($proxyInfo['proxy_auth'])) { curl_setopt($this->_CURL_RESOURCE, CURLOPT_PROXYUSERPWD, $proxyInfo['proxy_username'] . ":" . $proxyInfo['proxy_password']); } } else { showErrorMsg("No active proxies found!! Please check your proxy settings from Admin Panel."); } } $ret['page'] = curl_exec($this->_CURL_RESOURCE); $ret['error'] = curl_errno($this->_CURL_RESOURCE); $ret['errmsg'] = curl_error($this->_CURL_RESOURCE); // disable proxy if not working if (SP_ENABLE_PROXY && $enableProxy && !empty($ret['error']) && !empty($proxyInfo['id'])) { // deactivate proxy if (PROXY_DEACTIVATE_CRAWL) { echo "Deactivating proxy - " . $proxyInfo['proxy'] . "....<br>\n"; $proxyCtrler->__changeStatus($proxyInfo['id'], 0); } // chekc with another proxy if (CHECK_WITH_ANOTHER_PROXY_IF_FAILED) { echo "Checking with another proxy....<br>\n"; $ret = $this->getContent($url, $enableProxy); } } return $ret; }
function showImportProjectLinks($info = '') { $userId = isLoggedIn(); $where = isAdmin() ? "" : " and w.user_id={$userId}"; $projectList = $this->getAllProjects($where); $this->set('projectList', $projectList); if (empty($projectList)) { showErrorMsg($this->spTextSA['No active projects found'] . '!'); } $projectId = empty($info['project_id']) ? 0 : $info['project_id']; $this->set('projectId', $projectId); $this->render('siteauditor/importlinks'); }
* (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"; if (empty($_SERVER['REQUEST_METHOD'])) { # the section for generate reports using system cron job include_once SP_CTRLPATH . "/cron.ctrl.php"; $controller = new CronController(); include_once SP_CTRLPATH . "/directory.ctrl.php"; $dirCtrler = new DirectoryController(); $searchInfo = array('checked' => 0); $dirList = $dirCtrler->getAllDirectories($searchInfo); $dirCtrler->checkPR = 1; // check pagerank of directory or not foreach ($dirList as $dirInfo) { $dirCtrler->checkDirectoryStatus($dirInfo['id']); echo "sleep for " . SP_CRAWL_DELAY . " seconds"; sleep(SP_CRAWL_DELAY); } } else { showErrorMsg("<p style='color:red'>You don't have permission to access this page!</p>"); }
function getContent($url, $enableProxy = true, $logCrawl = true) { curl_setopt($this->_CURL_RESOURCE, CURLOPT_URL, $url); curl_setopt($this->_CURL_RESOURCE, CURLOPT_FAILONERROR, $this->_CURLOPT_FAILONERROR); @curl_setopt($this->_CURL_RESOURCE, CURLOPT_FOLLOWLOCATION, $this->_CURLOPT_FOLLOWLOCATION); curl_setopt($this->_CURL_RESOURCE, CURLOPT_RETURNTRANSFER, $this->_CURLOPT_RETURNTRANSFER); curl_setopt($this->_CURL_RESOURCE, CURLOPT_TIMEOUT, $this->_CURLOPT_TIMEOUT); curl_setopt($this->_CURL_RESOURCE, CURLOPT_COOKIEJAR, $this->_CURLOPT_COOKIEJAR); curl_setopt($this->_CURL_RESOURCE, CURLOPT_COOKIEFILE, $this->_CURLOPT_COOKIEFILE); curl_setopt($this->_CURL_RESOURCE, CURLOPT_HEADER, $this->_CURLOPT_HEADER); if (!empty($this->_CURLOPT_COOKIE)) { curl_setopt($this->_CURL_RESOURCE, CURLOPT_COOKIE, $this->_CURLOPT_COOKIE); } if (!empty($this->_CURLOPT_REFERER)) { curl_setopt($this->_CURL_RESOURCE, CURLOPT_REFERER, $this->_CURLOPT_REFERER); } if (strlen($this->_CURLOPT_POSTFIELDS) > 1) { curl_setopt($this->_CURL_RESOURCE, CURLOPT_POST, $this->_CURLOPT_POST); curl_setopt($this->_CURL_RESOURCE, CURLOPT_POSTFIELDS, $this->_CURLOPT_POSTFIELDS); } // user agent assignment $this->_CURLOPT_USERAGENT = defined('SP_USER_AGENT') ? SP_USER_AGENT : $this->_CURLOPT_USERAGENT; if (strlen($this->_CURLOPT_USERAGENT) > 0) { curl_setopt($this->_CURL_RESOURCE, CURLOPT_USERAGENT, $this->_CURLOPT_USERAGENT); } if (strlen($this->_CURLOPT_USERPWD) > 2) { curl_setopt($this->_CURL_RESOURCE, CURLOPT_USERPWD, $this->_CURLOPT_USERPWD); } // to use proxy if proxy enabled if (SP_ENABLE_PROXY && $enableProxy) { $proxyCtrler = new ProxyController(); if ($proxyInfo = $proxyCtrler->getRandomProxy()) { curl_setopt($this->_CURL_RESOURCE, CURLOPT_PROXY, $proxyInfo['proxy'] . ":" . $proxyInfo['port']); curl_setopt($this->_CURL_RESOURCE, CURLOPT_HTTPPROXYTUNNEL, CURLOPT_HTTPPROXYTUNNEL_VAL); if (!empty($proxyInfo['proxy_auth'])) { curl_setopt($this->_CURL_RESOURCE, CURLOPT_PROXYUSERPWD, $proxyInfo['proxy_username'] . ":" . $proxyInfo['proxy_password']); } } else { showErrorMsg("No active proxies found!! Please check your proxy settings from Admin Panel."); } } $ret['page'] = curl_exec($this->_CURL_RESOURCE); $ret['error'] = curl_errno($this->_CURL_RESOURCE); $ret['errmsg'] = curl_error($this->_CURL_RESOURCE); // update crawl log in database for future reference if ($logCrawl) { $crawlLogCtrl = new CrawlLogController(); $crawlInfo['crawl_status'] = $ret['error'] ? 0 : 1; $crawlInfo['ref_id'] = $crawlInfo['crawl_link'] = addslashes($url); $crawlInfo['crawl_referer'] = addslashes($this->_CURLOPT_REFERER); $crawlInfo['crawl_cookie'] = addslashes($this->_CURLOPT_COOKIE); $crawlInfo['crawl_post_fields'] = addslashes($this->_CURLOPT_POSTFIELDS); $crawlInfo['crawl_useragent'] = addslashes($this->_CURLOPT_USERAGENT); $crawlInfo['proxy_id'] = $proxyInfo['id']; $crawlInfo['log_message'] = addslashes($ret['errmsg']); $ret['log_id'] = $crawlLogCtrl->createCrawlLog($crawlInfo); } // disable proxy if not working if (SP_ENABLE_PROXY && $enableProxy && !empty($ret['error']) && !empty($proxyInfo['id'])) { // deactivate proxy if (PROXY_DEACTIVATE_CRAWL) { $proxyCtrler->__changeStatus($proxyInfo['id'], 0); } // chekc with another proxy if (CHECK_WITH_ANOTHER_PROXY_IF_FAILED) { $ret = $this->getContent($url, $enableProxy); } } return $ret; }
function requestPassword($userEmail) { $errMsg['email'] = formatErrorMsg($this->validate->checkEmail($userEmail)); $this->set('post', $_POST); if (!$this->validate->flagErr) { $userId = $this->__checkEmail($userEmail); if (!empty($userId)) { $userInfo = $this->__getUserInfo($userId); $rand = str_shuffle(rand() . $userInfo['username']); $sql = "update users set password=md5('{$rand}') where id={$userInfo['id']}"; $this->db->query($sql); # send password to user $error = 0; $this->set('rand', $rand); $this->set('name', $userInfo['first_name'] . " " . $userInfo['last_name']); $content = $this->getViewContent('email/passwordreset'); $subject = "Seo panel password reset"; if (!sendMail(SP_SUPPORT_EMAIL, SP_ADMIN_NAME, $userEmail, $subject, $content)) { $error = showErrorMsg('An internal error occured while sending password reset mail!', false); } $this->set('error', $error); $this->render('common/forgotconfirm'); exit; } else { $errMsg['email'] = formatErrorMsg($_SESSION['text']['login']['user_email_not_exist']); } } $this->set('errMsg', $errMsg); $this->forgotPasswordForm(); }
function getContent($url, $enableProxy = true) { curl_setopt($this->_CURL_RESOURCE, CURLOPT_URL, $url); curl_setopt($this->_CURL_RESOURCE, CURLOPT_FAILONERROR, $this->_CURLOPT_FAILONERROR); @curl_setopt($this->_CURL_RESOURCE, CURLOPT_FOLLOWLOCATION, $this->_CURLOPT_FOLLOWLOCATION); curl_setopt($this->_CURL_RESOURCE, CURLOPT_RETURNTRANSFER, $this->_CURLOPT_RETURNTRANSFER); curl_setopt($this->_CURL_RESOURCE, CURLOPT_TIMEOUT, $this->_CURLOPT_TIMEOUT); curl_setopt($this->_CURL_RESOURCE, CURLOPT_COOKIEJAR, $this->_CURLOPT_COOKIEJAR); curl_setopt($this->_CURL_RESOURCE, CURLOPT_COOKIEFILE, $this->_CURLOPT_COOKIEFILE); curl_setopt($this->_CURL_RESOURCE, CURLOPT_HEADER, $this->_CURLOPT_HEADER); if (!empty($this->_CURLOPT_COOKIE)) { curl_setopt($this->_CURL_RESOURCE, CURLOPT_COOKIE, $this->_CURLOPT_COOKIE); } if (!empty($this->_CURLOPT_REFERER)) { curl_setopt($this->_CURL_RESOURCE, CURLOPT_REFERER, $this->_CURLOPT_REFERER); } if (strlen($this->_CURLOPT_POSTFIELDS) > 1) { curl_setopt($this->_CURL_RESOURCE, CURLOPT_POST, $this->_CURLOPT_POST); curl_setopt($this->_CURL_RESOURCE, CURLOPT_POSTFIELDS, $this->_CURLOPT_POSTFIELDS); } $this->_CURLOPT_USERAGENT = defined('SP_USER_AGENT') ? SP_USER_AGENT : $this->_CURLOPT_USERAGENT; if (strlen($this->_CURLOPT_USERAGENT) > 0) { curl_setopt($this->_CURL_RESOURCE, CURLOPT_USERAGENT, $this->_CURLOPT_USERAGENT); } if (strlen($this->_CURLOPT_USERPWD) > 2) { curl_setopt($this->_CURL_RESOURCE, CURLOPT_USERPWD, $this->_CURLOPT_USERPWD); } // to use proxy if proxy enabled if (SP_ENABLE_PROXY && $enableProxy) { $proxyCtrler = new ProxyController(); if ($proxyInfo = $proxyCtrler->getRandomProxy()) { curl_setopt($this->_CURL_RESOURCE, CURLOPT_PROXY, $proxyInfo['proxy'] . ":" . $proxyInfo['port']); curl_setopt($this->_CURL_RESOURCE, CURLOPT_HTTPPROXYTUNNEL, 1); if (!empty($proxyInfo['proxy_auth'])) { curl_setopt($this->_CURL_RESOURCE, CURLOPT_PROXYUSERPWD, $proxyInfo['proxy_username'] . ":" . $proxyInfo['proxy_password']); } } else { showErrorMsg("No active proxies found!! Please check your proxy settings from Admin Panel."); } } $ret['page'] = curl_exec($this->_CURL_RESOURCE); $ret['error'] = curl_errno($this->_CURL_RESOURCE); $ret['errmsg'] = curl_error($this->_CURL_RESOURCE); return $ret; }
<td> <?php echo $this->render('website/websiteselectbox', 'ajax'); ?> </td> <td colspan="2"><a href="javascript:void(0);" onclick="scriptDoLoadPost('directories.php', 'search_form', 'content', '&sec=skipped')" class="actionbut"><?php echo $spText['button']['Show Records']; ?> </a></td> </tr> </table> </form> <?php if (empty($websiteId)) { showErrorMsg($spText['common']['nowebsites'] . '!'); } ?> <div id='subcontent'> <?php echo $pagingDiv; ?> <table width="100%" border="0" cellspacing="0" cellpadding="2px;" class="list" align='center'> <tr> <td width='33%'> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="list"> <tr class="listHead"> <td class="left"><?php echo $spText['common']['Id']; ?>
$fileName = ""; } $urlName = encodeHTML($row['url']); $doiName = encodeHTML($row['doi']); $contributionID = $row['contribution_id']; $onlinePublication = $row['online_publication']; $onlineCitationName = $row['online_citation']; $createdDate = $row['created_date']; $createdTime = $row['created_time']; $createdBy = encodeHTML($row['created_by']); $modifiedDate = $row['modified_date']; $modifiedTime = $row['modified_time']; $modifiedBy = encodeHTML($row['modified_by']); $origRecord = $row['orig_record']; } else { showErrorMsg($loc["The Query"] . ":\n<br>\n<br>\n<code>" . encodeHTML($query) . "</code>\n<br>\n<br>\n " . $loc["caused an error"] . ":", ""); } } else { if ($recordAction == "add" and $mode == "import" and empty($errors)) { foreach ($_REQUEST as $varname => $value) { // remove slashes from parameter values if 'magic_quotes_gpc = On': $_REQUEST[$varname] = stripSlashesIfMagicQuotes($value); } // function 'stripSlashesIfMagicQuotes()' is defined in 'include.inc.php' // read field data from a GET/POST request: if (isset($_REQUEST['author'])) { $authorName = encodeHTML($_REQUEST['author']); } else { $authorName = ""; } if (isset($_REQUEST['title'])) {
// If an error occurs in the code you're trying to exec(), it can be challenging to figure out what's going // wrong, since php echoes back the stdout stream rather than the stderr stream where all the useful error // reporting's done. The solution is to add the code "2>&1" to the end of your shell command, which redirects // stderr to stdout, which you can then easily print using something like print `shellcommand 2>&1`. // run the UPDATE query on the depends table of the (just imported) literature database: if (!($result = @mysql_query($queryUpdateDependsTable, $connection))) { if (mysql_errno() != 0) { // this works around a stupid(?) behaviour of the Roxen webserver that returns 'errno: 0' on success! ?:-( showErrorMsg("The following error occurred while trying to query the database:", ""); } } // (5) Close the database connection: if (!mysql_close($connection)) { if (mysql_errno() != 0) { // this works around a stupid(?) behaviour of the Roxen webserver that returns 'errno: 0' on success! ?:-( showErrorMsg("The following error occurred while trying to disconnect from the database:", ""); } } $resultLines = ""; // initialize variable // Read out the execution result array: if (!empty($resultArray)) { reset($resultArray); // reset the internal array pointer to the first element while (list($key, $val) = each($resultArray)) { $resultLines .= "\n" . trim($val); } // append each of the array elements to a string } // -------------------------------------------------------------------- // Provide a feedback page:
function disconnectFromMySQLDatabase() { global $connection; if (isset($connection)) { // (5) CLOSE the database connection: if (!mysql_close($connection)) { if (mysql_errno() != 0) { // this works around a stupid(?) behaviour of the Roxen webserver that returns 'errno: 0' on success! ?:-( showErrorMsg("The following error occurred while trying to disconnect from the database:"); } } } }
function generateSitemapFile($sitemapInfo) { $sitemapInfo['project_id'] = intval($sitemapInfo['project_id']); if (!empty($sitemapInfo['project_id'])) { # check whether the sitemap directory is writable if (!is_writable(SP_TMPPATH . "/" . $this->sitemapDir)) { hideDiv('message'); showErrorMsg("Directory '<b>" . SP_TMPPATH . "/" . $this->sitemapDir . "</b>' is not <b>writable</b>. Please change its <b>permission</b> !"); } $saCtrler = $this->createController('SiteAuditor'); $projectInfo = $saCtrler->__getProjectInfo($sitemapInfo['project_id']); $this->section = formatFileName($projectInfo['name']); $this->smType = $sitemapInfo['sm_type']; $this->excludeUrl = $sitemapInfo['exclude_url']; if (!empty($sitemapInfo['freq'])) { $this->changefreq = $sitemapInfo['freq']; } if (!empty($sitemapInfo['priority'])) { $this->priority = $sitemapInfo['priority']; } $auditorComp = $this->createComponent('AuditorComponent'); $pageList = $auditorComp->getAllreportPages(" and project_id=" . $sitemapInfo['project_id']); $urlList = array(); foreach ($pageList as $pageInfo) { $pageInfo['page_url'] = Spider::addTrailingSlash($pageInfo['page_url']); if ($auditorComp->isExcludeLink($pageInfo['page_url'], trim($sitemapInfo['exclude_url']))) { continue; } $urlList[] = $pageInfo['page_url']; } $this->createSitemap($this->smType, $urlList); } else { hideDiv('message'); showErrorMsg("No Website Found!"); } }
echo SP_WEBPATH; ?> /login.php?sec=forgot"> <input type="hidden" name="sec" value="requestpass"> <table width="500px" cellpadding="0" cellspacing="0" class="actionForm" style="margin-top: 20px;"> <tr> <td><?php if (!empty($error)) { ?> <h1 class="head"><?php echo $spText['login']['Your Password Reset Failed']; ?> </h1> <div class="acc_confirm"> <?php showErrorMsg($error, false); ?> </div> <?php } else { ?> <h1 class="head"><?php echo $spText['login']['Your Password Reset Successfully']; ?> </h1> <div class="acc_confirm"> <?php echo showSuccessMsg($spText['login']['password_reset_success_message'], false); ?> </div> <?php
function startSubmission($websiteId, $dirId = '') { # get list of already submitted directories $sql = "select directory_id from dirsubmitinfo where website_id={$websiteId}"; $list = $this->db->select($sql); $dirList = array(); foreach ($list as $listInfo) { $dirList[] = $listInfo['directory_id']; } # to get skipped directories $skipDirList = $this->__getAllSkippedDir($websiteId); if (count($skipDirList) > 0) { $dirList = array_merge($dirList, $skipDirList); } $sql = "select * from directories where working=1"; if (!empty($_SESSION['no_captcha'])) { $sql .= " and is_captcha=0"; } if (!empty($_SESSION['dirsub_pr'])) { $sql .= " and google_pagerank={$_SESSION['dirsub_pr']}"; } if (!empty($_SESSION['dirsub_lang'])) { $sql .= " and lang_code='{$_SESSION['dirsub_lang']}'"; } if (!empty($dirId)) { $sql .= " and id={$dirId}"; } if (count($dirList) > 0) { $sql .= " and id not in (" . implode(',', $dirList) . ")"; } $sql .= " order by rank DESC, extra_val ASC, id ASC"; $dirInfo = $this->db->select($sql, true); $this->set('dirInfo', $dirInfo); # directory list is empty if (empty($dirInfo['id'])) { showErrorMsg($this->spTextDir['nodirnote'] . ". Please <a href='" . SP_CONTACT_LINK . "' target='_blank'>Contact</a> <b>Seo Panel Team</b> to get more <b>directories</b>."); } $websiteController = new WebsiteController(); $websiteInfo = $websiteController->__getWebsiteInfo($websiteId); $this->set('websiteId', $websiteId); $spider = new Spider(); $spider->_CURLOPT_HEADER = 1; $ret = $spider->getContent(addHttpToUrl($dirInfo['submit_url'])); if ($ret['error']) { $this->set('error', 1); $this->set('msg', $ret['errmsg']); } $page = $ret['page']; if (!empty($page)) { $matches = $this->isCategoryExists($page, $dirInfo['category_col']); } # if category exists proceed submission if (!empty($matches[0])) { $categorysel = $matches[0]; $catList = explode(',', $websiteInfo['category']); if (count($catList) > 0) { foreach ($catList as $category) { $category = trim($category); $categorysel = preg_replace("/<(option.*?{$category}.*?)>/si", '<$1 selected>', $categorysel, 1, $count); if ($count > 0) { break; } } if ($count <= 0) { $categorysel = $matches[0]; } } $this->set('categorySel', $categorysel); $captchaUrl = ''; if (stristr($page, $dirInfo['captcha_script'])) { $captchaUrl = $dirInfo['captcha_script']; } $imageHash = ""; if (preg_match('/name="' . $dirInfo['imagehash_col'] . '".*?value="(.*?)"/is', $page, $hashMatch)) { $imageHash = $hashMatch[1]; } $this->set('imageHash', $imageHash); $phpsessid = $spider->getSessionId($page); $this->set('phpsessid', $phpsessid); if (!empty($captchaUrl)) { $captchaUrl = preg_replace('/^\\//', '', $captchaUrl); $dirInfo['domain'] = addHttpToUrl($dirInfo['domain']); if (preg_match('/\\/$/', $dirInfo['domain'])) { $captchaUrl = $dirInfo['domain'] . $captchaUrl; } else { $captchaUrl = $dirInfo['domain'] . "/" . $captchaUrl; } if (!stristr($captchaUrl, '?')) { if (!empty($imageHash)) { $captchaUrl .= "?" . $dirInfo['imagehashurl_col'] . "=" . $imageHash; } else { $captchaUrl .= "?rand=" . rand(1, 1000); } } else { if (!empty($imageHash)) { $captchaUrl .= "&" . $dirInfo['imagehashurl_col'] . "=" . $imageHash; } else { $captchaUrl .= "&rand=" . rand(1, 1000); } } # to get stored image path if hot linking is prevented $captchaUrl = $this->__getCreatedCaptchaUrl($captchaUrl, $dirInfo['submit_url'], $phpsessid); } $this->set('captchaUrl', $captchaUrl); // function check whether recriprocal directory $scriptInfo = $this->getDirectoryScriptMetaInfo($dirInfo['script_type_id']); $checkArg = $scriptInfo['link_type_col'] . "=" . $scriptInfo['reciprocal']; $reciprocalUrl = false; if (stristr($dirInfo['extra_val'], $checkArg)) { $reciprocalUrl = $websiteInfo['reciprocal_url']; if (empty($reciprocalUrl)) { if (preg_match("/&{$scriptInfo['reciprocal_col']}=(.*)/", $dirInfo['extra_val'], $matches)) { if (!empty($matches[1])) { $reciprocalUrl = $matches[1]; } } } } $this->set('reciprocalUrl', $reciprocalUrl); } else { $this->set('error', 1); $this->set('msg', $this->spTextDir['nocatnote']); } $this->render('directory/showsubmissionform'); }
function importProxy($data = "") { $errMsg['proxy_list'] = formatErrorMsg($this->validate->checkBlank($data['proxy_list'])); if (!$this->validate->flagErr) { $resInfo['total'] = $resInfo['valid'] = $resInfo['existing'] = 0; $proxyMaxId = $this->db->getMaxId('proxylist'); $proxyList = explode("\n", $data['proxy_list']); foreach ($proxyList as $proxy) { if (!preg_match('/\\w+/', $proxy)) { continue; } $listInfo = explode(",", $proxy); $proxyInfo['proxy'] = trim($listInfo[0]); if (!empty($proxyInfo['proxy'])) { $resInfo['total']++; $proxyInfo['port'] = trim($listInfo[1]); $proxyInfo['proxy_username'] = trim($listInfo[2]); $proxyInfo['proxy_password'] = trim($listInfo[3]); if ($this->__checkProxy($proxyInfo['proxy'], $proxyInfo['port'])) { $resInfo['existing']++; } else { $proxyInfo['proxy_auth'] = !empty($proxyInfo['proxy_username']) || !empty($proxyInfo['proxy_password']) ? 1 : 0; $this->insertProxy($proxyInfo); $resInfo['valid']++; } } } // if imported proxies needs to be checked $proxyList = array(); if (!empty($data['check_status'])) { $this->updateProxyCheckedStatus(0, ""); $condition = " and id > {$proxyMaxId}"; $sql = "select * from proxylist where 1=1 " . $condition; $proxyList = $this->db->select($sql); } $this->set('proxyList', $proxyList); $this->set('resInfo', $resInfo); $this->set('proxyMaxId', $proxyMaxId); $this->render('proxy/importresult'); } else { showErrorMsg("Please enter valid proxy list."); } }
<?php echo showSectionHead($spTextPanel['Seo Plugins Manager']); if (!empty($msg)) { echo $error ? showErrorMsg($msg, false) : showSuccessMsg($msg, false); } echo $pagingDiv; ?> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="list"> <tr class="listHead"> <td class="left"><?php echo $spText['label']['Plugin']; ?> </td> <td><?php echo $spText['label']['Author']; ?> </td> <td><?php echo $spText['common']['Website']; ?> </td> <td><?php echo $spText['common']['Status']; ?> </td> <td><?php echo $spText['label']['Installation']; ?> </td> <td class="right"><?php
function executeReportGenerationScript($info = '') { if (count($info['repTools']) <= 0) { showErrorMsg($this->spTextKeyword['pleaseselecttool'] . "!"); } $websiteCtrler = new WebsiteController(); if (!empty($info['website_id'])) { $allWebsiteList[] = $websiteCtrler->__getWebsiteInfo($info['website_id']); } else { $userCtrler = new UserController(); $userList = $userCtrler->__getAllUsers(); $allWebsiteList = array(); foreach ($userList as $userInfo) { $websiteList = $websiteCtrler->__getAllWebsites($userInfo['id']); foreach ($websiteList as $websiteInfo) { $allWebsiteList[] = $websiteInfo; } } } if (count($allWebsiteList) <= 0) { showErrorMsg($_SESSION['text']['common']['nowebsites'] . "!"); } $this->set('allWebsiteList', $allWebsiteList); $this->set('repTools', implode(':', $info['repTools'])); $this->render('report/reportgenerator'); }
<td> <?php echo $this->render('website/websiteselectbox', 'ajax'); ?> </td> <td colspan="2"><a href="javascript:void(0);" onclick="scriptDoLoadPost('directories.php', 'search_form', 'content', '&sec=skipped')"><img alt="" src="<?php echo SP_IMGPATH; ?> /show_records.gif"></a></td> </tr> </table> </form> <?php if (empty($websiteId)) { showErrorMsg('No Websites Found!'); } ?> <div id='subcontent'> <?php echo $pagingDiv; ?> <table width="100%" border="0" cellspacing="0" cellpadding="2px;" class="list" align='center'> <tr> <td width='33%'> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="list"> <tr class="listHead"> <td class="left">Id</td> <td>Directory</td> <td class="right">Action</td>