/*==========================================================================*\
|| ######################################################################## ||
|| # vB3 Statistic System 3.00. by PcFreak [http://at-lantis.de]         # ||
|| # Copyright (C) 2005 by Andree Haupt (PcFreak), All rights reserved.   # ||
|| # Email: vb3statistic@at-lantis.de					      									    # ||
|| # Support thread available at: http://at-lantis.de                     # ||
|| # Demo: http://at-lantis.de/statistic.php		                     	    # ||
|| # For use with vBulletin Version 3                            	        # ||
|| # tested with Version 3.03, 3.04 and 3.05                     	        # ||
|| # Tested, approved and bugfixed by Onkel_Tom (tom@onkeltom.org)        # ||
|| # 														 															            # ||
|| # vB Statistic System 3.00 is to be used in conjunction with VBULLETIN # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html     # ||
|| ######################################################################## ||
\*==========================================================================*/

The following regulations apply for the use of vBulletin Statistics Version 3
------------------------------------------------------------------------------

1. The Script vB Statistik 3, in the following text also named as script, is exclusivly distributed by the coder
    Andree Haupt (PcFreak) for after-use. The use of this script is only allowed if the copyright notice is pointed
    to the person Andree Haupt (PcFreak) and his website "at-lantis.de". This copyright notice must remain in its
    unchanged form and visible. 
	It is not allowed to remove, change or modify this copyright notice.
	
2. The use of this script is only allowed if the user owns a legal license of the vBulletin Forums Software
    from Jelsoft Enterprises Ltd.
	
3. The user is allowed, depending of the fullfillment of 2, to change the code of this script and/or adapting it on his needs.
	
4. The publication and passing on modified versions of this script without a permission of Andree Haupt (PcFreak) is not allowed.

5. Andree Haupt (PcFreak) is not obligated to check if the use or distribution of this script and/or the content of this package
	is against the rights of third parties or against the law of germany or any other state / country.
	Only the user of this script is responsible for this.

6. Andree Haupt (PcFreak) assumes no liability for possible damages or disadvantages caused by the use or not use of this script
	Furthermore there is no guarantee for an absolut and correct function of this script.
	There is also no warranty for files changed by the script or for data stored by the script.
	
7. With the first use of this script or opening the source code of the script, the user agree with this regulations.
	
--------------------------------------------------------------------
INFORMATION ABOUT TRADEMARKS:
--------------------------------------------------------------------

The product names used in this script are for identification purposes only.
All trademarks and registered trademarks are the property of their respective owners.

Only while mentioning these trademarks you should not think
that trademarks aren't protected by rights of third parties.

--------------------------------------------------------------------
INFORMATION ABOUT THE IMAGES (GRAPHICS)
--------------------------------------------------------------------

All used images were build by Andree Haupt (PcFreak) or they are
freeware images which are allowed to be redistributed.

	
*******************************************
**Installation of vB3Statistic Version 3.**
*******************************************

==============================
== step 1		   					    ==
==============================
-----------------------
open file:
-----------------------
admincp/index.php

-----------------------
search for:
-----------------------

	$printhr = false;
	if (can_administer('canadminstyles'))
	{
	
-----------------------
add after:
-----------------------

	//##### Statistic 3 by PcFreak START #####
		$printhr = true;
	construct_nav_option($vbphrase['vbstatistic_admin_index_general'],'statistic_admin.php?do=statistic_setting_general','<br />');		
	construct_nav_option($vbphrase['vbstatistic_admin_index_tld'],'statistic_admin.php?do=statistic_setting_limits','<br />');
	construct_nav_option($vbphrase['vbstatistic_admin_index_browser'],'statistic_admin.php?do=statistic_setting_limits_a','<br />');
	construct_nav_option($vbphrase['vbstatistic_admin_index_spider'],'statistic_admin.php?do=statistic_setting_limits_b','<br />');
	construct_nav_option($vbphrase['vbstatistic_admin_index_maintenance'],'statistic_admin.php?do=statistic_maintenance','<br />');	
	construct_nav_group($vbphrase['vbstatistic_admin_index_setting']);
	//##### Statistic 3 by PcFreak STOP #####

----------------------------------------------	
save edited file and upload it.
----------------------------------------------

==============================
== step 2		      				  ==
==============================

The image directory of the distribution package should be uploaded to the ./statistic directoy (/forum/statistic) 
Don't upload the content to the standard image directory of your forum (/forum/images)!

After that copy all files from the installation directory to your server (use the same directory structure!)


==============================
== step 3		    				    ==
==============================

Run the installation routine "statistic_install.php" from your Web-Browser

e.g. (http://yourdomain.com/forum/admincp/statistic_install.php)

follow the shown instructions.
the installation of the statistics will be done automatically. 
After the installation you must delete the following files from your admincp directory:

- statistic_database_install.php
- statistic_inserts_install.php
- statistic_install.php
- statistic_phrasen_install.php
- statistic_templates_install.php
- statistic_install_phrasen_english.xml
- statistic_install_templates.xml

==============================
== step 4		      				  ==
==============================

You'll find now the new entry "vb Statistik 3.0 Options" in your AdminCP.

Go to this menu and do your setup suitable for your needs.

ATTENTION! 
It is very important that you first edit your own Domainname under "Options for Statistics Main Page"

All other settings can be done later if you want.

==============================
== step 5		      				  ==
==============================

setup a vB-cronjob for the statistics update

Go to admin controlpanel

1) Scheduled Tasks
2) Add New Scheduled Task with the following data

	Titel:	hourly Statistics Update
	weekday: *
	day of month: *
	hour: *
	minute: 59
	enable log: yes(or no) its your decission ;-)
	filename: ./includes/cron/statisticupdate.php


==============================
== step 6		     					  ==
==============================

Now let's activate the statistics and count of visitors
---------------------------------------------------------------------
6.1) Open Template "headinclude" in your AdminCP
     add the following code at the end of the template in the last line!
---------------------------------------------------------------------

<script type="text/javascript" src="clientscript/statistic_java.js"></script>

---------------------------------------------------------------------
6.2) Open Template "phpinclude_start" in your AdminCP
     add the following code at the end of the template in the last line!
---------------------------------------------------------------------

include("./statistic_counter.php");

--------------
Hint:
--------------
For a forum with several Styles you must do the change for each Style 
or you have to put it into your Master Style.
(but think about vB Updates which is overwriting the Master Style!)

***************************************************
**Installation of vB3Statistic Version 3 finished**
***************************************************

You will find your Forum Statistics under the URL:
http://my-domain.com/forum/statistic.php 

*** "my-domain.com/forum" = is your path to your forums directory 

---------------------------------------------------------------------

congratulations
You have successfully installed the vBStatistics on your server and integrated it
in your vBulletin forum. You do not need to do any more, all data will be logged
from now for all visitors of your forum.

Attached your will find some small modifications for your Statistics
to change for your needs.

have fun
Andree Haupt (PcFreak), January 2005

                        ''~``
                        ( o o )
+------------------.oooO--(_)--Oooo.------------------+
|            STATISTIC INSTALLATION COMPLETED         |
|                    .oooO                            |
|                    (   )   Oooo.                    |
+---------------------\ (----(   )--------------------+
                       \_)    ) /
                             (_/




###############################################
############## Additional Features ############
###############################################

*******************************************
**If you want to deinstall the Statistics**
*******************************************

Redo step 6 and remove both entries from your Templates.

After that just upload again the file "statistic_install.php" to your admincp directory
of your server and point again your Browser on it like in step 3.
The installation script automatically detects if you have the Statistics installed on your server
and will start the deinstallation of this hack.

Redo step 4 and remove the lines from admincp/index.php


######################################################################
**********************************************************************
**If you want to exclude more than one domainname from beeing logged**
**********************************************************************
######################################################################
-----------------------
open:
-----------------------
statistic_counter

-----------------------
Search for:
-----------------------

//#########################################################################################################		
//Um weitere Domains auszuschliessen dieses Format benutzen

-----------------------
add above:
-----------------------

if (strpos(strtolower($DER_REFERER), "your-new-excluded-domain.com") === false)

-----------------------
Attention:
-----------------------
Type the Domainname without http://www  in the beginning!
just: your-new-excluded-domain.com

You can add Domainnames as much as you want to be excluded.
Use the same way as mentioned above.
	

######################################
**************************************
**Show Statistics in "Who is Online"**
**************************************
######################################

-----------------------
open:
-----------------------
includes/functions_online.php

-----------------------
search for:
-----------------------

default: 
if ($permissions['wolpermissions'] & CANWHOSONLINEBAD) 
{

-----------------------
add above:
-----------------------


// ##### Statistics Start ##### 
    case 'statistic':
			$userinfo['action'] = 'Views the vBStatistics 3.0';
			$userinfo['where'] = "<a href=\"statistic.php?$session[sessionurl]\" title=\"Statistics\">$vboptions[bbtitle] Statistics</a>";
		break;
// ##### Statistics Ende ##### 

-----------------------
search for:
-----------------------

default: 
$userinfo['activity'] = 'unknown'; 
} 

return $userinfo; 

-----------------------
add above:
-----------------------

// ##### Statistik Start ##### 
case 'statistic.php': 
$userinfo['activity'] = 'statistic'; 
break; 

----------------------------------------------	
save edited file and upload it.
----------------------------------------------

########################################################
********************************************************
**Use a own Templategroup for all Statistics Templates**
********************************************************
########################################################

-----------------------
open:
-----------------------
includes/adminfunctions_template.php

-----------------------
search for:
-----------------------

'subscription' => $vbphrase['group_paid_subscriptions'],

-----------------------
add after:
-----------------------

'statistic' => 'vB Statistics 3',

----------------------------------------------	
save edited file and upload it.
----------------------------------------------

########################################
****************************************
**Show Statistic Link in Navigationbar**
****************************************
########################################

-------------------------------------------------------
Add a new phrase in Admincp as Global Phrase (phrasetypeid = 1)
-------------------------------------------------------
 
Variablenname = vbstatistic_string_statistic 
Text = Forum-Statistics

-----------------------
open:
-----------------------

Template navbar

-----------------------
search for:
-----------------------

		<td class="vbmenu_control"><a href="calendar.php?$session[sessionurl]">$vbphrase[calendar]</a></td>
		
-----------------------
add after:
-----------------------

<!--##### Statistic #####--> 		
		<td class="vbmenu_control"><a href="statistic.php?$session[sessionurl]">$vbphrase[vbstatistic_string_statistic]</a></td>
<!--##### Statistic #####--> 					
	
----------------------------------------------	
save edited file and upload it.
----------------------------------------------


###############################################
***********************************************
**Show WC3 Validator Logo in Statistic Footer**
***********************************************
###############################################

-----------------------
open:
-----------------------

Template statistic_footer

-----------------------
search for:
-----------------------

<!--show the WC3 Valitator Image
<p align="center"> <a href="http://validator.w3.org/check?uri=referer">
<img src="statistic/images/misc/w3clogo.gif" alt="Valid XHTML 1.0!" width="88" height="31" border="0" /></a></p>
-->
		
-----------------------
replace with:
-----------------------

<p align="center"> <a href="http://validator.w3.org/check?uri=referer">
<img src="statistic/images/misc/w3clogo.gif" alt="Valid XHTML 1.0!" width="88" height="31" border="0" /></a></p>

----------------------------------------------	
save edited file and upload it.
----------------------------------------------
