( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<?php
ob_start();
include("includes/limittext.php");
include('Connections/videoondemand.php');
require("DbSql.inc.php");
require("NewsSql.inc.php");
$db = new NewsSQL($DBName);
error_reporting(0);/*error_reporting(1);error_reporting(E_ALL);
ini_set('display_errors', 1);*/
/*set_time_limit(0) ;*/
function filter($arr) {
global $link;
return array_map(array($link, 'real_escape_string'), $arr);
}
include("protect.php");
$_GET = filter($_GET);
$_POST = filter($_POST);
$mode=$_GET["mode"];
function getEachFontLibrary($position)
{
$sql = "select * from fontcombination where fontid='$position'";
global $link;
$result = mysqli_query($link,$sql) or die(mysql_error());
$row = mysqli_fetch_assoc($result);
/*print_r($row);*/
return $row;
}
if(!empty($id)){$position=$_GET["id"];}else {$position=63;}
$row = getEachFontLibrary($position);
$title = 'Lorem ipsum dolor sit amet';
$body = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer non nunc lectus.Curabitur hendrerit bibendum enim dignissim tempus. Suspendisse non ipsum auctor metus consectetur eleifend. Fusce cursus ullamcorper sem nec ';
$title_font = 'assets/fonts/'.$row['title'].'.ttf'; //font used
$body_font = 'assets/fonts/'.$row['body'].'.ttf'; //font used
$titleincrease =$row['titleincrease']; //font used
$bodyincrease =$row['bodyincrease']; //font used
$otherincrease =$row['otherincrease']; //font used
$titlecapitalize =$row['titlecapitalize']; //font used
$bodycapitalize =$row['bodycapitalize']; //font used
$othercapitalize =$row['othercapitalize']; //font used
if($titlecapitalize == "1") {$title = strtoupper($title);}
if($bodycapitalize == "1") {$body = strtoupper($body);}
header ("Content-type: image/png");
$background = imagecreate (500, 250) or die ("Cannot Create image");
$bg_color = imagecolorallocate($background, 255, 255, 255);
$title_font_color = imagecolorallocate($background, 0, 0, 0 ); // Create blue color
$body_font_color = imagecolorallocate($background, 137, 137, 137 ); // Create blue color
$other = 'assets/fonts/TitilliumWeb-Light.ttf'; //font used
$other_color = 'assets/fonts/TitilliumWeb-ExtraLight_0.ttf'; //font used
$y = 60;
$x = 25;
$font_size = 20+$titleincrease;
imagettftext($background, $font_size, 0,$x, $y, $title_font_color, $title_font,$title);
// Starting Y position
$y = 40 +$y ;
$x = 25;
$font_size = 12+$bodyincrease;
$word_size = 55;
$letter_spacing =25;
// Break it up into pieces 125 characters long
$lines = explode('|', wordwrap($body, $word_size, '|'));
// Loop through the lines and place them on the image
foreach ($lines as $line)
{
imagettftext($background, $font_size, 0,$x, $y, $body_font_color, $body_font, $line);
// Increment Y so the next line is below the previous line
$y += $letter_spacing;
}
imagepng($background);
ob_end_flush();?>