murrtex |
11-18-2005 11:23 AM |
it works great on my site..but otherwise i have another subdomain..and it does not wrok on it...why?
my subdomain wall.php
HTML Code:
<?
//////////////////////////// COPYRIGHT NOTICE //////////////////////////////
// This script is a software application written by Michael Pierce. //
// You are free to use this script on your site, but you may not claim //
// the product as your own or redistribute the contents of this ZIP file //
// without express written permission. //
// //
// http://www.mpdev.net packetjunkie@gmail.com //
// //
// GraffitiWall ? 2003-2005, Michael Pierce //
// //
// We are not resposible for any use of this script on your servers. //
////////////////////////////////////////////////////////////////////////////
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'graffiti');
define('NO_REGISTER_GLOBALS', 1);
// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();
// get special data templates from the datastore
$specialtemplates = array();
// pre-cache templates used by all actions
$globaltemplates = array();
// pre-cache templates used by specific actions
$actiontemplates = array();
require("global.php");
$vbulletin->input->clean_array_gpc('p', array(
'painttext' => TYPE_STR,
'adminreset' => TYPE_UINT,
));
if ( isset($vbulletin->GPC['painttext']) ) $painttext = $vbulletin->GPC['painttext'];
if ( isset($vbulletin->GPC['adminreset']) ) $adminreset = $vbulletin->GPC['adminreset'];
$pathto = "D:/home/vhosts/4umturk.com/subdomains/18/httpdocs/forum";
if ($painttext != '') {
$string = stripslashes("$painttext");
// You can keep a log of text sent to your wall by uncommenting this section
//$ip = IPADDRESS;
//$fd = fopen("$pathto/efgraffiti.txt","a");
//$debugtext = "$string | $ip | ".$bbuserinfo['username']."\n";
//fwrite($fd, $debugtext);
//fclose($fd);
//$string = ereg_replace( "[^a-zA-Z0-9.!]", "", $string );
$string = strtolower($string);
# feel free to add your own censored words, or put in your own replacements
$string = str_replace( "www", "", $string );
$fonts = array( "skate.ttf", "grand.ttf", "say.ttf", "tagster.ttf", "graffiti.ttf", "inthcity.ttf" );
$pickfont = $fonts[array_rand( $fonts )];
$fontfile = "$pathto/fonts/$pickfont";
$graffitifile = "$pathto/graffiti.png";
if ( $pickfont == "grand.ttf" ) $sizes = array( "16", "18", "20", "22" );
elseif ( $pickfont == "skate.ttf" ) $sizes = array( "12", "14", "16", "18" );
else
$sizes = array( "18", "20", "22" );
$fontsize = $sizes[array_rand( $sizes )];
$angles = array( "0", "5", "15", "20", "30", "-5", "-15", "-20", "-30" );
$textangle = $angles[array_rand( $angles )];
$picwidth = 1024;
$picheight = 600;
if ( !file_exists($graffitifile) || ($adminreset == 1 && can_moderate()) ) {
$myimage = ImageCreate($picwidth, $picheight);
$newimage = 1;
}
else {
$myimage = ImageCreateFromPng($graffitifile);
$newimage = 0;
}
$black = ImageColorAllocate($myimage, 0, 0, 0);
$red = ImageColorAllocate($myimage, 255, 0, 0);
$randcolor = rand(1,9);
if ( $randcolor == 1 ) $color = ImageColorAllocate($myimage, 255, 255, 0);
elseif ( $randcolor == 2 ) $color = ImageColorAllocate($myimage, 255, 165, 0);
elseif ( $randcolor == 3 ) $color = ImageColorAllocate($myimage, 255, 20, 147);
elseif ( $randcolor == 4 ) $color = ImageColorAllocate($myimage, 255, 0, 0);
elseif ( $randcolor == 5 ) $color = ImageColorAllocate($myimage, 255, 255, 255);
elseif ( $randcolor == 6 ) $color = ImageColorAllocate($myimage, 0, 255, 255);
elseif ( $randcolor == 7 ) $color = ImageColorAllocate($myimage, 255, 0, 255);
else $color = ImageColorAllocate($myimage, 0, 255, 0);
if ( $newimage == 1 ) {
ImageFilledRectangle($myimage, 0, 0, $picwidth, $picheight, $black);
ImageColorTransparent($myimage, $black);
$string = "18.4umTurk.com";
}
list($pos_blx, $pos_bly, $pos_brx, $pos_bry, $pos_trx, $pos_try, $pos_tlx, $pos_tly) = imagettfbbox($fontsize, $textangle, $fontfile, $string);
$textwidth = $pos_brx - $pos_blx;
$textheight = $pos_bry - $pos_bly;
do {
$randw = rand(0,($picwidth-20));
} while( (($randw+$textwidth) > $picwidth) );
$start_x = $randw;
do {
$randh = rand(0,($picheight-20));
} while( (($randh+$textheight) > $picheight) || (($randh-$textheight) < 0) );
$start_y = $randh;
imagettftext($myimage, $fontsize, $textangle, $start_x, $start_y, $color, $fontfile, $string);
ImagePng($myimage, $graffitifile);
ImageDestroy($myimage);
header("Location: http://18.4umturk.com/forum/wall.php");
exit;
}
$navbits = array();
$navbits[$parent] = 'Graffiti Wall';
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
$styleinclude = process_replacement_vars($styleinclude);
$headinclude = process_replacement_vars($headinclude);
$header = process_replacement_vars($header);
$navbar = process_replacement_vars($navbar);
$vbheader = "$stylevar[htmldoctype]
<html dir=\"$stylevar[textdirection]\" lang=\"$stylevar[languagecode]\">
<head>
<title>18.4umTurk Graffiti Wall - Duvar Yazıları</title>
$styleinclude
$headinclude
</head>
<body>
$header
$navbar";
print $vbheader;
?>
<form method="post" action="wall.php">
<table border="0" cellspacing="0" cellpadding="0" align="center" background="images/bricks.jpg">
<tr>
<td align="left">
<img src="graffiti.png?<? echo rand(10000,99999); ?>">
</td>
</tr>
<?php
if ( $vbulletin->userinfo['userid'] ) {
echo<<<INPUTTEXT
<tr>
<td align="center" class="alt1">
<input type="text" name="painttext" style="font-size: 8pt;" size="25" maxlength="25" value="" />
<input type="submit" value="Paint It!" style="font-size: 8pt;" />
INPUTTEXT;
if ( can_moderate() ) {
echo<<<INPUTTEXT
<br /><input type="checkbox" name="adminreset" value="1" /> Wipe Wall</font>
INPUTTEXT;
}
echo<<<INPUTTEXT
</td>
</tr>
INPUTTEXT;
}
?>
</table>
<br />
</form>
<?php
eval('$vbfooter = "' . fetch_template('footer') . '";');
$vbfooter = process_replacement_vars($vbfooter);
$vbfooter = "</div>$vbfooter";
print $vbfooter;
?>
and when i want to write something i get following error;
Warning: imagepng(): Unable to open 'D:/home/vhosts/4umturk.com/subdomains/18/httpdocs/forum/graffiti.png' for writing in \wall.php on line 128
Warning: Cannot modify header information - headers already sent by (output started at D:\home\vhosts\4umturk.com\subdomains\18\httpdocs\ forum\includes\class_core.php:2948) in \wall.php on line 131
and my graffiti.png chmod is 777
|