1 && 1 == 2) { for ($ik=1; $ik
" . str_replace("<","<",str_replace(">",">",substr($kkbit,1))) . "
\n", $ris);
       $ris=str_replace($kkbit, ":\n" . substr($kkbit,1) . "\n\n", $ris);
     } 
   }  
   if ($ris != '') {
     return "Next search ...
" . str_replace("<","<",str_replace(">",">",$ris)); } return str_replace("<","<",str_replace(">",">",$ris)); } function partof($insr, $afters) { $outsr=$insr; if (strpos($outsr, "fgrep ") !== false) { $fbits=explode("fgrep ", $outsr); $outsr="fgrep " . $fbits[1]; } if (strpos($outsr, " > ") !== false) { $fbits=explode(" > ", $outsr); $outsr=$fbits[0]; } return $outsr . $afters; } function pmoururldecode($ins) { return '/' . str_replace('+',' ',urldecode($ins)) . '/'; } function oururldecode($ins) { return str_replace('+',' ',urldecode($ins)); } $defplace="./*.*_GETME"; $defreadonly=" readonly"; $defplace="./*.*"; $defreadonly=""; $acom=""; if ($argc > 1) { $fullcommand=$argv[1] . " " . oururldecode($argv[2]) . " \"" . oururldecode($argv[3]) . "\" " . oururldecode($argv[4]) . " > " . dirname(__FILE__) . "/find_in_context.txt"; exec($argv[1] . " " . oururldecode($argv[2]) . " \"" . oururldecode($argv[3]) . "\" " . oururldecode($argv[4]) . " > " . dirname(__FILE__) . "/find_in_context.txt"); } else { $trythis=" trythis"; if (isset($_GET['command'])) { $trythis=" " . oururldecode($_GET['command']); $fullcommand="php " . dirname(__FILE__) . "/find_in_context.php" . $trythis . " " . urldecode($_GET['find']) . " " . urldecode($_GET['filespec']) . " > " . dirname(__FILE__) . "/find_in_context.txt"; $fs=oururldecode($_GET['filespec']); $oldfs=$fs; if (substr(($fs . " "),0,2) == './') $fs=dirname(__FILE__) . substr($fs,1); exec("php " . dirname(__FILE__) . "/find_in_context.php" . $trythis . " " . oururldecode($_GET['find']) . " " . str_replace('?','\?',str_replace('*','\*',$fs))); // . " > " . dirname(__FILE__) . "/find_in_context.txt"); sleep(2); $results=file_get_contents("find_in_context.txt"); if (substr(($oldfs . " "),0,2) == './') $results=str_replace(dirname(__FILE__),".",$results); if (strlen($_GET['x_9'] . $_GET['x_8'] . $_GET['x_7'] . $_GET['x_6'] . $_GET['x_5'] . $_GET['x_4'] . $_GET['x_3'] . $_GET['x_2'] . $_GET['x_1'] . $_GET['x1'] . $_GET['x2'] . $_GET['x3'] . $_GET['x4'] . $_GET['x5'] . $_GET['x6'] . $_GET['x7'] . $_GET['x8'] . $_GET['x9']) == 0) { echo " Find in Context - RJM Programming - July, 2017
" . partof($fullcommand, $acom) . "

" . noc($results) . "

Find in Context

RJM Programming - July, 2017

Line Previous -9 Condition:
Line Previous -8 Condition:
Line Previous -7 Condition:
Line Previous -6 Condition:
Line Previous -5 Condition:
Line Previous -4 Condition:
Line Previous -3 Condition:
Line Previous -2 Condition:
Line Previous -1 Condition:
Command Find-RegEx File-Specification:
Line After 1 Condition:
Line After 2 Condition:
Line After 3 Condition:
Line After 4 Condition:
Line After 5 Condition:
Line After 6 Condition:
Line After 7 Condition:
Line After 8 Condition:
Line After 9 Condition:

"; } else { $delim=""; $newresult=""; $partstoresult=explode("--", str_replace("'--'","'-' . '-'",str_replace('"--"','"-" . "-"', str_replace(' --',' #@#', str_replace('-- ',' #@# ', str_replace('---','-#@#', $results)))))); for ($i=0; $i 0) { if ($acom == "") $acom=" # "; if (strpos($acom, " Line Previous " . (0 - $j) . " Condition: ") === false) $acom.=" Line Previous " . (0 - $j) . " Condition: " . oururldecode($_GET['x_' . (0 - $j)]); if (preg_match(pmoururldecode($_GET['x_' . (0 - $j)]), $linestopartstoresult[9 + $j])) { $okay=$okay; } else { $okay=false; } } } else if ($j > 0) { if (strlen(oururldecode($_GET['x' . $j])) > 0) { if ($acom == "") $acom=" # "; if (strpos($acom, " Line After " . $j . " Condition: ") === false) $acom.=" Line After " . $j . " Condition: " . oururldecode($_GET['x' . $j]); //echo "
" . "preg_match(" . pmoururldecode($_GET['x' . $j]) . ", " . $linestopartstoresult[10 + $j] . ")
"; //exit; if (preg_match(pmoururldecode($_GET['x' . $j]), $linestopartstoresult[10 + $j])) { $okay=$okay; } else { $okay=false; } } } } if ($okay) { $newresult.=$delim . str_replace('#@#','--',$partstoresult[$i]); $delim='--'; } else { $okay=true; } } else { $okay=true; $xlinestopartstoresult=array("","","","","","","","","","","","","","","","","","","","",""); $jj=0; for ($ii=0; $ii=0; $ii--) { if ((10 + $ii - $jj) >= 0) { $xlinestopartstoresult[10 + $ii - $jj] = $linestopartstoresult[$ii]; //if (strpos($linestopartstoresult[$ii], "Google_OrgCh" . "art.php-25-") !== false) $wo=true; } } for ($j=-9; $j<10; $j++) { if ($j < 0) { if (strlen(oururldecode($_GET['x_' . (0 - $j)])) > 0) { if (preg_match(pmoururldecode($_GET['x_' . (0 - $j)]), $xlinestopartstoresult[9 + $j])) { $okay=$okay; } else { $okay=false; } } } else if ($j > 0) { if (strlen(oururldecode($_GET['x' . $j])) > 0) { if ($wo) echo "
" . "preg_match(" . pmoururldecode($_GET['x' . $j]) . ", " . $xlinestopartstoresult[10 + $j] . ")
"; //exit; if (preg_match(pmoururldecode($_GET['x' . $j]), $xlinestopartstoresult[10 + $j])) { $okay=$okay; } else { $okay=false; } } } } if ($okay) { $newresult.=$delim . str_replace('#@#','--',$partstoresult[$i]); $delim='--'; } else { $okay=true; } } } } } echo " Find in Context - RJM Programming - July, 2017
" . partof($fullcommand, $acom) . "

" . noc($newresult) . "

Find in Context

RJM Programming - July, 2017

Line Previous -9 Condition:
Line Previous -8 Condition:
Line Previous -7 Condition:
Line Previous -6 Condition:
Line Previous -5 Condition:
Line Previous -4 Condition:
Line Previous -3 Condition:
Line Previous -2 Condition:
Line Previous -1 Condition:
Command Find-RegEx File-Specification:
Line After 1 Condition:
Line After 2 Condition:
Line After 3 Condition:
Line After 4 Condition:
Line After 5 Condition:
Line After 6 Condition:
Line After 7 Condition:
Line After 8 Condition:
Line After 9 Condition:

"; exit; } else { echo " Find in Context - RJM Programming - July, 2017

Find in Context

RJM Programming - July, 2017

Line Previous -9 Condition:
Line Previous -8 Condition:
Line Previous -7 Condition:
Line Previous -6 Condition:
Line Previous -5 Condition:
Line Previous -4 Condition:
Line Previous -3 Condition:
Line Previous -2 Condition:
Line Previous -1 Condition:
Command Find-RegEx File-Specification:
Line After 1 Condition:
Line After 2 Condition:
Line After 3 Condition:
Line After 4 Condition:
Line After 5 Condition:
Line After 6 Condition:
Line After 7 Condition:
Line After 8 Condition:
Line After 9 Condition:

"; } } ?>