\n\n";
}
function jserver_remote_addr() {
global $stfle;
$rma = $_SERVER['REMOTE_ADDR'];
$ua = strtolower($_SERVER['HTTP_USER_AGENT']);
// you can add different browsers with the same way ..
if(preg_match('/(chromium)[ \/]([\w.]+)/', $ua))
$rma = '000000'.$rma;
elseif(preg_match('/(chrome)[ \/]([\w.]+)/', $ua))
$rma = '00000'.$rma;
elseif(preg_match('/(safari)[ \/]([\w.]+)/', $ua))
$rma = '0000'.$rma;
elseif(preg_match('/(opera)[ \/]([\w.]+)/', $ua))
$rma = '000'.$rma;
elseif(preg_match('/(msie)[ \/]([\w.]+)/', $ua))
$rma = '00'.$rma;
elseif(preg_match('/(mozilla)[ \/]([\w.]+)/', $ua))
$rma = '0'.$rma;
return str_replace(":", "_", $rma);
}
function server_remote_addr() {
global $stfle;
$rma = $_SERVER['REMOTE_ADDR'];
$ua = strtolower($_SERVER['HTTP_USER_AGENT']);
// you can add different browsers with the same way ..
if(preg_match('/(chromium)[ \/]([\w.]+)/', $ua))
$rma = '000000'.$rma;
elseif(preg_match('/(chrome)[ \/]([\w.]+)/', $ua))
$rma = '00000'.$rma;
elseif(preg_match('/(safari)[ \/]([\w.]+)/', $ua))
$rma = '0000'.$rma;
elseif(preg_match('/(opera)[ \/]([\w.]+)/', $ua))
$rma = '000'.$rma;
elseif(preg_match('/(msie)[ \/]([\w.]+)/', $ua))
$rma = '00'.$rma;
elseif(preg_match('/(mozilla)[ \/]([\w.]+)/', $ua))
$rma = '0'.$rma;
if (isset($_GET['outfile'])) {
if (urldecode($_GET['outfile']) != "") {
$stfle=' ';
return urldecode($_GET['outfile']);
}
} else if (isset($_POST['outfile'])) {
if (urldecode($_POST['outfile']) != "") {
$stfle=' ';
return urldecode($_POST['outfile']);
}
}
return str_replace(":", "_", $rma);
}
function analyze($url) {
//$aprefix="../";
$aprefix="";
if (strpos($url, "//") === false && strpos($_SERVER['SERVER_NAME'], "rjmprogramming.com.au") !== false) return $aprefix;
if (strpos($url, "//") === false && strpos($_SERVER['SERVER_NAME'], "localhost") !== false) return $aprefix;
$aub=$_SERVER['REQUEST_URI'];
$xubf=explode("?", $aub);
$xubf[0]=str_replace("tutorial_to_animated_gif.php", "", str_replace("@!@","", str_replace("@!@/","", "@!@" . $xubf[0])));
$xubff=explode("/", $xubf[0]);
for ($ih=1; $ih 2) {
$xub=str_replace("/" . $xubff[sizeof($xubff) - 1], "/", $xubf[0]);
} else {
$xub=str_replace("@$@", "", str_replace("/@$@", "/", ($xubf[0] . "@$@")));
}
$ubf=explode("?", $url);
$ubff=explode("/", $ubf[0]);
if (strpos($ubff[sizeof($ubff) - 1], ".") !== false && (sizeof($ubff) - 1) > 2) {
$ub=str_replace("/" . $ubff[sizeof($ubff) - 1], "/", $ubf[0]);
} else {
$ub=str_replace("@$@", "", str_replace("/@$@", "/", ($ubf[0] . "@$@")));
}
$preubff=explode("rjmprogramming.com.au:80/", $ub);
if (sizeof($preubff) > 1) {
$aprefix.=$preubff[1];
} else {
$preubff=explode("rjmprogramming.com.au/", $ub);
if (sizeof($preubff) > 1) {
$aprefix.=$preubff[1];
} else {
$preubff=explode("localhost:8888/", $ub);
if (sizeof($preubff) > 1) {
$aprefix.=$preubff[1];
}
}
}
return $aprefix;
}
if (isset($_GET['slideshow']) || isset($_POST['slideshow'])) {
if (isset($_GET['slideshow'])) $url=($_GET['slideshow']);
if (isset($_POST['slideshow'])) $url=($_POST['slideshow']);
if (strpos($url, ' src="') !== false) {
$shtml=$url;
file_put_contents(server_remote_addr() . "_huh.html", $url);
$moreh1=" ... you have 10 seconds to change delay value as necessary";
//$imagegifandthen.="document.getElementById('slideshow').value='http://www.rjmprogramming.com.au/PHP/animegif/" . server_remote_addr() . "_huh.html'; setTimeout(and_then,10000); ";
$imagegifandthen.="document.getElementById('slideshow').value='//www.rjmprogramming.com.au/PHP/animegif/" . server_remote_addr() . "_huh.html'; setTimeout(and_then,10000); ";
$shtml="";
} else {
if (isset($_GET['slideshow'])) $shtml=@file_get_contents($_GET['slideshow']);
if (isset($_POST['slideshow'])) $shtml=@file_get_contents($_POST['slideshow']);
}
$prefix=analyze($url);
if (isset($_GET['delay'])) $delay=($_GET['delay']);
if (isset($_POST['delay'])) $delay=($_POST['delay']);
$videocmd=$videopath . "ffmpeg -r " . (1000 / $delay) . " -i " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "%03d.jpg " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "video.mp4 2> " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "video.bad";
$svideocmd="ffmpeg -r " . (1000 / $delay) . " -i " . "%03d.jpg " . "video.mp4";
if (!file_exists($videopath . "ffmpeg")) {
$videohtml="
No ffmpeg installed, so ... if you have in your local system ... at command line (in download directory, first removing any existant %03d.jpg files such as 001.jpg to 999.jpg) type (to end up with a video.mp4 video)
" . $svideocmd . "
... after downloading ...
open video.mp4
";
$videosuffix=" creation advice";
}
$eachone=str_replace("[]=40;", "[]=" . $delay . ";", $eachone);
$eachonestring=str_replace("[]=40;", "[]=" . $delay . ";", $eachonestring);
$gifphp=$agifphp;
if (isset($_GET['stitle'])) $agtext=($_GET['stitle']);
if (isset($_POST['stitle'])) $agtext=($_POST['stitle']);
if (strpos($shtml, ' src="') === false) {
$shtml=' src="' . $url . '" ';
$icnt++;
$jfilep="00";
$ijf=1;
$jf=1;
while (isset($_GET['slideshow' . $icnt]) || isset($_POST['slideshow' . $icnt])) {
if (sizeof($ismulti) == 0) {
if (strpos($url,".") !== false) {
$ismulti[sizeof($ismulti)]=$url;
if (file_exists('video.mp4')) unlink('video.mp4');
if (1 == 1) {
if (file_exists('001.jpg')) {
while (file_exists(substr(($jfilep . $jf),-3) . '.jpg')) {
unlink(substr(($jfilep . $jf),-3) . '.jpg');
$jf++;
}
}
if (file_exists($videopath . "ffmpeg")) {
file_put_contents(substr(($jfilep . $ijf),-3) . '.jpg', file_get_contents($url));
} else {
$videohtml=str_replace("