Forum stats on external page.

A perfect place for code snippets to small to be a MOD or a library.
Or for examples on how to use our libraries.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
User avatar
tumba25
Past Contributor
Past Contributor
Posts: 1058
Joined: 24 Oct 2007, 13:10
Real name: Jari Kanerva
Location: Kokkola, Finland.
Contact:

Forum stats on external page.

Postby tumba25 » 12 Oct 2010, 16:50


c3dric
New member
New member
Posts: 1
Joined: 15 Oct 2010, 15:42
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Forum stats on external page.

Postby c3dric » 15 Oct 2010, 16:02

Hello everyone,

Could you tell me how to display the latest posts or topics with this API

Thank you for your help

Regards c3dric

User avatar
Peetra
Supporter
Supporter
Posts: 26
Joined: 29 Sep 2010, 04:12
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Forum stats on external page.

Postby Peetra » 31 Jan 2011, 19:34

I would use the normal Atom feed buildt in phpBB itself for such a thing. :)

robra
New member
New member
Posts: 2
Joined: 09 Mar 2012, 00:17
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Forum stats on external page.

Postby robra » 09 Mar 2012, 00:42


User avatar
RMcGirr83
Past Contributor
Past Contributor
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Forum stats on external page.

Postby RMcGirr83 » 09 Mar 2012, 10:43

There is no config for guests or all users online.

That is retrieved from the sessions table and is returned via the page_header function within the includes/functions.php file.

robra
New member
New member
Posts: 2
Joined: 09 Mar 2012, 00:17
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Forum stats on external page.

Postby robra » 09 Mar 2012, 13:39


User avatar
RMcGirr83
Past Contributor
Past Contributor
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Forum stats on external page.

Postby RMcGirr83 » 09 Mar 2012, 23:16

Read this

http://blog.phpbb.com/2009/11/09/how-to ... nal-pages/

pay attention to the last code block.

User avatar
EY
Supporter
Supporter
Posts: 204
Joined: 05 Nov 2006, 23:13
Real name: Elias
Location: Montreal
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Forum stats on external page.

Postby EY » 15 Mar 2012, 06:17

Never Say Never!

bigbigfan
New member
New member
Posts: 2
Joined: 01 Jan 2013, 16:46
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Forum stats on external page.

Postby bigbigfan » 01 Jan 2013, 16:50

Awesomely simple solution but I need just a *little* more.

Total posts
Total topics
Total members
Total visits today <---- is this stored in the database as well? It is over the past 5 mins but can be set to daily, no?

...and I need it from multiple forums, e.g. I have three different forums and I need this information posted on a 4th non-forum site.

User avatar
tumba25
Past Contributor
Past Contributor
Posts: 1058
Joined: 24 Oct 2007, 13:10
Real name: Jari Kanerva
Location: Kokkola, Finland.
Contact:

Re: Forum stats on external page.

Postby tumba25 » 02 Jan 2013, 00:56

Todays visits is not stored in the DB. You would need to store it in the DB. It would take to much resources otherwise.

bigbigfan
New member
New member
Posts: 2
Joined: 01 Jan 2013, 16:46
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Forum stats on external page.

Postby bigbigfan » 02 Jan 2013, 11:23

That's fine, i can pull the total visits from piwik, but how about the other part of the question, how could I merge the stats from 3 different forums onto the homepage of a 4th site?

While I could probably hack it together I'm not sure about needing 3 different databases to respond, performance, etc.

User avatar
tumba25
Past Contributor
Past Contributor
Posts: 1058
Joined: 24 Oct 2007, 13:10
Real name: Jari Kanerva
Location: Kokkola, Finland.
Contact:

Re: Forum stats on external page.

Postby tumba25 » 03 Jan 2013, 09:19

You need to query each DB and put the result on your 4th site. You could have all 3 forums in the same DB to not have to connect to different DBs.


[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Return to “3.0 Code snippets”

Who is online

Users browsing this forum: No registered users and 4 guests