Is there a good way to find out some info from the stats?
How many unique visitors per day
How many visits per day
How many articles viewed
etc...
Visitor Stats
Moderator: Thorsten
Hi Andrew,
do you mean a complete statistic page inside the admin section? This could be implemented in 1.4.0 if you like.
bye
Thorsten
do you mean a complete statistic page inside the admin section? This could be implemented in 1.4.0 if you like.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
I wrote a stats.php page
it just shows me how many unique visitors per day that visited my faq site in the last 31 days.
MyIE2info FAQ Stats
It runs pretty slowly and there is probably many better ways to code it but it gives me some basic visitor info

it just shows me how many unique visitors per day that visited my faq site in the last 31 days.
MyIE2info FAQ Stats
It runs pretty slowly and there is probably many better ways to code it but it gives me some basic visitor info

Nice page!
If you like you can post your code here...
bye
Thorsten
If you like you can post your code here...
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Here is the code. I think it should work as is for other phpMyFAQ systems also. (just change the heading in the table)
Code: Select all
<?php
global $db, $sqltblpre;
echo "<TABLE BORDER=0 CELLSPACING= CELLPADDING=4>";
echo "<TR><TD colspan=3>MyIE2info FAQ</TD></TR>";
echo "<TR><TD colspan=3>Number of Unique Visitors per Day</TD></TR>";
echo "<TR><TD align=center>Date</TD><TD align=center colspan=2># of Visitors</TD></TR>";
/* connect to the database server */
require ("inc/data.php");
require ("inc/database.php");
$db = new db_mysql();
$db->connect($mysql_server, $mysql_user, $mysql_passwort, $mysql_db);
$time2 = mktime(23, 59, 59);
$time1 = mktime(0, 0, 0);
$toggle = true;
/* Loop for 31 days */
for ($i = 1; $i <= 31; $i++)
{
$resultDB = $db->query("SELECT count(sid) FROM ".$sqltblpre."faqsessions WHERE time > '".$time1."' AND time < '".$time2."' GROUP BY ip");
$formattedDate = date("D, M j, Y", $time1);
if ($toggle)
{
$toggle=false;
echo "<TR bgcolor=#E7EBEF>";
}
else
{
$toggle=true;
echo "<TR bgcolor=white>";
}
echo "<TD width=150 align=right>".$formattedDate."</TD><TD width=60 align=right>".$db->num_rows($resultDB)."</TD><TD width=30> </TD></TR>";
$time2 = $time1;
$time1 = ($time2 - (24*3600));
}
echo "</TABLE>";
?>