Simple Portal - phpBB Extension

Extensions for phpBB 3.3.X
Maintained and supported by Stoker
User avatar
Stoker Online
Site Admin
Site Admin
Posts: 4,295
Joined: 12 May 2008, 21:26
Local time: Sunday 11:39
Last active: Online now
Favourite EXT: Forum Goal
Location: Denmark

Simple Portal - phpBB Extension

Post by Stoker »

Extension Name: phpBB Portal
Author: Stoker
Version: 1.0.8
PhpBB Version: 3.3.X

Description:
A simple Portal page with acp control to disable/enable and portal text, viewonline status.
You can use bbcodes and smilies in the text area.
There is a welcome message which changes during the day. Code originally by RmcGirr83
Noindex from Crizzo's about us page.
Displays user reg date and how long they have been member. Events for Forum Goal and Top Stats added
Look at screenshots for more explanation

100%

100%


Download:
portal_v1.0.8.zip


Screenshots:
portal_clean.png
portal_demo.png
portal_acp.png



Installation:
  1. Copy the entire contents of the repository to ext/stoker/portal/
  2. Navigate in the ACP to Customise -> Extension Management -> Extensions.
  3. Click Enable.

Older versions

portal_1.0.7.zip
portal1.0.6.zip
portal1.0.5.zip
You do not have the required permissions to view the files attached to this post.
~ The greatest achievement in life is to inspire ~
Regards Stoker
User avatar
Galandas Offline
BBCoder III
BBCoder III
Posts: 147
Joined: 06 Mar 2010, 22:08
Local time: Sunday 10:39
Last active: -
Favourite BBCode: player yahoo
Favourite EXT: Mod Rey
Location: italy

Re: [EXT] Simple Portal

Post by Galandas »

Hi I installed your extension on the latest phpbb version 3.3.13 and it gave me this error: [phpBB Debug] PHP Warning: in file [ROOT]/ext/stoker/portal/controller/main.php on line 137: A non-numeric value encountered

I solved it with this code, if it can help you

Code: Select all

// how long a member for
$member_for = '';
if ($this->user->data['is_registered'] && !$this->user->data['is_bot']) {
    // Verifica che user_regdate sia numerico
    if (is_numeric($this->user->data['user_regdate'])) {
        $member_length = time() - intval($this->user->data['user_regdate']);
    } else {
        $member_length = 0; // Se non è numerico, imposta a 0
    }

    $years = $months = $days = 0;
    $member_for = '';

    if ($member_length > 0) { // Assicurati che member_length sia positivo
        if ($member_length >= 31536000) {
            $years = floor($member_length / 31536000);
            $member_length -= ($years * 31536000);
            $member_for .= $years > 1 ? ($years . ' ' . $this->user->lang['WELCOME_YEARS'] . ', ') : ($years . ' ' . $this->user->lang['WELCOME_YEAR'] . ', ');
        }

        $months = floor($member_length / 2628000);
        if ($months > 0) {
            $member_length -= ($months * 2628000);
            $member_for .= $months > 1 ? ($months . ' ' . $this->user->lang['WELCOME_MONTHS'] . ', ') : ($months . ' ' . $this->user->lang['WELCOME_MONTH'] . ', ');
        }

        $days = floor($member_length / 86400);
        if ($days > 0) {
            $member_for .= $days > 1 ? ($days . ' ' . $this->user->lang['WELCOME_DAYS']) : ($days . ' ' . $this->user->lang['WELCOME_DAY']);
        }        
    }
}
User avatar
Stoker Online
Site Admin
Site Admin
Posts: 4,295
Joined: 12 May 2008, 21:26
Local time: Sunday 11:39
Last active: Online now
Favourite EXT: Forum Goal
Location: Denmark

Re: [EXT] Simple Portal

Post by Stoker »

Galandas wrote: 18 Oct 2024, 21:15 Hi I installed your extension on the latest phpbb version 3.3.13 and it gave me this error: [phpBB Debug] PHP Warning: in file [ROOT]/ext/stoker/portal/controller/main.php on line 137: A non-numeric value encountered

I solved it with this code, if it can help you

Code: Select all

// how long a member for
$member_for = '';
if ($this->user->data['is_registered'] && !$this->user->data['is_bot']) {
    // Verifica che user_regdate sia numerico
    if (is_numeric($this->user->data['user_regdate'])) {
        $member_length = time() - intval($this->user->data['user_regdate']);
    } else {
        $member_length = 0; // Se non è numerico, imposta a 0
    }

    $years = $months = $days = 0;
    $member_for = '';

    if ($member_length > 0) { // Assicurati che member_length sia positivo
        if ($member_length >= 31536000) {
            $years = floor($member_length / 31536000);
            $member_length -= ($years * 31536000);
            $member_for .= $years > 1 ? ($years . ' ' . $this->user->lang['WELCOME_YEARS'] . ', ') : ($years . ' ' . $this->user->lang['WELCOME_YEAR'] . ', ');
        }

        $months = floor($member_length / 2628000);
        if ($months > 0) {
            $member_length -= ($months * 2628000);
            $member_for .= $months > 1 ? ($months . ' ' . $this->user->lang['WELCOME_MONTHS'] . ', ') : ($months . ' ' . $this->user->lang['WELCOME_MONTH'] . ', ');
        }

        $days = floor($member_length / 86400);
        if ($days > 0) {
            $member_for .= $days > 1 ? ($days . ' ' . $this->user->lang['WELCOME_DAYS']) : ($days . ' ' . $this->user->lang['WELCOME_DAY']);
        }        
    }
}
Thanks for reporting :thumb:
I was aware about the error. Also the membership length was incorrect.
Did an update months ago but unfortunately i forgot to post the update :oops: :D
Let me know if the new code still give you errors
~ The greatest achievement in life is to inspire ~
Regards Stoker
User avatar
Steve Offline
Donator
Donator
Posts: 1,429
Joined: 04 Mar 2010, 23:10
Local time: Sunday 10:39
Last active: -

Re: [EXT] Simple Portal

Post by Steve »

I don't get that error from the latest download. Functions as is. I'll post my files tomorrow with smilies added.
secret code: 123 might be abc or thank you might work
When I'm writing code, I am building a picture for you to see and use on your screen...
User avatar
Galandas Offline
BBCoder III
BBCoder III
Posts: 147
Joined: 06 Mar 2010, 22:08
Local time: Sunday 10:39
Last active: -
Favourite BBCode: player yahoo
Favourite EXT: Mod Rey
Location: italy

Re: [EXT] Simple Portal

Post by Galandas »

👍👍💪
User avatar
Stoker Online
Site Admin
Site Admin
Posts: 4,295
Joined: 12 May 2008, 21:26
Local time: Sunday 11:39
Last active: Online now
Favourite EXT: Forum Goal
Location: Denmark

Re: [EXT] Simple Portal

Post by Stoker »

Updated, with some Steve changes that I forgot :thumb:
Fixes some errors
~ The greatest achievement in life is to inspire ~
Regards Stoker
User avatar
Galandas Offline
BBCoder III
BBCoder III
Posts: 147
Joined: 06 Mar 2010, 22:08
Local time: Sunday 10:39
Last active: -
Favourite BBCode: player yahoo
Favourite EXT: Mod Rey
Location: italy

Re: [EXT] Simple Portal

Post by Galandas »

I always liked the semi-transparent background ippi image under the text, could you kindly tell me how to put it, I see it a bit as a trademark of the simple portal.
User avatar
Stoker Online
Site Admin
Site Admin
Posts: 4,295
Joined: 12 May 2008, 21:26
Local time: Sunday 11:39
Last active: Online now
Favourite EXT: Forum Goal
Location: Denmark

Re: [EXT] Simple Portal

Post by Stoker »

Galandas wrote: 15 Dec 2024, 17:42 I always liked the semi-transparent background ippi image under the text, could you kindly tell me how to put it, I see it a bit as a trademark of the simple portal.
I wont be home for a couple of days.
If I forget, then please remind me 😁
~ The greatest achievement in life is to inspire ~
Regards Stoker
User avatar
Galandas Offline
BBCoder III
BBCoder III
Posts: 147
Joined: 06 Mar 2010, 22:08
Local time: Sunday 10:39
Last active: -
Favourite BBCode: player yahoo
Favourite EXT: Mod Rey
Location: italy

Re: [EXT] Simple Portal

Post by Galandas »

okay I'll take that as a no, thanks anyway.👍
User avatar
Stoker Online
Site Admin
Site Admin
Posts: 4,295
Joined: 12 May 2008, 21:26
Local time: Sunday 11:39
Last active: Online now
Favourite EXT: Forum Goal
Location: Denmark

Re: [EXT] Simple Portal

Post by Stoker »

Galandas wrote: 15 Dec 2024, 21:10 okay I'll take that as a no, thanks anyway.👍
Take it as a yes. But I need my pc to look at the files.
Cant remember the code and as i wrote earlier, im not at home the next couple of days 😉
~ The greatest achievement in life is to inspire ~
Regards Stoker