Jump to content

patawic

Members
  • Posts

    57
  • Joined

  • Last visited

    Never

Everything posted by patawic

  1. Well that was stupid of me, Completely forgot that you have to restart apache for it to reload the config. Fixed it by doing this Listen 80 NameVirtualHost * <VirtualHost *> ServerName www.gamerstats.net DocumentRoot C:\xampp\htdocs </VirtualHost> <VirtualHost *> ServerName card.gamerstats.net DocumentRoot C:\xampp\htdocs\card </VirtualHost>
  2. sorry for the delayed response, the edit button disappeared. It appears that i cant do it with a .htaccess file, as i have separate htaccess files in my card directories (eg. in the nxe folder) That handles further rewrites. It must be done in the httpd.conf file.
  3. My website (http://www.gamerstats.net) uses a domain of card.gamerstats.net to display gamercards. Recently my host had an issue with a harddrive that my server (is a vps, not web hosting) is hosted on and i was unable to retrieve my httpd.conf file which handled the subdomain. Basically i need to make the subdomain card.gamerstats.net mask over the top of gamerstats.net/card/ For example http://www.gamerstats.net/card/xbox/nxe/Xifictor/1/ would be masked as http://card.gamerstats.net/xbox/nxe/Xifictor/1/ A quick response would be wonderful as i need to get my website functioning as soon as possible I would prefer to do it using A records and httpd.conf But if its possible to do it using a .htaccess file, that will also work.
  4. I'm attempting to imitate the reflections on this image http://steamcard.com/do/nxe/patawic.png and i honestly have no idea where to start. Everything i've researched doesn't seem to be able to place hte reflection on a transparent background (ie they all fade out to white/black etc) is it possible to do it with inbuilt functions? or do i need to utilize something like imagemagick to do this. Thanks in advanced.
  5. wow thanks for all of your responses. Yeah my sql queries are a bit dodgy at the moment, Thanks for all of your help
  6. Hmm, it doesnt appear to, it must be an issue with firefox. (it only adds 1 when i use chrome) How would i go about resolving the issue with firefox?
  7. I have this script <?php header("content-type: image/png"); include '../../api/config.php'; include "../../api/api.php"; $gamercard = getInfo($_GET['gamertag']); updateStats($gamercard['Gamertag'], "Nxe", 75); $type = $_GET['type']; switch ($type) { case "dark": $type = "dark.png"; break; case "light": $type = "light.png"; break; default: $type = "dark.png"; break; } $image = imagecreatefrompng("$type"); $img = imagecreatetruecolor(imagesx($image), imagesy($image)); $avatar_l = imagecreatefrompng($gamercard["Avatarpic-l"]); $avatar_body = imagecreatefrompng($gamercard["Avatarpic-body"]); imagecopy($img, $image, 0, 0, 0, 0, imagesx($image), imagesy($image)); imagecopy($img, $avatar_l, 64, 7, 0, 0, imagesx($avatar_l), imagesy($avatar_l)); imagecopy($img, $avatar_body, 175, -40, 0, 0, imagesx($avatar_body), imagesy($avatar_body)); for($i = 1; $i <=count($gamercard["RecentGames"]); $i++) { $gameimg = imagecreatefromjpeg($gamercard["RecentGames"][$i]["Icon"]); $x = ($i-1)*35 + 10; imagecopy($img, $gameimg, $x, 77, 0, 0, imagesx($gameimg), imagesy($gameimg)); } $ColorText = imagecolorallocate($img, 255, 255, 255); ImageTTFText($img, 10, 0, 10, 127, $ColorText, "font.ttf", $gamercard['Gamertag']); ImageTTFText($img, 10, 0, 135, 127, $ColorText, "font.ttf", $gamercard['Gamerscore']); imagepng($img); imagedestroy($img); ?> which is made to call the updateStats() function 1 time everytime the page loads. Heres the function (its in api.php) function updateStats($gamertag, $type, $size) { $query = mysql_query("SELECT * FROM loadstats where Gamertag = '$gamertag' && Type = '$type'") or die(mysql_error()); $exists = mysql_num_rows($query); if ($exists == 0) { mysql_query("INSERT INTO loadstats (Gamertag, Type, Loads, Data) VALUES('$gamertag', '$type', '1', '$size' )") or die(mysql_error()); } else { $row = mysql_fetch_array($query); $newloads = $row['Loads'] + 1; $newdata = $row['Data'] + $size; mysql_query("UPDATE loadstats SET Loads = '$newloads' WHERE gamertag = '$gamertag' && Type = '$type'") or die(mysql_error()); mysql_query("UPDATE loadstats SET Data = '$newdata' WHERE gamertag = '$gamertag' && Type = '$type'") or die(mysql_error()); } } The wierd thing that is happening is, When i have the Header() set in the script, the updateStats() function appears to be called twice, but when the header is commented out, it is only called once. I can tell this by the change of data in the MYSQL database, the Loads value increases by 2 when the header is set, and it only creases by 1 when it isnt set. Any insight as to why this is happening would be greatly appreciated.
  8. turns out that google chrome doesnt like inline-table. I changed to inline-block and its working fine in every browser
  9. My website: http://xboxgamercard.net/ displays correctly in every browser that i have tried (firefox, IE7,IE8) but the navigation bar refuses to display correctly in chrome. Instead of being a horizontal menu, its displaying vertically, which looks terrible. The css for the menu is /* template menu */ #container{padding: 1px 15px 0 15px;background:#84BF00;} ul#simple-menu{list-style-type:none;width:100%;position:center;height:27px;font-family:"Trebuchet MS",Arial,sans-serif;font-size:13px;font-weight:bold;margin:0;padding:11px 0 0 0;float: center;} ul#simple-menu li{margin:0 0 0 4px;height:27px;} ul#simple-menu li.left{margin:0;} ul#simple-menu li a{display:inline-table;color:#000;background:#fff;line-height:27px;text-decoration:none;padding:0 17px 0 18px;height:27px;} ul#simple-menu li a.right{padding-right:19px;} ul#simple-menu li a:hover{color:#48A100;} html for the menu is just this <div id="container"> <ul id="simple-menu"><center><li><a href='#'>Link 1</a> <a href='#'>Link 2</a> <a href='#'>Link 3</a> </center></li></ul> </div> I have no idea how to fix it Any help will be greatly appreciated
  10. still havent managed to solve this :/
  11. yes i have it makes no difference.
  12. Im trying to make a script that previews the level for a game, but im having issues with transparency and the rotation of each image. you can see the problem here: http://beta.trackmill.com/DUI/preview/ here is the php file <?php header('Content-Type: image/png'); $image = imagecreatefrompng('images/Background.png'); function radiansToDegrees($radians) { return $radians * 180 / pi(); } $map = file_get_contents('map.txt'); $blocks = split("<obj", $map); for($i=2; $i<count($blocks); $i++) { $arg = split(" ", $blocks[$i]); $n = str_replace("n", "", str_replace("=", "", str_replace('"', "", $arg[1]))); $x = str_replace("x", "", str_replace("=", "", str_replace('"', "", $arg[2]))); $x = $x * 20 - 13; $y = str_replace("y", "", str_replace("=", "", str_replace('"', "", $arg[3]))); $y = $y * 22 + 15; $a = str_replace("a", "", str_replace("=", "", str_replace('"', "", $arg[4]))); $a = radiansToDegrees($a); $t = str_replace("t", "", str_replace("=", "", str_replace('"', "", $arg[5]))); $e = str_replace("e", "", str_replace("=", "", str_replace('"', "", $arg[6]))); $f = str_replace("f", "", str_replace("=", "", str_replace('"', "", str_replace('/>', "", $arg[7])))); $blockimage = imagecreatefrompng("images/$n.png"); $blockimage = imagerotate($blockimage, -$a, 0, 0) ; imagealphablending($blockimage, false); imagesavealpha($blockimage, true); imagecopy($image, $blockimage, $x, $y, 0, 0, imagesx($blockimage), imagesy($blockimage)); //echo "$i | $n - $x - $y - $a - $t - $e - $f <br>"; } imagepng($image); imagedestroy($image); ?> if you require the .zip containing the images etc, just reply and i will upload it as soon as possible
  13. Its ok guys, ive fixed it
  14. That script still makes it go 1,4,7 2,5,8 3,6,9 i need it to output as 1,2,3 4,5,6 7,8,9 :/
  15. update <?php include 'config.php'; mysql_connect($host, $user, $pass) or die(mysql_error()); mysql_select_db($database) or die(mysql_error()); $result = mysql_query("SELECT * FROM tracks ORDER BY id ASC"); $num = mysql_num_rows($result); $arr = array(); while($row = mysql_fetch_array($result)) { $arr[$row['id']] = $row; } echo '<div id="left_wrapper">'; for($i=1; $i<$num; $i+=2) { $row = $arr[$i]; $id = $row['id'] + 1; echo "<img src='Thumbnails/" . $id .".gif'></img><br />"; echo $row['name']. "<br />"; } echo "</div>"; echo '<div id="middle_wrapper">'; for ($i=2; $i<$num; $i+=2) { $row = $arr[$i]; $id = $row['id'] + 1; echo "<img src='Thumbnails/" . $id .".gif'></img><br />"; echo $row['name']. "<br />"; } echo "</div>"; echo '<div id="right_wrapper">'; for ($i=3; $i<$num; $i+=2) { $row = $arr[$i]; $id = $row['id'] + 1; echo "<img src='Thumbnails/" . $id .".gif'></img><br />"; echo $row['name']. "<br />"; } echo "</div>"; ?> Now its showing 1,2,3 3,4,6 6 I dont know what else to try
  16. Im trying to print several image url's and names from an sql database into 3 columns, Aiming to get it to go 1,2,3 4,5,6 7,8,9 etc etc. but for some reason myne is going 1,3,5 2,4,6 etc. Dont bother mentioning that my loops do nothing, i realised that about 10 minutes ago, Any help would be appreciated. <?php include 'config.php'; mysql_connect($host, $user, $pass) or die(mysql_error()); mysql_select_db($database) or die(mysql_error()); $result = mysql_query("SELECT * FROM tracks"); echo '<div id="left_wrapper">'; for ($i=0;$i<mysql_num_rows($result);$i+=3) { $row = mysql_fetch_array($result); $id = $row['id'] + 1; echo "<img src='Thumbnails/" . $id .".gif'></img><br>"; echo $row['name']. "<br>"; } echo "</div>"; echo '<div id="middle_wrapper">'; for ($i=1;$i<mysql_num_rows($result);$i+=3) { $row = mysql_fetch_array($result); $id = $row['id'] + 1; echo "<img src='Thumbnails/" . $id .".gif'></img><br>"; echo $row['name']. "<br>"; } echo "</div>"; echo '<div id="right_wrapper">'; for ($i=2;$i<mysql_num_rows($result);$i+=3) { $row = mysql_fetch_array($result); $id = $row['id'] + 1; echo "<img src='Thumbnails/" . $id .".gif'></img><br>"; echo $row['name']. "<br>"; } echo "</div>"; ?> i know each of those loops does nothing, But you can see where they are meant to do, Each div is aligned to different positions, first loop is left, 2nd is center, 3rd is right.
  17. its working somewhat, http://canvasrider.com/ But it should be appearing like the logo up the top here. But its not :/
  18. Im trying to make a script that draws the track for a game that i in development, Im stuck on something though. For some reason my script is drawing lines from 0,0 to the x,y of the start position to the x,y of the end position. I have no idea why. Here is the script <?php header ("Content-type: image/png"); $im = ImageCreate (700, 400); $background = ImageColorAllocate ($im, 255, 255, 255); $line = ImageColorAllocate ($im, 0, 0, 0); $trackcode = file_get_contents('test.txt'); $type = split("#", $trackcode); $line = split(",", $type[0]); $sline = split(",", $type[1]); for($i=0; $i<count($line); $i++) { $section = split(" ", $line[$i]); for($j=0; $j<count($section); $j+=2) { $startx = base_convert($section[$j],32,10); $starty = base_convert($section[$j+1],32,10); $endx = base_convert($section[$j+2],32,10); $endy = base_convert($section[$j+3],32,10); //echo "startx: $startx | starty: $starty | endx: $endx | endy: $endy <br>"; imageline ($im,$startx,$starty,$endx,$endy,$line); } } ImagePng ($im); ImageDestroy ($im); ?> You can echo the data if you want to see the raw coordinates. You will need to make a file called test.txt and put this in it for it to work 42 1i 5u a,8e a 8e -a 8e -u 8e -1i 92 -18 92 0 9m a aa 0 au -a au a,8e -1i 9m -26 au -1i aa -18 9m -1i 92 -18,6i a 84 a,b8 -a b8 a cg u d4 k do u do a do -a do -u cg -1i bs -18,do -u d4 -k bs -18,b8 -a bs -k bs 0 cg a d4 0 d4 -k,e2 k e2 -1i em -18,e2 -u em -k em u,fa -u fu -k gi -u fa -1i em -18,fu -k fu k fu u,gi k gi -u,fa -u em -k,6i a 5u a,gs -u gs 0 gs a i4 u jc a jc -u,gs -18 gs -u,gs -18 hg -1i hg 0 gs a,hg 0 i4 a io 0 jc a,io 0 io -1i jc -18 jc -u,jm a ku u li k m6 u m6 a,jm a jm -a ka -k ka 0 ku a li 0 li -k m6 -u m6 a,li -k ka -18 ku -1i m6 -u,mg a no u p0 a p0 -a oc -k no -u,oc -k p0 -u no -1i no -18 no -a,mg a n4 0 no a oc 0 no -a,qi a qi k r6 u r6 0 t2 u t2 a se 0 t2 -a,qi a qi -a,qi -1i qi 0,qi -1i rq -26 t2 -1i t2 -u t2 -a,r6 -18 rq -1i se -18 t2 -1i,se -18 se -k rq -a r6 -k r6 -18,qi -1i r6 -18,tc k u0 u,tc k tc 0 tc -18 u0 -1i u0 u,ua a vi u 10q a 10q -k 10q -1s 106 -26 106 -1i,ua a ua -a ua -u uu -k uu 0 vi a 106 0 106 -k 10q -u,ua -u vi -1i 106 -18 106 -1i,106 -k vi -u uu -k,114 a 12c u 130 k 11o 0 11o -a,114 a 114 -a 114 -u 12c -1i 13k -u 130 -k 130 -a 130 0 13k -a 13k -u,130 -k 12c -u 11o -k 114 -u,11o -k 11o -a,13u k 13u -u 13u -18 14i -1i 14i 0,13u k 14i u 14i 0,17m a 19i 1i 1es 1i 3d2 1i,pa a q8 a,8e a 9m u au a,e2 k em u,gi k fu u,42 1i -1mm 1i,17m a 14s a#9m -1i 9m -a aa 0,9m -a 92 0,bs 0 cg -a cg -u,cg -a d4 0,bs -k cg -u,em -k fa -a fa a fu 0,fa -a fu -k,em 0 fa a,hg 0 i4 -a io 0,hg -k i4 -u i4 -a,i4 -u io -k,ka 0 ku -a li 0,ku -a ku -u,ka -k ku -u,no -1i mg -u mg -a n4 0,mg -u no -a,no -u n4 -k,r6 -18 rq -u rq -a,rq -u se -18,tc -18 tc -1s u0 -1i,uu 0 vi -a vi -u,vi -a 106 0,11o -k 12c -a 12c a,12c -a 130 -k,130 0 12c a,14i -1i 156 -18 156 -k 14i -u# I have no idea why it isnt working properly, any help will be greatly appreciated.
  19. By learning how to do it the right way. There is absolutely no need to do a loop. Besides, that's a pretty lame attempt at trying to update all the records since it would be possible for an id number to be skipped if you were ever to delete a record. And, that just might be your problem. To update every record, simply leave off the WHERE clause UPDATE themes SET enabled = '0' doing that didnt work. it didnt update the record.
  20. wait nevermind, stupid mistake for($i=0;$i<$count;$i++){ mysql_query("UPDATE themes SET enabled = '1' WHERE id = '".$i."'"); } should of been for($i=0;$i<$count;$i++){ mysql_query("UPDATE themes SET enabled = '0' WHERE id = '".$i."'"); }
  21. function defaultstyle($id) { $theme = mysql_query("SELECT * FROM themes WHERE id = '".$id."'"); $count = mysql_num_rows(mysql_query("SELECT * FROM themes")); for($i=0;$i<$count;$i++){ mysql_query("UPDATE themes SET enabled = '1' WHERE id = '".$i."'"); } while($style = mysql_fetch_array($theme)) { if($style[enabled] == '1') { echo "<center>This theme is already set to default</center>"; } else { echo "<center>The theme $style[name] is now the default theme for the CMS</center>"; mysql_query("UPDATE themes SET enabled = '1' WHERE id = '".$id."'"); } } } The updating part where it set's enabled to "1" works fine, but the code before it for($i=0;$i<$count;$i++){ mysql_query("UPDATE themes SET enabled = '1' WHERE id = '".$i."'"); } That code is meant to load every mysql record and set the "enabled" row to 0, but its not doing that. How can i fix this?
  22. Thanks works perfectly
  23. if you look here http://xboxgamercard.net/ps3/?psn=derp it will show something similar to this [total trophies] => 204 [bronze trophies] => 169 [silver trophies] => 29 [Gold trophies] => 6 [platinum trophies] => 0 I am needing a more efficient way of adding up all of the trophies, my current method only ads up the first 10 games. Heres my current code for the adding up of the trophies $gamercard['total trophies'] = $total[1][0] + $total[1][5] + $total[1][10] + $total[1][15] + $total[1][20] + $total[1][25] + $total[1][30] + $total[1][35] + $total[1][40] + $total[1][45]; $gamercard['Bronze trophies'] = $total[1][1] + $total[1][6] + $total[1][11] + $total[1][16] + $total[1][21] + $total[1][26] + $total[1][31] + $total[1][36] + $total[1][41] + $total[1][46]; $gamercard['Silver trophies'] = $total[1][2] + $total[1][7] + $total[1][12] + $total[1][17] + $total[1][22] + $total[1][27] + $total[1][32] + $total[1][37] + $total[1][42] + $total[1][47]; $gamercard['Gold trophies'] = $total[1][3] + $total[1][8] + $total[1][13] + $total[1][18] + $total[1][23] + $total[1][28] + $total[1][33] + $total[1][38] + $total[1][43] + $total[1][48]; $gamercard['platinum trophies'] = $total[1][4] + $total[1][9] + $total[1][14] + $total[1][19] + $total[1][24] + $total[1][29] + $total[1][34] + $total[1][39] + $total[1][44] + $total[1][49]; There has to be a formula or something i can use to calculate that with ease. because some people have 100+ recent games played. which need to be added into the trophy counter. Any suggestions to point me in the right direction?
  24. bump, help guys please.
  25. if you look here http://xboxgamercard.net/ps3/?psn=derp it will show something similar to this [total trophies] => 204 [bronze trophies] => 169 [silver trophies] => 29 [Gold trophies] => 6 [platinum trophies] => 0 I am needing a more efficient way of adding up all of the trophies, my current method only ads up the first 10 games. Heres my current code for the adding up of the trophies $gamercard['total trophies'] = $total[1][0] + $total[1][5] + $total[1][10] + $total[1][15] + $total[1][20] + $total[1][25] + $total[1][30] + $total[1][35] + $total[1][40] + $total[1][45]; $gamercard['Bronze trophies'] = $total[1][1] + $total[1][6] + $total[1][11] + $total[1][16] + $total[1][21] + $total[1][26] + $total[1][31] + $total[1][36] + $total[1][41] + $total[1][46]; $gamercard['Silver trophies'] = $total[1][2] + $total[1][7] + $total[1][12] + $total[1][17] + $total[1][22] + $total[1][27] + $total[1][32] + $total[1][37] + $total[1][42] + $total[1][47]; $gamercard['Gold trophies'] = $total[1][3] + $total[1][8] + $total[1][13] + $total[1][18] + $total[1][23] + $total[1][28] + $total[1][33] + $total[1][38] + $total[1][43] + $total[1][48]; $gamercard['platinum trophies'] = $total[1][4] + $total[1][9] + $total[1][14] + $total[1][19] + $total[1][24] + $total[1][29] + $total[1][34] + $total[1][39] + $total[1][44] + $total[1][49]; There has to be an easier way to do that.. Any suggestions to point me in the right direction?
×
×
  • 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.