ImportBot Posted November 23, 2013 Share Posted November 23, 2013 Originally Posted by Kinsman*: Whats posted should have commanders, I'm UTC +11 so it will be about 12 hours before the servers are full again, will capture then. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 23, 2013 Share Posted November 23, 2013 Originally Posted by ty_ger07*: Whats posted should have commanders, I'm UTC +11 so it will be about 12 hours before the servers are full again, will capture then.It doesn't appear to have any players in the server. Commander stats aren't saved to the database. I am hoping they will at least show up on the scoreboard though when they are in the server. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 23, 2013 Share Posted November 23, 2013 Originally Posted by ty_ger07*: I am pretty good with the code but bad with design. What this project really needs is someone to help me design a great looking page. proto.jpg Anybody good with design interested? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 23, 2013 Share Posted November 23, 2013 Originally Posted by Kinsman*: Your awesome compared to me, so I'm prob not much help. This is me trying to add server totals and failing miserably. http://jw.servegame.org/stuff/ Anyhow, will capture those live players and post another sql dump for you tonight. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 23, 2013 Share Posted November 23, 2013 Originally Posted by ty_ger07*: Thanks! I will work on those totals. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 23, 2013 Share Posted November 23, 2013 Originally Posted by ty_ger07*: Right now I am working on overhauling it and making it look like BF4 and no longer like BF3. http://open-web-community.com/bf4sta...tats/index.php I hope to work out whether or not commanders can show on the scoreboard when I get that new copy of the database. That is when I will also focus on adding up server stats on the index page and work on weapon top rankings and that sort of stuff. EDIT: Code linked in first page has been updated (php files, images, and CSS). Now the page looks like BF4. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 23, 2013 Share Posted November 23, 2013 Originally Posted by Kinsman*: Heres sql with server 2 full, battlelog was showing commanders at the time. Attached Files: stats2.zip * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 23, 2013 Share Posted November 23, 2013 Originally Posted by ty_ger07*: Heres sql with server 2 full, battlelog was showing commanders at the time.Cool, cool, cool! Thanks a lot. I will take a look at it when I can. I am celebrating Thanksgiving this weekend with my family early, so it will probably be Monday when I take a look at it. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 23, 2013 Share Posted November 23, 2013 Originally Posted by Kinsman*: Family is more important, I will wait patiently for those server totals on tuesday. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 23, 2013 Share Posted November 23, 2013 Originally Posted by ty_ger07*: It doesn't look like there is any reliable commander data. If there are commanders listed in that data, I can't tell which ones are commanders. They are either the ones who say they are still joining the server, or they are the ones with no kills or deaths. There's nothing to reliably tell who is a commander. You haven't updated your stats page yet. It should look like this: proto.jpg It looks like US is always team 1 and team 2 can be RU or CN depending on the current map. I haven't played BF4 yet enough to know which maps have CN and which maps have RU. Anyone able to offer some insight? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 23, 2013 Share Posted November 23, 2013 Originally Posted by Cermit*: What if I run 2 Servers, with 2 separate DBs? Can I use the StatsMain.php only if both Servers are using the same database? I can only set a different server_ID, but cannot set a second Database... Is there any solution I just didn´t find yet? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 23, 2013 Share Posted November 23, 2013 Originally Posted by ty_ger07*: What if I run 2 Servers, with 2 separate DBs? Can I use the StatsMain.php only if both Servers are using the same database? I can only set a different server_ID, but cannot set a second Database... Is there any solution I just didn´t find yet? It would be possible to modify it to use different databases. Right now it assumes that the servers will all be in the same database. Do you need help with the php to edit the code for creating a second database connection link? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 23, 2013 Share Posted November 23, 2013 Originally Posted by TMiland*: Thanks for this ty_ger07! I wanted to share a little edit for the server name in the index file: Add this on line 149: Code: // get servername $server_name = @mysql_query("SELECT ServerName FROM tbl_server WHERE `ServerID` = '$sid'"); if(@mysql_num_rows($server_name)!=0) { $current_row = @mysql_fetch_assoc($server_name); $server_name = $current_row['ServerName']; }Then on line 190:Change this: Code: <a href="' . $link . '"><font size="4">' . $server . '</font></a>To:Code: <a href="' . $link . '"><font size="4">' . $server_name . '</font></a>Then delete line 18-19. Code: // SERVER NAME $server_name = array('Your servername','Your servername2','Your servername3'); // Enter each server name to display.For each server page, just delete line 16:Code: //$server_name = 'Your servername'; // server name to displayNow you have dynamic server names. http://www.nbfc.no/bf4stats/index.php * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 24, 2013 Share Posted November 24, 2013 Originally Posted by CptChaos*: Keep in mind that the search is capable of SQL injection as far as I can see. This is a bad idea, because someone can search for something and add a query to do something evil, like erasing all the stats. I'd like to develop and help, but I actually don't understand this code, I can't see what's doing what, otherwise I would've uploaded a patched version myself. Other tips and / or ideas: The database has the servername stored already; why not fetch it from there? And why isn't there something like a configuration file? One file, with most settings and thus setting it once and/or changing it once. Don't mind the looks though, I really like them a lot! But hey, I am a developer, not a designer, lol! Another tip: use numbers as integers, don't typecast them into text. Numbers are way faster than their alphanummeric character, $server_ID is a number, but the variable is used as text. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 24, 2013 Share Posted November 24, 2013 Originally Posted by Cermit*: It would be possible to modify it to use different databases. Right now it assumes that the servers will all be in the same database. Do you need help with the php to edit the code for creating a second database connection link?Thanks for the fast reply.Some help on that would be awesome, as I´m not too familiar on php editing. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 24, 2013 Share Posted November 24, 2013 Originally Posted by ty_ger07*: Edit: not to disagree with your input, but more to rationalize my choices: Yes, you could inject additional SQL into the URL if you wished. I guess I was never very concerned because I don't see why anyone would be malicious with a stats database. I guess they could do it to be a troll if they really wanted to. There isn't much motive and I assume that most people who are technically capable of SQL injection would have little incentive. This wouldn't provide you access to personal information or accounts. All you would be able to do is access or destroy publicly available information. But like you say, this could be fixed by filtering the URL input designing it to only accept expected inputs and ignore unexpected data. The page does already use the server's name in the database if an empty or NULL value is provided by the user. Adding a server name manually is optional. I'm not a designer either. I try my best. The page did/does use one setting file in a way. The stats index page I guess has turned into a second file, but originally the stats index page didn't exist and this was all one file. The user just needs to enter the server info for THIS server in the top of its associated stats file and that is it. This allows people to create as many copies of the same file as they want and connect each one to a different domain host or different database or use any combination of databases and server IDs. This decentralized settings system allows more options which a single settings file may restrict. With a single file, you run into issues if multiple databases are used and some servers connect to one database and another to another database and that sort of issue. The page does use numbers as integers already. It is only the configurable input at the top of the file which type cast the integer as a string simply for providing a consistent easy field insertion method for users using the file. Some may not know the difference between strings and integers and I decided to make them all strings so the user enters them all in the same way. But users are free to enter the server ID as 1; instead of '1'; if they wish. Edit 2: I think I will need to look through the file again though as it is possible that I made comparisons such as != '0' instead of != 0. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 24, 2013 Share Posted November 24, 2013 Originally Posted by Kinsman*: Some good input, I haven't updated as I was waiting for the server totals in Index, but will update now to keep up. :-) Our DB gets larger daily if you need more stats. Agreed about calling a config file, it would make updating faster. Just on the server name thing, the ability to manually enter server names is handy to make the page look nicer if you happen to have insanely long server names. By Server Totals this is what I mean here. http://jw.servegame.org/test/ Total Players, Total Scores, Total Dogtags, Total Kills, Total Headshot, and Total Deaths all work there. I've been plugging away at it still, but no joy getting it working on the index here yet. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 24, 2013 Share Posted November 24, 2013 Originally Posted by ty_ger07*: I plan to add the server totals to the index page monday. I am sorry I have taken so long to fulfill this request. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 24, 2013 Share Posted November 24, 2013 Originally Posted by t0p8uzz*: Nice small section for our front page Red blocks to hide server names. Happy to share if someone wants something very similar * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 24, 2013 Share Posted November 24, 2013 Originally Posted by MorpheusX(AUT)*: Nice small section for our front page Red blocks to hide server names. Happy to share if someone wants something very similar I'd be quite interested in something like this Looks great! * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 24, 2013 Share Posted November 24, 2013 Originally Posted by Kinsman*: I plan to add the server totals to the index page monday. I am sorry I have taken so long to fulfill this request.No problem, that's why I was waiting to update it all at once, as every update I need to make a lot of edits to all six pages, so it takes awhile. And yes those server displays look great t0p8uzz please do post the edits. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 24, 2013 Share Posted November 24, 2013 Originally Posted by Jamesonp*: Nice small section for our front page Red blocks to hide server names. Happy to share if someone wants something very similar Yes please! * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 24, 2013 Share Posted November 24, 2013 Originally Posted by Berndel*: Nice small section for our front page Red blocks to hide server names. Happy to share if someone wants something very similar Nice work thanks for share this can you upload the code ? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 24, 2013 Share Posted November 24, 2013 Originally Posted by Porthos1973*: Nice small section for our front page Red blocks to hide server names. Happy to share if someone wants something very similar Very interested in this. You should just send it to ty_ger07 so he can add it to the next update. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 24, 2013 Share Posted November 24, 2013 Originally Posted by CptChaos*: Is it maybe an idea to create a 'repository' for this on github? Thay way users can contribute to this statpage and I'd be happy to help develop! The page does already use the server's name in the database if an empty or NULL value is provided by the user. Adding a server name manually is optional.Maybe I need to update the files then, I tried to make them '' or an emtpy array, but then the names just disappear. And a feature request: Are player statistics coming? I know I can see the stats from a player per-server, but I'd like to also see the stats from multiple servers counted together, when a user has played on more than 1 server in the 'network'. Hmmm... Overwrited the files, I have to reconfigure everything now, would be awesome if someone wouldn't have to do that every time when an update has been released. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 24, 2013 Share Posted November 24, 2013 Originally Posted by Kinsman*: Heres some nice map pics if we going to add pics. www.jw.servegame.org/downloads/maps.zip * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 24, 2013 Share Posted November 24, 2013 Originally Posted by Ralphvd*: Nice small section for our front page Red blocks to hide server names. Happy to share if someone wants something very similar It looks really nice! * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 24, 2013 Share Posted November 24, 2013 Originally Posted by Kinsman*: adding map pics is easy, getting the alignment you want? not so much! http://jw.servegame.org/stuff/ * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 24, 2013 Share Posted November 24, 2013 Originally Posted by CptChaos*: Another tip, use valid HTML-code. The -tag has been deprecated for years now. Don't get me wrong, I may be picky and jerky, I like this stats page a lot and I really appreciate the time you've spend on it. I really would like to help out, even on coding and such. But the code could be much better and better readable, rewriting it would cost me too much time. EDIT: With how many tables did you build this? Damn, I hardly can't find a thing if I want to change a thing. Building a webpage with tables is sooo 1995... :/ (Sorry to put it that way) * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 24, 2013 Share Posted November 24, 2013 Originally Posted by TMiland*: I added map images as backgrounds, pretty satisfied! Let me know if interested, and i'll share the edits. *Edit I'll share them anyways. Download the map images maps.zip, then do the following in index.php(or whatever your index file is called): Add a new line on line 137: Code: $image_map = str_replace(' ', '%20', $map_name) . '.jpg'; // CHANGE SPACES FOR A VALID URLThen add new line on line 142:Code: <div style="border:none; background-image: url(' . $image_map . '); background-repeat:no-repeat; background-position:left; margin-left: 10px;">And closing div on line 174:Code: </div>That's it! *Edit2 Forgot to add the alignment of the tables! Just replace from line 139 to 179 with this: Code: echo ' <tr> <td width="100%" style="text-align: left;"> <div class="middlecontent"> <div style="border:none; background-image: url(' . $image_map . '); background-repeat:no-repeat; background-position:left; margin-left: 10px;"> <table width="95%" align="center" border="0"> <tr> <td width="45%"> <a href="' . $link . '"><font size="4">' . $server_name . '</font></a> </td> <td width="12%"> <font class="information">Current Players In Server:</font> ' . $players . ' </td> <td width="12%"> <font class="information">Current Map:</font> ' . $map_name . ' </td> <td width="11%"> <font class="information">Users Viewing Stats:</font> ' . $ses . ' </td> </tr> <tr> <td width="45%"> <a href="' . $battlelink . '" target="_blank"><img src="./joinbtn.png" alt="join"/></a> </td> <td width="12%"> <font class="information">Players Logged:</font> ' . $total_players . ' </td> <td width="12%"> <font class="information">Total Score:</font> ' . $score . ' </td> <td width="11%"> <font class="information">Total Kills:</font> ' . $kills . ' </td> </tr> </table> </div> </div> </td> </tr> '; Attached Files:1kLKb.jpeg * Restored post. It could be that the author is no longer active. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.