View Single Post
8088
Veteran Member
Join Date: Jan 2008
Old 04-09-2012 , 13:01   Re: Script to start HLTV
Reply With Quote #30

Sorry for the long wait, ghostofmybrain. Although I'm sure things can/should be optimised, I kept things as simple as possible and spend as little time as possible on it ;-)

Requirements:
  • PHP 5.2.8 or higher, with PDO
  • MySQL 5 or higher
Installation:
  1. extract and upload everything to your web space (preferrably into a directory that is password protected)
  2. create a database and import hlds.sql
  3. edit lib/db.php and change the values of $db_host, $db_user, $db_password and $db_database
  4. open index.php in your browser and start adding/editing your servers
  5. edit the path to db.php in cronjob/cronjob.php if you move conjob.php to a different location (recommended, but not required)
  6. create a cronjob to have cronjob/cronjob.php executed at regular intervals:
    1. this requires the path to db.php to be absolute:
      Code:
      php /path/to/cronjob.php
    2. and this allows for a relative path to db.php:
      Code:
      cd /path/to/cronjob.php && php cronjob.php
    3. if you're unsure what your cronjob should look like, upload a seperate .php file with this line:
      PHP Code:
      <?php echo 'cd ' realpath(dirname(__FILE__)) . ' &amp;&amp; php cronjob.php'?>
      open the file in your browser and use the output as your cronjob command
Disclaimer: I've not been able to test every aspect, had a fever, was busy with other stuff, don't know what I'm doing, blah blah unaccountable blah so use at your own risk! And feel free to report bugs (I'm sure there are plenty) here or in a PM.

Credits to xPaw for his fine SourceQuery class.

Here's a demo of the web interface: http://awesomatic.net/hltv/index.php
Attached Files
File Type: zip hltv.zip (19.5 KB, 321 views)
__________________
steamID converter with OpenSearch browser plugin

Last edited by 8088; 05-30-2012 at 14:26. Reason: added 6c
8088 is offline