> 8) . chr($length & 0xFF); } else { $retval .= chr(0x80) . chr(0x04) . chr(($length >> 24) & 0xFF) . chr(($length >> 16) & 0xFF) . chr(($length >> 8) & 0xFF) . chr($length & 0xFF); } return $retval . $value; } if (isset($_GET['myta'])) { $dru="http://" . $_SERVER['SERVER_NAME'] . "" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/"; $contis=str_replace('+',' ',urldecode($_GET['myta'])); //file_put_contents('xx.xx', $contis); $myf=''; $backi=''; $cali=''; $taback=''; $bcontis="'" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("'", "' + String.fromCharCode(39) + '", $contis)))) . "'"; if (substr(($bcontis . ' '),0,3) == "' + ") { $bcontis=$bcontis.substr(3); } if (substr((' ' . $bcontis),-3,3) == " + '") { $bcontis=$bcontis.substr(0,(-3 + strlen($bcontis))); } foreach ($_GET as $name=>$val) { if ($name != 'myta' && $val == '') { //echo $name; $myf=$name; $taback=str_replace('-','_',str_replace('itd','tatd',$myf)); $backi=str_replace('-','_',str_replace('screen-','itd_',$myf)); $cali=str_replace('-','',str_replace('screen-','td',$myf)); $idcali=explode('-',explode('_',str_replace('screen-','td',str_replace('itd_','td',$myf)))[0])[0]; // Thanks to https://doc.bccnsoft.com/docs/php-docs-7-en/function.iptcembed.html // Path to jpeg file $path = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . str_replace('_','-',str_replace('itd_','screen-',$myf)) . '.jpg'; //file_put_contents('x.x',$path); $capt = ""; // Thanks to https://www.php.net/manual/en/function.iptcparse.php $size = getimagesize( $path, $info ); if (isset($info["APP13"])) { //file_put_contents('xx.xx',$path); if ($iptc = iptcparse( $info["APP13"] ) ) { //file_put_contents('xxx.xxx',$path); $capt = str_replace( "\000", "", $iptc["2#120"][0] ); //file_put_contents('xxxx.xxxx',$capt); } } $bcontis="" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("'", "' + String.fromCharCode(39) + '", $capt)))) . ""; $ccpre="

"; $ccpost="

"; $ccontis="

" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "
", str_replace("\r\n", "
", str_replace("'", "' + String.fromCharCode(39) + '", $capt)))) . "

"; //file_put_contents('xxxxx.xxxxx',$bcontis); //file_put_contents('xxxxxx.xxxxxx',$taback . ' ... ' . $backi); //file_put_contents('xxxxxxx.xxxxxxx',"parent.document.getElementById('" . $backi . "').title='" . $bcontis . "'; parent.document.getElementById('" . $taback . "').value='" . $bcontis . "'; "); } if ($bcontis != "''") { echo "'); } parent.document.getElementById('" . $idcali . "').innerHTML+=huhg; } \">"; } } } else if (isset($_POST['myta'])) { $dru="http://" . $_SERVER['SERVER_NAME'] . "" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/"; $contis=str_replace('+',' ',urldecode($_POST['myta'])); //file_put_contents('xx.xx', $contis); $myf=''; $backi=''; $cali=''; $bcontis="'" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "' + String.fromCharCode(10) + '", str_replace("\r\n", "' + String.fromCharCode(10) + '", str_replace("'", "' + String.fromCharCode(39) + '", $contis)))) . "'"; $ccpre="

"; $ccpost="

"; $ccontis="

" . str_replace(chr(34), "' + String.fromCharCode(34) + '", str_replace("\n", "
", str_replace("\r\n", "
", str_replace("'", "' + String.fromCharCode(39) + '", $capt)))) . "

"; if (substr(($bcontis . ' '),0,3) == "' + ") { $bcontis=$bcontis.substr(3); } if (substr((' ' . $bcontis),-3,3) == " + '") { $bcontis=$bcontis.substr(0,(-3 + strlen($bcontis))); } foreach ($_POST as $name=>$val) { if ($name != 'myta') { $myf=$name; $backi=str_replace('-','_',str_replace('screen-','itd_',$myf)); $taback=str_replace('tatd','tatd_',substr(str_replace('-','',str_replace('_','',str_replace('itd','tatd',str_replace('screen','tatd',$myf)))),0,12)) . '_' . substr(str_replace('-','',str_replace('_','',str_replace('itd','tatd',str_replace('screen','tatd',$myf)))),-4,4); $pback=str_replace('tatd','ip',$taback); $cali=str_replace('-','',str_replace('screen-','td',$myf)); $idcali=explode('-',explode('_',str_replace('screen-','td',str_replace('itd_','td',$myf)))[0])[0]; // Thanks to https://doc.bccnsoft.com/docs/php-docs-7-en/function.iptcembed.html // Path to jpeg file $path = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $myf . '.jpg'; //file_put_contents('x.x', $path); // Set the IPTC tags $iptc = array( '2#120' => $contis, '2#116' => 'Copyright 2021, RJM Programming' ); // Convert the IPTC tags into binary code $data = ''; foreach($iptc as $tag => $string) { $tag = substr($tag, 2); $data .= iptc_make_tag(2, $tag, $string); } // Embed the IPTC data $content = iptcembed($data, $path); // Write the new image data out to the file. $fp = fopen($path, "wb"); fwrite($fp, $content); fclose($fp); } echo "'); } if (parent.document.getElementById('" . $pback . "')) { parent.document.getElementById('" . $pback . "').innerHTML=huhg; } else { parent.document.getElementById('" . $idcali . "').innerHTML+=huhg; } } \">"; } } else { exec("/usr/sbin/screencapture -Cd -tjpg /Applications/MAMP/htdocs/screen-`date +\"%Y%m%d-%H%M\"`.jpg"); } exit; ?>