phpbb site admin panel

  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

I created a separate admin panel for my site which is integrated into phpbb 3. Works well on my local host but when I upload it on to my site, it tells me I don't have administrative privileges to get in. I doubt that it's the code since it works on my local server... I don't know what it is.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

How did you integrate it, did you use a new ACP module ?

If you did, look in the file for it that's in the "info" folder of the ACP modules folder & find out which permission it's using, then you can guestimate which permission you need to check.

For instance, here's the info file for an ACP module I'm working on.
http://code.google.com/p/bb3-mods/sourc ... e_info.php

Note the 'auth' => 'acl_a_phpinfo',, that's what you're looking for. If it has an "*_a_*" it's an administrative permission, if it's a "*_m_*" it's a moderator permission, a "*_u_*" is a user permission.

In the case of my module there, I'm piggybacking the PHPINFO permission.
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

What I'm doing is... (Here is the whole page... a whole ne ACP page...).

Code: [ Select ]
<?php
/**
*
* @package site acp
* @version $Id: index.php 8591 2008-06-04 11:40:53Z Kellanved $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
*/
define('IN_PHPBB', true);
define('ADMIN_START', true);
define('NEED_SID', true);

// Include files
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
require($phpbb_root_path . 'common.' . $phpEx);
require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
require($phpbb_root_path . 'includes/functions_module.' . $phpEx);

// Default page (index)
$page = 'index';

// Get the required admin template page
if (isset($_GET['atp']))
{

    //atp = admin template page
    $page = $_GET['atp'];
}

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('mods/acp/'. $page);
// End session management

// Have they authenticated (again) as an admin for this session?
if (!isset($user->data['session_admin']) || !$user->data['session_admin'])
{
    login_box('', $user->lang['LOGIN_ADMIN_CONFIRM'], $user->lang['LOGIN_ADMIN_SUCCESS'], true, false, './index.php');
}

// Is user any type of admin? No, then stop here, each script needs to
// check specific permissions but this is a catchall
if (!$auth->acl_get('a_'))
{
    trigger_error('NO_ADMIN');
}

// We define the admin variables now, because the user is now able to use the admin related features...
define('IN_ADMIN', true);
$phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : './';

// Set custom template for admin area
$template->set_custom_template($phpbb_admin_path . 'style', 'index');
$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');

// the acp template is never stored in the database
$user->theme['template_storedb'] = false;



// My Administrative Codes and options and whatever...



// Page title, this language variable should be defined in the language file you setup at the top of this page.
page_header($user->lang['PAGE_TITLE2']);

// Set the filename of the template you want to use for this file.
// This is the name of our template file located in /styles/<style>/templates/.
$template->set_filenames(array(
    'body' => 'acp_' . $page . '.html',
));

// Completing the script and displaying the page.
page_footer();

?>
  1. <?php
  2. /**
  3. *
  4. * @package site acp
  5. * @version $Id: index.php 8591 2008-06-04 11:40:53Z Kellanved $
  6. * @copyright (c) 2005 phpBB Group
  7. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  8. *
  9. */
  10. /**
  11. */
  12. define('IN_PHPBB', true);
  13. define('ADMIN_START', true);
  14. define('NEED_SID', true);
  15. // Include files
  16. $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../forum/';
  17. $phpEx = substr(strrchr(__FILE__, '.'), 1);
  18. require($phpbb_root_path . 'common.' . $phpEx);
  19. require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
  20. require($phpbb_root_path . 'includes/functions_module.' . $phpEx);
  21. // Default page (index)
  22. $page = 'index';
  23. // Get the required admin template page
  24. if (isset($_GET['atp']))
  25. {
  26.     //atp = admin template page
  27.     $page = $_GET['atp'];
  28. }
  29. // Start session management
  30. $user->session_begin();
  31. $auth->acl($user->data);
  32. $user->setup('mods/acp/'. $page);
  33. // End session management
  34. // Have they authenticated (again) as an admin for this session?
  35. if (!isset($user->data['session_admin']) || !$user->data['session_admin'])
  36. {
  37.     login_box('', $user->lang['LOGIN_ADMIN_CONFIRM'], $user->lang['LOGIN_ADMIN_SUCCESS'], true, false, './index.php');
  38. }
  39. // Is user any type of admin? No, then stop here, each script needs to
  40. // check specific permissions but this is a catchall
  41. if (!$auth->acl_get('a_'))
  42. {
  43.     trigger_error('NO_ADMIN');
  44. }
  45. // We define the admin variables now, because the user is now able to use the admin related features...
  46. define('IN_ADMIN', true);
  47. $phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : './';
  48. // Set custom template for admin area
  49. $template->set_custom_template($phpbb_admin_path . 'style', 'index');
  50. $template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');
  51. // the acp template is never stored in the database
  52. $user->theme['template_storedb'] = false;
  53. // My Administrative Codes and options and whatever...
  54. // Page title, this language variable should be defined in the language file you setup at the top of this page.
  55. page_header($user->lang['PAGE_TITLE2']);
  56. // Set the filename of the template you want to use for this file.
  57. // This is the name of our template file located in /styles/<style>/templates/.
  58. $template->set_filenames(array(
  59.     'body' => 'acp_' . $page . '.html',
  60. ));
  61. // Completing the script and displaying the page.
  62. page_footer();
  63. ?>
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

The only thing that comes to mind is that you're not logged in as a phpBB3 administrator on the remote site, and that you are but don't realize it on the local site.

Have you thought about actually creating a new ACP module for this ?
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

I have but the fact that I don't know how to do that forced me to attempt at it this way. If you are so kind as to point me on how to do that, I would be more than glad to do it as a module :D

And I don't get the following sentence in your post:

Joebert wrote:
The only thing that comes to mind is that you're not logged in as a phpBB3 administrator on the remote site, and that you are but don't realize it on the local site.


[EDIT:] I found this page on the phpbb site so I will be going through that... I still don't understand the above quote though :oops: lol

[EDIT 2:] Oh... I think I get that quote lol. It lets me go to the forum acp correctly and doesn't give me that error thing.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

I'm going to create a "Hello World" ACP module right here and now & write down everything I do as I do it. You should be able to finish integration of your other administrative functions beyond that. :)

Oh and BTW, It's a good idea to do this as a full phpBB administrator.

---
Start my text editor.

Open "includes/acp/acp_php_info.php"
Save a new copy in the same folder as "acp_my_module.php"

Find and replace "php_info" with "my_module" throughout the file.

Replace the "main" function with the following

Code: [ Select ]
    function main($id, $mode)
    {
        global $db, $user, $auth, $template;
        global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
 
        if ($mode != 'hello_world')
        {
            trigger_error('NO_MODE', E_USER_ERROR);
        }
 
        $this->tpl_name = 'acp_php_info';
        $this->page_title = 'ACP_MY_MODULE';
 
        $output = 'Hello World !';
 
        $template->assign_var('PHPINFO', $output);
    }
  1.     function main($id, $mode)
  2.     {
  3.         global $db, $user, $auth, $template;
  4.         global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
  5.  
  6.         if ($mode != 'hello_world')
  7.         {
  8.             trigger_error('NO_MODE', E_USER_ERROR);
  9.         }
  10.  
  11.         $this->tpl_name = 'acp_php_info';
  12.         $this->page_title = 'ACP_MY_MODULE';
  13.  
  14.         $output = 'Hello World !';
  15.  
  16.         $template->assign_var('PHPINFO', $output);
  17.     }


Save the file.

Open "includes/acp/info/acp_php_info.php"
Save a new copy in the same folder as "acp_my_module.php"

Find and replace "php_info" with "my_module" throughout the file.

Replace the "module" function with the following

Code: [ Select ]
    function module()
    {
        return array(
            'filename'  => 'acp_my_module',
            'title'     => 'ACP_MY_MODULE',
            'version'   => '1.0.0',
            'modes'     => array(
                'hello_world'       => array('title' => 'ACP_MY_MODULE', 'auth' => 'acl_a_phpinfo', 'cat' => array('ACP_GENERAL_TASKS')),
            ),
        );
    }
  1.     function module()
  2.     {
  3.         return array(
  4.             'filename'  => 'acp_my_module',
  5.             'title'     => 'ACP_MY_MODULE',
  6.             'version'   => '1.0.0',
  7.             'modes'     => array(
  8.                 'hello_world'       => array('title' => 'ACP_MY_MODULE', 'auth' => 'acl_a_phpinfo', 'cat' => array('ACP_GENERAL_TASKS')),
  9.             ),
  10.         );
  11.     }


Save the file.

Open "language/en/acp/common.php"

Merge the new language entry for the modules title at the end of the file like so

Code: [ Select ]
// My Module
$lang = array_merge($lang, array(
    'ACP_MY_MODULE' => 'My Modules Title'
));
  1. // My Module
  2. $lang = array_merge($lang, array(
  3.     'ACP_MY_MODULE' => 'My Modules Title'
  4. ));


Save the file.

Login to my ACP, go to the "System" tab.

Click the "Administration Control Panel" option under "Module Management".

Click the ".MODS" row.

Enter "My Category" in the text box next to the "Create New Module" button.

Click "Create New Module".

Select "Yes" for "Module Enabled".

click "Submit".

Click "Back To Previous Page".

Click "My Category".

Select "My Modules Title" from the dropdown next to the "Add Module" button on the bottom-right of the page.

Click the "Add Module" button.

Click "Yes".

Click "Back to previous page".

Click "Enable" on the right side of the "My Modules Title" row.

Click "Admin Index" on the top-right of the page to refresh the ACP.

Click the ".MODS" tab.

I see the description for PHPINFO & the text "Hello World !" in the content area, and My Category & My Modules Title in the menu on the left.

At this point I'm using the php_info template file to quickly get something in working order, time to change that.

Open "adm/style/acp_php_info.html"
Save a copy in the same folder as "acp_my_module.html"

Replace the contents with the following

Code: [ Select ]
<!-- INCLUDE overall_header.html -->
 
<a name="maincontent"></a>
 
<h1>{L_ACP_MY_MODULE}</h1>
 
{HELLO_WORLD}
 
<!-- INCLUDE overall_footer.html -->
  1. <!-- INCLUDE overall_header.html -->
  2.  
  3. <a name="maincontent"></a>
  4.  
  5. <h1>{L_ACP_MY_MODULE}</h1>
  6.  
  7. {HELLO_WORLD}
  8.  
  9. <!-- INCLUDE overall_footer.html -->


Save the file.

Go back into "includes/acp/acp_my_module.php"

Change the value for "$this->tpl_name" to "acp_my_module" so I have

Code: [ Select ]
$this->tpl_name = 'acp_my_module';


Change the template variable key "PHPINFO" to "HELLO_WORLD" so I have

Code: [ Select ]
$template->assign_var('HELLO_WORLD', $output);


Save the file.

At this point I realize I'm using the permission setting for "PHPINFO" to control who can access this module & instead want it to require the same permission as altering board settings requires.

Open "includes/acp/info/acp_board.php"

Deterine which permissions that module uses by looking at the "auth" portion of the different modes.
In this case some use "acl_a_board" and some use "acl_a_server".

Go back to "includes/acp/info/acp_my_module.php"

I want my permissions to be a little less granulated than they are in acp_board, so I'm going to replace my modules "auth" which is "acl_a_phpinfo" to "acl_a_board && acl_a_server" which will require both of those permissions to access this module & give me the following

Code: [ Select ]
'auth' => 'acl_a_board && acl_a_server',


Save the file.

Click "My Modules Title" from the "My Category" menu on the left.

I don't see the PHPINFO stuff anymore, just "My Modules Title" in big letters, and "Hello World !" in smaller letters under it.

At this point I can make alterations to the following files to finish integrating something.
"includes/acp/acp_my_module.php"
"adm/style/acp_my_module.html"
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

Wow Joebert. Thanks so much for that. I appreciate it really much. Thanks for taking your time to post that tutorial for me.

I now will do exactly that :D
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6251
  • Loc: Seattle, WA

Post 3+ Months Ago

Hmm, have you considered posting that as a PHP tutorial Joe?
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

I know I haven't replied here in a long while, but I'm currently facing a problem... I can't get certain config variables to be submitted and saved...

Below is my includes/acp/acp_notifications.php
PHP Code: [ Select ]
<?php
/**
*
* @package acp
* @version $Id: acp_php_info.php 8479 2008-03-29 00:22:48Z naderman $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php<!-- m --> GNU Public License
*
*/
 
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
    exit;
}
 
/**
* @package acp
*/
class acp_notifications
{
    var $u_action;
 
    function main($id, $mode)
    {
        global $db, $user, $auth, $template;
        global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
       
        $action = request_var('action', '');
        $submit = (isset($_POST['submit'])) ? true : false;
       
        switch ($mode)
        {
            case 'Notifications':
                $display_vars = array(
                   'title'  => 'Notifications',
                   'vars'   => array(
                      'legend1'                         => 'NOTIFICATION_NOTIFICATION',
                      'remove_notification_loggin'      => array('lang' => 'NOTIFICATION_LOGGIN',   'validate' => 'bool',       'type' => 'radio:yes_no',   'explain' => true),
                      'remove_notification_posting'     => array('lang' => 'NOTIFICATION_POSTING',  'validate' => 'bool',       'type' => 'radio:yes_no',   'explain' => true),
                   )
                );
                break;
            default:
           
                trigger_error('NO_MODE', E_USER_ERROR);
                break;
        }
       
        $error = array();
 
        // We validate the complete config if whished
        validate_config_vars($display_vars['vars'], $cfg_array, $error);
 
        // Do not write values if there is an error
        if (sizeof($error) > 0)
        {
            $submit = false;
        }
 
        // We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to...
        foreach ($display_vars['vars'] as $config_name => $null)
        {
            if ($submit && $config_name != 'legend1')
            {
                set_config($config_name, $config_value);
            }
        }
 
        if ($submit)
        {
            add_log('admin', 'LOG_CONFIG_' . strtoupper($mode));
 
            trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
        }
 
        $this->tpl_name = 'acp_board';
        $this->page_title = $display_vars['title'];
 
        $template->assign_vars(array(
            'L_TITLE'         => $user->lang['ACP_NOTIFICATIONS_INFO'],
            'L_TITLE_EXPLAIN'   => $user->lang['ACP_NOTIFICATIONS_EXPLAIN'],
 
            'S_ERROR'         => (sizeof($error)) ? true : false,
            'ERROR_MSG'         => implode('<br />', $error),
 
            'U_ACTION'         => $this->u_action
        ));
 
        // Output relevant page
        foreach ($display_vars['vars'] as $config_key => $vars)
        {
            if (!is_array($vars) && strpos($config_key, 'legend') === false)
            {
                continue;
            }
 
            if (strpos($config_key, 'legend') !== false)
            {
                $template->assign_block_vars('options', array(
                    'S_LEGEND'      => true,
                    'LEGEND'      => (isset($user->lang[$vars])) ? $user->lang[$vars] : $vars
                ));
 
                continue;
            }
 
            $type = explode(':', $vars['type']);
 
            $l_explain = '';
            if ($vars['explain'] && isset($vars['lang_explain']))
            {
                $l_explain = (isset($user->lang[$vars['lang_explain']])) ? $user->lang[$vars['lang_explain']] : $vars['lang_explain'];
            }
            else if ($vars['explain'])
            {
                $l_explain = (isset($user->lang[$vars['lang'] . '_EXPLAIN'])) ? $user->lang[$vars['lang'] . '_EXPLAIN'] : '';
            }
 
            $template->assign_block_vars('options', array(
                'KEY'         => $config_key,
                'TITLE'         => (isset($user->lang[$vars['lang']])) ? $user->lang[$vars['lang']] : $vars['lang'],
                'S_EXPLAIN'      => $vars['explain'],
                'TITLE_EXPLAIN'   => $l_explain,
                'CONTENT'      => build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars),
            ));
 
            unset($display_vars['vars'][$config_key]);
        }
    }
}
?>
  1. <?php
  2. /**
  3. *
  4. * @package acp
  5. * @version $Id: acp_php_info.php 8479 2008-03-29 00:22:48Z naderman $
  6. * @copyright (c) 2005 phpBB Group
  7. * @license http://opensource.org/licenses/gpl-license.php<!-- m --> GNU Public License
  8. *
  9. */
  10.  
  11. /**
  12. * @ignore
  13. */
  14. if (!defined('IN_PHPBB'))
  15. {
  16.     exit;
  17. }
  18.  
  19. /**
  20. * @package acp
  21. */
  22. class acp_notifications
  23. {
  24.     var $u_action;
  25.  
  26.     function main($id, $mode)
  27.     {
  28.         global $db, $user, $auth, $template;
  29.         global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
  30.        
  31.         $action = request_var('action', '');
  32.         $submit = (isset($_POST['submit'])) ? true : false;
  33.        
  34.         switch ($mode)
  35.         {
  36.             case 'Notifications':
  37.                 $display_vars = array(
  38.                    'title'  => 'Notifications',
  39.                    'vars'   => array(
  40.                       'legend1'                         => 'NOTIFICATION_NOTIFICATION',
  41.                       'remove_notification_loggin'      => array('lang' => 'NOTIFICATION_LOGGIN',   'validate' => 'bool',       'type' => 'radio:yes_no',   'explain' => true),
  42.                       'remove_notification_posting'     => array('lang' => 'NOTIFICATION_POSTING',  'validate' => 'bool',       'type' => 'radio:yes_no',   'explain' => true),
  43.                    )
  44.                 );
  45.                 break;
  46.             default:
  47.            
  48.                 trigger_error('NO_MODE', E_USER_ERROR);
  49.                 break;
  50.         }
  51.        
  52.         $error = array();
  53.  
  54.         // We validate the complete config if whished
  55.         validate_config_vars($display_vars['vars'], $cfg_array, $error);
  56.  
  57.         // Do not write values if there is an error
  58.         if (sizeof($error) > 0)
  59.         {
  60.             $submit = false;
  61.         }
  62.  
  63.         // We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to...
  64.         foreach ($display_vars['vars'] as $config_name => $null)
  65.         {
  66.             if ($submit && $config_name != 'legend1')
  67.             {
  68.                 set_config($config_name, $config_value);
  69.             }
  70.         }
  71.  
  72.         if ($submit)
  73.         {
  74.             add_log('admin', 'LOG_CONFIG_' . strtoupper($mode));
  75.  
  76.             trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
  77.         }
  78.  
  79.         $this->tpl_name = 'acp_board';
  80.         $this->page_title = $display_vars['title'];
  81.  
  82.         $template->assign_vars(array(
  83.             'L_TITLE'         => $user->lang['ACP_NOTIFICATIONS_INFO'],
  84.             'L_TITLE_EXPLAIN'   => $user->lang['ACP_NOTIFICATIONS_EXPLAIN'],
  85.  
  86.             'S_ERROR'         => (sizeof($error)) ? true : false,
  87.             'ERROR_MSG'         => implode('<br />', $error),
  88.  
  89.             'U_ACTION'         => $this->u_action
  90.         ));
  91.  
  92.         // Output relevant page
  93.         foreach ($display_vars['vars'] as $config_key => $vars)
  94.         {
  95.             if (!is_array($vars) && strpos($config_key, 'legend') === false)
  96.             {
  97.                 continue;
  98.             }
  99.  
  100.             if (strpos($config_key, 'legend') !== false)
  101.             {
  102.                 $template->assign_block_vars('options', array(
  103.                     'S_LEGEND'      => true,
  104.                     'LEGEND'      => (isset($user->lang[$vars])) ? $user->lang[$vars] : $vars
  105.                 ));
  106.  
  107.                 continue;
  108.             }
  109.  
  110.             $type = explode(':', $vars['type']);
  111.  
  112.             $l_explain = '';
  113.             if ($vars['explain'] && isset($vars['lang_explain']))
  114.             {
  115.                 $l_explain = (isset($user->lang[$vars['lang_explain']])) ? $user->lang[$vars['lang_explain']] : $vars['lang_explain'];
  116.             }
  117.             else if ($vars['explain'])
  118.             {
  119.                 $l_explain = (isset($user->lang[$vars['lang'] . '_EXPLAIN'])) ? $user->lang[$vars['lang'] . '_EXPLAIN'] : '';
  120.             }
  121.  
  122.             $template->assign_block_vars('options', array(
  123.                 'KEY'         => $config_key,
  124.                 'TITLE'         => (isset($user->lang[$vars['lang']])) ? $user->lang[$vars['lang']] : $vars['lang'],
  125.                 'S_EXPLAIN'      => $vars['explain'],
  126.                 'TITLE_EXPLAIN'   => $l_explain,
  127.                 'CONTENT'      => build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars),
  128.             ));
  129.  
  130.             unset($display_vars['vars'][$config_key]);
  131.         }
  132.     }
  133. }
  134. ?>


And my includes/acp/info/acp_notifications.php:
PHP Code: [ Select ]
<?php
/**
*
* @package acp
* @version $Id: acp_php_info.php 8479 2008-03-29 00:22:48Z naderman $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php<!-- m --> GNU Public License
*
*/
 
/**
* @package module_install
*/
class acp_notifications_info
{
    function module()
    {
        return array(
            'filename'  => 'notifications',
            'title'     => 'Notifications',
            'version'   => '1.0.0',
            'modes'     => array(
                'Notifications'       => array('title' => 'Notifications', 'auth' => 'acl_a_board', 'cat' => array('ACP_GENERAL_TASKS')),
            ),
        );
    }
 
    function install()
    {
    }
 
    function uninstall()
    {
    }
}
 
?>
  1. <?php
  2. /**
  3. *
  4. * @package acp
  5. * @version $Id: acp_php_info.php 8479 2008-03-29 00:22:48Z naderman $
  6. * @copyright (c) 2005 phpBB Group
  7. * @license http://opensource.org/licenses/gpl-license.php<!-- m --> GNU Public License
  8. *
  9. */
  10.  
  11. /**
  12. * @package module_install
  13. */
  14. class acp_notifications_info
  15. {
  16.     function module()
  17.     {
  18.         return array(
  19.             'filename'  => 'notifications',
  20.             'title'     => 'Notifications',
  21.             'version'   => '1.0.0',
  22.             'modes'     => array(
  23.                 'Notifications'       => array('title' => 'Notifications', 'auth' => 'acl_a_board', 'cat' => array('ACP_GENERAL_TASKS')),
  24.             ),
  25.         );
  26.     }
  27.  
  28.     function install()
  29.     {
  30.     }
  31.  
  32.     function uninstall()
  33.     {
  34.     }
  35. }
  36.  
  37. ?>

It shows everything correctly, but what it doesn't do is actually submit the values into the database. This is getting a bit frustrating... I don't know what to do... the following is my SQL for it...
Code: [ Select ]
"INSERT INTO `$dbname`.`{$table_pre}config` (`config_name` , `config_value` , `is_dynamic`) VALUES
('remove_notification_loggin', '1', '0'),
('remove_notification_posting', '1', '0');"
  1. "INSERT INTO `$dbname`.`{$table_pre}config` (`config_name` , `config_value` , `is_dynamic`) VALUES
  2. ('remove_notification_loggin', '1', '0'),
  3. ('remove_notification_posting', '1', '0');"
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

Nobody knows how to solve this problem? ?
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

I managed to solve the problem... What was wrong is that I didn't define $cfg_config... I had it defined before, but something else was causing the problem, and so I removed that.

Code: [ Select ]
        $this->new_config = $config;
        $cfg_array = (isset($_REQUEST['config'])) ? utf8_normalize_nfc(request_var('config', array('' => ''), true)) : $this->new_config;
        $error = array();
  1.         $this->new_config = $config;
  2.         $cfg_array = (isset($_REQUEST['config'])) ? utf8_normalize_nfc(request_var('config', array('' => ''), true)) : $this->new_config;
  3.         $error = array();

Added that right after the switch and it all works fine :D Hope that this helps somebody.

Post Information

  • Total Posts in this topic: 11 posts
  • Users browsing this forum: No registered users and 96 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
 
cron
 

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