Lid |
|
hello, jullie kennen het IRPG spel wel denk ik.
Nu heb ik dat zelf ook en ook die website.
maar daar krijg ik een paar errors
Citaat: Fatal error: Call to undefined function imageCreate() in /home/flux/public_html/ddrpg/makeworldmap.php on line 14
makeworldmap.php<?
session_start(); // sessions to generate only one map / person / 20s
include("config.php");
$file = fopen($irpg_db,"r");
fgets($file);
if (isset($_SESSION['time']) && time()-$_SESSION['time'] < 20) {
header("Location: maperror.png");
exit(0);
}
$_SESSION['time']=time();
$map = imageCreate(500,500);
$magenta = ImageColorAllocate($map, 255, 0, 255);
$blue = imageColorAllocate($map, 0, 128, 255);
$red = imageColorAllocate($map, 211, 0, 0);
ImageColorTransparent($map, $magenta);
while ($line=fgets($file)) {
list(,,,,,,,,$online,,$x,$y) = explode("\t",trim($line));
if ($online == 1) imageFilledEllipse($map, $x, $y, 3, 3, $blue);
else imageFilledEllipse($map, $x, $y, 3, 3, $red);
}
header("Content-type: image/png");
imagePNG($map);
imageDestroy($map);
?>
makeworldmap.php<? session_start(); // sessions to generate only one map / person / 20s include("config.php"); $file = fopen($irpg_db,"r"); if (isset($_SESSION['time']) && time()-$_SESSION['time'] < 20) { header("Location: maperror.png"); } $_SESSION['time']=time(); $map = imageCreate(500,500); $magenta = ImageColorAllocate($map, 255, 0, 255); $blue = imageColorAllocate($map, 0, 128, 255); $red = imageColorAllocate($map, 211, 0, 0); ImageColorTransparent($map, $magenta); while ($line=fgets($file)) { list(,,,,,,,,$online,,$x,$y) = explode("\t",trim($line)); if ($online == 1) imageFilledEllipse($map, $x, $y, 3, 3, $blue); else imageFilledEllipse($map, $x, $y, 3, 3, $red); } header("Content-type: image/png"); imagePNG($map); imageDestroy($map); ?>
Citaat: Warning: fopen(hits.db) [function.fopen]: failed to open stream: Permission denied in /home/flux/public_html/ddrpg/footer.php on line 8
Error: could not open file hits.db. 236 hits since Jul 13, 2004
Warning: fclose(): supplied argument is not a valid stream resource in /home/flux/public_html/ddrpg/footer.php on line 29
footer.php
<?php
$hits = file("hits.db");
$fp = fopen("hits.db", "w");
$thispage = explode("/",$_SERVER['PHP_SELF']);
$thispage = array_pop($thispage);
if ($fp == false) {
echo "Error: could not open file hits.db.";
}
foreach ($hits as $line) {
list($page,$numhits,$date) = explode("\t",trim($line));
if ($page == $thispage) {
++$numhits;
echo " $numhits hits since $date";
$found = 1;
}
if ($fp) {
fwrite($fp,"$page\t$numhits\t$date\n");
}
}
if (!$found && $fp) {
echo " 1 hit since ".date("M j, Y",time());
fwrite($fp,$thispage."\t1\t".date("M j, Y",time())."\n");
}
fclose($fp);
?>
footer.php <?php $fp = fopen("hits.db", "w"); $thispage = explode("/",$_SERVER['PHP_SELF']); if ($fp == false) { echo "Error: could not open file hits.db."; } foreach ($hits as $line) { if ($page == $thispage) { ++$numhits; echo " $numhits hits since $date"; $found = 1; } if ($fp) { fwrite($fp,"$page\t$numhits\t$date\n"); } } if (!$found && $fp) { } ?>
Citaat: Fatal error: Call to undefined function imageCreate() in /home/flux/public_html/ddrpg/makemap.php on line 9
makemap.php
<?
include("config.php");
session_start(); // sessions to generate only one map / person / 20s
if (isset($_SESSION['time']) && time()-$_SESSION['time'] < 20) {
header("Location: maperror.png");
exit(0);
}
$_SESSION['time']=time();
$map = imageCreate(500,500);
$user = substr($_GET['player'],0,30);
$stringx=$stringy=-1;
$file = file($irpg_db);
unset($file[0]);
foreach ($file as $line) {
list($username,,,,,,,,,,$x,$y) = explode("\t",trim($line));
if ($username == $user) {
$stringx = $x;
$stringy = $y;
break;
}
}
if ($stringx == $stringy && $stringx == -1) {
imageString($map,5,200,245,"NO SUCH USER",imagecolorallocate($map,255,0,0));
}
else {
$width = imageFontWidth(5);
$height = imageFontHeight(5);
if ($x+((strlen($user)+1)*$width) > 500) {
$stringx = $x - ((strlen($user)+1)*$width)-12;
}
if ($y+$height > 500) {
$stringy = $y - ($height/2)-2;
}
$magenta = imageColorAllocate($map,255,0,255);
imageColorTransparent($map,$magenta);
$brown = imagecolorallocate($map, 102, 51, 0);
$parchment = imagecolorallocate($map, 255, 255, 204);
// Avoid drawing a brown dot on a brown area
$rgb = imageColorAt($map, $x, $y);
if ($rgb > 0) { // $rgb is 0 on our parchment-colored areas
$temp = $brown;
$brown = $parchment;
$parchment = $temp;
}
// YOU ARE HERE
imageFilledEllipse($map, $x, $y, 6, 6, $brown);
// background for text
imageFilledRectangle($map,$stringx+6,$stringy-($height/2),$stringx+6+$width*(strlen($user)+1),$stringy+($height/2),$brown);
// text itself
imageString($map,5,$stringx+7+($width/2),$stringy-($height/2)-1,$user,$parchment);
}
header("Content-type: image/png");
imagePNG($map);
imageDestroy($map);
?>
makemap.php <? include("config.php"); session_start(); // sessions to generate only one map / person / 20s if (isset($_SESSION['time']) && time()-$_SESSION['time'] < 20) { header("Location: maperror.png"); } $_SESSION['time']=time(); $map = imageCreate(500,500); $user = substr($_GET['player'],0,30); $stringx=$stringy=-1; foreach ($file as $line) { list($username,,,,,,,,,,$x,$y) = explode("\t",trim($line)); if ($username == $user) { $stringx = $x; $stringy = $y; break; } } if ($stringx == $stringy && $stringx == -1) { imageString($map,5,200,245,"NO SUCH USER",imagecolorallocate($map,255,0,0)); } else { $width = imageFontWidth(5); $height = imageFontHeight(5); if ($x+((strlen($user)+1)*$width) > 500) { $stringx = $x - ((strlen($user)+1)*$width)-12; } if ($y+$height > 500) { $stringy = $y - ($height/2)-2; } $magenta = imageColorAllocate($map,255,0,255); imageColorTransparent($map,$magenta); $brown = imagecolorallocate($map, 102, 51, 0); $parchment = imagecolorallocate($map, 255, 255, 204); // Avoid drawing a brown dot on a brown area $rgb = imageColorAt($map, $x, $y); if ($rgb > 0) { // $rgb is 0 on our parchment-colored areas $temp = $brown; $brown = $parchment; $parchment = $temp; } // YOU ARE HERE imageFilledEllipse($map, $x, $y, 6, 6, $brown); // background for text imageFilledRectangle ($map,$stringx+6,$stringy-($height/2),$stringx+6+$width*(strlen($user)+1),$stringy+($height/2),$brown); // text itself imageString($map,5,$stringx+7+($width/2),$stringy-($height/2)-1,$user,$parchment); } header("Content-type: image/png"); imagePNG($map); imageDestroy($map); ?>
|