The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
I love how we can see a daily/weekly/etc breakdown of how many members/posts/threads we see per period, but would it be possible to have the option to see how many *thread views* we get as well? I think it'd be cool to see which days see heavier traffic through threads themselves.
Or maybe it's just me. Still be cool tho |
#2
|
||||
|
||||
Ok, here goes...
In stats.php, add this: Code:
echo "<option value=\"views\">Thread Views</option>\n"; Code:
echo "<option value=\"thread\">Threads</option>\n"; Code:
if ($type == "thread") { $table = "thread"; $field = "dateline"; } elseif ($type == "post") { $table = "post"; $field = "dateline"; } elseif ($type == "user") { $table = "user"; $field = "joindate"; } Code:
if ($type == "thread") { $table = "thread"; $field = "dateline"; $countsql = "COUNT(*)"; } elseif ($type == "views") { $table = "thread"; $field = "dateline"; $countsql = "SUM(views)"; } elseif ($type == "post") { $table = "post"; $field = "dateline"; $countsql = "COUNT(*)"; } elseif ($type == "user") { $table = "user"; $field = "joindate"; $countsql = "COUNT(*)"; } Code:
$stats = $DB_site->query("SELECT COUNT(*), DATE_FORMAT(FROM_UNIXTIME($field),'$sqlformat') AS timeframe, MAX($field) FROM $table WHERE $field > '$from' AND $field < '$to' GROUP BY timeframe ORDER BY $field $sort"); Code:
$stats = $DB_site->query("SELECT $countsql , DATE_FORMAT(FROM_UNIXTIME($field),'$sqlformat') AS timeframe, MAX($field) FROM $table WHERE $field > '$from' AND $field < '$to' GROUP BY timeframe ORDER BY $field $sort"); |
#3
|
||||
|
||||
Works great! Thanks (yet again!) Mr Fly
|
#4
|
||||
|
||||
it's great!!
if we want to add post views or someone forum views what should i do? |
#5
|
||||
|
||||
There is no such thing as post / forum views.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|