PDA

View Full Version : Implement scriptdata in website



Ni3ls
4th March 2016, 09:18
I save the stats in a scriptdata folder. Is it possible to show these stats on a website? Or can this only done with mysql database?

IzNoGoD
4th March 2016, 11:50
Probably doable, but mysql is a far superior option.

kung foo man
5th March 2016, 04:31
Basically you can just do echo file_get_contents("/home/niels/cod2/whatever_fs_game/scriptdata/$guid.txt") and then parse the data with explode() to prettyprint it.

Make sure your www-data can access your stats-folder, every folder needs the "x" for "all", like:



chmod a+x /home
chmod a+x /home/niels
chmod a+x /home/niels/cod2
chmod a+x /home/niels/whatever_fs_game
chmod a+x /home/niels/whatever_fs_game/scriptdata
# last one needs to be readable aswell to get the *.txt list e.g. with glob("/home/niels/whatever_fs_game/scriptdata/*.txt")
chmod a+r /home/niels/whatever_fs_game/scriptdata


But you will lack the ability to search through the player data or make stats e.g., pretty dumb stats printing only by a list of guid's.

Perfect is the enemy of the good, so just go for it, till you master MySQL :^)