';
$surlprefix=str_replace("//localhost/", "/",str_replace("index.php", "", str_replace("indexslideshow.php", "", str_replace("phpidea.php", "", "//" . $_SERVER['SERVER_NAME'] . explode("#", explode("?", $_SERVER['REQUEST_URI'])[0])[0]))));
$prepurlis=str_replace('//localhost','http://localhost','//' . $_SERVER['SERVER_NAME'] . "" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/");
$purlis=str_replace("index.php","",'http://' . $_SERVER['SERVER_NAME'] . "" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "" . explode("#", explode("?", $_SERVER['REQUEST_URI'])[0])[0]);
$ssurlprefix=".." . str_replace("index.php","",explode("#", explode("?", $_SERVER['REQUEST_URI'])[0])[0]);
$zerobit=' style="vertical-align:top;padding-top:200px;" ';
$zerobit='';
$tos="";
//$string = "🇦🇩";
function ingp($string) {
$entity = preg_replace_callback('/[\x{80}-\x{10FFFF}]/u', function ($m) {
$char = current($m);
$utf = iconv('UTF-8', 'UCS-4', $char);
//return sprintf("%s;", ltrim(strtoupper(bin2hex($utf)), "0"));
return sprintf("%s;", ltrim(strtoupper(bin2hex($utf)), "0"));
}, $string);
echo str_replace('&','&',htmlentities($entity));
}
function maybeh($inm) {
if (substr(($inm . '6'),0,1) < '0' || substr(($inm . '6'),0,1) > '9') {
//file_put_contents('aazz.aazz',html_entity_decode(('' . $inm . ''),ENT_QUOTES|ENT_XML1,"UTF-8"));
//file_put_contents('aaz.aaz','');
$converted = iconv('UTF-8', 'UTF-32', $inm);
for ($i = 0; $i < strlen($converted); $i += 4) {
$codeUnit = ord($converted[$i]) + (ord($converted[$i+1]) << 16);
//file_put_contents('aaz.aaz',file_get_contents('aaz.aaz') . "\n" . $codeUnit . PHP_EOL);
}
}
return $inm;
}
function pdfw($inw) {
global $isiPad;
if ($isiPad) { return '600'; }
return '' . $inw;
}
function pdfh($inh) {
global $isiPad;
if ($isiPad) { return "400px;\" width=\"600px;\" height=\"400"; }
return '' . $inh;
}
function oururlencode($instgis) {
global $tos, $fcform;
if (strpos($instgis, "&") === false) {
return urlencode($instgis);
} else {
$rvas=explode("&", $instgis);
$rva=urlencode($rvas[0]);
$fcform=str_replace(' value="" ', ' value="' . $rvas[0] . '" ', $fcform);
for ($ir=1; $ir', ' value="' . substr($rvas[$ir],(strlen($rve[0]) + 1)) . '">', $fcform);
}
return $rva;
}
}
function andmore($oneis, $twois) {
$couldbe=$oneis . $twois;
$suffix="&rp=" . $oneis;
$oneis="";
$andthenmaybe="";
$items = glob("*[-_][0-9]*of.[jJgGpP][pPiInN]*");
natsort($items);
//foreach (glob("*[-_][0-9]*of.[jJgGpP][pPiInN]*") as $ifil) {
foreach ($items as $key => $val) {
if ($andthenmaybe == "") {
$andthenmaybe=$oneis . $val;
} else if (strpos($andthenmaybe, $oneis . $val) === false) {
$andthenmaybe.=',' . $oneis . $val;
}
}
$items = glob("*[-_][0-9]*.[jJgGpP][pPiInN]*");
natsort($items);
foreach ($items as $key => $val) {
if ($andthenmaybe == "") {
$andthenmaybe=$oneis . $val;
} else if (strpos($andthenmaybe, $oneis . $val) === false) {
$andthenmaybe.=',' . $oneis . $val;
}
}
if ($andthenmaybe == "") {
return $couldbe;
} else {
return $andthenmaybe . $suffix;
}
}
function ourrealpath($inid) {
global $surlprefix, $purlis, $ssurlprefix;
//echo $purlis;
//exit;
if (realpath($inid) != $inid && realpath($inid) != '') {
if (strpos($inid, $delim) === false && strpos($inid, "/") === false) {
$surlprefix="";
}
return realpath($inid);
}
$delim=substr("\\" . "\\",0,1);
if (PHP_OS=='WINNT' || PHP_OS=='WIN32' || PHP_OS=='Windows') {
if (strpos($inid, $delim) === false && strpos($inid, "/") === false) {
$surlprefix="";
return dirname(__FILE__) . $delim . $inid;
}
$bits=explode($delim, $inid);
$lbit=$bits[-1 + sizeof($bits)];
if (strpos($lbit, ".") !== false) {
if (file_exists(str_replace($delim . $lbit, $delim, $inid))) {
if (realpath(str_replace($delim . $lbit, $delim, $inid)) != str_replace($delim . $lbit, $delim, $inid) && realpath(str_replace($delim . $lbit, $delim, $inid)) != '') {
return realpath(str_replace($delim . $lbit, "", $inid)) . $delim . $lbit;
}
}
}
} else {
if (strpos($inid, "/") === false) {
$surlprefix="";
return dirname(__FILE__) . "/" . $inid;
}
$bits=explode("/", $inid);
$lbit=$bits[-1 + sizeof($bits)];
if (strpos($lbit, ".") !== false) {
if (file_exists(str_replace("/" . $lbit, "/", $inid))) {
if (realpath(str_replace("/" . $lbit, "/", $inid)) != str_replace("/" . $lbit, "/", $inid) && realpath(str_replace("/" . $lbit, "/", $inid)) != '') {
return realpath(str_replace("/" . $lbit, "", $inid)) . "/" . $lbit;
}
}
}
} return $inid;
}
function startBackgroundProcess(
$command,
$stdin = null,
$redirectStdout = null,
$redirectStderr = null,
$cwd = null,
$env = null,
$other_options = null
) { // thanks to https://stackoverflow.com/questions/45953/php-execute-a-background-process
global $wh;
$trunning = false;
$proc = null;
$descriptorspec = array(
1 => is_string($redirectStdout) ? array('file', $redirectStdout, 'w') : array('pipe', 'w'),
2 => is_string($redirectStderr) ? array('file', $redirectStderr, 'w') : array('pipe', 'w'),
);
if (is_string($stdin)) {
$descriptorspec[0] = array('pipe', 'r');
}
//if ($iswatchdog) { file_put_contents("zz.5",""); }
//if ($isthere) {
//if ($iswatchdog) { file_put_contents("zz.6",""); }
$proc = proc_open($command, $descriptorspec, $pipes, $cwd, $env, $other_options);
//}
if (!is_resource($proc)) {
//throw new \Exception("Failed to start background process by command: $command");
$proc=null;
}
if (is_string($stdin)) {
fwrite($pipes[0], $stdin);
fclose($pipes[0]);
}
if (!is_string($redirectStdout)) {
fclose($pipes[1]);
}
if (!is_string($redirectStderr)) {
fclose($pipes[2]);
}
return $proc;
}
$sothers="";
$tdid=''; //' id="tdfirst" ';
$stitle=""; //"Please sign it";
if (isset($_GET['title'])) { $stitle=str_replace("+"," ",urldecode($_GET['title'])); }
$scnt=0;
$sscnt=1;
$whsbits="";
//$zerobit="";
$slo=-1;
$smodebit="";
$spush="";
if (isset($_GET['exif'])) { // //www.rjmprogramming.com.au/PHP/read_exif_off_image_rotate.php?image=
$surlprefix=str_replace("//www.rjmprogramming.com.au/", "../", $surlprefix);
$smodetemplate="\n if (smode != '0') document.getElementById('row').innerHTML+='> | | '; \n";
} else if (isset($_GET['emoji'])) { // //www.rjmprogramming.com.au/image_svg.php?insvg=GET[emoji]&image=
$surlprefix=str_replace("//www.rjmprogramming.com.au/", "../", $surlprefix);
$smodetemplate="\n if (smode != '0') document.getElementById('row').innerHTML+='> | | '; \n";
} else if (isset($_GET['pdf'])) { // //www.rjmprogramming.com.au/PHP/read_exif_off_image_rotate.php?image=
$surlprefix=str_replace("//www.rjmprogramming.com.au/", "../", $surlprefix);
$smodetemplate="\n if (smode != '0') document.getElementById('row').innerHTML+='> | | '; \n";
} else {
$smodetemplate="\n if (smode != '0') document.getElementById('row').innerHTML+='> | | '; \n";
}
// Zip file coding
$rmcmd="";
$onlyzip="";
$pattern1 = '/[-_][0-9]*of.[jJgGpP][pPiInN]/';
$pattern2 = '/[-_][0-9]*.[jJgGpP][pPiInN]/';
$matches1 = [];
$matches2 = [];
// End of zip file coding
if (!file_exists("index.htm") && !file_exists("index.html")) {
// Zip file coding
foreach (glob("*[-_][0-9]*.[zZ][iI][pP]") as $ifil) {
$onlyzip=$ifil;
}
foreach (glob("*[-_][0-9]*of.[zZ][iI][pP]") as $ifil) {
$onlyzip=$ifil;
}
if ($onlyzip != "") {
foreach (glob("*[-_][0-9]*of.[jJgGpP][pPiInN]*") as $ifil) {
$onlyzip="";
}
foreach (glob("*[-_][0-9]*.[jJgGpP][pPiInN]*") as $ifil) {
$onlyzip="";
}
}
if ($onlyzip != "") {
foreach (glob("*[-_][0-9]*.[zZ][iI][pP]") as $ifil) {
$zip = zip_open($ifil);
if ($zip) {
while ($zip_entry = zip_read($zip)) {
$ourfilename=zip_entry_name($zip_entry);
preg_match($pattern1, $ourfilename, $matches1, PREG_OFFSET_CAPTURE);
if (sizeof($matches1) == 0) {
preg_match($pattern2, $ourfilename, $matches2, PREG_OFFSET_CAPTURE);
}
if (sizeof($matches1) > 0 || sizeof($matches2) > 0) {
if (zip_entry_open($zip, $zip_entry)) {
// some code
$cont=zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
file_put_contents(basename($ourfilename), $cont);
if ($rmcmd == "") { $rmcmd=" sleep 3600; "; }
$rmcmd.=" rm -f " . realpath(basename($ourfilename)) . "; ";
}
}
$matches1 = [];
$matches2 = [];
}
zip_close($zip);
}
}
$matches1 = [];
$matches2 = [];
foreach (glob("*[-_][0-9]*of.[zZ][iI][pP]") as $ifil) {
$zip = zip_open($ifil);
if ($zip) {
while ($zip_entry = zip_read($zip)) {
$ourfilename=zip_entry_name($zip_entry);
preg_match($pattern1, $ourfilename, $matches1, PREG_OFFSET_CAPTURE);
if (sizeof($matches1) == 0) {
preg_match($pattern2, $ourfilename, $matches2, PREG_OFFSET_CAPTURE);
}
if (sizeof($matches1) > 0 || sizeof($matches2) > 0) {
if (zip_entry_open($zip, $zip_entry)) {
// some code
$cont=zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
file_put_contents(basename($ourfilename), $cont);
if ($rmcmd == "") { $rmcmd=" sleep 3600; "; }
$rmcmd.=" rm -f " . realpath(basename($ourfilename)) . "; ";
}
}
$matches1 = [];
$matches2 = [];
}
zip_close($zip);
}
}
}
// End of zip file coding
// Zip file coding
if ($rmcmd != "") {
$huhp = startBackgroundProcess($rmcmd);
header("Location: " . $_SERVER['REQUEST_URI']);
exit;
}
// End of zip file coding
$items = glob("*[-_][0-9]*of.[jJgGpP][pPiInN]*");
natsort($items);
//foreach (glob("*[-_][0-9]*of.[jJgGpP][pPiInN]*") as $ifil) {
foreach ($items as $key => $val) {
$ifil=$val; //$items[$iio];
$ibits=explode("-", $ifil);
if (sizeof($ibits) <= 1) {
$ibits=explode("_", $ifil);
}
if (sizeof($ibits) > 1) {
$proposedstitle=str_replace("_", " ", $ibits[0]);
if ($proposedstitle != $stitle) {
if ($stitle == "") {
$stitle=$proposedstitle;
} else if (strpos($sothers, $proposedstitle) === false) {
$spush.="\n firstones.push(" . $scnt . "); \n";
$spush.="\n lastones.push(" . (-1 + $scnt) . "); \n";
$sothers.="
" . $proposedstitle . "";
$sscnt++;
}
}
if (isset($_GET['exif'])) { // //www.rjmprogramming.com.au/PHP/read_exif_off_image_rotate.php?image=
//echo ourrealpath($ifil);
//exit;
list($width, $height, $type, $attr) = getimagesize(ourrealpath($ifil));
if (strpos($zerobit, ' style="') !== false) {
$zerobit=str_replace(' style="', ' style="width:' . $width . 'px;height:' . $height . 'px;', $zerobit);
} else {
$zerobit=" style=\"vertical-align:top;width:" . $width . "px;height:" . $height . "px;\" ";
}
$smodebit.="\n if (smode != '0') document.getElementById('row').innerHTML+='> | | '; \n";
} else if (isset($_GET['emoji'])) { // //www.rjmprogramming.com.au/image_svg.php?insvg=GET[emoji]&image=
//echo ourrealpath($ifil);
//exit;
list($width, $height, $type, $attr) = getimagesize(ourrealpath($ifil));
if (strpos($zerobit, ' style="') !== false) {
$zerobit=str_replace(' style="', ' style="width:' . $width . 'px;height:' . $height . 'px;', $zerobit);
} else {
$zerobit=" style=\"vertical-align:top;width:" . $width . "px;height:" . $height . "px;\" ";
}
$smodebit.="\n if (smode != '0') document.getElementById('row').innerHTML+='> | | '; \n";
} else if (isset($_GET['pdf'])) { // //www.rjmprogramming.com.au/PHP/read_exif_off_image_rotate.php?image=
//echo ourrealpath($ifil);
//exit;
list($width, $height, $type, $attr) = getimagesize(ourrealpath($ifil));
if (strpos($zerobit, ' style="') !== false) {
$zerobit=str_replace(' style="', ' style="width:' . $width . 'px;height:' . $height . 'px;', $zerobit);
} else {
$zerobit=" style=\"width:" . $width . "px;height:" . $height . "px;\" ";
}
if (strpos($smodebit, "form_creator.php?slideshowlist=") === false) {
$smodebit.="\n if (smode != '0') document.getElementById('row').innerHTML+='> | | '; \n";
}
} else {
$smodebit.="\n if (smode != '0') document.getElementById('row').innerHTML+='> | | '; \n";
}
$spush.="\n uarraydatauri.push('" . $surlprefix . $ifil . "'); \n";
$scnt++;
}
}
$items = glob("*[-_][0-9]*.[jJgGpP][pPiInN]*");
natsort($items);
foreach ($items as $key => $val) {
$ifil=$val; //$items[$iio];
//echo ourrealpath($ifil) . ' surlprefix=' . $surlprefix;
//exit;
if (strpos($spush, "'" . $surlprefix . $ifil . "'") === false) {
$ibits=explode("-", $ifil);
if (sizeof($ibits) <= 1) {
$ibits=explode("_", $ifil);
}
if (sizeof($ibits) > 1) {
$proposedstitle=str_replace("_", " ", $ibits[0]);
if ($proposedstitle != $stitle) {
if ($stitle == "") {
$stitle=$proposedstitle;
} else if (strpos($sothers, $proposedstitle) === false) {
$spush.="\n firstones.push(" . $scnt . "); \n";
$spush.="\n lastones.push(" . (-1 + $scnt) . "); \n";
$sothers.="
" . $proposedstitle . "";
$sscnt++;
}
}
if (isset($_GET['exif'])) {
//echo $surlprefix;
//exit;
list($width, $height, $type, $attr) = getimagesize(ourrealpath($ifil));
if (strpos($zerobit, ' style="') !== false) {
$zerobit=str_replace(' style="', ' style="width:' . $width . 'px;height:' . $height . 'px;', $zerobit);
} else {
$zerobit=" style=\"width:" . $width . "px;height:" . $height . "px;\" ";
}
$smodebit.="\n if (smode != '0') document.getElementById('row').innerHTML+='> | | '; \n";
$tdid="";
} else if (isset($_GET['emoji'])) {
//echo $surlprefix;
//exit;
list($width, $height, $type, $attr) = getimagesize(ourrealpath($ifil));
if (strpos($zerobit, ' style="') !== false) {
$zerobit=str_replace(' style="', ' style="width:' . $width . 'px;height:' . $height . 'px;', $zerobit);
} else {
$zerobit=" style=\"width:" . $width . "px;height:" . $height . "px;\" ";
}
$smodebit.="\n if (smode != '0') document.getElementById('row').innerHTML+='> | | '; \n";
$tdid="";
} else if (isset($_GET['pdf'])) {
//echo $surlprefix;
//exit;
list($width, $height, $type, $attr) = getimagesize(ourrealpath($ifil));
if (strpos($zerobit, ' style="') !== false) {
$zerobit=str_replace(' style="', ' style="width:' . $width . 'px;height:' . $height . 'px;', $zerobit);
} else {
$zerobit=" style=\"width:" . $width . "px;height:" . $height . "px;\" ";
}
if (strpos($smodebit, "form_creator.php?slideshowlist=") === false) {
$smodebit.="\n if (smode != '0') document.getElementById('row').innerHTML+='> | | '; \n";
}
$tdid="";
} else {
$smodebit.="\n if (smode != '0') document.getElementById('row').innerHTML+='> | | '; \n";
}
$spush.="\n uarraydatauri.push('" . $surlprefix . $ifil . "'); \n";
$scnt++;
}
}
}
}
?>
- via RJM Programming Slideshow Presentation
iframe { width: 100%; height: 100%; }
td { vertical-align: top; }
";
}
?>
version below ... optionally get content via web browser (Windows right click, Mac OS X two finger gesture) ...