PDA

View Full Version : Has anybody done a VB stats hack?


Kevlar
25 Aug 2001, 18:33
Alright, I'm new here... and I tried looking around but couldn't find anything like this yet.

Has anybody done like a VB stats hack? I mean to get some cool information like this?

http://www.bimmerforums.com/stats.php ?

I got most of it working, I just can't get the "most users online" feature to work. It always says the most users online is current user count.

Any ideas?

FYI... this is my first time coding PHP so if I overlooked something simple... give me a break, I'm still learning. :o

Bane
25 Aug 2001, 19:24
I believe there are currently two people working on vb stats currently.

Znaper is working on one at http://www.german-community.de/statistik.php

And I am working on one as well.

As far as the record users, I can try playing with that a bit and try to figure something out.

JoshFink
25 Aug 2001, 19:56
Bane, have you had any luck oin the stats code? I'm just trying to figure out if I should start my own or wait for others.

Thanks,

Josh

Kevlar
25 Aug 2001, 19:57
Good... at least I don't feel alone in my quest for putting the board stats up.

:D

Bane
25 Aug 2001, 20:26
Well, what Im working on is a little more in depth.. :D A bit more statistics than any others I saw so far..

My niece just led me through a half hour tirade of why that witch from little mermaid is a really horrible person so I havent even looked at the record users bit.

As far as starting your own, if you are any good you can probably do much better than I will anyway. :p If you do figure out the code let us all know.

TheProfessor
26 Aug 2001, 00:55
Well, here it is, the statistics hack:

Create a file named stats.php. insert the following lines:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Save this file the root directory of your board.

Next create a template namend boardstatistics. Insert the following lines into the template:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Now just call stats.php. Furthermore place a link in on of your templates so members can view the stats. I suggest forumhome ...

Greetings, The Professor!

JamesUS
26 Aug 2001, 06:54
There is also another vBStats hack that does something slightly different. If you want to take a look, search for 'vbstats' in the Hacks forum.

Lian
26 Aug 2001, 13:52
Very nice TheProfessor,
I'll suggest to built that into our forums,
Lian

TheProfessor
26 Aug 2001, 15:00
Yeah, but please remeber that all credits go to Znaper and AA ...

Kevlar
26 Aug 2001, 17:24
Random users are getting this error

Warning: Cannot add header information - headers already sent by (output started at /home/bimmer/www/main.php:7) in /home/bimmer/www/forum/admin/functions.php on line 1459

Only random users. I don't get it, but other users are telling me the error exists.

any ideas?

TheProfessor
26 Aug 2001, 17:29
This has nothing to do with this hack, because main.php is not a part of vB ...

Kevlar
26 Aug 2001, 18:04
Yeah, main.php is the webpage which I included the stats on.

http://www.bimmerforums.com/main.php

The page is all HTML except for some php that does the includes for my header.htm, footer.htm, last10posts and now stats.php.

But it's random... I don't see the error, but somebody else does...

Znaper
26 Aug 2001, 18:12
Im work on a new Version of the Stats Hack, this release in the next 2 weeks.

Sarge
26 Aug 2001, 22:01
Originally posted by Kevlar
Random users are getting this error

Warning: Cannot add header information - headers already sent by (output started at /home/bimmer/www/main.php:7) in /home/bimmer/www/forum/admin/functions.php on line 1459

Only random users. I don't get it, but other users are telling me the error exists.

any ideas?

HEy bro, this is an easy fix

since you are including the stats file onto another page, you don't need to use the header and footer information included in the template above. He designed this as a stand alone script and if you include it into a file it will print 2 headers, which is why you got a error.

What you need to do is to modify the template, so that the < head > and < foot > sections don't show . You only need the table part
Thanks
Sarge

Kevlar
26 Aug 2001, 22:34
Here is the code that I am now using. I cannobolized the code from above to make it work on my webpage instead of in a template.



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



I don't see a < head > or < foot > section you are talking about. I have a < head > as part of the HTML page like a < head > and a < / head > and a < body > and < / body >

Is that what you mean?

Sarge
26 Aug 2001, 22:48
You posted the php file, I was referring to the template

Remove the below from your board statictics template and you will be good to go

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>

<title>$bbtitle Boardstatistics</title>
$headinclude
</head>
<body>

$header


$footer
<center>$co</center>
</body>
</html>

Kevlar
27 Aug 2001, 14:04
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



I took out most of the text to make this somewhat shorter, if you want to see the full page, go to http://www.bimmerforums.com/main.php ... The only things in the header.htm and footer.htm are regular HTML files that have a bunch of links for the menu.

So you're saying I should take out the < head > and < / head > from the HTML file?

Sarge
27 Aug 2001, 15:06
Yes.. you only need to include the table
If you don't then you will have 2 heads and 2 body tags on the same page
Also.. your template was incorrect anyways because you forgot to start the <body> tag, but you ended </ body>
at the bottom

Use this and see if it works


<?php
include ('header.htm');
?>
<TABLE WIDTH="<? echo("$tablewidth") ?>" BORDER="0" CELLSPACING="0" CELLPADDING="2" ALIGN="CENTER">
<TR>
<TD>
<DIV ALIGN="center">
<P><IMG SRC="grfx/yellowm.jpg" WIDTH="760" HEIGHT="72" ALT="" BORDER="0"></P>
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="2">
<TR VALIGN="TOP">
<TD><FONT FACE="Verdana, Arial" SIZE="+1">Welcome to Bimmerforums.com</FONT><BR>
<BR>
<FONT FACE="Verdana, Arial" SIZE="-2">Bimmerforums.com ... bimmerforums.com. Come join us!</FONT><BR>
</P>
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="4">
<TR>
<TD BGCOLOR="#DDDDFF"><B><FONT FACE="Verdana, Arial" SIZE="-1">Main Headlines</FONT></B></TD>
</TR>
</TABLE>
<P><B><FONT FACE="Verdana, Arial" SIZE="-1">August 23, 2001 - </FONT></B><FONT FACE="Verdana, Arial" SIZE="-1">New
page is up, but still under development.</FONT></P>
<P><B><FONT FACE="Verdana, Arial" SIZE="-1">July 18th, 2001</FONT></B><FONT FACE="Verdana, Arial" SIZE="-1">
- I decided to play around with the idea of 1024x768 screen resolutions. I liked it... those who
don't have a 1024x768, UPGRADE TIME!</FONT></P>
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="4">
<TR>
<TD BGCOLOR="#DDDDFF"><B><FONT FACE="Verdana, Arial" SIZE="-1"><B>Future Gatherings</B></FONT></B></TD>
</TR>
</TABLE>
<P><FONT FACE="Verdana, Arial" SIZE="-1"><B>09/19/01</B> - Md/NoVA/DC Meet and Drive through the mountains
</FONT></P>
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="4">
<TR>
<TD BGCOLOR="#DDDDFF"><B><FONT FACE="Verdana, Arial" SIZE="-1"><B>Most Recent Threads</B></FONT></B></TD>
</TR>
</TABLE>

<? include("last10.php"); ?>

</TD>
<TD WIDTH="250">
<TABLE WIDTH="275" BORDER="0" CELLSPACING="0" CELLPADDING="2" ALIGN="RIGHT">
<TR>
<TD BGCOLOR="#DDDDFF">
<DIV ALIGN="CENTER"><B><FONT FACE="Verdana, Arial" SIZE="-1">Product Focus</FONT></B></DIV>
</TD>
</TR>
<TR>
<TD>
<DIV ALIGN="CENTER"><IMG SRC="grfx/m5engine.jpg" WIDTH="275" HEIGHT="206"><BR>
<FONT FACE="Verdana, Arial" SIZE="-1">2001 M5 Engine</FONT></DIV>
</TD>
</TR>
<TR>
<TD BGCOLOR="#DDDDFF">
<DIV ALIGN="CENTER"><B><FONT FACE="Verdana, Arial" SIZE="-1">Featured BMW</FONT></B></DIV>
</TD>
</TR>
<TR>
<TD>
<DIV ALIGN="CENTER"><IMG SRC="grfx/m3coupe.jpg" WIDTH="275" HEIGHT="139"><BR>
<FONT FACE="Verdana, Arial" SIZE="-1">Kevlar's WannaBe 2002 M3 SMG Coupe</FONT></DIV>
</TD>
</TR>
<TR>
<TD BGCOLOR="#DDDDFF">
<DIV ALIGN="CENTER"><FONT FACE="Verdana, Arial" SIZE="-1"><B>Board Information</B></FONT></DIV>
</TD>
</TR>
<TR>
<TD VALIGN="TOP">
<FONT FACE="Verdana, Arial" SIZE="-1">Top Posters:</FONT>
<? include("topposters.php"); ?>
<P><FONT FACE="Verdana, Arial" SIZE="-1"></FONT></P>

</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>

</DIV>
</TD>
</TR>
</TABLE>
<P>
<?php
include ('footer.htm');
?>

Kevlar
27 Aug 2001, 15:41
I'm a bone head :o ... I understand now, I'll try it and see how it works.

Thanks.

calldaffer
25 May 2002, 04:08
Alright guys, I am using this hack on my site and I like it. Can anyone tell me how I would add in a few more lines that would show me the top thread starter, member of the day, etc...can this be added in relatively easily?

Xanthine
25 May 2002, 04:44
Originally posted by calldaffer
Alright guys, I am using this hack on my site and I like it. Can anyone tell me how I would add in a few more lines that would show me the top thread starter, member of the day, etc...can this be added in relatively easily? \

THIS WAS POSTED 7 MONTHS AGO!!!

:)

calldaffer
25 May 2002, 12:34
Ok, so I can't use it cuz its posted 7 months ago? Anyway...I have this hack installed, and my question is does anyone know how I can add more lines into the code to reflect Top threat starter and a member of the day?

Dalius
25 May 2002, 16:33
Oh my god. Why is this bumped?

Use Bane's vB Stats hack.

Mireade
17 Apr 2003, 10:10
Hello

Thanks to Znaper and other good contributors of this thread.
:bunny:

I know this is an old thread but, I could not find anywhere else what I'm looking for.

I installed here (http://www.repaire.net/) the Boardstatistics add on by Znaper.

It works great and tell real time on my first page how many members, how many connected people and howmany threads.
All right.

I would be glad now to add one more to these items

How could I add the number of visits (sessions) today or yesterday ? (I'm not able to generate the right query for that...)

I guess it should be a few lines to add to the script but which lines ;-) ?

Thanks in advance.