Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)

Reply
 
Thread Tools Display Modes
  #11  
Old 08-26-2001, 04:29 PM
TheProfessor TheProfessor is offline
 
Join Date: Jan 2003
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This has nothing to do with this hack, because main.php is not a part of vB ...
Reply With Quote
  #12  
Old 08-26-2001, 05:04 PM
Kevlar's Avatar
Kevlar Kevlar is offline
 
Join Date: Nov 2001
Location: Ft. Lauderdale, FL.
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #13  
Old 08-26-2001, 05:12 PM
Znaper Znaper is offline
 
Join Date: Oct 2001
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Im work on a new Version of the Stats Hack, this release in the next 2 weeks.
Reply With Quote
  #14  
Old 08-26-2001, 09:01 PM
Sarge
Guest
 
Posts: n/a
Default

Quote:
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
Reply With Quote
  #15  
Old 08-26-2001, 09:34 PM
Kevlar's Avatar
Kevlar Kevlar is offline
 
Join Date: Nov 2001
Location: Ft. Lauderdale, FL.
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.

PHP Code:
<?php
// Boardstatistics scripted by Znaper (e-mail: [email]webmaster@znapers-board.de[/email])

require('./global.php');

// get total members
$numbersmembers=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user');
$numbermembers=$numbersmembers['users'];

// Get newest Member

// $getnewestusers=$DB_site->query_first("SELECT userid,username FROM user WHERE userid=$numbermembers");
// $newusername=$getnewestusers['username'];
// $newuserid=$getnewestusers['userid'];

// get active members
$snonposters=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user WHERE posts=0');
$nonposters=$snonposters['users'];
$activemembers=$numbermembers-$nonposters;
$activityrate=sprintf("%.2f",(100*$activemembers/$numbermembers));

// get total posts
$countposts=$DB_site->query_first('SELECT COUNT(*) AS posts FROM post');
$totalposts=$countposts['posts'];

// get total threads
$countthreads=$DB_site->query_first('SELECT COUNT(*) AS threads FROM thread');
$totalthreads=$countthreads['threads'];

// get total thread views
$boardviews $DB_site->query_first("SELECT SUM(views) AS threadviews FROM thread");
$totalviews $boardviews[threadviews];

// get total pms
$totalpms $DB_site->query_first("SELECT count(*) as pmcount FROM privatemessage"); 
$totalpm $totalpms[pmcount];

// get record users online
$getrecordusers=$DB_site->query_first("SELECT * FROM template WHERE title='maxloggedin'");

// thanks to AA for the following lines:
// get Top 10 Posters of the last 30 days
if (isset($days)==and $days==0) { $days=30; }

$datecut=time()-($days*86400);

$posts=$DB_site->query("SELECT DISTINCT(userid),COUNT(postid) AS posts
                          FROM post
                         WHERE userid > 0 AND post.dateline>=
$datecut
                      GROUP BY userid
                      ORDER BY posts DESC
                         LIMIT 10"
);

while (
$user=$DB_site->fetch_array($posts)) {

$result=$DB_site->query_first("SELECT username
                                   FROM user
                                  WHERE userid=
$user[userid]");
                                  
$topposters.="<tr><td><a href=\"forum/member.php?action=getinfo&userid=$user[userid]\">$result[username]</a></td><td>$user[posts]</td></tr>";
                                  }
                                  
// thanks to AA for the following lines:
// get Top 10 Posters of the last 24 hours
if (isset($days2)==and $days2==0) { $days2=1; }

$datecut2=time()-($days2*86400);

$posts2=$DB_site->query("SELECT DISTINCT(userid),COUNT(postid) AS posts
                          FROM post
                         WHERE userid > 0 AND post.dateline>=
$datecut2
                      GROUP BY userid
                      ORDER BY posts DESC
                         LIMIT 10"
);

while (
$user2=$DB_site->fetch_array($posts2)) {

$result2=$DB_site->query_first("SELECT username
                                   FROM user
                                  WHERE userid=
$user2[userid]");
                                  
$toplastposters.="<tr><td><a href=\"forum/member.php?action=getinfo&userid=$user2[userid]\">$result2[username]</a></td><td>$user2[posts]</td></tr>";
                                  }

$co="Statistics-Hack ? 2001 by <a href=\"mailto:webmaster@znapers-board.de\">Znaper</a>, thanks to AA";
// $templatesused = "";
// Only one template is used so load it when called
// eval("dooutput(\"".gettemplate("boardstatistics")."\");");

echo ("    <font face=\"Verdana,Arial\" size=\"-1\"> ");
echo (
" <b>?</b> Registered Members: <b>$numbermembers</b><br> ");
// echo (" <b>?</b> Newest Member: <b><a href=\"forum/member.php?action=getinfo&userid=$newuserid\">$newusername</a></b><br> ");
// echo (" <b>?</b> 0-Posters: <b>$nonposters</b><br> ");
// echo (" <b>?</b> Active Members: <b>$activemembers</b><br> ");
echo (" <b>?</b> Active rate of all Members: <b>$activityrate % </b><br> ");
echo (
" <b>?</b> Total Threads: <b>$totalthreads </b><br> ");
echo (
" <b>?</b> Total Posts: <b> $totalposts </b><br> ");
echo (
" <b>?</b> Total Views: <b>$totalviews </b><br> ");
// echo (" <br> ");
// echo (" <b>?</b> <b> $totalpm </b> Private Messages are stored in our Mailboxes! </font> ");
  
echo ("<Table cellpadding=2 cellspacing=0 border=0 style=\"font-family:verdana,arial; font-size:xx-small;\">");
echo (
"<tr><td colspan=2>Top Posters for Past 30 days</td></tr>");
echo (
"$topposters");
echo (
"</table>");

echo (
"<Table cellpadding=2 cellspacing=0 border=0 style=\"font-family:verdana,arial; font-size:xx-small;\">");
echo (
"<tr><td colspan=2>Top Posters for Past 24 hours</td></tr>");
echo (
"$toplastposters");
echo (
"</table>");

// free used memory
unset($user);
$DB_site->free_result($posts);
unset(
$user2);
$DB_site->free_result($posts2);

?>
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?
Reply With Quote
  #16  
Old 08-26-2001, 09:48 PM
Sarge
Guest
 
Posts: n/a
Default

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>
Reply With Quote
  #17  
Old 08-27-2001, 01:04 PM
Kevlar's Avatar
Kevlar Kevlar is offline
 
Join Date: Nov 2001
Location: Ft. Lauderdale, FL.
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
<HTML>
<HEAD>
<TITLE>BIMMERFORUMS</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">

</HEAD>
<?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');
?>
</BODY>
</HTML>
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?
Reply With Quote
  #18  
Old 08-27-2001, 02:06 PM
Sarge
Guest
 
Posts: n/a
Default

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');
?>
Reply With Quote
  #19  
Old 08-27-2001, 02:41 PM
Kevlar's Avatar
Kevlar Kevlar is offline
 
Join Date: Nov 2001
Location: Ft. Lauderdale, FL.
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm a bone head ... I understand now, I'll try it and see how it works.

Thanks.
Reply With Quote
  #20  
Old 05-25-2002, 03:08 AM
calldaffer's Avatar
calldaffer calldaffer is offline
 
Join Date: Mar 2002
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
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. The time now is 10:17 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04402 seconds
  • Memory Usage 2,320KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (7)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete