How to add a PHP scripts into WordPress
I have some PHP scripts around 60, which contains images that every 10 secs are refreshing, the source is from a live streaming server.
My question is how to add them to WP? Some the code is on the image
The result, in the end, should be an image that is refreshing every 10 secs. Any ideas? Should I create a shortcode? and insert the code inside? Any plugin?
<?php
ini_set(“default_socket_timeout”, 10);
// Report all PHP errors (see changelog)
error_reporting(0);
date_default_timezone_set(“Europe/Athens”);
copy(“http:/streaming/channels/1/picture”, “temp.jpg”);
header(‘Content-Type: image/jpeg’);
$cam_me = @imagecreatefromjpeg(‘temp.jpg’);
//йахояислос вяылатым
$white = imagecolorallocate($cam_me, 255, 255, 255);
$grey = imagecolorallocate($cam_me, 128, 128, 128);
$blue = imagecolorallocate($cam_me, 0, 0, 200);
$black = imagecolorallocate($cam_me, 0, 0, 0);
$offblack = imagecolorallocate($cam_me, 30, 30, 30);
//LOGO
$cam_logo = @imagecreatefrompng(‘logo.png’);
$cam_logo2 = @imagecreatefromjpeg(‘logo2.jpg’);
//Create blue frame
imagefilledrectangle($cam_me, 0, 0, 2688, 30, $blue);
//
//Font
$font = ‘tahoma.ttf’;
//елжамисг омолатос йалеяас
imagettftext($cam_me, 25, 0, 800, 30, $white, $font, “Σαμαρίνα Πλατεία” );
imagettftext($cam_me, 30, 0, 2460, 1265, $white, $font, “” );
imagettftext($cam_me, 30, 0, 0, 1350, $white, $font, “” );
imagettftext($cam_me, 40, 0, 2100, 1390, $white, $font, “” );
//Import LOGO
imagecopy($cam_me, $cam_logo, 1600, 80, 0, 0, 300,129);
imagecopy($cam_me, $cam_logo2, 2500, 1338, 0, 0, 161, 160);
imagejpeg($cam_me);
imagejpeg($cam_me, ‘samarinaplateia.jpg’);
imagedestroy($cam_me);
imagedestroy($cam_logo);
imagedestroy($cam_logo2);
?>
Leave an answer
You must login or register to add a new answer .