I know this is not directly an LFS addon question, but some insight would be very appreciated.
We at Fun Racing League are trying to do dynamic userbars to be used here in the forums and we've come to a wall. We have a php script that generates and deploys a dynamic userbar containing some driver data fetched from the DB.
The thing is, right now that script receives an lfs username and generates the userbar at that moment and delivers it. I thought that would be very resource consuming as the userbars would be generated time and time again for no reason.
So I thought the right way would be to generate/update all userbars on a certain event, that is when we upload new race results (at that moment userbars must be updated). Then all those userbars are saved into a folder as they are created as png images. Then we have a php file that translates a request to a png image. For example:
1.- Race results are uploaded (in this process userbars are automatically generated and saved into the directory http://www.funracingleague.com/images/ubars
2.- Then we have a php file like this: http://www.funracingleague.com/userbars.php?lfsname=makakazo that the only thing it does is to return this image http://www.funracingleague.com/images/ubars/makakazo.png
I think this is the right way to do it. Anyway, right now I don't know exactly how to do some of the things. For example I don't know which functions should be used to store the png generated userbars in the web server, and also I don't know how the php file in point (2.-) does the translation from a GET request to the actual userbar stored. I don't have much knowledge of HTML, though I think that these things can be done rather easily.
Am I on the right path? Any suggestions/tips?
Thanks in advance
We at Fun Racing League are trying to do dynamic userbars to be used here in the forums and we've come to a wall. We have a php script that generates and deploys a dynamic userbar containing some driver data fetched from the DB.
The thing is, right now that script receives an lfs username and generates the userbar at that moment and delivers it. I thought that would be very resource consuming as the userbars would be generated time and time again for no reason.
So I thought the right way would be to generate/update all userbars on a certain event, that is when we upload new race results (at that moment userbars must be updated). Then all those userbars are saved into a folder as they are created as png images. Then we have a php file that translates a request to a png image. For example:
1.- Race results are uploaded (in this process userbars are automatically generated and saved into the directory http://www.funracingleague.com/images/ubars
2.- Then we have a php file like this: http://www.funracingleague.com/userbars.php?lfsname=makakazo that the only thing it does is to return this image http://www.funracingleague.com/images/ubars/makakazo.png
I think this is the right way to do it. Anyway, right now I don't know exactly how to do some of the things. For example I don't know which functions should be used to store the png generated userbars in the web server, and also I don't know how the php file in point (2.-) does the translation from a GET request to the actual userbar stored. I don't have much knowledge of HTML, though I think that these things can be done rather easily.
Am I on the right path? Any suggestions/tips?
Thanks in advance