PHP GD Image and Cron - HELP
$30-50 USD
Kiszállításkor fizetve
I've been tearing my hair out with this >:( I want to generate dynamic forum images using this script:
[php]<?php
if($connect==true){$online=$serverdetails['players'] . ' / '.$serverdetails['max_players'].' players' ; } else { $online='offline'; }
echo '<img src="[url removed, login to view]'.$row['servername'].'&votes='.$row['lastmonthvotes'].'&id='.$row['id'].'&ip='.$row['ip'].'&online='.$online.'&rank='.$row['position'].'" />"';
?>[/php]
This script is what generates the images (I've included the entire script in case I flipped something up elsewhere). Here is [url removed, login to view]:
[php]<?php
header( "Content-type: image/gif" );
// destroy the image in memory to free up server resources
ImageDestroy($gif);
$servername = $_GET['name'];
$rank = $_GET['rank'];
$ip = $_GET['ip'];
$id = $_GET['id'];
$online = $_GET['online'];
$votes = $_GET['votes'];
$image_path = "/var/www/html/serverfinder/img/server_".$id.".gif";
$gif = imagecreatefromgif('/var/www/html/serverfinder/img/[url removed, login to view]');
$yellow = imagecolorallocate($gif, 255, 255, 0);
$white = imagecolorallocate($gif, 255, 255, 255);
$font = '/var/www/html/serverfinder/[url removed, login to view]';
$initialX = '15';
$initialY = '25';
$increaseY = '8';
$fontSize = '14';
$fontRotation = '0';
$fontSizeSmall = '9';
$firstline = $servername;
$secondline = $ip . ' - ' . $online;
$thirdline = 'ranked #' . $rank . ' with ' . $votes . ' votes';
//imagestring($gif, $font, $px, 20, $string, $black);
imagettftext($gif, $fontSize, $fontRotation, $initialX, $initialY, $white, $font, $firstline);
imagettftext($gif, $fontSizeSmall, $fontRotation, $initialX, $initialY+$increaseY+$increaseY, $yellow, $font, $secondline);
imagettftext($gif, $fontSizeSmall, $fontRotation, $initialX, $initialY+$increaseY+$increaseY+$increaseY+$increaseY, $yellow, $font, $thirdline);
imagegif($gif);
// now save a copy of the new image to the cache directory
Imagegif($gif, $image_path);
// send the new image to the browser
Imagegif($gif);
?>
[/php]
[url removed, login to view] is supposed to save the new banners to the /img directory. Now this works perfectly when I manually got to [url removed, login to view] (after about 30 seconds of loading) but does not work when I cron it. Whenever I cron, I get the correct out put, but it doesn't write to the directory. It just spits out code.
Any ideas? I really have no idea :( I need this done TODAY, will hire you if you have a reasonable price.
Projektazonosító: #2374458
A projektről
Odaítélve:
4 szabadúszó tett átlagosan 43$ összegű árajánlatot erre a munkára
Hi There, I got it what's wrong going on there, will tell you also how to solve it and I'll resolve it immediately.