phpnuke BF 2142 stats

For discussion of the BB stats code.
nos

phpnuke BF 2142 stats

Postby nos » Tue Sep 25, 2007 11:22 am

Hey guys,

First off i wanna say thanks for releasing the stats system to the public
as i know how much hard work has gone into it, I hope ppl appreciate it.

Over the last week i have been working on my own clan system
for phpnuke, thanks to Mort for pointing me in the direction of the
bf2142 stats Wiki. Its not as complex as the Budda System, basically
only gets the members player over view and lists them from highest
to lowest.

view it here.
http://www.wwoy.net/modules.php?action= ... s&sub=View

I had originally planned not to bother with detailed stats like
awards, medals ect, but now i have decided to continue with my project
and complete a full stats system.

I'm still yet to decide exactly how im going to
format the stats but I'm not going to copy the budda
system just use it as a reference.

All of my project will be documented in this forum and all source code
will also be made available here along with the finished phpnuke module.

:-D

User avatar
Mort
Alpha-Forum Whore
Alpha-Forum Whore
Posts: 4231
Joined: Thu Dec 01, 2005 10:40 pm

Postby Mort » Tue Sep 25, 2007 12:05 pm

Cool, just remember to keep credits where appropriate. If you put a link on the bottom of your stats page pointing to us, then it might help bring more people into the "community" as well.
Image

nos

Re: phpnuke BF 2142 stats

Postby nos » Fri Jan 18, 2008 1:59 pm

hey all,

the PHP conversion for the Budda clan BF 2142 stats system is coming along nicely
I have completed the Player stats summary and just now finished converting the
Player over view.

check it out
Image


Image

User avatar
Mort
Alpha-Forum Whore
Alpha-Forum Whore
Posts: 4231
Joined: Thu Dec 01, 2005 10:40 pm

Re: phpnuke BF 2142 stats

Postby Mort » Fri Jan 18, 2008 4:53 pm

Good work. It's not a trivial excercise what you are doing, and chances are your efforts will be much more greatly appreciated by the wider community as I would expect more people would be using pure php/MySQL environments rather than MS based ones.

Look forward to seeing the published results on your site!
Image

User avatar
Piers
Comfortable with my sexuality
Comfortable with my sexuality
Posts: 1408
Joined: Fri Dec 02, 2005 7:57 am
Location: Horse country

Re: phpnuke BF 2142 stats

Postby Piers » Sat Jan 19, 2008 8:13 am

Good one - feel free to borrow my CSS to make it look nice.
Image

nos

Re: phpnuke BF 2142 stats

Postby nos » Sat Jan 19, 2008 8:59 am

I was going to ask you about that, where can i get your CSS file from?

also I have 2 problems with the Player Overview.

1. can figure out what this is.

Code: Select all

if inStr(colval(ci),"!") > 0 then
resultStr = calcFn(a,mid(colval(ci),2))

What Stat value is this?
I do not see any "Colval" with an Instr "!".

or how the function its calling works.

Code: Select all

function calcFn(a,calcn)
   fnset = split(calcn,",")
   if fnset(0) = "SUM" then
      calcFn = 0
      for fi = 1 to Ubound(fnset)
         calcFn = calcFn + int(playerHash.Item(a).Item(fnset(fi)))
      next
   else
      aval = int(playerHash.Item(a).Item(fnset(0)))
      bval = int(playerHash.Item(a).Item(fnset(2)))
      select case fnset(1)
         case "-"
            calcFn = aval - bval
         case "/"
            calcFn = formatnumber(aval / bval,2)
      end select
   end if
end function


2.Player Clan Dog tags.
How are u getting this value?

Thanks mate,
Nos

User avatar
Mort
Alpha-Forum Whore
Alpha-Forum Whore
Posts: 4231
Joined: Thu Dec 01, 2005 10:40 pm

Re: phpnuke BF 2142 stats

Postby Mort » Sat Jan 19, 2008 12:29 pm

If the CSS isn't already in the download pack I'll put a copy in the stats download topic for you. It's the same style sheet we are using for the whole site so it's got a lot of stuff not relevant to the code pages. Maybe if Piers gets bored he can make a version with just the stats page specific stuff in it.

The stat query I don't know about. Have to wait for Piers on that one.

Clan dogtags... a BB special :) We have an extra field in the DB table [tags]. Theres a function in the 2142datafeed code (gettags) that gets the dogtags the player has collected and then filters it against the list of clan nicks from the array at the top. By default it's commented out, but just remove the comments if you want to do it as well :D

You can see how we use it as a simple table on the front page of the site. Good for inter-clan bragging rights. :axe:

nos

Re: phpnuke BF 2142 stats

Postby nos » Sat Jan 19, 2008 12:47 pm

Thanks mort that would be grate, I dont want to use your CSS just to take a look at
the way u did ur styles would be good enough as Im not really that good with CSS.

I did see the dog tags part I'll have to set that up for sure.

I have just finished the weapons and vehicles tables, just have the awards and
unlocks left but i imagine they will be the hardest part of the conversion.

oh and the Big Player summary with the last 7 days stats.

thanks
Nos.

User avatar
Mort
Alpha-Forum Whore
Alpha-Forum Whore
Posts: 4231
Joined: Thu Dec 01, 2005 10:40 pm

Re: phpnuke BF 2142 stats

Postby Mort » Sat Jan 19, 2008 1:07 pm

nos wrote:Thanks mort that would be grate, I dont want to use your CSS just to take a look at
the way u did ur styles would be good enough as Im not really that good with CSS.
If you've been generating the code with the style codes we have used then just changing the style sheet to suit your sites look is all you need to do then. The first part of our style sheet has all the stuff from the "skins" Piers setup, there's a section about half way down commented as the stats style section that you are probably after most.

BTW - With the screen shot images, if you use the "Upload attachment" tab at the bottom of the post screen then it will create thumbnails in the post instead of just cutting them off when they don't fit the column...
Image

nos

Re: phpnuke BF 2142 stats

Postby nos » Sat Jan 19, 2008 5:07 pm

I have been using the same tags in my code so the CSS worked perfectly,Thanks.

another update.

I just finished the unlock Tables and its all working well and looking very nice with ur CSS.

Now I'm just waiting for piers to answer my other question about the Over view Tables
so i can complete them,then I'll start the Awards Tables and its pretty much done!

Hope to get the Awards done tomorrow.

I cant believe how well u did this piers, your a bloody good coder mate!

PS:
Can you also explain how the popstar function works? does it use any
Java scrip to show the windows or is it just CSS.

Edit ***
Almost Finished the Awards tables just have a couple of little errors to fix
I'm getting most of the awards print out right but then i get a syntax error
because of a null value passed to a function.

User avatar
Piers
Comfortable with my sexuality
Comfortable with my sexuality
Posts: 1408
Joined: Fri Dec 02, 2005 7:57 am
Location: Horse country

Re: phpnuke BF 2142 stats

Postby Piers » Sun Jan 20, 2008 12:59 pm

nos wrote:I was going to ask you about that, where can i get your CSS file from?

also I have 2 problems with the Player Overview.

1. can figure out what this is.

Code: Select all

if inStr(colval(ci),"!") > 0 then


It's leftover code, I used to have a few values combined to do calculations on the fly, e.g.

Code: Select all

 "!win,/,los" ... "!SUM,bksgpm-0,bksgpm-1"

Feel free to remove the code.
In the ASP, this means the existing loop

Code: Select all

         <% for each a in playerHash.Keys
             if inStr(colval(ci),"!") > 0 then
               resultStr = calcFn(a,mid(colval(ci),2)) %>
            <td align="right"><%=resultStr%></td>
         <%    elseif inStr(colname(ci),"Favourite") then %>
            
         <%    if inStr(colname(ci),"Mode") then %>
            <td align="right"><%=fmode(playerHash(a)(colval(ci)))%></td>            
         <%    elseif inStr(colname(ci),"Veh") then %>
            <td align="right"><%=vehs(playerHash(a)(colval(ci)))%></td>            
         <%    elseif inStr(colname(ci),"Kit") then %>
            <td align="right"><%=kits(playerHash(a)(colval(ci)))%></td>            
         <%    elseif inStr(colname(ci),"Map") then %>
            <td align="right"><%=fmap(playerHash(a)(colval(ci)))%></td>            
         <%    elseif inStr(colname(ci),"Weap") then %>
            <td align="right"><%=weps(playerHash(a)(colval(ci)))%></td>            
         <%    elseif inStr(colname(ci),"Equip") then %>
            <td align="right"><%=equip(playerHash(a)(colval(ci)))%></td>            
         <% end if %>
         <%    elseif inStr(colname(ci),"Time") then %>
            <td align="right"><%=makeTime(playerHash(a)(colval(ci)))%></td>
         <%    else %>
            <td align="right"><%=Replace(playerHash(a)(colval(ci)),",","<br>")%></td>
         <%   end if
            next %>

becomes

Code: Select all

         <% for each a in playerHash.Keys
                      if inStr(colname(ci),"Favourite") then %>
            
             <%    if inStr(colname(ci),"Mode") then %>
            <td align="right"><%=fmode(playerHash(a)(colval(ci)))%></td>            
             <%    elseif inStr(colname(ci),"Veh") then %>
            <td align="right"><%=vehs(playerHash(a)(colval(ci)))%></td>            
             <%    elseif inStr(colname(ci),"Kit") then %>
            <td align="right"><%=kits(playerHash(a)(colval(ci)))%></td>            
             <%    elseif inStr(colname(ci),"Map") then %>
            <td align="right"><%=fmap(playerHash(a)(colval(ci)))%></td>            
             <%    elseif inStr(colname(ci),"Weap") then %>
            <td align="right"><%=weps(playerHash(a)(colval(ci)))%></td>            
             <%    elseif inStr(colname(ci),"Equip") then %>
            <td align="right"><%=equip(playerHash(a)(colval(ci)))%></td>            
               <%         end if %>
         <%        elseif inStr(colname(ci),"Time") then %>
            <td align="right"><%=makeTime(playerHash(a)(colval(ci)))%></td>
         <%        else %>
            <td align="right"><%=Replace(playerHash(a)(colval(ci)),",","<br>")%></td>
         <%        end if
            next %>
Image

User avatar
Piers
Comfortable with my sexuality
Comfortable with my sexuality
Posts: 1408
Joined: Fri Dec 02, 2005 7:57 am
Location: Horse country

Re: phpnuke BF 2142 stats

Postby Piers » Sun Jan 20, 2008 1:05 pm

nos wrote:I have been using the same tags in my code so the CSS worked perfectly,Thanks.

another update.

I just finished the unlock Tables and its all working well and looking very nice with ur CSS.

Now I'm just waiting for piers to answer my other question about the Over view Tables
so i can complete them,then I'll start the Awards Tables and its pretty much done!

Hope to get the Awards done tomorrow.

I cant believe how well u did this piers, your a bloody good coder mate!

Having a high IQ finally came in handy in the end after all.
nos wrote:PS:
Can you also explain how the popstar function works? does it use any
Java scrip to show the windows or is it just CSS.

Edit ***
Almost Finished the Awards tables just have a couple of little errors to fix
I'm getting most of the awards print out right but then i get a syntax error
because of a null value passed to a function.

popstar writes to a styled div that's not displayed until mouseover of the parent - the javascript is in the ASP:

Code: Select all

<div style="text-align:center; float:left; margin:1px 4px" class="awin<%=css%>" onmouseover="showMine(this);" onmouseout="hideMine(this);"><%=blingPx(j,bWon)%><%=awlevel%><div class="pop stat"><%=popstar(a,j,bWon)%></div></div>
Image

User avatar
Piers
Comfortable with my sexuality
Comfortable with my sexuality
Posts: 1408
Joined: Fri Dec 02, 2005 7:57 am
Location: Horse country

Re: phpnuke BF 2142 stats

Postby Piers » Sun Jan 20, 2008 1:09 pm

nos wrote:...or how the function its calling works.

Code: Select all

function calcFn(a,calcn)
   fnset = split(calcn,",")
   if fnset(0) = "SUM" then
      calcFn = 0
      for fi = 1 to Ubound(fnset)
         calcFn = calcFn + int(playerHash.Item(a).Item(fnset(fi)))
      next
   else
      aval = int(playerHash.Item(a).Item(fnset(0)))
      bval = int(playerHash.Item(a).Item(fnset(2)))
      select case fnset(1)
         case "-"
            calcFn = aval - bval
         case "/"
            calcFn = formatnumber(aval / bval,2)
      end select
   end if
end function


I just noticed that the code you're looking at isn't the most recent version of the stats2142.asp code.
Mort, did you update the download with my most recent updates?
I removed all the .Item code because I discovered that .Item is the default object of a DictionaryObject, so playerhash.Item(a) is identical to playerhash(a).
There might be other changes you don't have as well, apologies for this...
check the bug list thread to see if there's anything you think you might need and I'll tell you what my code changes were.
Image

User avatar
Mort
Alpha-Forum Whore
Alpha-Forum Whore
Posts: 4231
Joined: Thu Dec 01, 2005 10:40 pm

Re: phpnuke BF 2142 stats

Postby Mort » Sun Jan 20, 2008 3:15 pm

I was going to bundle a new stats download sometime, but I just grab whatever the "production" versions of the files are currently being used.

Perhaps we should put a small commented history section at the beginning of the files with a version number so we can track different versions of the code chunks.
Image

nos

Re: phpnuke BF 2142 stats

Postby nos » Mon Jan 21, 2008 10:19 pm

hey all,

Just another update, I finished the Awards table completely and the pop up awards stats.

check out the images.
You do not have the required permissions to view the files attached to this post.


Return to “The Buddabudda Stats system”

Who is online

Users browsing this forum: CommonCrawl [Bot] and 0 guests