function getpr($url) { $ch = getch($url); $fp = fsockopen(self::GOOGLEHOST, 80, $errno, $errstr, 30); if ($fp) { $out = "GET /search?client=navclient-auto&ch={$ch}&features=Rank&q=info:{$url} HTTP/1.1\r\n"; //echo "<pre>$out</pre>\n"; //debug only $out .= "User-Agent: " . self::GOOGLEUA . "\r\n"; $out .= "Host: " . self::GOOGLEHOST . "\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); //$pagerank = substr(fgets($fp, 128), 4); //debug only //echo $pagerank; //debug only while (!feof($fp)) { $data = fgets($fp, 128); //echo $data; $pos = strpos($data, "Rank_"); if ($pos === false) { } else { $pr = substr($data, $pos + 9); $pr = trim($pr); $pr = str_replace("\n", '', $pr); return $pr; } } //else { echo "$errstr ($errno)<br />\n"; } //debug only fclose($fp); } }
function getPR($url) { $googlehost = 'toolbarqueries.google.com'; $googleua = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5'; $ch = getch($url); $fp = fsockopen($googlehost, 80, $errno, $errstr, 30); if ($fp) { $out = "GET /search?client=navclient-auto&ch={$ch}&features=Rank&q=info:{$url} HTTP/1.1\r\n"; // echo "<pre>$out</pre>\n"; //debug only $out .= "User-Agent: {$googleua}\r\n"; $out .= "Host: {$googlehost}\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); // $pagerank = substr(fgets($fp, 128), 4); //debug only // echo $pagerank; //debug only while (!feof($fp)) { $data = fgets($fp, 128); //echo $data; $pos = strpos($data, "Rank_"); if ($pos === false) { } else { $pr = substr($data, $pos + 9); $pr = trim($pr); $pr = str_replace("\n", '', $pr); return $pr; } } // else { echo "$errstr ($errno)<br />\n"; } //debug only fclose($fp); return "0"; } }
function getpr($url) { global $googlehost,$googleua; $ch = getch($url); $fp = fsockopen($googlehost, 80, $errno, $errstr, 30); if ($fp) { $out = "GET /search?client=navclient-auto&ch=$ch&features=Rank&q=info:$url HTTP/1.1\r\n"; $out .= "User-Agent: $googleua\r\n"; $out .= "Host: $googlehost\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); while (!feof($fp)) { $data = fgets($fp, 128); //echo $data; $pos = strpos($data, "Rank_"); if($pos === false){} else{ $pr=substr($data, $pos + 9); $pr=trim($pr); $pr=str_replace("\n",'',$pr); return $pr; } } fclose($fp); } }
function addRights() { $categories = $this->getModuleCategoryID(); for ($i = 0; $i < count($categories); $i++) { $this->setModuleID($categories[$i]); $arrFieldList[0] = "'" . $this->getUserGroupID() . "'"; $arrFieldList[1] = "'" . $this->getModuleID() . "'"; $arrFieldList[2] = "'" . $this->getRightAdd() . "'"; $arrFieldList[3] = "'" . $this->getRightEdit() . "'"; $arrFieldList[4] = "'" . $this->getRightDelete() . "'"; $arrFieldList[5] = "'" . $this->getRightView() . "'"; $arrRecordsList[0] = 'USERG_ID'; $arrRecordsList[1] = 'MOD_ID'; $arrRecordsList[2] = 'ADDITION'; $arrRecordsList[3] = 'EDITING'; $arrRecordsList[4] = 'DELETION'; $arrRecordsList[5] = 'VIEWING'; $this->sql_builder->table_name = 'HS_HR_MORE_RIGHTS'; $this->sql_builder->flg_insert = 'true'; $this->sql_builder->arr_insertfield = $arrRecordsList; $this->sql_builder->arr_insert = $arrFieldList; $sqlQString = $this->sql_builder->addNewRecordFeature2(); $message2 = $this->dbConnection->executeQuery($sqlQString); //Calling the addData() function } getch(); //return $message2; //echo $message2; }
function getpr($url) { $ch = getch($url); $errno = '0'; $errstr = ''; require_code('files'); $data = http_download_file('http://toolbarqueries.google.com/search?client=navclient-auto&ch=' . $ch . '&features=Rank&q=info:' . $url, NULL, false); if (is_null($data)) { return ''; } $pos = strpos($data, "Rank_"); if ($pos !== false) { $pr = substr($data, $pos + 9); $pr = trim($pr); $pr = str_replace("\n", '', $pr); return $pr; } return ''; }