HaLo2FrEeEk Posted February 26, 2007 Share Posted February 26, 2007 I don't know how to properly explain this, basically, I want someone to be able to load an image from my server, but have the image update itself based on the stats from my forum, kind of like how mygamercard.net has it, you load, for example, http://card.mygamercard.net/marble/pink/HaLo2FrEeEk.png, but the image updates itself, instead of loading, say...http://card.mygamercard.net/marble/pink/gamercard.php?tag=HaLo2FrEeEk. I want someone to be able to load, say, http://claninfectionist.com/forum/stats/HaLo2FrEeEk.png and it would look like that, but if someone else loaded the picture, it would display their stats. I don't know it this was a good enough explanation, I'm pretty sure I need a htaccess file to do this, but I don't know how to use htaccess for anything more than to redirect to error pages and stop directory indexing. If anyone could help me, I would be much appreciative, I can also try to explain it better if you don't understand. Quote Link to comment https://forums.phpfreaks.com/topic/40274-dynamic-png-image-without-loading-php-page/ Share on other sites More sharing options...
fert Posted February 26, 2007 Share Posted February 26, 2007 the redirect part is done with .htaccess, but the image is done with php: http://us3.php.net/manual/en/ref.image.php Quote Link to comment https://forums.phpfreaks.com/topic/40274-dynamic-png-image-without-loading-php-page/#findComment-194826 Share on other sites More sharing options...
HaLo2FrEeEk Posted February 26, 2007 Author Share Posted February 26, 2007 but would this allow someone to load http://claninfectionist.com/forum/stats/HaLo2FrEeEk.png, instead of, perhaps, http://claninfectionist.com/forum/stats/statsig.php?user=HaLo2FrEeEk, since those types of pictures are not displayable on phpbb forums. Quote Link to comment https://forums.phpfreaks.com/topic/40274-dynamic-png-image-without-loading-php-page/#findComment-194828 Share on other sites More sharing options...
fert Posted February 26, 2007 Share Posted February 26, 2007 you would do that in the .htaccess file with this code RewriteEngine on RewriteRule ^(.*)\.png$ picture.php?user=$1 Quote Link to comment https://forums.phpfreaks.com/topic/40274-dynamic-png-image-without-loading-php-page/#findComment-194829 Share on other sites More sharing options...
HaLo2FrEeEk Posted February 26, 2007 Author Share Posted February 26, 2007 Ok, thank you, I will try this out, I'm sure I'll need more help though, is it ok if I keep asking? Like I said, I don't know anything about htaccess, and I'm still new to creating images with php. Quote Link to comment https://forums.phpfreaks.com/topic/40274-dynamic-png-image-without-loading-php-page/#findComment-194832 Share on other sites More sharing options...
HaLo2FrEeEk Posted February 26, 2007 Author Share Posted February 26, 2007 Sorry for the double post, but can you please add a little more to that htaccess code, I don't completely understand how I would do the actual redirecting. Sorry, and thank you very much, I appreciate your help. Quote Link to comment https://forums.phpfreaks.com/topic/40274-dynamic-png-image-without-loading-php-page/#findComment-194844 Share on other sites More sharing options...
fert Posted February 26, 2007 Share Posted February 26, 2007 Just put that code in your .htaccess and upload it to your server Quote Link to comment https://forums.phpfreaks.com/topic/40274-dynamic-png-image-without-loading-php-page/#findComment-194848 Share on other sites More sharing options...
HaLo2FrEeEk Posted February 27, 2007 Author Share Posted February 27, 2007 Ok, thanks, I'm writing the code for the picture right now, the person that made the picture is sending me the psd so I'll know the coordinates where the stuff is supposed to go, I dropped a .htaccess file with this in it into the folder where the pictures will be stored: RewriteEngine on RewriteRule ^(.*)\.png$ statsig.php?user=$1 which I assume will call statsig.php?user=HaLo2FrEeEk when someone visits HaLo2FrEeEk.png, is this right? Quote Link to comment https://forums.phpfreaks.com/topic/40274-dynamic-png-image-without-loading-php-page/#findComment-194855 Share on other sites More sharing options...
fert Posted February 27, 2007 Share Posted February 27, 2007 which I assume will call statsig.php?user=HaLo2FrEeEk when someone visits HaLo2FrEeEk.png, is this right? that's right Quote Link to comment https://forums.phpfreaks.com/topic/40274-dynamic-png-image-without-loading-php-page/#findComment-194860 Share on other sites More sharing options...
HaLo2FrEeEk Posted February 27, 2007 Author Share Posted February 27, 2007 Ok, I got most of the script done, no avatar yet, but here is what I do have: http://claninfectionist.com/misc/testing/statssig.php?user=HaLo2FrEeEk You can change the user value to see the stats for other users on my board, here are some test values: Ze Popcorn King KJdog23 Roanoke884 but I would still like a little help, I understand how the htaccess works, so its not with that. I want to center the text inside a certain area, like, the Xbox360 style text looks fine, but Wii (on Ze Popcorn King's) looks bad, is there anyway to center it, as well as the avatar, which can be up to 100 pixels by 100 pixels. The biggest word size for the board style is 11 characters, Macinscott2, the smallest is 3 characters, Wii. The max size for usernames is 18 characters. Quote Link to comment https://forums.phpfreaks.com/topic/40274-dynamic-png-image-without-loading-php-page/#findComment-194923 Share on other sites More sharing options...
HaLo2FrEeEk Posted February 27, 2007 Author Share Posted February 27, 2007 Anyone? sry for the double post, I needed to bump it, I'm in kinda a hurry. Quote Link to comment https://forums.phpfreaks.com/topic/40274-dynamic-png-image-without-loading-php-page/#findComment-194936 Share on other sites More sharing options...
corbin Posted February 27, 2007 Share Posted February 27, 2007 Based on the coordinates of where the top left of the avatar would be if it was the max size, you could do some semi-fancy math and figure out where to center it in the avatar box. As for fonts, I'm no help there... Quote Link to comment https://forums.phpfreaks.com/topic/40274-dynamic-png-image-without-loading-php-page/#findComment-194937 Share on other sites More sharing options...
HaLo2FrEeEk Posted February 27, 2007 Author Share Posted February 27, 2007 I could do that with the image, but not the text, since I'm not using imageloadtext, I'm using a ttf font, so I have to use imagettftext, there is a imagettfbbox function that will make an 8 value array with the x and y coordinates of the text inside it, but I don't know how to use it. Quote Link to comment https://forums.phpfreaks.com/topic/40274-dynamic-png-image-without-loading-php-page/#findComment-194960 Share on other sites More sharing options...
HaLo2FrEeEk Posted February 27, 2007 Author Share Posted February 27, 2007 Anyone, I still need some help please, and thank you. Quote Link to comment https://forums.phpfreaks.com/topic/40274-dynamic-png-image-without-loading-php-page/#findComment-195580 Share on other sites More sharing options...
HaLo2FrEeEk Posted February 27, 2007 Author Share Posted February 27, 2007 I could eally use some help with this please Sorry for the multi post. Quote Link to comment https://forums.phpfreaks.com/topic/40274-dynamic-png-image-without-loading-php-page/#findComment-195617 Share on other sites More sharing options...
Snooble Posted February 28, 2007 Share Posted February 28, 2007 i dont quite understand the problem here. If it's an alignment problem then it should be easy to figure. Take a look at the image. If you have the .psd then open it up! Dont write back here until you have done that. You know what you're doing, help is too easily available some of the time. Snooble Quote Link to comment https://forums.phpfreaks.com/topic/40274-dynamic-png-image-without-loading-php-page/#findComment-195624 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.