PDA

View Full Version : Ultimate Forum Stats Integration for Non-VB Page


BlackxRam
03-30-2004, 10:00 PM
This Hack was a port over from my vb2.x script that pulled information from teh forum to a seperate script which you then could break apart and include into your standard website via PHP includes or SSI.

This version is about the same but it now works with VB3.00 Gold


Features for Logged in Members:

*Users Avatar
*Default Avatar For Members Without a Set Avatar
*Number of Registered Members
*Number of Threads
*Number of Posts
*How Many Posts since last visit
*How Many New PM's
*How Many PM's in your Inbox
*Latest Registered User
*Member with the Most Posts
*Member with the Most Threads

Features for Guests:

*Welcome Text
*VB3 Gold Login Box with option to Remember.
*Newest Member
*Member with the most Posts
*Member with the most Threads


All that is needed to do is download the attached Zip File. Then open the boardstat.php file in any Text Editor. Follow the Commented Portions that have been outlined in there. You will need to change all the PATHS and URLS in that file to match YOUR server. It might take some tweaking on your part but it works just fine as I have tested it with several other websites. When You are Done Editing it, just upload it to your forums directory and call it to your main website using php includes, ssi or iframes.

IF YOUR FORUMS AND SITE ARE ON DIFFERENT SERVERS THEN YOU HAVE TO USE AN IFRAME TO CALL THE FILE OVER. ANYTHING ELSE COULD YIELD HEADER ERRORS.

------------------------------------
Please Remember. Follow the in-file instructions
and edit all the URLS and PATHS. I can't stress this enough.
I just know someone will pop on and say "Why does my links point to http://www.yourdomain.com/forums..... This is a warning lol ;)
------------------------------------

My Next Few Posts Will include Some Images of How the HTML is Built Inside the File.

BlackxRam
03-31-2004, 09:43 AM
Snaps of the User Logged in and then when the User is logged out.

BlackxRam
03-31-2004, 10:32 AM
You can see a LIVE view of it Here: http://www.mogusland.com/

sabret00the
03-31-2004, 10:35 AM
that's a great hack, now all i need is a decent top10 hack and i can start making my new front page :D

msimplay
03-31-2004, 04:05 PM
that's a great hack, now all i need is a decent top10 hack and i can start making my new front page :D
theres top x stats available u can change the stats to whatever number hence the 'x' hehe

its the one i use on my homepage :)

BlackxRam
03-31-2004, 04:21 PM
Glad you guys like it. The instructions werent too difficult to understand were they?

Owen
03-31-2004, 04:29 PM
I dont know yet, what I do know is that I'll be using this.

msimonds
04-01-2004, 02:34 AM
I checked the paths twice and then a third time, I know that they are all correct and I am getting this error

Warning: main(./includes/init.php): failed to open stream: No such file or directory in /home/rantman/public_html/forums/global.php on line 18

I placed the boardstats.php inside my root folder, is that the correct place to put it?

msimonds
04-01-2004, 02:49 AM
Well I figured it out that it needs to be in the forums directory and then you can try and use it outside of that but it does not show you logged in when you are outside the forums!

msimonds
04-01-2004, 03:33 AM
If this can be corrected to work without using an iframe, then it would be one of the best hacks available for people that do not use a vb portal.

If you use a include statement then it will not work, example:

http://www.sportsrant.com/index_tmp.php

sign in test account:

user: nyallsports
pass: sf49ers

Then if you go here:

http://www.sportsrant.com/forums/boardstat.php and sign in and look it works. Something about vb does not like the password outside the forum folder.

Also some of the links that you are using are incorrect in the form, when you check your private messages, usercp and others are incorrect or not updated. I have changed them and it works.

There has to be someone out there that can get this to work outside the forums folder without using an iframe

Mike

gmarik
04-01-2004, 04:45 PM
looks promissing

msimonds
04-01-2004, 05:55 PM
I finally was able to get this to work by taking/changing some of the code out of the boardstats.php and adding it to my index.php on my home page http://www.sportsrant.com

If anyone wants to try it out:

user: nyallsports
pass: sf49ers


Let me know what you think?

BlackxRam
04-01-2004, 07:51 PM
Yes ill update the hack information when i get home tonight, I seem to have forgot to upload that file that explain the other paths. My bad guys, ill get it up ASAP. If you wish to use this without iframes you need to change the paths in Global.php, init.php ect. msimonds. If you can send me your changes via email ill update the hack infomation for that as well. You guys can troubleshoot it yourselves as well. Just modify the paths in the error script that the file gives you. If it says init.php open init.php and search for all the REQUIRED paths in that file. Ill update with more directions in a little bit.

you can email me at akauth+mogusland.com just replace the + with a @

sammyman
04-02-2004, 05:05 AM
Sounds interesting. Let me know when everything is working

BlackxRam
04-03-2004, 04:29 AM
I dont know MSIMONDS isnt sending me his modifications.

BlackxRam
04-03-2004, 06:56 AM
I HAVE FIXED THE SCRIPT.

It will now work just fine with INCLUDING this. I will post instructions tomarrow in full.

In the mean time, do you guys want to be able to edit this file directly or resort to VBulletin templates? I personally like leaving vbulletin templates out of this add on but who knows.

Tomarrow i will post a Fix for everyone! :)

mmw
04-03-2004, 07:15 AM
Really nice hack, can't wait for for your instructions today ;)
* mmw clicks install

Agent Richard
04-03-2004, 07:37 AM
I'd say leave out vBulletin. I for one prefer it without as it makes for far easier customisation.

Can't wait for the fix - I'm not really liking the iframe system I've got running.

www.roller-coaster.com.au

mmw
04-05-2004, 06:49 PM
Anyluck with the fix :o

msimonds
04-05-2004, 07:11 PM
okay my fixes are a little different becuase I removed some stuff like the avatar and a few of the options.

Should I still post them here

Mike

Agent Richard
04-05-2004, 08:58 PM
I personally wouldn't mind it - I removed a lot of the stuff also. :)

msimonds
04-05-2004, 09:10 PM
This is what I have on my index.php in my root folder

<?php
error_reporting(7);
//////////////////////////////////////
// You need to EDIT your PATHS or this will not WORK properly
//////////////////////////////////////
// STEP #1
chdir('/home/yourpath/to/forums');
//chdir('..');
//////////////////////////////////////////////////////////////////
//You WILL Need to Enter your full path to global.php, below is just a Generic Version
//////////////////////////////////////////////////////////////////
//require_once("/home/rantman/public_html/forums/global.php");
require_once('./global.php');
//////////////////////////////////////////////////////////////////
//
// NO NEED TO EDIT ANYTHING IN THIS AREA! PLEASE SCROLL DOWN!!
//
//////////////////////////////////////////////////////////////////
//
?>

and where I wanted to place the login form, I have this


<?
$getnewestusers=$DB_site->query_first("SELECT userid,username FROM user ORDER BY joindate DESC LIMIT 1");
$newusername=$getnewestusers['username'];
$newuserid=$getnewestusers['userid'];
$numbersmembers=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user');
$numbermembers=number_format($numbersmembers['users']);
if ($enablepms==1 and $permissions['canusepm'] and $bbuserinfo['receivepm']) {
$ignoreusers="";
if (trim($bbuserinfo['ignorelist'])!="") {
$ignoreusers='AND fromuserid<>'.implode(' AND fromuserid<>',explode(' ', trim($bbuserinfo['ignorelist'])));
}
$allpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] $ignoreusers");
$newpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND dateline>$bbuserinfo[lastvisit] AND folderid=0 $ignoreusers");
$unreadpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND messageread=0 AND folderid=0 $ignoreusers");
if ($newpm['messages']==0) {
echo "";
} else {
echo "";
}
} else {
$pminfo='';
}
require_once('/home/rantman/public_html/forums/includes/functions_user.php');
$indexpage = true;
$bbuserinfo['avatarurl'] =
fetch_avatar_url($bbuserinfo['userid']);
$newposts = $DB_site->query_first("
SELECT COUNT(*) AS count
FROM ".TABLE_PREFIX."post
WHERE dateline > '".$bbuserinfo['lastvisit']."'
");
$activethreads = $DB_site->query_first("
SELECT COUNT(*) AS count
FROM ".TABLE_PREFIX."thread
WHERE lastpost > '".$bbuserinfo['lastvisit']."'
");
fetch_options_overrides($bbuserinfo);
$newdate = vbdate($vboptions['timeformat'], $bbuserinfo['lastvisit'], 0);
$pmbox = array();
$pmbox['lastvisitdate'] = vbdate($vboptions['dateformat'], $bbuserinfo['lastvisit'], 1);
$pmbox['lastvisittime'] = vbdate($vboptions['timeformat'], $bbuserinfo['lastvisit']);
$pmunread_html = iif($bbuserinfo['pmunread'], "<strong>$bbuserinfo[pmunread]</strong>", $bbuserinfo['pmunread']);
$vbphrase['unread_x_nav_compiled'] = construct_phrase($vbphrase['unread_x_nav'], $pmunread_html);
$vbphrase['total_x_nav_compiled'] = construct_phrase($vbphrase['total_x_nav'], $bbuserinfo['pmtotal']);
// ########## \\__> Added from Hwulex's Welcome Hack THANKS!!!<__// ########## \\
$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE lastpost > '$bbuserinfo[lastvisit]'");
$getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE dateline > '$bbuserinfo[lastvisit]'");
if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];
?>
<?
echo "

<td width=\"33%\" class=\"RantMenuLight\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\" color=\"#EEEEEE\">Welcome Back, <strong><b>$username!</b></strong><br><phrase 1=\"$pmbox[lastvisitdate]\" 2=\"$pmbox[lastvisittime]\">Last visited: $pmbox[lastvisitdate] at $pmbox[lastvisittime]</phrase><br></font></td>
<td width=\"33%\" align=\"center\"><div align=\"center\">
<a class=\"RantMenuLight\" href=\"http://www.sportsrant.com/forums/login.php?do=logout\" target=\"_parent\"><b>Logout</b></a>&nbsp;|&nbsp;
<a class=\"RantMenuLight\" href=\"http://www.sportsrant.com/forums/search.php?&do=getnew\" target=\"_parent\"><b>View New Posts</b></a>&nbsp;|&nbsp;
<a class=\"RantMenuLight\" href=\"http://www.sportsrant.com/forums/usercp.php\" target=\"_parent\"><b>User CP</b></a>&nbsp;
</div></td>

<td width=\"33%\"><div align=\"right\">
<font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\" color=\"#EEEEEE\"><b>$bbuserinfo[pmunread] new message(s)<br>
<a class=\"RantMenuLight\" href=\"http://www.sportsrant.com/forums\" target=\"_parent\">Go To The Forums</a>
</div></td>
<td width=\"1%\">&nbsp;


";

} else {
echo "


<td>

<form action=\"http://www.sportsrant.com/forums/login.php\" method=\"post\" onsubmit=\"md5hash(vb_login_password,vb_login_md5password)\">
<script type=\"text/javascript\" src=\"http://www.sportsrant.com/forums/clientscript/vbulletin_md5.js\"></script>

<td width=\"0%\">&nbsp;</td>
<td><table width=\"400\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td width=\"150\"><strong><font color=\"#EEEEEE\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">Nickname:
</font></strong>
<input type=\"text\" class=\"RantMenuTop\" name=\"vb_login_username\" id=\"navbar_username\" size=\"10\" accesskey=\"u\" tabindex=\"1\" value=\"User Name\" onfocus=\"if (this.value == 'User Name') this.value = '';\" /></td>
<td width=\"150\"><strong><font color=\"#EEEEEE\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">Password:</font></strong>
<input type=\"password\" class=\"RantMenuTop\" name=\"vb_login_password\" size=\"10\" accesskey=\"p\" tabindex=\"2\" /></td>
<td><input type=\"image\" src=\"images/srlogin.gif\" value=\"Log in\" tabindex=\"4\" title=\"Enter your username and password in the boxes provided to login, or click the 'register' button to create a profile for yourself.\" accesskey=\"s\" /></td>
<td class=\"RantMenuLight\"><label for=\"cb_cookieuser_navbar\"><input type=\"checkbox\" name=\"cookieuser\" value=\"1\" tabindex=\"3\" id=\"cb_cookieuser_navbar\" accesskey=\"c\" checked=\"checked\" />Remember?</label></td>
</tr>
</table></td>
<input type=\"hidden\" name=\"s\" value=\"\" />
<input type=\"hidden\" name=\"do\" value=\"login\" />
<input type=\"hidden\" name=\"forceredirect\" value=\"1\" />
<input type=\"hidden\" name=\"vb_login_md5password\" />
</form>
</td>
<td width=\"60%\" class=\"RantMenuLight\"><div align=\"right\">Welcome Guest!<br>
<a class=\"RantMenuLight\" href=\"http://www.sportsrant.com/forums/register.php\" target=\"_parent\">Register</a>
</div></td>
<td width=\"1%\">&nbsp;

";
}
echo "
</td>
";
?>



I can make modifications to work to try and help anyone out that wants to get this to work and I also attahed a modified login.php that can go into your root folder, NOT THE FORUMS FOLDER


Mike

BlackxRam
04-07-2004, 03:54 AM
yes one thing i forgot was the CHDIR thing. That was one of the things i added but my computer was overtaken by college freaks finishing up homeworks. Ill look over MSIMONDS stuff and finish it up in about an hour or so.

msimonds
04-07-2004, 12:03 PM
hey if this works for anyone else then that is great. I fI Can help out in anyway just let me know. I have been trying to correct a different login for months becuase of a javescript error, but if it was not for your code, BlackxRam, then I would have never been able to get this to work. Great job man, really!!

BlackxRam
04-08-2004, 02:30 AM
One problem I am upset about is the seemingly longer loading time. It was MUCH faster with VB2... Im not sure if its a VB3 issue but I would like to try to get it more streamlined.

BlackxRam
04-08-2004, 05:18 AM
Updated the Zip File so everyone can understand it better.

Bro_Joey_Gowdy
04-08-2004, 01:49 PM
/me clicks install

msimonds
04-08-2004, 02:17 PM
One problem I am upset about is the seemingly longer loading time. It was MUCH faster with VB2... Im not sure if its a VB3 issue but I would like to try to get it more streamlined.


I actually have to agree with you there. It does seem to load slower, I will also look into this and see if I can somehow speed it up

Billspaintball
04-10-2004, 12:58 PM
Gave it a go.
All works fine except it wont display an avatar.
Just the little box with a red cross in it.

If I look at the html page produced I get

<a href="http://www.billspaintball.com/vb3/profile.php?&do=editavatar"><img src="image.php?u=1&amp;dateline=1036410394" border="0"></a>

However, If I use the image part of that and enter it straight into the browser like
http://www.billspaintball.com/vb3/image.php?u=1&amp;dateline=1036410394" border="0"
The image will display.

What wrong???


EDIT:

Doh!!
Stupid mistake on my part.
FIxed :)

Great script, using on my site. :D

egyptsons
04-12-2004, 01:43 PM
greatttttttttt ;)

BlackxRam
04-15-2004, 04:16 AM
Gave it a go.
All works fine except it wont display an avatar.
Just the little box with a red cross in it.

If I look at the html page produced I get

<a href="http://www.billspaintball.com/vb3/profile.php?&do=editavatar"><img src="image.php?u=1&amp;dateline=1036410394" border="0"></a>

However, If I use the image part of that and enter it straight into the browser like
http://www.billspaintball.com/vb3/image.php?u=1&amp;dateline=1036410394" border="0"
The image will display.

What wrong???


EDIT:

Doh!!
Stupid mistake on my part.
FIxed :)

Great script, using on my site. :D

That seems to be a server issue or perhaps you should put the ENTIRE url into the IMG tag if your forums are on subdomains.

Billspaintball
04-22-2004, 02:20 PM
Im using this on my site now.
There was one thing that was annoying me a little. That was some of my users have large avatars that messed up the formatting on the non VBb pages when they were displayed because they were so large.

Ive added a few lines to this to resize any oversized avatars to a desired max size (keeping everything in proportion of course).

Anyone interested?

Should I post it here?

nektar
04-22-2004, 05:15 PM
Hi!

Text from guide.txt

"If your website uses a CMS (Content Management System) this script
might not function as well because it does call information from a
another database"

Well, I can assure it doesn't work with mambo.

I think the problem is caused by chdir('/home/yourpath/to/forums');

I have searched the forum and have not found a login-huck that will work with Mambo.

I currently use phpBB2 (before I transfer to VB3) and I have a nice hack which works fine.

Do you guys think that the code can be more flexible and work with CMS?

Any ideas?

Thank you.

Nektarios

BlackxRam
04-25-2004, 10:24 AM
By All means bill share it. :)



About the CMS, its really hard to get something like that to work in a CMS if:

A) the CMS is in a different Database

B) the CMS doesnt allow php scripting to take place

C) the CMS has its own cookie system therefore the script might conflict with the CMS

There has been some luck in programs like PHPnuke that allows for Custom User "blocks" some CMS's also feature custom blocks as well. Those are the easiest to be able to make work. Otherwise if you use a CMS and are unable to integrate the code directly into your CMS by modifying your core files the best course of action would have to be an iframe.

You would have better luck incorporating the two if they were on the same database name and the CMS allowed full php scripting. Most CMS's dont allow it cause its too much of a risk. Coding it for a CMS would be different every time cause every CMS is different. I personally wouldnt know about Mambo I am using a early build of a brand new CMS called IONcms and this hack will work perfectly with that CMS as i built it alongside the cms development.

You would need someone who knows Mambo well to integrate it.

Billspaintball
04-27-2004, 01:01 PM
Ok here is my little avatar max size hack.
It works fine on my site but no promisies that it will work elsewhere.

Sorry about the messy code, (Im sure there is a neater more efficent way of doing this but, hey, it works) but im a php n00b, this is my first hack :D

Anyone can use this in their hack if they wish, just keep the commented credit intact.

Anyhow, this is the code.

// display avatar - resize if too big
// By Bill - http://www.billspaintball.com
$file = "http://www.yourdomain.com/pathto/forums/$bbuserinfo[avatarurl]"; // Path to pic
$maxw = 130; // Max thumbnail width
$maxh = 140; // Max thumbnail height
list($width, $height, $type) = getimagesize($file);

if ( $width <= $maxw AND $height <= $maxh )// check width and height
{// if width and height under size display unchanged
echo "<img src=\"$file.$type\" align=\"center\" border=\"0\">";
}
else
{
if ($width > $maxw)//check if width is too wide
{ // if it is, resize
$ratio = $width / $maxw; //work out resize ratio
$newwidth = $maxw; // new width
$newheight = ($height / $ratio); // new height at this resize
}
else
{
$newheight = $height; // if width is ok, set this cos we need it later
$newwidth = $width; // if width was ok, set this cos we ned it later
}
If ($newheight <= $maxh )
{
// if current height is ok, were done.
}

else // either origional or resized height is too big
if( $newheight >= $maxh )
{ // if resized height is still too big we resize it
$ratio2 = $newheight / $maxh; //work out resize ratio
$newheight = $maxh; // give $newheight a new value
$newwidth = ($newwidth / $ratio2); // new width at this resize
} // the value of $newwidth has just been changed
else
{// if were here then origional height is too big so we resize it
$ratio2 = $newheight / $maxh; //work out resize ratio
$newheight = $maxh; // give $newheight a new value
$newwidth = ($newwidth / $ratio2); // new width at this resize
}

// now we can finally display resized pic
echo "<img src=\"$file.$type\" border=\"0\" width = \"$newwidth\" height = \"$newheight\" align=\"center\">"; // display resized pic
}



Instructions.

Find this section in the origional code.
Its about half way through the step 2 section.



</td></tr><tr><td width=10%><a href=\"http://www.yourdomain.com/forums/profile.php?$session[sessionurl]&do=editavatar\"><img src=\"$bbuserinfo[avatarurl]\" border=\"0\"></a></td><td width=50%>



Change it to

</td></tr><tr><td width=10%><a href=\"http://www.yourdomain.com/forums/profile.php?$session[sessionurl]&do=editavatar\">";

//insert my new code here!!!

echo "</a></td><td width=50%>



You need to edit 2 lines in my code
$maxw is the maximum width of the avatar. Anything bigger will be resized to this.
$maxh is the maximum height of the avatar. Anything bigger will be resized to this.

Anything smaller will not be resized up since that can make them look ugly and pixelated.

All resized pics will retain their origional width/height proportions.

The pic will be resized so that both width and height will fix in the max sizes you have choosen.

kelangtri
09-12-2004, 07:14 AM
if i have a login.php and index.html, what the cm insert .php to .html, i used <?include, but it don't work, who can help me???

Gobbas
11-20-2004, 08:29 PM
i get the following error on my page:
Database error in vBulletin 3.0.3:

Invalid SQL: SELECT userid,username FROM user ORDER BY joindate DESC LIMIT 1
mysql error: Table 'gobbas1.user' doesn't exist

mysql error number: 1146

BlackxRam
11-21-2004, 02:42 AM
It looks to me that you have entered some invalid table information to the page.

Are you adding this to a normal PHP page or a CMS SCRIPT?

Gobbas
11-21-2004, 02:54 AM
CMS script, Mira server.
the thing is that gobbas1 is the database name for my forums, i don't know what table gobbas1.user is though since my vB tables are called vB3_.

BlackxRam
11-27-2004, 08:35 PM
try changing all the Database Fields to match your VB Named Fields, it looks like the script is pulling from the CMS tables... in the stats script change any and all mysql info to vb3.user see if that helps.

romulus
12-11-2004, 12:52 AM
I'm getting errors for everyline that has "$DB_site" in it. I think this is the question you've answered above, but do I just place this with my database username? Or what?

bgtking
12-11-2004, 09:18 PM
Anyone know how to make it display a default avatar if a member does not have an avatar?

BlackxRam
12-26-2004, 06:47 AM
You might want to try the default avatar mod for users, or change your avatars to file based instead of database type. However, Currently I am really too busy to work on any coding at all. If someone feels upto making some changes to the above code, I will repackage the zip file above with their fixes and so on and I will add credit where credit is due.

I would appreciate help from anyone who is interested in expanding this addon. :)

BlackxRam
01-02-2005, 07:10 AM
Still looking for help to speed this hack up. :) The updated Avatar fix is apparently working just fine.

scottishcruise
01-02-2005, 01:00 PM
just installed, seems to work fine altho;

it shows both the User's logged in details (PMs, avatar etc) AND the 'Welcome guest, sign in etc etc) stuff, can it not be an either or? (as I'm loading the php page in a small 495x150iFrame and it can be all squashed and needscrolling when all that info is shown.

*edit* - right kept playing about with it, took out the avatar and the 'top poster, top thread starter' bits and took out the 'welcome guest, login' bit so it would only show the users details when they came onto the page. thing is, NOW if ur not logged in, it just shows a blank page :ermm: am probably doin sumthin wrong, am a n00b to VB like, just recently switched over from phpnuke.

BlackxRam
01-03-2005, 10:04 AM
I am not sure what you mean.

Your script should look exactly like this: https://vborg.vbsupport.ru/attachment.php?attachmentid=17770

Only with your information replaced. Can you please post a screenshot of what your script looks like?

I think you may have changed something that you shouldnt have changed. Did you set your cookies to your .domain.com? For example mine would be, .mogusland.com.

You also need to ensure that all the paths and places to edit INSIDE the file are changed as per the instructions. :)

BlackxRam
01-03-2005, 10:11 AM
btw when i visit your boardstat.php file.. i get header errors. You do not need to add any body or head tags to this file.

MajorFm.com
01-03-2005, 07:39 PM
Does this hack work with vb3.0.3?

scottishcruise
01-03-2005, 07:57 PM
btw when i visit your boardstat.php file.. i get header errors. You do not need to add any body or head tags to this file.
thanks for reply m8, I mustv'e done it wrong first time, downloaded file again and went thru it step by step, works a treat lol. ^^ the header info I put in was to set the margins to 0 all round for putting it in an iFrame, al get around that tho.

great hack! ;)

BlackxRam
01-03-2005, 10:34 PM
Does this hack work with vb3.0.3?

No reason why it shouldn't. However I am still using 3.0.1 because my forum has alot of mods.

MajorFm.com
02-19-2005, 05:37 PM
Installed and works perfectly...

For those that use html pages with ssi...

simply include using:

<!--#include virtual="forum/boardstat.php" -->

replacing the forum/ if needed.

Great hack, just what i was looking for!

Live on www.majorfm.com/main.shtml

BlackxRam
02-20-2005, 12:22 AM
Glad you Enjoy it Major, this hack has been the same besides a minor update now and then. I am planning to rewrite it in the future so it could possibly share vbulletin templates or have more information in multiple areas of your site. basically, I was thinking of setting it up so people who want vbulletin stats like this don't need a vb portal system. With a portal system like the ones offered, your design styles are severly limited. :)

Glad you enjoy it and wait for the future update.

MajorFm.com
02-20-2005, 02:48 AM
tiny problem...

Threads: 3,441, Posts: 28,672, Members: 2,366, Registered Today: 3
Welcome to our newest member, Baby D
is the stats on the board but...
Threads: 3554
Posts: 29414
Members: 2366
is the stats on the welcome panel... i assume it counts all the posts not after the ones been deleted...?

...and yes i love it, i have been looking for this for ages, i have tweaked the html a bit as you will see at: http://www.majorfm.com/main.shtml for guests and members... neatened it out a bit... felt it was a touch cluttered... :squareeyed:

eblivion
02-20-2005, 08:06 PM
The stats works fine if I view the page, boardstats.php.

When I included into into another php page, it works fine if I'm logged in. However, if I'm not logged in I get the following error:

Unable to add cookies, header already sent.

eblivion
02-21-2005, 12:52 PM
I figured out a workaround. It doesn't give all the board stats, but it's suitable for now.

BlackxRam
02-22-2005, 01:12 PM
Not sure what you are referring to there. It pulls the same stats as if it were on your forums. Are you trying to display all posts counts ever? What would be the point of that ?

Indy
02-22-2005, 01:40 PM
One small issue.

1. Login using this script.
2. Go to your forums. (I added a link to my forums in the script)
3. Logout at your forums.
4. Return to this script.
5. Page is cached, still shows you logged in even though cookies have been cleared etc. Hit reload/refresh and the correct page is displayed showing login boxes.

In the script code, I added the following at the beginning of the HTML code but the page still wants to cache. Is there a work around for this? I basically just dropped the php file in my forums dir and running it from there - not #included in HTML page.

<HEAD>
<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">
<META HTTP-EQUIV=\"Expires\" CONTENT=\"-1\">
</HEAD>

Thanks!

MajorFm.com
02-22-2005, 04:05 PM
Not sure what you are referring to there. It pulls the same stats as if it were on your forums. Are you trying to display all posts counts ever? What would be the point of that ?
My point was, it does display all the posts... its meant to display the 2 figures are not the same... the board's standard vb stats has less posts...

Indy
02-22-2005, 05:46 PM
A little success. Per an article at Microsoft, I added an additional <HEAD></HEAD> tag set after the </BODY> set. In both sets and put in:
<META HTTP-EQUIV=\"Expires\" CONTENT=\"0\">
<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">
<META HTTP-EQUIV=\"Cache-Control\" CONTENT=\"no-cache\">
<META HTTP-EQUIV=\"Pragma-directive\" CONTENT=\"no-cache\">
<META HTTP-EQUIV=\"cache-directive\" CONTENT=\"no-cache\">

Works well with Firefox and Netscape, but no go with IE. I'll propbably head over to the HTML forum where it appears I probably should have been in the first place. Didn't mean to post in the wrong forum.

Thanks for the great script!!

axi
03-14-2005, 03:26 AM
sorry, not sure how to, how do i add the code to my php file to call it over?

cheers

BlackxRam
04-19-2005, 08:42 AM
AXI the instructions are in the zip file and all over this thread, use a php command or a ssi include.

I have never had any problems with the script wanting to cache. Perhaps your browser settings are keeping stored pages longer and not refreshing.

im still at a loss Major, do you have any other hacks installed which may affect the post counts?

Slapyo
04-19-2005, 02:12 PM
actually this doesn't display the stats correctly. if you have deleted posts or threads in your forum, but not physically deleted them, it will still show up in these stats, but it doesn't show up in the forum stats. here is the code i use to grab the stats from the forums itself.

$specialtemplates = array(
'userstats',
);

chdir("./forums/");
require_once("./global.php");
require_once("./includes/functions_forumlist.php");
chdir("../");

// Forum Stats
cache_ordered_forums(1);

$totalthreads = 0;
$totalposts = 0;
if (is_array($forumcache))
{
foreach ($forumcache AS $forum)
{
$totalthreads += $forum['threadcount'];
$totalposts += $forum['replycount'];
}
}
$totalthreads = vb_number_format($totalthreads);
$totalposts = vb_number_format($totalposts);
$userstats = unserialize($datastore['userstats']);
$totalmembers = vb_number_format($userstats['numbermembers']);

BlackxRam
06-01-2005, 11:27 AM
actually this doesn't display the stats correctly. if you have deleted posts or threads in your forum, but not physically deleted them, it will still show up in these stats, but it doesn't show up in the forum stats. here is the code i use to grab the stats from the forums itself.

Actually it does display the stats correctly, lol. It does display how many total posts your forum has, not how many you have and are also hidden heh.

The numbers numbers were meant to be an accurate account of total posts, if something is soft deleted, its not really gone, just hidden. I say, if your going to delete something... just delete it lol ;)

Slapyo
06-01-2005, 02:05 PM
if you delete it you lose the IP address of the poster. if you have a person who many be a repeat offender, soft deleting posts will allow you to see the other posts made by the same IP. obviously doesn't work for everyone, but it does work for quite a bit of people. if you hard delete then it is gone and there is no record. :/

BlackxRam
06-01-2005, 07:53 PM
Thats why there is user notes. ;) =)

Slapyo
06-02-2005, 05:37 AM
but you have to sort through the notes. with this, you just click the ip link in the post and it tells you everything. :)

d2sector
07-14-2005, 12:03 PM
How do you get around the Unable to add cookies, header already sent.
error?

Snetty
07-25-2005, 10:43 AM
does this work with 3.5?

SirJonathan
11-04-2005, 05:18 PM
*bump*.. Anyone know if this works with 3.5?

Dark Riku
11-23-2005, 12:41 AM
A little success. Per an article at Microsoft, I added an additional <HEAD></HEAD> tag set after the </BODY> set. In both sets and put in:


Works well with Firefox and Netscape, but no go with IE. I'll propbably head over to the HTML forum where it appears I probably should have been in the first place. Didn't mean to post in the wrong forum.

Thanks for the great script!!

Has anyone found out the exact code? Thanks

Dark Riku
11-23-2005, 01:53 AM
I found out why its doing this, but i dont no how to change it... its caused because the cookies are being stored in the domain on the non-vb site. when you hit logout, it loging out cookies on vb forum, and the cookies are seperate...