3c3 < // Create table of information about filespec or report about dead links --- > // Create table of information about filespec 7d6 < $fsev = ' document.getElementById("files").addEventListener("change", handleFileSelect, false); '; 9,55d7 < $mode = "Read bytes"; < $title = "File Information Table"; < $deadlinks = ""; < $snapshot = ""; < $myfe = "myf="; < $flh = ""; < $omyh1stuff = ""; < $fnameis = ""; < $lnameis = ""; < $pnameis = ""; < $undefined = " "; < $urlsuffix = ""; < $urllist = ""; < $statuslist = ""; < $linelist = ""; < $collist = ""; < < if (isset($_GET['myf'])) { < $huhis = explode("strong>", $_GET['myf']); < if (sizeof($huhis) >= 3) $undefined = str_replace(" if (strpos($url, "https:") !== false || strpos($url, "HTTPS:") !== false) { > if (!$fp = curl_init($url)) return false; > return true; 89d17 < $flh = $file_headers[0]; 101,281d28 < function echop($ine) { < global $fnameis; < global $lnameis; < global $pnameis; < echo "

" . $ine . "

"; < } < < function prelook($xinfl) { < global $fnameis; < global $lnameis; < global $pnameis; < global $undefined; < $outinfl = $xinfl; < $fnameis = ""; < if (strpos($xinfl, "http(") !== false || strpos($xinfl, "HTTP(") !== false) { < $zxinfl = explode(")", substr($xinfl, 5)); < $hbit = "(" . $zxinfl[0] . ")"; < $outinfl = str_replace($hbit, "", $outinfl); < $fnameis = str_replace(" undefined ", $undefined, str_replace("(", " in ", str_replace(")", "", str_replace(":", " on line ", str_replace("@", " at column ", $hbit))))); < } < return $outinfl; < } < < function pluck($sdelim, $pstr, $bstr, $edelim, $ourln, $ourcp) { < global $urllist, $statuslist, $linelist, $collist, $fnameis; < < if ($sdelim == "") { < $preturl = explode($edelim, $bstr); < $turl = explode("<", $preturl[0]); < } else { < $preturl = explode($sdelim, $bstr); < $turl = explode("<", $preturl[0]); < } < $endl = ""; < if (strpos(substr(trim($pstr . $turl[0]), 8), "/") === false) $turl[0] = trim($turl[0]) . "/"; < $urllist .= $pstr . $turl[0] . "
"; < if (url_exists($pstr . $turl[0])) { < $statuslist .= "exists
"; < } else { < $statuslist .= "does not exist
"; < } < $linelist .= $ourln . "
"; < $collist .= $ourcp . "
"; < return $pstr . "(" . $fnameis . ":" . $ourln . "@" . $ourcp . ")" . $turl[0] . $edelim; < } < < function makeintolist($inst) { // via web server filelist via glob < global $urllist, $statuslist, $linelist, $collist, $fnameis, $urlsuffix; < < $urlbit = ""; < $outst = $inst; < $interimst = $inst; < $interimst = explode("\n", $inst); < < if (sizeof($interimst) > 0) $outst = ""; < < for ($ik=0; $ik exists" . $fnameis . $lnameis . $pnameis . "."; < } else { < $outfl .= "" . $urls[$ij] . $endl . " does not exist" . $fnameis . $lnameis . $pnameis . "."; < } < $flh = ""; < } < } < $outfl .= ""; < } < return $outfl; < } < < function on_to($on, $to) { < global $fnameis; < global $lnameis; < global $pnameis; < if (url_exists(urldecode($on))) { < if ($to == "") { < echop(urldecode($on) . " exists" . $fnameis . $lnameis . $pnameis . ".\n"); < } else { < file_put_contents($to, file_get_contents($to) . urldecode($on) . " exists" . $fnameis . $lnameis . $pnameis . ".\n"); < } < exit; < } else { < if ($to == "") { < echop(urldecode($on) . " does not exist" . $fnameis . $lnameis . $pnameis . ".\n"); < } else { < file_put_contents($to, file_get_contents($to) . urldecode($on) . " does not exist" . $fnameis . $lnameis . $pnameis . ".\n"); < } < exit; < } < } < < $outrep = ""; < if (isset($_GET['justreportto'])) { < $outrep = urldecode($_GET['justreportto']); < if (strpos($outrep, "/") === false && strpos($outrep, "\\") === false) { < $outrep = dirname(__FILE__) . "/" . $outrep; < } < } else if (isset($_POST['justreportto'])) { < $outrep = urldecode($_POST['justreportto']); < if (strpos($outrep, "/") === false && strpos($outrep, "\\") === false) { < $outrep = dirname(__FILE__) . "/" . $outrep; < } < } < < if (isset($_GET['justreporton'])) { < on_to(urldecode($_GET['justreporton']), $outrep); < exit; < } else if (isset($_POST['justreporton'])) { < on_to(urldecode($_POST['justreporton']), $outrep); < exit; < } else { < 288c35 < } else if ($deadlinks == "") { --- > } else { 291,293d37 < } else { < $fsp = "index"; < $ext = ".html"; 314,315d57 < } else if ($deadlinks == "") { < $dir = '/'; // '/Library/pgAgent/Downloads/CRL/'; 317c59 < $dir = 'http://'; --- > $dir = '/Library/pgAgent/Downloads/CRL/'; 321c63 < $outhtml = "\n" . $title . "\n"; --- > $outhtml = "\nFile Information Table\n"; 325d66 < var omyh1; 328d68 < var bigj=0; 332,342d71 < var bigbuffer=""; < var prevmy_res=""; < var bigf=new Array(); < var urlsuf="' . $urlsuffix . '"; < < function mh() { omyh1=document.getElementById("myh1"); if (urlsuf != "" && omyh1.innerHTML.indexOf(" Please wait ") == -1) { omyh1.innerHTML = omyh1.innerHTML + " ... Please wait while we analyze your URLs ... "; } } < < function dlbclick() { < //alert(document.getElementById("flist").value); < document.getElementById("dlb").click(); < } 365,368d93 < omyh1 = document.getElementById("myh1"); < < ' . $omyh1stuff . ' < 397d121 < omyh1 = document.getElementById("myh1"); 416c140 < ' . $fsev . ' --- > document.getElementById("files").addEventListener("change", handleFileSelect, false); 420d143 < 422d144 < if (infilecontents != null) { 424,445c146,148 < var ourlines = infilecontents.split(String.fromCharCode(10)); < '; < if ($deadlinks != "") { < $outhtml .= ' < if (1 == 1) { < document.getElementById("flist").value = document.getElementById("flist").value + justhttp(ourlines); < document.getElementById("dlb").click(); < } else { < for (var jj=0; jj location.href = huh[0] + "?myf=" + decodeURIComponent(myfis); 451c154 < location.href = document.URL + "?' . $myfe . '" + decodeURIComponent(myfis); --- > location.href = document.URL + "?myf=" + decodeURIComponent(myfis); 453,457c156 < fcont = infilecontents; < '; < } < $outhtml .= ' < } --- > fcont = infilecontents; 460,524d158 < function nocaret(iinf, lno, jpos, inc) { < var noinc = inc.split("<"); < if (jpos > 0) return noinc[0].replace("http", "http(" + iinf + ":" + lno + "@" + jpos + ")").replace("HTTP", "HTTP(" + iinf + ":" + lno + "@" + jpos + ")"); < return noinc[0].replace("http", "http(" + iinf + ":" + lno + ")").replace("HTTP", "HTTP(" + iinf + ":" + lno + ")"); < } < < function justhttps(instr, ininfo) { < //document.title = ininfo; < if (bigf[bigj] == null || bigf[bigj] == undefined) { < bigf[bigj] = document.getElementById("file").value; < } < return justhttp(instr.split(String.fromCharCode(eval(0 + 10))), bigf[bigj]); // ininfo); < } < < function justhttp(inarr, ininf) { < var outst = "", arec = "", ipos = 0, httparr, ijkh, otherarr, endl = "", qpos = 0; < bigj = bigj + 1; < //alert(ininf); < for (var iq=0; iq 1) { < while (arec.indexOf("http") > 1) { < qpos = eval(1 + arec.indexOf("http")); < httparr = arec.split("http"); < for (ijkh=1; ijkh 1) { < while (arec.indexOf("HTTP") > 1) { < qpos = eval(1 + arec.indexOf("HTTP")); < httparr = arec.split("HTTP"); < for (ijkh=1; ijkhTable", str_replace("Report", "Report", $title)) . ""; < $outhtml .= ''; < //$snapshot = $outhtml . "

Please wait while we analyze your URLs ...


"; < //echo $snapshot; < //$snapshot = "
" . readandprocess($_POST['flist']) . "
"; < $outhtml .= "

Please wait while we analyze your URLs ...


"; < $outhtml .= "
" . readandprocess($_POST['flist']) . "
"; < } else { < $outhtml .= "

" . str_replace("Table", "Table", str_replace("Report", "Report", $title)) . "

"; < $outhtml .= ''; < //$snapshot = $outhtml; < } < $outhtml .= "
"; --- > $outhtml .= "

File Information Table

"; 670c246 < $outhtml .= ""; --- > $outhtml .= ""; 676,683c252,253 < $outhtml .= '
'; < if ($deadlinks != "") { < //$outhtml = $snapshot . '


'; < $outhtml .= '


'; < } else { < $outhtml .= '


... or ...

'; < } < $outhtml .= ' ' . $mode . ': --- > $outhtml .= ' >


... or ...

Read bytes: 688c258 < --- > 709,719c279,280 < $outhtml = "" . $title . " for " . $dir . $fsp . $ext . "\n"; < $dc = "Date"; < $sb = "Size (bytes)"; < $lc = "Lines"; < $wc = "Words"; < if ($urlsuffix != "") { < $dc = "URL"; < $sb = "Status"; < $lc = "On Line"; < $wc = "At Column"; < } --- > $outhtml = "File Information Table for " . $dir . $fsp . $ext . "\n"; > $outhtml .= "

File Information Table for " . $dir . $fsp . $ext . "

"; 721,722c282 < $outhtml .= "

" . $title . " for " . $dir . $fsp . $ext . "

"; < $outhtml .= ""; --- > $outhtml .= ""; 724,725c284 < $outhtml .= "

" . $title . " for " . $dir . $fsp . $ext . "

Filename" . $dc . "" . $sb . "" . $lc . "" . $wc . "
FilenameDateSize (bytes)LinesWords
"; < $outhtml .= ""; --- > $outhtml .= ""; 732,739d290 < if ($urlsuffix != "") { < readandprocess($fsp . $ext . "@!~*^@" . $cont); // new ideas here < $outhtml .= ""; < $urllist = ""; < $statuslist = ""; < $linelist = ""; < $collist = ""; < } else { 750d300 < } 752a303 > 754d304 < 756,763d305 < if ($urlsuffix != "") { < readandprocess($filename . "@!~*^@" . file_get_contents($filename)); // new ideas here < $outhtml .= ""; < $urllist = ""; < $statuslist = ""; < $linelist = ""; < $collist = ""; < } else { 771c313 < } --- > 779d320 < }
Filename in " . $dir . "" . $dc . "" . $sb . "" . $lc . "" . $wc . "
Filename in " . $dir . "DateSize (bytes)LinesWords
" . str_replace($dir, "", $dir . $fsp . $ext) . "" . $urllist . "" . $statuslist . "" . $linelist . "" . $collist . "
" . str_replace($dir, "", $filename) . "" . $urllist . "" . $statuslist . "" . $linelist . "" . $collist . "