1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved Directory Configs

Discussion in 'Development' started by BLOCKSTORM, Feb 12, 2018.

  1. BLOCKSTORM

    BLOCKSTORM Witch

    Messages:
    67
    Hello Guys,
    actually im searching for a method to get a worth from all Config Files in a specified Directory.Why? Im saving all Reports in a /Reports/ Directory, and when a staff member would execute /reports, there should be a UI showing a button for each Report.The Button part is easy, but i want to make the Button text {Reported}, {Reason}.
    Regards,
    Tobias aka BLOCKSTORM_
     
  2. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    You can list files in a directory using https://php.net/dir
    However, for better performance, it is better to store a file that indexes all active reports yourself.
     
  3. BLOCKSTORM

    BLOCKSTORM Witch

    Messages:
    67
    Can you give me an Example? I do not really Understand how you mean this.
     
  4. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    You mean in resources/ ?
     
  5. Kenn Fatt

    Kenn Fatt Slime

    Messages:
    82
    GitHub:
    kennfatt
    Im just guessing what he wanted to do is:

    - Allow his staff to see all reports by execute /reports.
    - All reports are saved in '/Reports/' directory.

    I dont get it when he want button {Reported}, {Reason}.

    Anyway, you can save all reports in single file.
     
  6. BLOCKSTORM

    BLOCKSTORM Witch

    Messages:
    67
    Thats exactly what i want
     
  7. BLOCKSTORM

    BLOCKSTORM Witch

    Messages:
    67
    But all in one file? how to realize this? Saving every report in a file like 1: {Reported}:{reporter}:{reason}:{status}:{staff}
    And the count get higher for every report. Or how?
     
  8. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Or you could just use an SQLite3 database. That's optimal for your purpose.
    If you want to stick to YAML files, try making an index.yml that stores an array of all report IDs.
     
  9. BLOCKSTORM

    BLOCKSTORM Witch

    Messages:
    67
    Is there any SQLite3 Tutorial
     
  10. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Is there any search engine
     
  11. BLOCKSTORM

    BLOCKSTORM Witch

    Messages:
    67
    yes im sry
     
  12. BLOCKSTORM

    BLOCKSTORM Witch

    Messages:
    67
    All done, report System working well! Thanks for help guys
     
    jasonwynn10 likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.