Jump to content

CrazeD

Members
  • Posts

    136
  • Joined

  • Last visited

    Never

Everything posted by CrazeD

  1. I'm trying to make an articles system, where you put the article in a textarea and when you view the page PHP splits it into pages. I know how to do pagination, but I'm not really sure how to go about splitting the article into pages the way I want. Just splitting into pages isn't a problem, however I'd like it to be split where specified. So far I have two ways to do that, one would be using Javascript to create multiple textarea's for each page section, and the other would be to insert, for example, {PAGE2} into the article where it would be split and have PHP parse it. For either method, I'll probably still have {PAGE2} (or whatever) entered to be parsed by PHP. The problem is, I don't really know how to parse a string and execute code if certain criteria is met. If anyone understands what I'm trying to do, can you please help in any way? Thanks.
  2. I kind of figured I opened Flash and edited it... HOW do I edit it in Flash? This is what I see when I double click the sprite: http://i13.photobucket.com/albums/a283/crazed_rider/flash.jpg Care to tell me where I'm supposed to edit the code? Thanks...
  3. Well yes, I get that. HOW do I change it? From where I got that code, I can't edit it. I have to edit it in Flash.
  4. I'm not stealing anything. The games are from a free plugin for e107. All I want to do is change the link that uploads the high score, so that it will work on my site.
  5. I'm trying to add some free flash arcade games to my site. I have the swf files. I got a SWF decompiler to get the FLA file. In the SWF decompiler I found the thing I need. It's under the actionscript and it's called 'sprite123'. It has the link I need to edit which uploads the score for the arcade game. So. I open the FLA in Flash and find the sprite123. But, I have not even a clue what I'm doing with it. How can I change the link to what I need? This is the code I see in the SWF decompiler: // Action script... // [Action in Frame 33] stop (); sendscore = new LoadVars(); sendscore.gname = "hybrid_fighter"; sendscore.gscore = _root.score; sendscore.send("index.php?act=Arcade&do=newscore", "_self", "POST"); name_txt.restrict = "A-Z 0-9.:\\-"; name_txt.text = _root.game_so.data.playerName; Selection.setFocus(name_txt); Selection.setSelection(name_txt.length, name_txt.length); newGame_btn.onRelease = function () { _root.gotoandstop(2); }; I need to change the "sendscore.send" link. Can anyone help please?
  6. Ok I got it to work...kind of. It's heavily distorting the second image. I Googled that for a bit and it seems a lot of people have problems with that but no answers. Can somebody help me with this? The images are all in png, and I tried gif and jpeg as well. http://72.37.226.250/test_monitor.php?ip=72.37.226.250:28960 Original image: http://72.37.226.250/images/maps/shipment.png Code: $get_map_image = explode ('_', $data['mapname']); $get_map_image = $get_map_image[1]; if (file_exists ('images/maps/'.$get_map_image.'.png')) { $map_image = imagecreatefrompng ('images/maps/'.$get_map_image.'.png'); } else { $map_image = imagecreatefrompng ('images/maps/'.$map_image.'.png'); } $image = imagecreate (220,$size); $background = imagecolorallocate($image, 0, 0, 0); $fontColor = imagecolorallocate($image, 255, 255, 255); imagestring($image, 3, 70, 175, $map, $fontColor); imagestring($image, 3, 10, 200, $hostname, $fontColor); imagestring($image, 3, 10, 215, $ip, $fontColor); imagestring($image, 3, 10, 230, $game, $fontColor); imagestring($image, 3, 10, 245, $numplayers, $fontColor); imagestring($image, 3, 10, 260, $gametype, $fontColor); imagestring($image, 3, 10, 275, $version, $fontColor); imagestring($image, 3, 10, 300, 'PLAYERLIST', $fontColor); imagecopymerge ($image, $map_image, 35, 20, 0, 0, 150, 150, 100); if ($player[1]['name'] == '') { imagestring($image, 3, 10, 320, 'Server is empty', $fontColor); } else { imagestring($image, 3, 10, 320, 'Name', $fontColor); imagestring($image, 3, 123, 320, 'Score', $fontColor); imagestring($image, 3, 178, 320, 'Ping', $fontColor); $pos = 335; for ($i = 1; $i <= $playerCount; $i++) { $pos = $pos+15; imagestring($image, 3, 10, $pos, $player[$i]['name'], $fontColor); imagestring($image, 3, 123, $pos, $player[$i]['score'], $fontColor); imagestring($image, 3, 178, $pos, $player[$i]['ping'], $fontColor); } } Header("Content-type: image/png"); imagepng($image); imagedestroy($image); I'd really appreciate some help, I'd like to get this done soon. Thanks!
  7. I looked over that and was a little confused, and couldn't make it work. $image = imagecreate (220,$size); $image2 = imagecreatefrompng ('images/maps/overgrown.png'); $background = imagecolorallocate($image, 0, 0, 0); $fontColor = imagecolorallocate($image, 255, 255, 255); imagestring($image, 3, 10, 5, $hostname, $fontColor); /*imagestring($image, 3, 10, 20, $ip, $fontColor); imagestring($image, 3, 10, 35, $game, $fontColor); imagestring($image, 3, 10, 50, $map, $fontColor); imagestring($image, 3, 10, 65, $numplayers, $fontColor); imagestring($image, 3, 10, 80, $gametype, $fontColor); imagestring($image, 3, 10, 95, $version, $fontColor); imagestring($image, 3, 10, 120, 'PLAYERLIST', $fontColor);*/ imagecopymerge ($image, $image2, 0, 0, 0, 0, 180, 180); /*if ($player[1]['name'] == '') { imagestring($image, 3, 10, 135, 'Server is empty', $fontColor); } else { imagestring($image, 3, 10, 135, 'Name', $fontColor); imagestring($image, 3, 123, 135, 'Score', $fontColor); imagestring($image, 3, 178, 135, 'Ping', $fontColor); $pos = 150; for ($i = 1; $i <= $playerCount; $i++) { $pos = $pos+15; imagestring($image, 3, 10, $pos, $player[$i]['name'], $fontColor); imagestring($image, 3, 123, $pos, $player[$i]['score'], $fontColor); imagestring($image, 3, 178, $pos, $player[$i]['ping'], $fontColor); } }*/ Header("Content-type: image/png"); imagepng($image); imagedestroy($image); Don't mind the commented out stuff, I'm just trying to make this work before that stuff comes into play. What am I doing wrong? Thanks.
  8. I'm working on my game-server monitor and would like to include map images above all of it. I can't run the script directly on my webhost, so I have it running on my dedicated game-server box, generated by an image. So, I need to know how to generate two images and put one over the other...if that makes sense. Here's my existing code for the image with the regular text details: $image = imagecreate (220,$size); $background = imagecolorallocate($image, 0, 0, 0); $fontColor = imagecolorallocate($image, 255, 255, 255); imagestring($image, 3, 10, 5, $hostname, $fontColor); imagestring($image, 3, 10, 20, $ip, $fontColor); imagestring($image, 3, 10, 35, $game, $fontColor); imagestring($image, 3, 10, 50, $map, $fontColor); imagestring($image, 3, 10, 65, $numplayers, $fontColor); imagestring($image, 3, 10, 80, $gametype, $fontColor); imagestring($image, 3, 10, 95, $version, $fontColor); imagestring($image, 3, 10, 120, 'PLAYERLIST', $fontColor); if ($player[1]['name'] == '') { imagestring($image, 3, 10, 135, 'Server is empty', $fontColor); } else { imagestring($image, 3, 10, 135, 'Name', $fontColor); imagestring($image, 3, 123, 135, 'Score', $fontColor); imagestring($image, 3, 178, 135, 'Ping', $fontColor); $pos = 150; for ($i = 1; $i <= $playerCount; $i++) { $pos = $pos+15; imagestring($image, 3, 10, $pos, $player[$i]['name'], $fontColor); imagestring($image, 3, 123, $pos, $player[$i]['score'], $fontColor); imagestring($image, 3, 178, $pos, $player[$i]['ping'], $fontColor); } } Header("Content-type: image/png"); imagepng($image); imagedestroy($image); I just need to know how to generate another image (using imagecreatefrompng ()) and then place it "over" (on) my other image. Sorry if that's confusing, but I really need some help with this. I tried to Google it, but for lack of a better search term I didn't really find anything. Thanks.
  9. Because I don't know how to do that. It's okay though, I have it running on my dedicated game server box now. http://72.37.226.250/monitor.php?ip=72.37.226.250:28960
  10. Yup....I emailed the support and they said every port other than 80 and 443 are blocked. Bunk. Oh well, I'll just use my dedicated server box instead...hehe. Thanks for the help.
  11. sleep (10) didn't work. I put this in: if (!fwrite ($fp, $challenge)) { print 'fwrite() failed<br />'; } And it didn't display the error, so I guess the problem would be with fread then, eh? Do you think it's a problem with my code or with the hosting (as in, not allowed)? Thanks for the help.
  12. Thanks for the reply. Can you elaborate "wait till before fread"?
  13. The IP is correct. What exactly am I checking on that line? It works fine on my localhost, remember.
  14. I did... Line 41 is: fwrite ($fp, $challenge); I'm not positive but I think this is where it's going bad.
  15. Hi I'm trying to make a server monitor for Call of Duty 4. Everything works fine on my localhost, but when I upload it to my server, it doesn't work. <body bgcolor='#000000'> <?php $ip = '8.9.9.13'; // Server IP $port = '28960'; // Server Port $cellColor = '#101010'; // Cell Background Color $borderColor = '#9d9d9d'; // Table Border Color $fontColor = '#ffffff'; // Text Color $width = '300px'; // Overall Table Width print '<style type="text/css"> .gentext { font-family: serif; color: '.$fontColor.'; font-size: 12pt; } .infotable { border: 1px; border-style: solid; border-width: thin; border-color: '.$borderColor.'; border-collapse: collapse; } </style>'; $challenge = "\xFF\xFF\xFF\xFFgetstatus"; $fp = @fsockopen ('udp://'.$ip, $port, $errno, $errstr, 1); if (!$fp) { print 'Connection Refused!'; } stream_set_timeout ($fp, 1, 0); stream_set_blocking ($fp, true); fwrite ($fp, $challenge); $buffer = fread ($fp, 4096); fclose ($fp); if (!$buffer) { print 'Buffer Empty!'; } $rawdata = explode ("\n", $buffer); array_pop ($rawdata); $rawitem = explode ("\\", $rawdata[1]); foreach ($rawitem as $key => $value) { $value = strtolower ($value); $value = preg_replace ("/\^./", "", $value); $rawitem[$key + 1] = preg_replace ("/\^./", "", $rawitem[$key + 1]); $setting[$value] = $rawitem[$key + 1]; } $data['gamemod'] = $setting['gamename']; $data['hostname'] = $setting['sv_hostname']; $data['mapname'] = $setting['mapname']; $data['players'] = $rawdata[2] ? count($rawdata) - 2 : 0; $data['maxplayers'] = $setting['sv_maxclients']; $data['password'] = $setting['g_needpass']; $data['gametype'] = $setting['g_gametype']; $data['version'] = $setting['shortversion']; array_shift ($rawdata); array_shift ($rawdata); foreach ($rawdata as $key => $value) { preg_match("/(.*) (.*) \"(.*)\"/", $value, $match); $player[$key + 1]['score'] = $match[1]; $player[$key + 1]['ping'] = $match[2]; $player[$key + 1]['name'] = $match[3]; $player[$key + 1]['name'] = preg_replace ("/\^./", "", $player[$key + 1]['name']); } print '<table border="1" class="infotable" width="'.$width.'"> <tr> <td bgcolor="'.$cellColor.'" align="left" class="gentext"><b>Name:</b></td> <td bgcolor="'.$cellColor.'" align="left" class="gentext" colspan="2">'.$data['hostname'].'</td> </tr> <tr> <td bgcolor="'.$cellColor.'" align="left" class="gentext"><b>IP:</b></td> <td bgcolor="'.$cellColor.'" align="left" class="gentext" colspan="2">'.$ip.':'.$port.'</td> </tr> <tr> <td bgcolor="'.$cellColor.'" align="left" class="gentext"><b>Game:</b></td> <td bgcolor="'.$cellColor.'" align="left" class="gentext" colspan="2">'.$data['gamemod'].'</td> </tr> <tr> <td bgcolor="'.$cellColor.'" align="left" class="gentext"><b>Map:</b></td> <td bgcolor="'.$cellColor.'" align="left" class="gentext" colspan="2">'.$data['mapname'].'</td> </tr> <tr> <td bgcolor="'.$cellColor.'" align="left" class="gentext"><b>Gametype:</b></td> <td bgcolor="'.$cellColor.'" align="left" class="gentext" colspan="2">'.ucfirst ($data['gametype']).'</td> </tr> <tr> <td bgcolor="'.$cellColor.'" align="left" class="gentext"><b>Version:</b></td> <td bgcolor="'.$cellColor.'" align="left" class="gentext" colspan="2">'.$data['version'].'</td> </tr> <tr> <td bgcolor="'.$cellColor.'" align="left" class="gentext"><b>Players:</b></td> <td bgcolor="'.$cellColor.'" align="left" class="gentext" colspan="2">'.$data['players'].'</td> </tr> <tr> <td bgcolor="'.$cellColor.'" align="center" class="gentext" colspan="3"><b>PLAYERLIST</b></td> </tr>'; $playerCount = count ($player); if ($player[1]['name'] == '') { print '<tr> <td bgcolor="'.$cellColor.'" align="center" class="gentext" colspan="3">The server is empty.</td> </tr>'; } else { print '<tr> <td bgcolor="'.$cellColor.'" align="center" class="gentext"><b>Name</b></td> <td bgcolor="'.$cellColor.'" align="center" class="gentext"><b>Score</b></td> <td bgcolor="'.$cellColor.'" align="center" class="gentext"><b>Ping</b></td> </tr>'; for ($i = 1; $i <= $playerCount; $i++) { print '<tr> <td bgcolor="'.$cellColor.'" align="center" class="gentext">'.$player[$i]['name'].'</td> <td bgcolor="'.$cellColor.'" align="center" class="gentext">'.$player[$i]['score'].'</td> <td bgcolor="'.$cellColor.'" align="center" class="gentext">'.$player[$i]['ping'].'</td> </tr>'; } } print '</table>'; ?> The problem I get when I upload it is, "Buffer Empty!" It seems to have a problem with line 41, "fwrite ($fp, $challenge);" $challenge is "$challenge = "\xFF\xFF\xFF\xFFgetstatus";" I'm totally stumped here. Note that it connects fine, just that one bit on line 41 doesn't work. Is this because of my web host? I've tried 2 different hosts. Please help.
  16. I made a register script on my site and the Email always goes to spam, or at least for me and my friend it does (we both use Gmail). Is it part of my code that's doing this? How can I prevent it? The Email is not for spam, but rather to give the user an activation key and his login details. Here is the code for sending my Email: $email_body = "Thank you for signing up on the {ForsaKen} Clan website! ---------- Your login details: Username: ".$username." Password: ".$password." ---------- In order to login to the website, you must first activate your account. You can activate your account by clicking the link below: http://forsakenwarfare.com/register.php?act=activate&key=".$actkey." If the above link doesn't work, you may copy and paste the key at the link below: Key: ".$actkey." http://forsakenwarfare.com/register.php?act=activate If neither methods work, please contact the webmaster at the link below: http://forsakenwarfare.com/contact.php THIS IS AN AUTOMATED EMAIL, DO NOT REPLY ---------------- {ForsaKen} Clan"; mail ($email, 'ForsaKen Website Account Activation', $email_body, 'From: Forsaken Warfare'); Any help would be great, thanks.
  17. I used NOW(). I'll try what you said and see what I get.
  18. I have my date in MySQL, but I need to retrieve it. I'm making some forums, I need it to say when the post was submitted....which I can INSERT it, just can't get it back. It keeps putting the current date for all the posts, not the date in which they were entered. $date_entered = time ($post_row['date_entered']); $timestamp = date ('D M j, Y h:i A', $date_entered); $post_row refers to my SELECT query, where it gets the date in the MySQL table. This code here just outputs the current date/time, not what's in the database. Can anyone help? Thanks.
  19. I'm trying to make a website that's going to be using email for a lot of things. Rather than uploading my scripts every 10 seconds after changes are made, I like to do all the work on my WAMP server first. However I can't send mail. I tried downloading a few SMTP servers but I still can't get it to work. Any help please? I use AppServ as my WAMP.
  20. I had copied this script off a tutorial because I was too lazy to write my own. I ended up writing my own anyway and that fixed my problem. Thanks anyways guys.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.