Статистика от форум в сайт

  • Автор Автор JcaL
  • Начална дата Начална дата

JcaL

Registered
Трябва ми статистика от форум (phpBB3) в сайта - колко мнения,теми,потребители , последния регистриран...
 
http://web-tourist.net/forum/viewtopic.php?t=70537

Код:
<?
#database info, or include a config.php file
$db_host = 'localhost'; #change to your host
$db_user = 'username'; #change to your user name
$db_password = 'password'; #change to your password
$db_name = 'database_name'; #change to your db name #connect to the database, or end all scripts and give the reason for ending

mysql_connect($db_host,$db_user,$db_password) or die(mysql_error());
mysql_select_db($db_name) or die(mysql_error());

#select the number of users online
$result = mysql_query("SELECT count(s.session_logged_in) FROM phpbb_sessions s WHERE s.session_logged_in = 1");

#display amount of users online
echo "<table><tr><td>";
#this is a while loop that will loop through the array of returned
#results and display them, it is used throughout this script
while($r=mysql_fetch_array($result)){
echo "Total users online: ".$r['count(s.session_logged_in)']."<br>";
}

#select the newest member
$result = mysql_query("SELECT u.user_id, u.username FROM phpbb_users u ORDER BY u.user_id DESC LIMIT 1");

#display newest user, change the <a> tag to your forum directory
while($r=mysql_fetch_array($result)){
# Change http://www.domain.com/forum either the path to your forum, or a direct link to the forum if it's on a sub-domain */
echo "Newest registerd user: <a href=\"http://www.domain.com/forum/profile.php?mode=viewprofile&u=".$r['user_id']."\">".$r['username']."</a><p>";
}

#select total topics
$result = mysql_query("SELECT count(t.topic_id) FROM phpbb_topics t");

#display total topics
while($r=mysql_fetch_array($result)){
echo "Total topics: ".$r['count(t.topic_id)']."<br>";
}

#select total amount of posts
$result = mysql_query("SELECT count(p.post_id) FROM phpbb_posts p");

#display total posts
while($r=mysql_fetch_array($result)){
echo "Total Posts: ".$r['count(p.post_id)']."";
}

echo "</td></tr></table>";
?>
 
И аз го имам тва горното и работи .... ама аз минах на еди друг
ама не знам от къде го взех :І
 
Ще може ли някой да даде работещ мод за phpBB3 ?!

или ако наистина работи, значе аз не го слагам където трябва. Горния код, къде трябва да се сложи?!
 
нещо подобно ?

d17040d24e4cd59d.jpg
 
А като го сваля и разхивирам този мод, какво го правя?! Къде трябва да го сложа?! И става ли това за phpBB3 ?! И на мен ми трябва да сложа статистиката в сайта, а не във форума!!!
 
На мене ми трябва така статистика от форума за сайта , но само написани мнения, потребители и най новия потребител
 

Back
Горе