Author Topic: Need help (Mysql/Sql i think)  (Read 988 times)

Offline PlayDota.eu08

  • WickedSick Member
  • *
  • Topic Author
  • Posts: 1217
  • Karma: +88/-326
  • hi
    • View Profile
    • Awards
Need help (Mysql/Sql i think)
« on: September 07, 2010, 06:40 »
Can someone help me ,
Wana make my own stats site but fail , dont know why xddd but help pls :)

http://4h.vacau.com/

line 144

Code: [Select]
<?php
/*********************************************
<!-- 
*           DOTA ALLSTATS
*   
*        Developers: Reinert, Dag Morten, Netbrain, Billbabong, Boltergeist.
*        Contact: developer@miq.no - Reinert
*
*        
*        Please see http://www.codelain.com/forum/index.php?topic=4752.0
*        and post your webpage there, so I know who&#39;s using it.
*
*        Files downloaded from http://code.google.com/p/allstats/
*
*        Copyright (C) 2009-2010  Reinert, Dag Morten , Netbrain, Billbabong, Boltergeist
*
*
*        This file is part of DOTA ALLSTATS.
*

*         DOTA ALLSTATS is free software: you can redistribute it and/or modify
*    it under the terms of the GNU General Public License as published by
*    the Free Software Foundation, either version 3 of the License, or
*    (at your option) any later version.
*
*    DOTA ALLSTATS is distributed in the hope that it will be useful,
*    but WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*    GNU General Public License for more details.
*
*    You should have received a copy of the GNU General Public License
*    along with DOTA ALLSTATS.  If not, see <http://www.gnu.org/licenses/>
*
-->
**********************************************/
 
/*************************************
 *        EDITABLE CONFIGURATION SETTINGS  *
 *************************************/
 
// language for AllStats, please change this to "rus.php" if you want russian version
require_once("eng.php");
 
 
//Database type:
//Enter sqlite to use a SQLite database.
//Enter mysql to use a MySQL database.
//Configure your selected database below. 
$dbType = &#39;mysql&#39;;
 
//SQLite Database Connection information (Optional):
//dbLocation must point to your SQLite Database.
$dbLocation = &#39;./ghost.dbs&#39;;
 
//MySQL Database Connection information (Optional):
//Must correspond to the settings in your MySQL Database.
$host = &#39;mysql15.000webhost.com&#39;;
$username = &#39;-&#39;;
$password = &#39;&#39;-&#39;;
$databasename = &#39;-&#39;;
 
// do __NOT__ enable this option on public (free) sql servers as this will
// query shared tables (information_schema.tables)
$verifytables false;
 
//If you save your replays to a folder that AllStats can access, more information, the ability to download a replay, and a chat log will be displayed on the game info page.
//If replays cannot be found, this info will be automatically omitted.
 
//Replay Location:
//OMIT THE ENDING /. DO NOT END WITH A /
//Must be a relative path.  IE: Cannot use C:/... Use repeated ../ to move up directory chain.
$replayLocation "C:mowes\www\replays";
 
//GHost++ bot user name:
$botName = &#39;[4H]Guard&#39;;
 
//GHost++ root administrator name:
$rootAdmin = &#39;Dragoljub&#39;;
 
//Settings for Top Players page
 
//Default minimum number of games played in order to be displayed on Top Players page:
$minGamesPlayed 1;
 
//Minimal ratio (lefttime/duration) that a player/hero has to complete a game to be counted as win/loss. otherwise game is ignored.
$minPlayedRatio 0;
//string to be shown instead of WIN/LOSS if a game is not counted due to ratio (lefttime/duration)
$notCompleted = &#39;LEAVER&#39;;
 
//show bans from table imported_bans (requires this table to be present!)
$includeImportedBans false;
 
//-------------Monthly/Weekly options----------------
 
// Default view (Month / Week)
$monthlyDefaultView = &#39;Month&#39;;
 
// determine which rows to be shown
$monthlyRow1 true;
$monthlyRow2 true;
$monthlyRow3 true;
$monthlyRow4 true;
$monthlyRow5 true;
 
// min games played for monthly tops (only for overall stats -> row 3/4)
$montlyMinGames 5;
 
//The number of entries in each highscore list
$monthlyTopsListSize 5;
 
//hide banned players on monthly / alltime tops
$hideBannedPlayersOnTops false;
 
//---------------------------------------------------
//-------------User history options----------------
 
// Default view (Month / Week)
$historyDefaultView = &#39;Week&#39;;
 
// min games played for monthly tops (only for overall stats -> row 3/4)
$historyMinGames 5;
 
//---------------------------------------------------
 
//Pre-Calculate score
//If true:  Player scores will be taken from the score table in your MySQL database. You must populate this table through your own methods.
//                    One easy way to populate the score is to run the update_dota_elo.exe program in your GHost++ folder periodically. This will automatically populate
//          your scores table through an ELO method. Personally, I have modified my GHost++ to run update_dota_elo after every game automatically.
//If false: Player scores will be dynamically calculated on page load through a formula that takes into account kills, deaths, assists, wins, losses, etc...
//                        This is less ideal and will slow your top players page load slightly. As of yet, I have not found a numeric scoring system that I believe 
//                   accurately reflects skill level.
$scoreFromDB false;
 
//Score Formula: (Only used if $scoreFromDB = false)
//Must follow SQL formatting conventions.
//Allowed variables: totgames, kills, deaths, assists, creepkills, creepdenies, neutralkills, towerkills, raxkills, courierkills, wins, losses
//Backup of default formula in case of error: &#39;((((kills-deaths+assists*0.5+towerkills*0.5+raxkills*0.2+(courierkills+creepdenies)*0.1+neutralkills*0.03+creepkills*0.03) * .2)+(wins-losses)))&#39;
$scoreFormula = &#39;Pd.eu scoresystem&#39; 
 
//Ignore public or private games on statistics pages
//Will only affect scores if you do not pre-calculate ($scoreFromDB = false).  
//If you do pre-calculate, you are expected to filter out public or private games on your own.
//IgnorePubs will override ignorePrivs if both are set to true.
$ignorePubs false;
$ignorePrivs false;
 
//Show all results at once or show the first page of results by default.
//$displayStyle=&#39;all&#39; shows all data at once by default.
//$displayStyle=&#39;page&#39; shows a single page of data by default.
$displayStyle=&#39;all&#39;;
 
//The number of results returned in a page on the top players page
$topResultSize 50;
//The number of results returned in a page on the player statistics page
$allPlayerResultSize 50;
//The number of results returned in a page on the hero statistics page
$allHeroResultSize 50;
//The number of results returned in a page on the game history page
$gameResultSize 50;
//The number of results returned in a page on the bans page
$banResultSize 50;
//The number of results returned in a page on the admins page
$adminResultSize 50;
//The number of results returned in a page on a hero&#39;s page
$heroResultSize 50;
//The number of results returned in a page on a user&#39;s page
$userResultSize 50;
//The number of results returned in a page on the monthly tops page
$monthlyTopsResultSize 1;
//The number of results returned in a page on the monthly tops page
$userHistoryResultSize 50;
 
 
//configure which pages to be shown
$showTops=true;
$showMonthlyTops=false;
$showPlayerStats=true;
$showHeroStats=false;
$showGameHistoy=true;
$showBans=true;
$showAdmins=false;
 
//SQLite
if($dbType == &#39;sqlite&#39;)
{
        try{
 
        
$dbHandle = new PDO(&#39;sqlite:&#39;.$dbLocation);
 
        
}catch( PDOException $exception ){
 
        die(
$exception->getMessage());
 
        }
}
else

//MySQL
 
        
$link mysql_connect($host,$username,$password);
        if (!
$link) {
                die(&
#39;Not connected : &#39; . mysql_error());
        
}
 
        
// make the current db
        
$db_selected mysql_select_db($databasename$link);
        if (!
$db_selected) {
                die (&
#39;Can&#39;t use current db : &#39; . mysql_error());
        
}
}
?>



<?php
/*********************************************
<!--
*           DOTA ALLSTATS
*   
*        Developers: Reinert, Dag Morten, Netbrain, Billbabong, Boltergeist.
*        Contact: developer@miq.no - Reinert
*
*       
*        Please see http://www.codelain.com/forum/index.php?topic=4752.0
*        and post your webpage there, so I know who's using it.
*
*        Files downloaded from http://code.google.com/p/allstats/
*
*        Copyright (C) 2009-2010  Reinert, Dag Morten , Netbrain, Billbabong, Boltergeist
*
*
*        This file is part of DOTA ALLSTATS.
*
*
*         DOTA ALLSTATS is free software: you can redistribute it and/or modify
*    it under the terms of the GNU General Public License as published by
*    the Free Software Foundation, either version 3 of the License, or
*    (at your option) any later version.
*
*    DOTA ALLSTATS is distributed in the hope that it will be useful,
*    but WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*    GNU General Public License for more details.
*
*    You should have received a copy of the GNU General Public License
*    along with DOTA ALLSTATS.  If not, see <http://www.gnu.org/licenses/>
*
-->
**********************************************/
 
/*************************************
 *        EDITABLE CONFIGURATION SETTINGS  *
 *************************************/
 
// language for AllStats, please change this to "rus.php" if you want russian version
require_once("eng.php");
 
 
//Database type:
//Enter sqlite to use a SQLite database.
//Enter mysql to use a MySQL database.
//Configure your selected database below.
$dbType = 'mysql';
 
//SQLite Database Connection information (Optional):
//dbLocation must point to your SQLite Database.
$dbLocation = './ghost.dbs';
 
//MySQL Database Connection information (Optional):
//Must correspond to the settings in your MySQL Database.
$host = '-';
$username = '-';
$password = -';
$databasename = '-';
 
// do __NOT__ enable this option on public (free) sql servers as this will
// query shared tables (information_schema.tables)
$verifytables = false;
 
//If you save your replays to a folder that AllStats can access, more information, the ability to download a replay, and a chat log will be displayed on the game info page.
//If replays cannot be found, this info will be automatically omitted.
 
//Replay Location:
//OMIT THE ENDING /. DO NOT END WITH A /
//Must be a relative path.  IE: Cannot use C:/... Use repeated ../ to move up directory chain.
$replayLocation = "C:mowes\www\replays";
 
//GHost++ bot user name:
$botName = '[4H]Guard';
 
//GHost++ root administrator name:
$rootAdmin = 'Dragoljub';
 
//Settings for Top Players page
 
//Default minimum number of games played in order to be displayed on Top Players page:
$minGamesPlayed = 1;
 
//Minimal ratio (lefttime/duration) that a player/hero has to complete a game to be counted as win/loss. otherwise game is ignored.
$minPlayedRatio = 0;
//string to be shown instead of WIN/LOSS if a game is not counted due to ratio (lefttime/duration)
$notCompleted = 'LEAVER';
 
//show bans from table imported_bans (requires this table to be present!)
$includeImportedBans = false;
 
//-------------Monthly/Weekly options----------------
 
// Default view (Month / Week)
$monthlyDefaultView = 'Month';
 
// determine which rows to be shown
$monthlyRow1 = true;
$monthlyRow2 = true;
$monthlyRow3 = true;
$monthlyRow4 = true;
$monthlyRow5 = true;
 
// min games played for monthly tops (only for overall stats -> row 3/4)
$montlyMinGames = 5;
 
//The number of entries in each highscore list
$monthlyTopsListSize = 5;
 
//hide banned players on monthly / alltime tops
$hideBannedPlayersOnTops = false;
 
//---------------------------------------------------
//-------------User history options----------------
 
// Default view (Month / Week)
$historyDefaultView = 'Week';
 
// min games played for monthly tops (only for overall stats -> row 3/4)
$historyMinGames = 5;
 
//---------------------------------------------------
 
//Pre-Calculate score
//If true:  Player scores will be taken from the score table in your MySQL database. You must populate this table through your own methods.
//                    One easy way to populate the score is to run the update_dota_elo.exe program in your GHost++ folder periodically. This will automatically populate
//          your scores table through an ELO method. Personally, I have modified my GHost++ to run update_dota_elo after every game automatically.
//If false: Player scores will be dynamically calculated on page load through a formula that takes into account kills, deaths, assists, wins, losses, etc...
//                        This is less ideal and will slow your top players page load slightly. As of yet, I have not found a numeric scoring system that I believe
//                   accurately reflects skill level.
$scoreFromDB = false;
 
//Score Formula: (Only used if $scoreFromDB = false)
//Must follow SQL formatting conventions.
//Allowed variables: totgames, kills, deaths, assists, creepkills, creepdenies, neutralkills, towerkills, raxkills, courierkills, wins, losses
//Backup of default formula in case of error: '((((kills-deaths+assists*0.5+towerkills*0.5+raxkills*0.2+(courierkills+creepdenies)*0.1+neutralkills*0.03+creepkills*0.03) * .2)+(wins-losses)))'
$scoreFormula = 'Pd.eu scoresystem'
 
//Ignore public or private games on statistics pages
//Will only affect scores if you do not pre-calculate ($scoreFromDB = false). 
//If you do pre-calculate, you are expected to filter out public or private games on your own.
//IgnorePubs will override ignorePrivs if both are set to true.
$ignorePubs = false;
$ignorePrivs = false;
 
//Show all results at once or show the first page of results by default.
//$displayStyle='all' shows all data at once by default.
//$displayStyle='page' shows a single page of data by default.
$displayStyle='all';
 
//The number of results returned in a page on the top players page
$topResultSize = 50;
//The number of results returned in a page on the player statistics page
$allPlayerResultSize = 50;
//The number of results returned in a page on the hero statistics page
$allHeroResultSize = 50;
//The number of results returned in a page on the game history page
$gameResultSize = 50;
//The number of results returned in a page on the bans page
$banResultSize = 50;
//The number of results returned in a page on the admins page
$adminResultSize = 50;
//The number of results returned in a page on a hero's page
$heroResultSize = 50;
//The number of results returned in a page on a user's page
$userResultSize = 50;
//The number of results returned in a page on the monthly tops page
$monthlyTopsResultSize = 1;
//The number of results returned in a page on the monthly tops page
$userHistoryResultSize = 50;
 
 
//configure which pages to be shown
$showTops=true;
$showMonthlyTops=false;
$showPlayerStats=true;
$showHeroStats=false;
$showGameHistoy=true;
$showBans=true;
$showAdmins=false;
 
//SQLite
if($dbType == 'sqlite')
{
        try{
 
        $dbHandle = new PDO('sqlite:'.$dbLocation);
 
        }catch( PDOException $exception ){
 
        die($exception->getMessage());
 
        }
}
else
{
//MySQL
 
        $link = mysql_connect($host,$username,$password);
        if (!$link) {
                die('Not connected : ' . mysql_error());
        }
 
        // make the current db
        $db_selected = mysql_select_db($databasename, $link);
        if (!$db_selected) {
                die ('Can't use current db : ' . mysql_error());
        }
}
?>

« Last Edit: September 07, 2010, 09:39 by PlayDota.eu08 »
Quote from: Dino-Merlin
Ne nisam ti rekao sve, jednostavno nisam imao snage za to

Offline [.Shade.]

  • Pro Member
  • *
  • Posts: 327
  • Karma: +216/-88
  • Security is just a lie!!!!
    • View Profile
    • Awards
Re: Need help (Mysql i think)
« Reply #1 on: September 07, 2010, 09:23 »
nice thats mean you are a programmer is this a ranking system?


the database is telling you that there is an error with configuration in line 144 and btw i saw an error in line 144 on youre config maybe its the problem:


Code: [Select]
//The number of results returned in a page on the monthly tops page
$monthlyTopsResultSize = 1;
//The number of results returned in a page on the monthly tops page
$userHistoryResultSize = 50;


Quote
something is not good in this script

IF its not that i don't know whats the problem ask a programer in a forum of SQL he will give you the answer



best regards,
« Last Edit: September 07, 2010, 09:50 by [.Shade.] »
Award Taken:



Offline PlayDota.eu08

  • WickedSick Member
  • *
  • Topic Author
  • Posts: 1217
  • Karma: +88/-326
  • hi
    • View Profile
    • Awards
Re: Need help (Mysql i think)
« Reply #2 on: September 07, 2010, 09:27 »
nn programmer :S xd
but i ll be one :)
nah thats stats site like http://stats.playdota.eu/?p=top , only other design .
but problem is stats = ignorepub= false´
but wtf ??? lol . tried with true , tried delet and nn work



nn i just hide the pw and ... and removed the ´ :P
« Last Edit: September 07, 2010, 09:36 by PlayDota.eu08 »
Quote from: Dino-Merlin
Ne nisam ti rekao sve, jednostavno nisam imao snage za to

Offline hotbarbecue

  • Advanced Member
  • *
  • Posts: 197
  • Karma: +30/-52
  • ♫ Cucurucucuuuu ♪♫
    • View Profile
    • Awards
Re: Need help (Mysql/Sql i think)
« Reply #3 on: September 07, 2010, 10:00 »
lawl

Offline XenyStyle

  • WickedSick Member
  • *
  • Posts: 1090
  • Karma: +58/-55
  • Waarsshhhgggg!!! khm...khm..khmm damn this cold
    • View Profile
    • Awards
Re: Need help (Mysql/Sql i think)
« Reply #4 on: September 07, 2010, 10:47 »
i hate programming :P
4 years in school C++,C#,C builder,a bit mysql,baaaaaaaaa,HATE IT
and there are 2 more years of programing >.<

Offline PlayDota.eu08

  • WickedSick Member
  • *
  • Topic Author
  • Posts: 1217
  • Karma: +88/-326
  • hi
    • View Profile
    • Awards
Re: Need help (Mysql/Sql i think)
« Reply #5 on: September 16, 2010, 22:44 »
kk np u can close it me fix it like np xddd
http://clan-4h.comoj.com/
Quote from: Dino-Merlin
Ne nisam ti rekao sve, jednostavno nisam imao snage za to

Offline fawkz

  • Founder
  • Hero Member
  • *
  • Posts: 532
  • Country: 00
  • Karma: +181/-40
  • F#WKz!
  • Awards LA High Staff [EPIC]
    • View Profile
    • Awards
Re: Need help (Mysql/Sql i think)
« Reply #6 on: September 17, 2010, 01:11 »
If you need any kind of this support go to http://www.codelain.com/forum/, the proper site.

Locked.