Raised This Month: $423 Target: $400
 105% 

[TF2 Stats] With Web Ranking and Item Logger [v9.1.0]


Post New Thread Reply   
 
Thread Tools Display Modes
DarthNinja
SourceMod Plugin Approver
Join Date: Mar 2009
Location: PreThinkHook()
Old 09-13-2011 , 00:23   Re: [TF2 Stats] With Web Ranking and Item Logger [v8.6.0/v7.3.0]
Reply With Quote #1921

Quote:
Originally Posted by cjmwid View Post
when i go to edit the index.php to put a Ad at the top or bottom i uplaod new index file and i get a blank page any help?
You probably screwed something up in the file.
__________________
DarthNinja is offline
Obsidian
Senior Member
Join Date: Jun 2011
Old 09-13-2011 , 14:36   Re: [TF2 Stats] With Web Ranking and Item Logger [v8.6.0/v7.3.0]
Reply With Quote #1922

Quote:
Originally Posted by cjmwid View Post
when i go to edit the index.php to put a Ad at the top or bottom i uplaod new index file and i get a blank page any help?
Check the httpd error log.
__________________
TF2 Stats plugin alternative web interface - profile @ Github
(tf2stats-webui latest release: 1.1.1)


"If you're not willing to do it right, don't get involved with security or Explosive Ordinance Disposal."
Obsidian is offline
Obsidian
Senior Member
Join Date: Jun 2011
Old 09-13-2011 , 17:29   Re: [TF2 Stats] With Web Ranking and Item Logger [v8.6.0/v7.3.0]
Reply With Quote #1923

Took a break from Calculus homework (yay derivatives!)

So, without further ado...

The 1.1.1 update for my tf2stats web ui is now available!

The interface also leverages the new features of HTML5, CSS3, and also makes use of PHP 5.3 OOP to organize the codebase into something very close to an MVC pattern (it doesn't use models, that'd be overkill).
The interface also makes use of the Steam Web API to provide a few different unique features, and to also build it around an already existing community and foster its growth.

The full set of changes is available here:
https://github.com/damianb/tf2stats/...1.1.0...v1.1.1

Notable changes in 1.1.1 include:
  • [bug] Rows with the BOT steamid were queried along with normal players. They are now excluded
  • [dependency] Twig updated to 1.2.0
  • [dependency] OpenFlame Framework updated to latest commit
  • [dependency] OpenFlame Dbal updated to full v1.0 release
  • [dependency] Quartz updated to latest commit
  • [improvement] Remove a bit of duplicate code by extending the Quartz controllers

Update instructions:
  1. Download 1.1.1
  2. Delete the following off of your server:
    • All files and directories in includes/
    • All subdirectories in cache/twig/
  3. Take a backup of your config file at data/config/config.json
  4. Upload (overwrite) these files:
    • data/config/routes.json
  5. IF YOU ARE USING THE PHAR RELEASE, UPLOAD THE lib/ DIRECTORY
    IF YOU ARE USING THE NORMAL RELEASE, UPLOAD THE includes/ DIRECTORY
  6. Open up site, make sure everything works
  7. Act as if you're lightheaded, and appear to pass out at your computer.

Quote:
WARNING REGARDING THE PHAR RELEASE
The phar release requires that your PHP installation have OpenSSL support!
Additionally, if you are running the Suhosin PHP hardening patch, you must allow the .phar extension to be executed by PHP in your suhosin configuration.
Furthermore, as discovered by the Silex team (another Open Source project), if you are running the Ioncube loader, you must be running 4.0.9 or newer; older versions interfere with phar execution.


I'm sure you're wondering now, why the phar release?
Well, it's openssl signed. This guarantees that, if the phar archive is modified, it cannot be used unless resigned by the private key that is in only my possession. This protects you, the end user, against having the script modified without your knowledge.
If you wish to modify the script, you're free to do so, but you'll have to obtain the includes/ directory which is included in the other release.
Oh, and the phar release is also much more compact. The .zip for the normal release of 1.1.0 was about 3.5MB; the .zip for the phar release of 1.1.0 was 475KB, which is a substantial difference in size.

Anyways.


Demo: http://tf.scrii.com/
I am not responsible for any raptor attacks that occur on the demo site.
(running a slightly customized version of 1.1.1)


License: Original code licensed under GNU GPL v3 - dependency licenses are listed in the README, available here: https://github.com/damianb/tf2stats/...EADME.markdown

Download 1.1.1 @ github: https://github.com/damianb/tf2stats/downloads



ENJOY!
__________________
TF2 Stats plugin alternative web interface - profile @ Github
(tf2stats-webui latest release: 1.1.1)


"If you're not willing to do it right, don't get involved with security or Explosive Ordinance Disposal."
Obsidian is offline
cjmwid
Junior Member
Join Date: Sep 2011
Old 09-13-2011 , 23:08   Re: [TF2 Stats] With Web Ranking and Item Logger [v8.6.0/v7.3.0]
Reply With Quote #1924

Quote:
Originally Posted by DarthNinja View Post
You probably screwed something up in the file.
Quote:
Originally Posted by Obsidian View Post
Check the httpd error log.
DarthNinja i only added the google ads code and thats it i added it here
Index.php With Ads
Code:
<script type="text/javascript"><!--
google_ad_client = "ca-pub-2821170659970125";
/* tf2index */
google_ad_slot = "5102888375";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<?php
header( 'Content-Type: text/html; charset=UTF-8' );

include("inc/dbconnect.php");
include("inc/footer.inc.php");
include("swf/open-flash-chart.php");

mysql_query("SET CHARACTER SET 'utf8'");
    
$sql = 'SELECT STEAMID, NAME, POINTS FROM `Player`';
$sql .= " WHERE `STEAMID` <> 'BOT'";
$sql .= ' ORDER BY `POINTS` DESC LIMIT 0, 5 ';

$ergebnis = mysql_query($sql);

$players = array();
$points = array();
$highestpoints = 0;
$counter = 0;
while ($adr = mysql_fetch_array($ergebnis)){
    $counter++;
    $players[$counter] = $adr['NAME'];
    $points[$counter] = $adr['POINTS'];
    
    if($adr['POINTS'] > $highestpoints)
    {
        $highestpoints = $adr['POINTS'];
    }
}

$animation = 'pop';
$delay = 0.5;
$cascade = 1;

$title = new title( "" );
$title->set_style( '{color: #567300; font-size: 14px}' );

$data=array();
$x_labels = array();
$i2 = 0;
foreach ($players as $player)
{
                $i2++;
        $barvalue = new bar_value($points[$i2]);
        $barvalue->set_tooltip( $points[$i2] );
        $data[] = $barvalue;
        
        $x_labels[] = $player;
}

$bar = new bar_sketch( '#EEA411', '#567300', 5 );
$bar->set_values( $data );
$bar->set_on_show(new bar_on_show($animation, $cascade, $delay));

$y = new y_axis_right();
$y->set_range( 0, $highestpoints );


                $xlabel= new x_axis_labels();
                $xlabel->set_vertical();
                $xlabel->set_labels( $x_labels );
                
                                $x = new x_axis();
                $x->set_labels_from_array($x_labels);
                $x->set_labels( $xlabel );

$chart = new open_flash_chart();
$chart->set_title( $title );
$chart->add_element( $bar );
$chart->set_y_axis( $y );
$chart->set_x_axis( $x );

//echo $chart->toPrettyString();
?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Current Players - <?php echo $clanname ?></title>
<link rel=stylesheet type=text/css href="styles/default.css">
<link type="text/css" href="styles/menu.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="styles/jquery.jqplot.css" />

<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script> 
<script type="text/javascript" src="js/menu.js"></script>
    
<script type="text/javascript" src="js/json2.js"></script>
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript">swfobject.embedSWF("swf/open-flash-chart.swf", "my_chart", "490", "300", "9.0.0");</script>

        <script type="text/javascript" language="javascript"><!--
            
            function ofc_ready()
            {}
            
            function open_flash_chart_data()
            {
                return JSON.stringify(data);
            }
            
            function findSWF(movieName) {
              if (navigator.appName.indexOf("Microsoft")!= -1) {
                return window[movieName];
              } else {
                return document[movieName];
              }
            }
                
            var data = <?php echo $chart->toPrettyString(); ?>;

        </script>
        
</head>
<body>
<?php include("inc/headerlinks.inc.php"); ?>
<div align=center>
  <img src="images/headers/header_onlineplayers.jpg" />
</div>
<table style="" width="500" border="0" cellpadding="0" cellspacing="0" align="center">
                <tr valign="top">
                                              <td valign=top colspan="2" align="center" class="tlarge coltitle">Best Players of the Server</td>
                                                        </tr>
                                                        <tr><td class=row style="background-color:#fff;" colspan="2">
                                                      
                                                      <div id="my_chart"></div>
                                                      
                                                  </td></tr></table>
  <table class="" style="border:none" width=500" border="0">
      
    <tr>
<td class=row><div>

<?php
$ts1 = time() - (90 + $tioffset);
mysql_query("SET CHARACTER SET 'utf8'");

$sql = "SELECT * FROM Player WHERE LASTONTIME >= '$ts1'";
$query = mysql_query($sql) or die('DB Query failed');
if (mysql_num_rows($query) == 0) {
echo 'No online players at the moment';
}
else {
    
$page = 1;
if(isset( $_GET['page'] ))
{
    if(mysql_real_escape_string($_GET['page']))
    {
       $page = mysql_real_escape_string($_GET['page']);
    }
}

$per_page = "35";
$count = mysql_num_rows($query);
$limit = ($page - 1) * $per_page;

$pages = ceil($count / $per_page);
$previous = $page - 1;
$next = $page + 1;

$ol = $limit + 1;

echo('<ol start="' . $ol . '">');

if($page <= $pages)
{
   $sql = 'SELECT * FROM `Player` WHERE LASTONTIME >= '.$ts1.' ORDER BY `POINTS` DESC LIMIT ' . $limit . ',' . $per_page;
   $ergebnis = mysql_query($sql);
  $fromplayer = 0;
  $i = 1;
$i = $i + $fromplayer;
while ($adr = mysql_fetch_array($ergebnis)){
 $timestamp = $adr['LASTONTIME'];
 if ($timestamp == 0)
 {
 $laststr = "never";
 }
 else
 {
 $datum = date("d.m.Y",$timestamp);
  $uhrzeit = date("H:i",$timestamp);
  $laststr = $datum." - ".$uhrzeit;
  }
echo '
    <li><a href="player.php?steamid='.$adr['STEAMID'].'">'.$adr['NAME'].'</a><br /><br /></li>
    
    ';



}
echo('</ol>');

switch($page)
{
     case($page == $pages && $previous == 0):
          echo('Page ' . $page . ' of ' . $pages);
     break;

     case($page != $pages && $previous != 0):
          echo('Page ' . $page . ' of ' . $pages . ' <a href="?page=' . $previous . '">Previous 20</a> | <a href="?page=' . $next . '">Next 20</a>');
     break;

     case($page != $pages):
          echo('Page ' . $page . ' of ' . $pages . ' <a href="?page=' . $next . '">Next 20</a>');
     break;

     case($page == $pages && $previous != 0):
          echo('Page ' . $page . ' of ' . $pages . ' <a href="?page=' . $previous . '">Previous 20</a>');
     break; 
}
}
else
{
  echo("</ol>");
}
}

########################






#############################


?>
</td></tr></div>
  </table>
<?php echo $mainindexfooter ?>
</td>
</tr>
</table>
</body>
</html>
and whe n i do that i get this in error_log

Code:
[13-Sep-2011 23:06:08] PHP Warning:  Module 'suhosin' already loaded in Unknown on line 0
[13-Sep-2011 23:06:08] PHP Warning:  Module 'ionCube Loader' already loaded in Unknown on line 0
[13-Sep-2011 23:06:08] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/cjmwid/public_html/index.php:12) in /home/cjmwid/public_html/index.php on line 13
[13-Sep-2011 23:06:13] PHP Warning:  Module 'suhosin' already loaded in Unknown on line 0
[13-Sep-2011 23:06:13] PHP Warning:  Module 'ionCube Loader' already loaded in Unknown on line 0
so i don't know the page loads fine should i be ok?
cjmwid is offline
cool_myll
SourceMod Donor
Join Date: Aug 2011
Old 09-14-2011 , 03:43   Re: [TF2 Stats] With Web Ranking and Item Logger [v8.6.0/v7.3.0]
Reply With Quote #1925

Can someone help me with the settings?

http://www.tf2.gr/stats/player.php?s...AM_0:1:4976452

Why this isnt opening? I registered the Steam API key to tf2.gr. Should i have registered it to tf2.gr/stats?

Also i have some problems inserting the the old sqlite database in the mysql database.

EDIT: It opened but i get this now: Query failed: Table 'tf2stats.weapons' doesn't exist
__________________

Last edited by cool_myll; 09-14-2011 at 05:36.
cool_myll is offline
DarthNinja
SourceMod Plugin Approver
Join Date: Mar 2009
Location: PreThinkHook()
Old 09-14-2011 , 07:15   Re: [TF2 Stats] With Web Ranking and Item Logger [v8.6.0/v7.3.0]
Reply With Quote #1926

Quote:
Originally Posted by cool_myll View Post
Can someone help me with the settings?

http://www.tf2.gr/stats/player.php?s...AM_0:1:4976452

Why this isnt opening? I registered the Steam API key to tf2.gr. Should i have registered it to tf2.gr/stats?

Also i have some problems inserting the the old sqlite database in the mysql database.

EDIT: It opened but i get this now: Query failed: Table 'tf2stats.weapons' doesn't exist
Looks ok to me.
If you're still having issues, did you read the setup guide, and/or steps to port from sqlite to mysql, and/or FAQ?
__________________
DarthNinja is offline
cool_myll
SourceMod Donor
Join Date: Aug 2011
Old 09-14-2011 , 08:15   Re: [TF2 Stats] With Web Ranking and Item Logger [v8.6.0/v7.3.0]
Reply With Quote #1927

Yes i read the guide. Finally did it but hosting the database on the same server as the game lags the server. I tried 000webhost.com but i get the DB failed message. Anyone knows any free mysql hosts?

Maybe 000webhost cant be accessed by outside?
__________________
cool_myll is offline
Obsidian
Senior Member
Join Date: Jun 2011
Old 09-14-2011 , 17:49   Re: [TF2 Stats] With Web Ranking and Item Logger [v8.6.0/v7.3.0]
Reply With Quote #1928

Quote:
Originally Posted by cool_myll View Post
Can someone help me with the settings?

http://www.tf2.gr/stats/player.php?s...AM_0:1:4976452

Why this isnt opening? I registered the Steam API key to tf2.gr. Should i have registered it to tf2.gr/stats?

Also i have some problems inserting the the old sqlite database in the mysql database.

EDIT: It opened but i get this now: Query failed: Table 'tf2stats.weapons' doesn't exist
I'm not sure if a Steam API key is required for the official web ui or not. I know it's needed for mine, however; mine is built around the API.
__________________
TF2 Stats plugin alternative web interface - profile @ Github
(tf2stats-webui latest release: 1.1.1)


"If you're not willing to do it right, don't get involved with security or Explosive Ordinance Disposal."
Obsidian is offline
cool_myll
SourceMod Donor
Join Date: Aug 2011
Old 09-14-2011 , 18:23   Re: [TF2 Stats] With Web Ranking and Item Logger [v8.6.0/v7.3.0]
Reply With Quote #1929

Thanks for the answer obsidian. I fixed most of the problems but my server often lags now. Is the stats live? Is it possible to write once every maps so it isnt so intensive?
__________________
cool_myll is offline
Obsidian
Senior Member
Join Date: Jun 2011
Old 09-14-2011 , 22:28   Re: [TF2 Stats] With Web Ranking and Item Logger [v8.6.0/v7.3.0]
Reply With Quote #1930

It is live, however with the current design, you can't queue updates from what I understand. That'd be up to DN for a recode; it'd be a heavy one too.
__________________
TF2 Stats plugin alternative web interface - profile @ Github
(tf2stats-webui latest release: 1.1.1)


"If you're not willing to do it right, don't get involved with security or Explosive Ordinance Disposal."
Obsidian is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:43.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode