Modding a phpbb3 mod

  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8397
  • Loc: USA

Post 3+ Months Ago

Alright, I got a phpbb portal from http://www.phpbb3portal.com, and integrated it to work with my site and enabled all the things that I want and edited them to be valid XHTML Strict.

There is a problem though, not a flaw in the system, but a problem caused by preference. The mod works fine as it is, the only problem it has consists within the Welcome block. In the admin panel, under Portal, I can edit the text that goes into that block, but it only allows characters... I can't even have spaces there.

What I want though, is to allow bbcode and spaces so I could create paragraphs, lists and whatever else that I need in there... I would also would love to edit the title from 'Welcome' to whatever else I may see fit.

I know that this isn't the support forum for the mod, but their support forum is blocked from registration, and the topic in phpbb.com is locked and the user hasn't being active since February 2008. So I'm along here and trying to get some help here as to where to start...

On my notepad++ I opened around 50+ phpBB files and searched for where it is retrieving the information from the database for the welcome text, but I couldn't find it... I only found where it was inserting the values into the database (install_portal.php).

In the ACP file (acp_portal.php) I found the following code:
Code: [ Select ]
        case 'welcome':
            $display_vars = array(
               'title'   => 'ACP_PORTAL_WELCOME_SETTINGS',
               'vars'   => array(
                  'legend1'                             => 'ACP_PORTAL_WELCOME_SETTINGS',
                  'portal_welcome'                      => array('lang' => 'PORTAL_WELCOME'                   ,   'validate' => 'bool',     'type' => 'radio:yes_no',   'explain' => true),
                  'portal_welcome_intro'                => array('lang' => 'PORTAL_WELCOME_INTRO'             ,   'validate' => 'string',   'type' => 'textarea:6:6',    'explain' => true),
                )
            );
         break;
  1.         case 'welcome':
  2.             $display_vars = array(
  3.                'title'   => 'ACP_PORTAL_WELCOME_SETTINGS',
  4.                'vars'   => array(
  5.                   'legend1'                             => 'ACP_PORTAL_WELCOME_SETTINGS',
  6.                   'portal_welcome'                      => array('lang' => 'PORTAL_WELCOME'                   ,   'validate' => 'bool',     'type' => 'radio:yes_no',   'explain' => true),
  7.                   'portal_welcome_intro'                => array('lang' => 'PORTAL_WELCOME_INTRO'             ,   'validate' => 'string',   'type' => 'textarea:6:6',    'explain' => true),
  8.                 )
  9.             );
  10.          break;

But again, not the actual insertion into the database... I don't think that the SQL thing (that I am looking for) is actually important... but I was thinking maybe redoing the whole thing (where it sets the value to be printed in the template file) my way and including bbcodes and paragraph styling :lol:

The code that sets the variable to be used in the template is:
Code: [ Select ]
if ($config['portal_welcome'])
{
    $template->assign_vars(array(
        'S_DISPLAY_WELCOME'     => true,
        'PORTAL_WELCOME_INTRO'  => $config['portal_welcome_intro'],
    ));
}
  1. if ($config['portal_welcome'])
  2. {
  3.     $template->assign_vars(array(
  4.         'S_DISPLAY_WELCOME'     => true,
  5.         'PORTAL_WELCOME_INTRO'  => $config['portal_welcome_intro'],
  6.     ));
  7. }

I can't find where it sets that config... I searched for both $config['portal_welcome_intro'] and portal_welcome_intro in over 50 files and only found stuff that I didn't understand :lol: Below is a screenshot of the results.

http://www.wedevoy.com/ozzu/Help/bogey/portal_search_results.PNG

Thanks :D
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8397
  • Loc: USA

Post 3+ Months Ago

No one knows a solution to this? I am thinking of redoing this completely... I want to make a button in the admin panel... heck, even in the front page that only admin can see that says 'Update Welcome Message' and when I click that, I see a a textbox that allows bbcode and as many characters as I need.

Help to this would be greatly appreciated.
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9090
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

Whenever you see the variable called $config['blah_blah'] with phpbb3 that basically means it's referencing data in the MySQL table:

phpbb_config

Look in that table for the variable 'portal_welcome_intro'

And that first block of code you pasted is where its getting set into that phpbb table:

Code: [ Select ]
'portal_welcome_intro'                => array('lang' => 'PORTAL_WELCOME_INTRO'             ,   'validate' => 'string',   'type' => 'textarea:6:6',    'explain' => true),


See how it says:

'validate' => 'string'

That is what is is validating the text you enter against. Research the different validation types (which you can find in includes/functions_user.php) and you will be able to get the type of text you want in there. Be warned though the phpbb config table by default allows 255 characters max, so you are probably going to want to rewrite the mod to store the data elsewhere instead of the config table.

I hope that helps!
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8397
  • Loc: USA

Post 3+ Months Ago

That did help... a big bit though... now I wonder how I could set it up that it would save the text wherever I want it to be and not in the config... how do I change that thing so it puts it in a different spot? Do I just remove that PHP and simply use SQL?
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9090
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

Yeah, unfortunately if you aren't going to use the config variables it is going to require you to write own SQL statements to put the data in your own table where you can specify exactly what you want.
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8397
  • Loc: USA

Post 3+ Months Ago

Alright thanks bigwebmaster... I'll try that and come back with the results :) Thanks :D

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 113 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.