Statistics on Index

Modifications for phpBB3. Try the Mods here and share Your own Mods
There is no support here! Only Read Access!
Forum rules
You dont have to use ModX or make your mod AutoMod compatible. A simple textfile is fine
But if you post Mods here You also have to give support
napus
BBCoder I
BBCoder I
Posts: 2
Joined: 24 Apr 2010, 11:37

Re: Statistics on Index

Post by napus »

Anyone knows what is going on ??

Code: Select all

[phpBB Debug] PHP Notice: in file /index.php on line 45: Division by zero
[phpBB Debug] PHP Notice: in file /index.php on line 51: Division by zero
[phpBB Debug] PHP Notice: in file /index.php on line 53: Division by zero
[phpBB Debug] PHP Notice: in file /index.php on line 59: Division by zero
[phpBB Debug] PHP Notice: in file /index.php on line 65: Division by zero

Code: Select all

$posts_per_topic = $total_posts / $total_topics;
    $l_posts_per_topic_s = ($posts_per_topic == 0) ? 'POSTS_PER_TOPIC_ZERO' : 'POSTS_PER_TOPIC_OTHER';
    $topics_per_day = $total_topics / $boarddays;
    $l_topics_per_day_s = ($topics_per_day == 0) ? 'TOPICS_PER_DAY_ZERO' : 'TOPICS_PER_DAY_OTHER';
    $topics_per_year = $topics_per_day * 365;
    $l_topics_per_year_s = ($topics_per_year == 0) ? 'TOPICS_PER_YEAR_ZERO' : 'TOPICS_PER_YEAR_OTHER';
    $topics_per_user = $total_topics / $total_users;
    $l_topics_per_user_s = ($topics_per_user == 0) ? 'TOPICS_PER_USER_ZERO' : 'TOPICS_PER_USER_OTHER';
    $files_per_day = $total_files / $boarddays;
    $l_files_per_day_s = ($files_per_day == 0) ? 'FILES_PER_DAY_ZERO' : 'FILES_PER_DAY_OTHER';
    $files_per_year = $files_per_day * 365;
    $l_files_per_year_s = ($files_per_year == 0) ? 'FILES_PER_YEAR_ZERO' : 'FILES_PER_YEAR_OTHER';
    $files_per_user = $total_files / $total_users;
User avatar
Stoker
Site Admin
Site Admin
Posts: 3521
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: Statistics on Index

Post by Stoker »

Is it being installed on a completely new board, 0 days old?

EDIT: I have tried to reproduce it by resetting the board start date. No errors.
What has happened that could cause the error at your board? Have you just installed it?
Board rules! No PM support
User avatar
Wildthinks
BBCoder II
BBCoder II
Posts: 9
Joined: 08 Mar 2010, 20:38

Re: Statistics on Index

Post by Wildthinks »

Hey,

I have installed it once again and now I have a question about the start date...
Now it's like this: 29 Aug 2010, 00:29:31
But I would like to have it like this: 29 Aug 2010
I just don't know how to do this, I'm sorry :D
Could you please explain it?
User avatar
Stoker
Site Admin
Site Admin
Posts: 3521
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: Statistics on Index

Post by Stoker »

The start date is using $user->format_date which means that it is displayed according to the users setting in UCP.
However, as board owner, it would be nice to be able to format the date different.

To do so, find this:

Code: Select all

$start_date     = $user->format_date($config['board_startdate']);
replace it with:

Code: Select all

$start_date  	= date("d M Y, H:i:s", $config['board_startdate'] );
Now you can change this part - d M Y, H:i:s - according to the php date function (google it)
Board rules! No PM support
User avatar
Wildthinks
BBCoder II
BBCoder II
Posts: 9
Joined: 08 Mar 2010, 20:38

Re: Statistics on Index

Post by Wildthinks »

Thank you, Stoker, it was very helpful!
Locked