The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Comments |
#52
|
|||
|
|||
at the moment ... no, sorry
|
#53
|
||||
|
||||
Wanted to install but looks a little dodgy.
|
#54
|
|||
|
|||
I noticed that this mod only calculates from the day it was installed... is there any way to get this to calculate the entire database? Basically for daily stats?
|
#55
|
|||
|
|||
The only way was befofe installing the Mod.
count_statistic.php counts all PM's, threads ... there's no chance to get the statistics from the beginning of the forum |
#56
|
|||
|
|||
Why would it be impossible to get the Daily Stats section to fill out since the beginning? All posts and threads are dated, as well as account creation dates. Couldn't a script be written that calculates the New Threads, New Posts and Registrations by date?
Since I've installed the script, what would happen if I ran count_statistic.php again? |
#57
|
|||
|
|||
It will only count the smilies, posts, threads and PM's again
|
#58
|
|||
|
|||
hmm... I've got a good question...
What sort of impact on performance does this mode have? I noticed a large number of added queries on each page... Would this mod be the culprit? *EDIT*... it adds 11 queries on EVERY page. Oh yes... also... formatting problem... http://www.8wayrun.com/statistic.php?submenue=1&menue=4 |
#59
|
|||
|
|||
After install I got these lines a full 19" screen on each page before forums appear
Code:
query ("UPDATE `" . TABLE_PREFIX . "user` SET `lastip`='" . $iponline . "' WHERE `userid`='" . $vbulletin->userinfo['userid'] . "'"); $vbip_count_file = "vbcount.txt"; // path zum countfile $vbip_file = "vbip.txt"; // path zum ipfile $vbip_userip = getenv ('REMOTE_ADDR'); // Achtung! F2S User! "REMOTE_ADDR" durch "HTTP_X_FORWARDED_FOR" ersetzen! if (file_exists ($vbip_count_file)) $vbip_count_temp = file ($vbip_count_file); if (file_exists ($vbip_file)) $vbip_temp = file ($vbip_file); $vbip_detail = explode ("|", $vbip_count_temp[0]); $vbip_t = getdate (time ()); $vbip_day = $vbip_t['mday']; if ($vbip_detail[0] == $vbip_day) { $vbip_detail[1]++; $vbip_detail[2]++; $vbip_count = count ($vbip_temp); $vbip_check = 1; $ip_array = explode ('\n', $vbip_temp[0]); if (count ($ip_array)) { foreach ($ip_array as $key => $val) { if ($val == $vbip_userip) $vbip_check = 0; } } if ($vbip_check == 1) { $vbip_detail[3]++; $vbip_detail[4]++; $vbip_fp = fopen ($vbip_file, 'a'); @flock ($vbip_fp, 3); @fputs ($vbip_fp, $vbip_userip . '\n'); @fclose ($vbip_fp); } } else { $vbip_detail[0] = $vbip_day; $vbip_detail[1] = 1; $vbip_detail[3] = 1; $vbip_detail[2]++; $vbip_detail[4]++; $vbip_fp = @fopen ($vbip_file, 'w'); @flock ($vbip_fp, 3); @fputs ($vbip_fp, $vbip_userip . '\n'); @fclose ($vbip_fp); } $db->query ("UPDATE `" . TABLE_PREFIX . "user` SET `seitencounter`=`seitencounter`+'1' WHERE `userid`='" . $vbulletin->userinfo['userid'] . "'"); $vbip_new = implode ('|', $vbip_detail); $vbip_fp = @fopen ($vbip_count_file, 'w'); @flock ($vbip_fp, 3); @fputs ($vbip_fp, $vbip_new); @fclose ($vbip_fp); $language = ''; $curtime = time (); $date_today = getdate ($curtime); $time_today = mktime (0, 0, 0, $date_today['mon'], $date_today['mday'], $date_today['year']); $currentstat = $db->query_first ("SELECT * FROM `" . TABLE_PREFIX . "vbstat` WHERE `time`='" . $time_today . "'"); if (!$currentstat['time']) $db->query ("INSERT INTO `" . TABLE_PREFIX . "vbstat` (`time`) VALUES ('" . $time_today . "')"); if ($vbulletin->userinfo['userid']) { $schonda = $db->query_first ("SELECT * FROM `" . TABLE_PREFIX . "vbsessions_day` WHERE `userid`='" . $vbulletin->userinfo['userid'] . "'"); if (!$schonda['userid']) $db->query ("UPDATE `" . TABLE_PREFIX . "vbstat` SET `memberson`=`memberson`+'1' WHERE `time`='" . $time_today . "'"); } $user = $db->query_first ("SELECT COUNT(*) AS anzahl FROM `" . TABLE_PREFIX . "session` WHERE `lastactivity`>='" . (TIMENOW - $vbulletin->options['cookietimeout']) . "'"); if ($user['anzahl'] > $currentstat['maxuseron']) $db->query ("UPDATE `" . TABLE_PREFIX . "vbstat` SET `maxuseron`='" . $user['anzahl'] . "', `maxuserontime`='" . $curtime . "' WHERE `time`='" . $time_today . "'"); $res1 = $db->query ("DELETE FROM `" . TABLE_PREFIX . "vbsessions_day` WHERE `time`<'" . $time_today . "'"); if ($vbulletin->userinfo['userid']) { $row = $db->query_first ("SELECT * FROM `" . TABLE_PREFIX . "vbsessions_day` WHERE `userid`='" . $vbulletin->userinfo['userid'] . "'"); if (!$row['userid']) $db->query ("INSERT INTO `" . TABLE_PREFIX . "vbsessions_day` VALUES ('" . $vbulletin->userinfo['userid'] . "','" . $curtime . "')"); } $aktuelldate = date ("Ymd"); $db->query ("DELETE FROM `" . TABLE_PREFIX . "vbgastonline` WHERE `gastdate`<>'" . $aktuelldate . "'"); $datenbank = $db->query_first ("SELECT `lastip` FROM `" . TABLE_PREFIX . "user` WHERE `userid`='" . $vbulletin->userinfo['userid'] . "'" ); if ($datenbank['lastip'] == $_SERVER['REMOTE_ADDR']) { if ($vbulletin->userinfo['userid'] > 0) $Fragab = 0; } else { if ($vbulletin->userinfo['userid'] > 0) $Fragab = 1; } $datenbank = $db->query_first ("SELECT * FROM `" . TABLE_PREFIX . "vbgastonline` WHERE `ip`='" . $_SERVER['REMOTE_ADDR'] . "'" ); if ($datenbank['ip'] == $_SERVER['REMOTE_ADDR']) { if ($vbulletin->userinfo['userid'] == 0) $Fragab = 0; } else { if ($vbulletin->userinfo['userid'] == 0) $Fragab = 1; } unset ($BROWSER_AGENT); unset ($SPIDER_CRAWLER); unset ($BROWSER_PLATFORM); $bagent = $HTTP_SERVER_VARS['HTTP_USER_AGENT']; $blang = $HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE']; if ($bagent == '') $bagent = $_SERVER['HTTP_USER_AGENT']; if ($blang == '') $blang = $_SERVER['HTTP_ACCEPT_LANGUAGE']; if ($Fragab == 1) { require_once (DIR . '/includes/class_xml.php'); if (ereg ('MSIE', $bagent)) { if (strstr ($bagent, 'MSIE 5.0')) $BROWSER_AGENT = 'IE5'; else if (strstr ($bagent, 'MSIE 5.5')) $BROWSER_AGENT = 'IE55'; else if (strstr ($bagent, 'MSIE 6.0')) $BROWSER_AGENT = 'IE6'; else if (strstr ($bagent, 'MSIE 7.0')) $BROWSER_AGENT = 'IE7'; else $BROWSER_AGENT = 'IE'; } else if (ereg ('Lynx', $bagent)) $BROWSER_AGENT = 'Lynx'; else if (ereg ('iCab', $bagent)) $BROWSER_AGENT = 'iCab'; else if (ereg ('OmniWeb', $bagent)) $BROWSER_AGENT = 'OmniWeb'; else if (ereg ('Konqueror', $bagent)) $BROWSER_AGENT = 'Konqueror'; else if (ereg ('Opera', $bagent)) $BROWSER_AGENT = 'Opera'; else if (ereg ('Safari', $bagent)) $BROWSER_AGENT = 'Safari'; else if (ereg ('Camino', $bagent)) $BROWSER_AGENT = 'Camino'; else if (ereg ('Mozilla/([0-9].[0-9]{1,2})', $bagent)) $BROWSER_AGENT = 'Mozilla'; else $BROWSER_AGENT = 'Other'; // log all the Spiders we've got in "statistic_spiders.xml" $spider_obj = new vB_XML_Parser (false, DIR . '/includes/xml/statistic_spiders.xml'); $spider_data = $spider_obj->parse (); if (is_array ($spider_data['spider'])) { foreach ($spider_data['spider'] as $key => $val) { if (eregi ($val['ident'], $bagent)) $SPIDER_CRAWLER = $val['name']; } } if ($SPIDER_CRAWLER != '') { $spider_chk = $db->query_first ("SELECT `id` FROM `" . TABLE_PREFIX ."vbstats_new` WHERE `artcount`='3' AND `title`='" . $SPIDER_CRAWLER . "'"); if ($spider_chk['id']) $db->query ("UPDATE `" . TABLE_PREFIX . "vbstats_new` SET `counter`=`counter`+'1' WHERE `artcount`='3' AND `title`='" . $SPIDER_CRAWLER . "'"); else { $db->query ("INSERT INTO `" . TABLE_PREFIX . "vbstats_new` (`artcount`,`title`, `counter`,`icon`) VALUES ('3', '" . addslashes ($SPIDER_CRAWLER) . "','1', 'spiders.gif') "); } } if (eregi ('linux', $bagent)) $BROWSER_PLATFORM = 'Linux'; else if (eregi ('win32', $bagent)) $BROWSER_PLATFORM = 'Windows'; else if (eregi ('Win 9x 4.90', $bagent)) $BROWSER_PLATFORM = 'Windows ME'; else if (eregi ('Windows2000', $bagent)) $BROWSER_PLATFORM = 'Windows 2000'; else if (eregi ('NT 5.0', $bagent)) $BROWSER_PLATFORM = 'Windows 2000'; else if (eregi ('NT 5.1', $bagent)) $BROWSER_PLATFORM = 'Windows XP'; else if (eregi ('mac', $bagent)) $BROWSER_PLATFORM = 'Macintosh'; else if (eregi ('NT 4.0', $bagent)) $BROWSER_PLATFORM = 'Windows NT'; else if (eregi ('sunos', $bagent)) $BROWSER_PLATFORM = 'SunOS'; else if (eregi ('irix', $bagent)) $BROWSER_PLATFORM = 'IRIX'; else if (eregi ('os/2', $bagent)) $BROWSER_PLATFORM = 'OS/2'; else if (eregi ('unix', $bagent)) $BROWSER_PLATFORM = 'Unix'; else if (eregi ('hp-ux', $bagent)) $BROWSER_PLATFORM = 'Unix'; else if (eregi ('X11', $bagent)) $BROWSER_PLATFORM = 'Unix'; else if (eregi ('Windows 95', $bagent)) $BROWSER_PLATFORM = 'Windows 95'; else if (eregi ('Windows 98', $bagent)) $BROWSER_PLATFORM = 'Windows 98'; else if (eregi ('NT 6.0', $bagent)) $BROWSER_PLATFORM = 'Windows Vista'; else if (eregi ('beos', $bagent)) $BROWSER_PLATFORM = 'BeOs'; else if (eregi ('freebsd', $bagent)) $BROWSER_PLATFORM = 'FreeBSD'; else $BROWSER_PLATFORM = 'Other'; $havel = 0; $language = substr (strtolower ($blang), 0, 2); if ($language == 'ja') $language = 'jp'; if ($language == 'dk') $language = 'da'; if ($language == 'us') $language = 'en'; $blangs = array ('aa','ab','af','am','ar','as','ay','az', 'ba','be','bg','bh','bi','bn','bo','br', 'ca','co','cs','cy', 'da','de','dz', 'el','en','eo','es','et','eu', 'fa','fi','fj','fo','fr','fy', 'ga','gd','gl','gn','gu', 'ha','he','hi','hr','hu','hy', 'ia','id','ie','ik','is','it','iu', 'jp','jw', 'ka','kk','kl','km','kn','ko','ks','ku','ky', 'la','ln','lo','lt','lv', 'mg','mi','mk','ml','mn','mo','mr','ms','mt','my', 'na','ne','nl','no', 'oc','om','or', 'pa','pl','ps','pt', 'qu', 'rm','rn','ro','ru','rw', 'sa','sd','sg','si','sk','sl','sm','sn','so','sq','sr','ss','st','su','sv','sw', 'ta','te','tg','th','ti','tk','tl','tn','to','tr','ts','tt','tw', 'uk','ur','uz', 'vi','vo', 'wo', 'xh', 'yi', 'za','zh'); foreach ($blangs as $la => $lu) { if ($language == $lu) $havel = 1; } if ($language == '') { $htt = explode (';', $bagent); foreach ($htt as $la => $lu) { foreach ($blangs as $le => $li) { if (substr (trim ($lu), 0, 2) == $li) $havel = 1; } } } if (!$havel) $language = 'other'; } if ($BROWSER_PLATFORM != '') $db->query ("UPDATE `" . TABLE_PREFIX . "vbstats_new` SET `counter`=`counter`+'1' WHERE `artcount`='0' AND `title`='" . $BROWSER_PLATFORM . "'"); if ($BROWSER_AGENT != '') $db->query ("UPDATE `" . TABLE_PREFIX . "vbstats_new` SET `counter`=`counter`+'1' WHERE `artcount`='1' AND `title`='" . $BROWSER_AGENT . "'"); if ($language != '') $db->query ("UPDATE `" . TABLE_PREFIX . "vbstats_new` SET `counter`=`counter`+'1' WHERE `artcount`='2' AND `title`='" . $language . "'"); $gastdata = $db->query_first ("SELECT * FROM `" . TABLE_PREFIX . "vbgastonline` WHERE `ip`='" . $_SERVER['REMOTE_ADDR'] . "'"); if (!$gastdata['ip']) $db->query ("INSERT INTO `" . TABLE_PREFIX . "vbgastonline` VALUES ('" . $_SERVER['REMOTE_ADDR'] . "','" . $aktuelldate . "')"); function ip_getsmilies () { global $db; $count = 0; $result = $db->query ("SELECT smilieid as smilieid, smiliepath as path, smilietext as text FROM `" . TABLE_PREFIX . "smilie`"); while ($row = $db->fetch_array ($result)) { $count++; $smiliecache[$count] = $row; } return $smiliecache; } function ip_smiliescount ($out) { global $db, $smiliecache, $vbulletin; if (!count ($smiliecache)) $smiliecache = ip_getsmilies (); for ($i = 0; $i < count ($smiliecache); $i++) { if ($smiliecache[$i]['text']) { if (stristr ($out, $smiliecache[$i]['text'])) { $outarray = explode ($smiliecache[$i]['text'], $out); $plus = count ($outarray) - 1; $smilieid = $smiliecache[$i]['smilieid']; $result = $db->query_first ("SELECT `smiliesint` FROM `" . TABLE_PREFIX . "smilie` WHERE `smilieid`='" . $smilieid . "'"); $smiliesintarray = $result['smiliesint']; $smiliesint = $smiliesintarray + $plus; $db->query ("UPDATE `" . TABLE_PREFIX . "smilie` SET `smiliesint`='" . $smiliesint . "' WHERE `smilieid`='" . $smilieid . "'"); } } } } function ip_smiliesdecount ($out) { global $db, $smiliecache; if (!count ($smiliecache)) $smiliecache = ip_getsmilies (); for ($i = 0; $i < count($smiliecache); $i++) { if (stristr ($out, $smiliecache[$i]['text'])) { $outarray = explode ($smiliecache[$i]['text'], $out); $plus = count($outarray) - 1; $smilieid = $smiliecache[$i]['smilieid']; $result = $db->query_first ("SELECT `smiliesint` FROM `" . TABLE_PREFIX . "smilie` WHERE `smilieid`='" . $smilieid . "'"); $smiliesintarray = $result['smiliesint']; $smiliesint = $smiliesintarray + $plus; $db->query ("UPDATE `" . TABLE_PREFIX . "smilie` SET `smiliesint`='" . $smiliesint . "' WHERE `smilieid`='" . $smilieid . "'"); } } } ?> Edit: fixed by adding the missing "php" at file beginnings of every attached .php Code:
<?php |
#60
|
|||
|
|||
Next step I'd like to integrate vB-Statistic with vBadvanced CMPS.
Using THIS_SCRIPT statistic I get following errors: - in cmps - blank page - calling statistic.php directly - system message Deleting THIS_SCRIPT entry in vBadvanced options the statistic runs fine again. Did somebody successfully integrate vB Statistic in vBadvanced? |
#61
|
|||
|
|||
Does it work on 3.8 version?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|