Results 1 to 3 of 3

Thread: Implement scriptdata in website

  1. #1
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts

    Implement scriptdata in website

    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?

  2. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Probably doable, but mysql is a far superior option.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  3. The Following User Says Thank You to IzNoGoD For This Useful Post:

    Ni3ls (18th March 2016)

  4. #3
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    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:

    Code:
    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 :^)
    timescale 0.01

  5. The Following User Says Thank You to kung foo man For This Useful Post:

    Ni3ls (18th March 2016)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •