GetAnimation();
?>
";
$lastbitfrom="echo \$gif->GetAnimation();";
$lastbitto="\$fp = fopen('animegif.gif', 'w');
\$data = \$gif->GetAnimation();
\$dataUri = 'data:image/gif;base64,' . base64_encode(\$data);
fwrite(\$fp, \$data);
fclose(\$fp);
\$fp = fopen('animegif.html', 'w');
fwrite(\$fp, '
Data URI version below
... via web browser (Windows right click, Mac OS X two finger gesture) ...
');
fclose(\$fp);";
$agtext="";
$url="";
function inhouseslideshow($uarray,$uarraydatauri) {
global $agtext;
if (sizeof($uarray) == 0) return "";
$sofar=" \n";
$sofar.=" \n";
$sofar.="" . $agtext . " - via RJM Programming Slideshow Presentation \n";
$sofar.=" \n ";
$sofar.="" . $agtext . " \n ";
$sofar.=" \n ";
$sofar.=" \n ";
$sofar.="Slideshow version below
... optionally get content via web browser (Windows right click, Mac OS X two finger gesture) ...
\n ";
$sofar.="
\n ";
$sofar.=" \n ";
$sofar.="@--> | | \n ";
//for ($iqw=1; $iqw--> | \n ";
//}
return $sofar . "
\n\n";
}
function server_remote_addr() {
$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 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); ";
$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']);
$eachone=str_replace("[]=40;", "[]=" . $delay . ";", $eachone);
$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++;
while (isset($_GET['slideshow' . $icnt]) || isset($_POST['slideshow' . $icnt])) {
if (sizeof($ismulti) == 0) {
if (strpos($url,".") !== false) {
$ismulti[sizeof($ismulti)]=$url;
$ismultidatauri[sizeof($ismultidatauri)]='data:image/' . str_replace('jpg','jpeg',strtolower(explode('.',$url)[-1 + sizeof(explode('.',$url))])) . ';base64,' . base64_encode(file_get_contents($url));
}
}
if (isset($_GET['slideshow' . $icnt])) {
$url=($_GET['slideshow' . $icnt]);
if (strpos($url,".") !== false) {
$ismulti[sizeof($ismulti)]=$url;
$ismultidatauri[sizeof($ismultidatauri)]='data:image/' . str_replace('jpg','jpeg',strtolower(explode('.',$url)[-1 + sizeof(explode('.',$url))])) . ';base64,' . base64_encode(file_get_contents($url));
}
}
if (isset($_POST['slideshow' . $icnt])) {
$url=($_POST['slideshow' . $icnt]);
if (strpos($url,".") !== false) {
$ismulti[sizeof($ismulti)]=$url;
$ismultidatauri[sizeof($ismultidatauri)]='data:image/' . str_replace('jpg','jpeg',strtolower(explode('.',$url)[-1 + sizeof(explode('.',$url))])) . ';base64,' . base64_encode(file_get_contents($url));
}
}
$shtml.=' src="' . $url . '" ';
$icnt++;
}
if (sizeof($ismulti) > 0) {
$ofp = fopen('slideshow.html', 'w');
fwrite($ofp, inhouseslideshow($ismulti,$ismultidatauri));
fclose($ofp);
$extras=" Animated GIF Data URI version Slideshow versions";
} else {
$extras=" Animated GIF Data URI version";
}
}
$photos=explode(' src="', $shtml);
if (sizeof($photos) > 1) {
$atext=$agtext;
$wasprefix=$prefix;
for ($io=1; $ioPreview Below ... Animated GIF (Later) (Way) Below
";
$imagegif.="
";
if (sizeof($ismulti) > 0) {
$imagegifandthen.="document.getElementById('idiv').innerHTML+=\"
Preview Above ... Animated GIF Below
Data URI version Top Animated GIF Slideshow Data URI
Slideshow
" . "\";";
} else {
$imagegifandthen.="document.getElementById('idiv').innerHTML+=\"
Preview Above ... Animated GIF Below
Top Animated GIF
" . "\";";
}
}
} //else {
echo "
Tutorial Slideshow to Animated GIF
Tutorial Slideshow to Animated GIF" . $moreh1 . "
";
//}
?>