11,13d10 < $xselclass = ""; < $xselid = ""; < $xseltag = ""; 15,18d11 < $bextras = " "; < $firsttag = ""; < //$doc = new DOMDocument(); < $docb = false; 31,32c24 < $xselid = $selid; < $onload = " onload='document.getElementById(\"uluu\").innerHTML = document.getElementById(\"uluu\").innerHTML + \" ... id=\" + \"" . $selid . "\"; preaddele(\"" . $selid . "\",\"id\",\"" . $url . "\");'"; --- > $onload = " onload='preaddele(\"" . $selid . "\",\"id\",\"" . $url . "\");'"; 42,43c34 < $xselclass = $selclass; < $onload = " onload='document.getElementById(\"uluu\").innerHTML = document.getElementById(\"uluu\").innerHTML + \" ... class=\" + \"" . $selclass . "\"; preaddele(\"" . $selclass . "\",\"class\",\"" . $url . "\");'"; --- > $onload = " onload='preaddele(\"" . $selclass . "\",\"class\",\"" . $url . "\");'"; 53,54c44 < $xseltag = $seltag; < $onload = " onload='document.getElementById(\"uluu\").innerHTML = document.getElementById(\"uluu\").innerHTML + \" ... tag is \" + \"" . $seltag . "\"; preaddele(\"" . $seltag . "\",\"tag\",\"" . $url . "\");'"; --- > $onload = " onload='preaddele(\"" . $seltag . "\",\"tag\",\"" . $url . "\");'"; 59d48 < 63c52 < return "

Url (optional):

" . $stuff . ""; --- > return "" . $stuff . ""; 114,133d102 < if (str_replace("http://" . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . str_replace("?" . $_SERVER['QUERY_STRING'], "", $_SERVER['REQUEST_URI']), "", $url) != "") { < try { < //$ch = curl_init(); < //$timeout = 5; < //curl_setopt($ch, CURLOPT_URL, $url); < //curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); < //curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); < //$html = curl_exec($ch); < //curl_close($ch); < //echo $acont; < $doc = new DOMDocument(); < $doc->preserveWhiteSpace = FALSE; < $before = libxml_use_internal_errors(true); < $doc->loadHTML($acont); < libxml_use_internal_errors($before); < $docb = true; < } catch (Exception $e) { < throw new Exception( 'Something really wrong', 0, $e); < } < } 135,166c104,105 < function classadd($thing, $fthing) { < global $classarray, $selclass, $xselclass, $cont, $bextras, $docb, $doc; < if ($thing == $xselclass) { < if ($docb && 1 == 2) { < foreach ($doc->getElementsByClassName($thing) as $link) { < $bextras = str_replace(" ", $link->C14N() . "
", $bextras); < } < //foreach ($doc->getElementsByTagName($thing)->item(0)->childNodes as $link) { < // $bextras = str_replace(" ", $doc->saveXML($link) . "
", $bextras); < //} < } else { < $huh = strpos($cont, $fthing); < if ($huh !== false) { < $bthings = explode("<", substr($cont, 0, ($huh + strlen($fthing)))); < $bis = "<" . $bthings[sizeof($bthings) - 1] . " class=" . substr($cont, (($huh + strlen($fthing)) + 8)); < $words = explode(" ", $bthings[sizeof($bthings) - 1]); < $huh2 = strpos($bis, ""); < if ($huh2 !== false) { < $bextras = str_replace(" ", substr($bis, 0, ($huh2 + strlen(""))) . " ", $bextras); < } else { < $huh2 = strpos($bis, "/>"); < if ($huh2 !== false) { < $bextras = str_replace(" ", substr($bis, 0, ($huh2 + strlen("/>"))) . " ", $bextras); < } else { < $huh2 = strpos($bis, ">"); < if ($huh2 !== false) $bextras = str_replace(" ", substr($bis, 0, ($huh2 + strlen(">"))) . " ", $bextras); < } < } < < } < } < } --- > function classadd($thing) { > global $classarray, $selclass; 174,207c113,114 < function idadd($thing, $fthing) { < global $idarray, $selid, $xselid, $cont, $bextras, $docb, $doc; < if ($thing == $xselid) { < < if ($docb) { < $dobj = $doc->getElementById($thing); < $bextras = str_replace(" ", $dobj->C14N() . "
", $bextras); < //foreach ($doc->getElementById($thing)->item(0)->childNodes as $link) { < // $bextras = str_replace(" ", $doc->saveXML($doc->getElementById($thing)->item(0)->childNodes) . "
", $bextras); < //} < } else { < < $huh = strpos($cont, $fthing); < if ($huh !== false) { < $bthings = explode("<", substr($cont, 0, ($huh + strlen($fthing)))); < $bis = "<" . $bthings[sizeof($bthings) - 1] . " id=" . substr($cont, (($huh + strlen($fthing)) + 5)); < $words = explode(" ", $bthings[sizeof($bthings) - 1]); < $huh2 = strpos($bis, ""); < if ($huh2 !== false) { < $bextras = str_replace(" ", substr($bis, 0, ($huh2 + strlen(""))) . " ", $bextras); < } else { < $huh2 = strpos($bis, "/>"); < if ($huh2 !== false) { < $bextras = str_replace(" ", substr($bis, 0, ($huh2 + strlen("/>"))) . " ", $bextras); < } else { < $huh2 = strpos($bis, ">"); < if ($huh2 !== false) $bextras = str_replace(" ", substr($bis, 0, ($huh2 + strlen(">"))) . " ", $bextras); < } < } < < < } < } < } --- > function idadd($thing) { > global $idarray, $selid; 215,248c122,123 < function tagadd($thing, $fthing, $xcont) { < global $tagarray, $seltag, $outtag, $xseltag, $cont, $bextras, $firsttag, $docb, $doc; < if (($firsttag != "" || $thing == "body" || $thing == "BODY") && strpos($thing, "/") === false && strpos($thing, "*") === false && strpos($thing, "&") === false && strpos($thing, "|") === false && strpos($thing, ",") === false && strpos($thing, "{") === false && strpos($thing, "[") === false && strpos($thing, "(") === false && substr($thing, 0, 1) != "/" && substr($thing, 0, 1) != "!") { < $firsttag = "body"; < if ($thing == $xseltag) { < if ($docb) { < foreach ($doc->getElementsByTagName($thing) as $link) { < $bextras = str_replace(" ", $link->C14N() . "
", $bextras); < } < //foreach ($doc->getElementsByTagName($thing)->item(0)->childNodes as $link) { < // $bextras = str_replace(" ", $doc->saveXML($link) . "
", $bextras); < //} < } else { < $huh = strpos($xcont, $fthing . "<"); < if ($huh !== false) { < $bthings = explode("<", substr($cont, 0, ($huh + strlen($fthing) + 1))); < $bis = "<" . $bthings[sizeof($bthings) - 1] . $thing . substr($cont, (($huh + strlen($fthing)) + 1 + strlen($thing))); < $words = explode(" ", substr($bis,1)); < $huh2 = strpos($bis, ""); < if ($huh2 !== false) { < $bextras = str_replace(" ", substr($bis, 0, ($huh2 + strlen(""))) . " ", $bextras); < } else { < $huh2 = strpos($bis, "/>"); < if ($huh2 !== false) { < $bextras = str_replace(" ", substr($bis, 0, ($huh2 + strlen("/>"))) . " ", $bextras); < } else { < $huh2 = strpos($bis, ">"); < if ($huh2 !== false) $bextras = str_replace(" ", substr($bis, 0, ($huh2 + strlen(">"))) . " ", $bextras); < } < } < < } < } < } --- > function tagadd($thing) { > global $tagarray, $seltag, $outtag; 258d132 < } 262d135 < if (999 == 999) { 265,277c138,139 < $xxtag = explode(" ", $xtag[$i]); < if ($docb) { < try { < $items = $doc->getElementsByTagName($xxtag[0]); < if (count($items) > 0) tagadd($xxtag[0], $xid[$i - 1], str_replace(">", " ", str_replace("/>", " ", $cont))); < } catch (Exception $ee) { < } < } else { < tagadd($xxtag[0], $xtag[$i - 1], str_replace(">", " ", str_replace("/>", " ", $cont))); < } < < } < --- > $xxtag = explode(" ", $xtag[$i]); > tagadd($xxtag[0]); 284d145 < 289,294c150 < if ($docb && 1 == 7) { < $items = $doc->getElementsByClassName($xxclass[$j]); < if (count($items) > 0) classadd($xxclass[$j], $xclass[$i - 1]); < } else { < classadd($xxclass[$j], $xclass[$i - 1]); < } --- > classadd($xxclass[$j]); 300,305c156 < if ($docb && 1 == 7) { < $items = $doc->getElementsByClassName($xxclass[$j]); < if (count($items) > 0) classadd($xxclass[$j], $xclass[$i - 1]); < } else { < classadd($xxclass[$j], $xclass[$i - 1]); < } --- > classadd($xxclass[$j]); 309d159 < $xzxclass = explode(">", $xclass[$i]); 311,318c161 < if ($docb && 1 == 7) { < $items = $doc->getElementsByClassName($xxclass[$j]); < if (count($items) > 0) classadd($xxclass[0], $xclass[$i - 1]); < } else if (strlen($xzxclass[0]) < strlen($xxclass[0])) { < classadd($xzxclass[0], $xclass[$i - 1]); < } else { < classadd($xxclass[0], $xclass[$i - 1]); < } --- > classadd($xxclass[0]); 331,336c174 < if ($docb) { < $item = $doc->getElementById($xxid[$j]); < if ($item) idadd($xxid[$j], $xid[$i - 1]); < } else { < idadd($xxid[$j], $xid[$i - 1]); < } --- > idadd($xxid[$j]); 342,347c180 < if ($docb) { < $item = $doc->getElementById($xxid[$j]); < if ($item) idadd($xxid[$j], $xid[$i - 1]); < } else { < idadd($xxid[$j], $xid[$i - 1]); < } --- > idadd($xxid[$j]); 351d183 < $xzxid = explode(">", $xid[$i]); 353,360c185 < if ($docb) { < $item = $doc->getElementById($xxid[$j]); < if ($item) idadd($xxid[0], $xid[$i - 1]); < } else if (strlen($xzxid[0]) < strlen($xxid[0])) { < idadd($xzxid[0], $xid[$i - 1]); < } else { < idadd($xxid[0], $xid[$i - 1]); < } --- > idadd($xxid[0]); 366,367d190 < < 382d204 < var errcnt = 0; 385,386d206 < //document.title = document.title.replace("The putElement", ".The putElement"); < //if (document.title.indexOf("..........") != -1) document.title = document.title.replace("..........", "."); 409d228 < //if (cis != null) document.title = document.title.replace("The putElement", "@The putElement"); 416,428c235 < //if (cis != null) document.title = document.title.replace("The putElement", "=The putElement"); < errcnt = errcnt + 1; < if (errcnt == 3) { < document.getElementById('pextras').style.display = 'block'; < if (cis) { < cis.close(); < cis = null; < } else if (cis) { < setTimeout(callpreaddele, 1000); < } < } else if (cis) { < setTimeout(callpreaddele, 1000); < } --- > setTimeout(callpreaddele, 1000); 435,440c242,245 < //if (cis != null) document.title = document.title.replace("The putElement", "-The putElement"); < var myxcs = wis.document.getElementById(ttval); < //if (cis != null) document.title = document.title.replace("The putElement", "+The putElement"); < if (myxcs == null && cis != null) { < //document.title = document.title.replace("The putElement", ttval + "!The putElement"); < //document.getElementById('pextras').style.display = 'block'; --- > var mycs = wis.document.getElementById(ttval); > if (mycs == null && cis != null) { > setTimeout(callpreaddele, 1000); > } else if (mycs.length == 0 && cis != null) { 443,453c248 < try { < //document.title = document.title.replace("The putElement", ":The putElement"); < document.body.innerHTML = document.body.innerHTML + myxcs.outerHTML; < if (cis) { < cis.close(); < cis = null; < } < } catch (ex) { < //document.title = document.title.replace("The putElement", ex.message + "The putElement"); < setTimeout(callpreaddele, 1000); < } --- > document.body.innerHTML = document.body.innerHTML + mycs.outerHTML; 463d257 < //document.getElementById('pextras').style.display = 'block'; 468d261 < try { 472,479d264 < if (cis) { < cis.close(); < cis = null; < } < } catch (ex) { < //document.title = document.title.replace("The putElement", ex.message + "The putElement"); < setTimeout(callpreaddele, 1000); < } 488d272 < //document.getElementById('pextras').style.display = 'block'; 493d276 < try { 497,504d279 < if (cis) { < cis.close(); < cis = null; < } < } catch (ex) { < //document.title = document.title.replace("The putElement", ex.message + "The putElement"); < setTimeout(callpreaddele, 1000); < } 533c308 <

Under line under here are putElement(s)By HTML elements

--- >

Under line under here are putElement(s)By HTML elements

535d309 <