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);
?>
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);
?>
Share
Improve this question
edited Dec 19, 2019 at 15:32
RiddleMeThis
3,8078 gold badges22 silver badges30 bronze badges
asked Dec 19, 2019 at 13:21
Konstantinos MasourasKonstantinos Masouras
11 bronze badge
4
|
1 Answer
Reset to default 1You could basically create a simple plugin, that will generate a shortcode. The function of this shortcode would be displaying the required images. You can choose between Ajax or maybe using the embedded PHP timer to trigger Ajax to retrieve the images. Then you embed this shortcode in your post or page (wherever you wish your images to be displayed).
Good luck.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744890016a4599354.html
copy
command, you should change them as they'll be in the edit history even if you remove the image – Tom J Nowell ♦ Commented Dec 19, 2019 at 14:05