define("TRIBAL_VERSION", "152"); // version number shown in footer. This = the revision number in SVN /trunk Please change when you upgrade. Also add "Rev" in front of it if you customize the ladder code somehow and if you are not a part of the development team of tribal bliss. (we do however invite you to become so : ) $maintenanceMode = false; // Is the site under maintenance, if so set this to true and all pages will show a maintenance screen $backupKey = "A long password w!tH $ymb0ls is G00d mjepsulaijaa345632"; // You can backup the database without logging in if you have access to the key below. Change it to a secure string //configure database info $adminemail = "tume@kapsi.fi"; $laddermailsender = "test@dot.com"; // this will be the senders email when the ladder sends a mail to someone... $databaseserver = "db1.kapsi.fi"; //usually localhost $databasename = "tume"; //the name of your database $databaseuser = "tume"; //the name of the database-user $databasepass = "Ue5SPIAxqGKD"; // the password to your database $directory ="http://www.pulliainen.fi/sls/ladder" ; //the location of your ladder directory (no trailing slash) $path_file_replay = "replay/"; // directory where the replay files are uploaded on the server. Notice that there should be a trailing slash at the end. //configure the tables in the database $playerstable = "webl_players"; //the name of the table that contains information about the players $gamestable = "webl_games"; //the name of the table that stores the played games $newstable = "webl_news"; // the name of the table that stores the news $admintable = "webl_admin"; //name of the table that stores the admin login information $waitingtable = "webl_waiting"; //name of the table that stores the players waiting for a game... $standingscachetable = "webl_standings_cache"; // important cache, improves and makes up for mysql-sickness. $logtable ="webl_log";//name of tabel that has some log info $mailhost = "my.smtp.server"; //config security $salt = "fj44klj54kldfj323"; // WARNING: If you have a running ladder with registered users DONT ever change the salt! Nobody will be able to login then, ever, if you lose the salt. //config stuff that has to do with the registration process... define("REG_MIN_NICKLENGTH", 3); //Minimum number of characters allowed in a registrants nickname define("REG_MAX_NICKLENGTH", 20); //Maximum number of characters allowed in a registrants nickname define("REG_MAILVERIFICATION", 0); //Set to 0 or 1, where 0 is off and 1 on. If enabled (1) the player will get a e-mail when registering, with a link he must click in order to activate his account. Unverified accounts can't report games or logg in at all. If set to 0 no mail will be sent and the player can start using his acocunt directly since he will be "auto-verified" instead. Currently, and maybe depending on your host and who you send to, 10 - 30% of the mails sent are killed by the spam-filters, so it might be an idea to have this disabled if many complain, else they won't be able to use their accoutn unless you manually activate them through fiddling with their Confirmation-entry in the the players database. define("NONPUBLIC_REPLAY_COMMENTS", 1); //set to 1 to enable, 0 to disable. If enabled only logged in members can view other members game comment $reportdays = 7; // The number of days after a report that you can contest/withdraw the game // Measures against match spam (players gaining advantage by merely being more active than others) define("ANTI_MATCHSPAM_METHOD", 1); // 0 for none [default], 1 for cap on X matches / Y days, 2 for fixed k penalty factor after cap, 3 for dynamic factor define("ANTI_MATCHSPAM_NUMGAMES", 14); // Amount of games (victories) a player can report within period x, where x is an amount of days. e.g. 14 define("ANTI_MATCHSPAM_DAYS", 7); // The player can play <= y games within x days. If he exceeds that number he can't report the game. e.g. 7 for one week define("ANTI_MATCHSPAM_FACTOR", 0.5); // On METHOD 2 or 3, this 0 < value < 1 determines the point reduction above NUMGAMES (less value = more punishment) Recommendation: 0.5 // Group ladder config define("GADDER_ELO_RANGE", 50); // The range in points of a rating that a player needs to be within the group leader in order to be rated as within the same group on the gadder. It works the following way: The 1:st group is based on the number one ranked player on the ladder. All who are within GADDER_ELO_RANGE of his rating are ranked as belonging to his group (the first one). As soon as a player is < GADDER_ELO_RANGE he will be placed in the next group. Summarised: Let the value reflect the point system and K-values in use and experiment with it to see if the Gadder is meaningfull. If it's not and groups too many together, then either your ladder is new with few games/players or you have set a too huge value here. Else, if the Gadder has very many groups, you have probably set the value too low: Keep in mind it's supposed to group players which it thinks are nearby or equal skillwise, saying that they're pretty much the same rank. E.g. a good default value when using standard Elo system with usual K and entry of 1500 would be somewhere between 45 - 65. This value however depends only on all the other settings made and is only valid with such parameters. Also notice that the gadder works the very same way as the ladder, with the obvious exception for the grouping and displaying of rank. Whoever is displayed in the normal ladder would appear somewhere in the gadder. define("GADDER_FLAGS", 0); // Should we show flags in the gadder? 1 for yes, 0 for no. Personally I find it chaotic having it enabled. //config etc $titlebar = "SLS-liigan ranking"; $numindexnewbs = 3; // number of newcomers to show in index sidebar.. $numindexresults = 10; //num of latest played games results to show in index sidebar $numindexhiscore = 10; //number of people listed in the hiscore in the index sidebar $numindexnews = 10; // news items displayed at index bottom... $newsitems = 3; //news items to show full text of...this needs to be fixed - index shows 3 even if it says 5 in here.. lol $numindexdeled = 5; // how many deleted games are shown at index. define("MIN_GAMES_REPORT_POPUP", 30); // Players who have reported (won) less than this many games will get to see a pop up asking them if they are sure they want to report. define("COUNT_GAMES_OF_LATEST_DAYS", 1); // amount of days we're gonne count the most recent played games in to display in index sidebar define("MIN_COUNT_GAMES_OF_LATEST_DAYS", 1); // minimum amount of games that need to have been played within the x most recent days to show the amount of games the x most recent days define("AVERAGE_GAME_LENGTH", 40); // amount of minutes the average game is expected to last. This is used for calcuating work-hours spent on gaming in the sidebar. define("MAX_REPLAYSIZE", 200000); // max fileseize of replay file user can upload, set in bytes. 200000 = 200 kb. This will have to be adjusted to fit different games and maybe according to you hosting limits. $replayfileextension = "gz"; //file extension of the replay files. define("INDEX_COMMENT_HILITE", 1); // 0 or 1. If enabled (1) then the latest game with a comment & replay will be displayed before the news posts. $displayDateFormat = '%d.%m.%Y %h:%i'; // The format style used here is the one from mysql DATE_FORMAT - http://dev.mysql.com/doc/refman/6.0/en/date-and-time-functions.html#function_date-format define("FOOTER_MAIL", "your info at here dot whatever"); //email adr shown in footer define("SPAM_REPORT_TIME_PROTECTION", 1); // Number of minutes a user has to wait inbetween reporting a victory. define("SPAM_REPORT_TIME_PROTECTION_UNLOCKED", 9999); // When a user has _reported_ at least these many games he won't adhere under the spam report protection rule. Instead he'll be able to report results within any time intervall. Set this number very high to shut off this feature. Set it to 50 or 100 or so to give the veterans the freedom. define("ALLOW_REPLAY_UPLOAD", 0); // 1 for enabled, 0 for disabled. // Don't change the values below unless you have some basic understanding of how Elo works, the settings that are there already are okey for most people. // WARNING: If you have played games and you change any of the below values, you MUST rerank the entire ladder. As the values below will change the rankings of players. $passivedays = 30; // number of days a player has to play a game before he's put in passive rating mode $ladderminelo = 1000; // all players that have this or higher elo rating will be listed in the ladder... the rest are not _visible_ in it. $gamestorank = 3; // number of games a player must have played in order to get a ranking (not the same as getting an elo rating!) $playersshown = 200; //Number of players to show per php query on stats // Define a Kvalue array, must be in descending points order. rating => kvalue $kArray = array(2100 => 16, 1800 => 24, 0 => 32); $kArrayProvisional = array(2100 => 16, 1800 => 24, 0 => 32); define("ELO_DIVIDE_FACTOR",400); // This number regulates the win expectancy and is a part of the Elo formula. Leave it on 400 in full information games with 0 randomness like chess. Make it 800 or so in games with some more randomness in them. The more randomness, the higher the number should be, but, the higher the number and the more randomness, the more useless the Elo system gets. define("BASE_RATING", 1500); // this is what a new player gets define("MAX_DIFFERENCE", 1000); //1200 is so high this never gets used define("PROVISIONAL", 10); //The number of games it takes to not be provisional anymore define("PROVISIONAL_PROTECTION", 2); //The amount provisional rating is divided by. // Variableis that used to be stored in the database. They have been unified in this one configuration file. $standingsnogames = 0; $pctnum = 0; $hotcoldnum = 5; $gamesmaxday = 30; $gamesmaxdayplayer = 10; $approve = 'no'; $approvegames = 'no'; $system = 'elorating'; $pointswin = 2; $pointsloss = -1; $report = 'winner'; $leaguename = 'Ladder of Wesnoth'; //$copyright = 'powered by: WebLeague'; $copyright = ''; // Config ends here! Don't edit anything beyond this line unless you know what your doing. $latestGameSql = "select name, max(latest_game) as latest_game from ( select name, max(reported_on) as latest_game FROM $playerstable JOIN $gamestable ON (name = winner) WHERE contested_by_loser = 0 AND withdrawn = 0 GROUP BY 1 UNION ALL select name, max(reported_on) as latest_game FROM $playerstable JOIN $gamestable ON (name = loser) WHERE contested_by_loser = 0 AND withdrawn = 0 GROUP BY 1 ) latest_game GROUP BY 1"; // This is the sql used to insert into the standings cache table for speed $cacheSql = "select * from (select a.name, g.reported_on, CASE WHEN g.winner = a.name THEN g.winner_elo ELSE g.loser_elo END as rating, CASE WHEN g.winner = a.name THEN g.winner_wins ELSE g.loser_wins END as wins, CASE WHEN g.winner = a.name THEN g.winner_losses ELSE g.loser_losses END as losses, CASE WHEN g.winner = a.name THEN g.winner_games ELSE g.loser_games END as games, CASE WHEN g.winner = a.name THEN g.winner_streak ELSE g.loser_streak END as streak FROM ($latestGameSql) a JOIN $gamestable g ON (g.reported_on = a.latest_game)) standings "; // This selects the standings against every player $standingsSql = "select * from $standingscachetable join $playerstable USING (name)"; // Apply the restrictions to standings $standingsSqlWithRestrictions = $standingsSql." WHERE reported_on > now() - interval $passivedays day AND rating >= $ladderminelo AND games >= $gamestorank ORDER BY 3 desc, 6 desc"; // variabledb.php used to connect to the database, I've added a temporary hack here to do that in the config file, it should be // moved somewhere more appropriate $db = mysql_connect($databaseserver, $databaseuser, $databasepass); mysql_select_db($databasename,$db); ?>