phpBB sitio admin panel

  • Bogey
  • Bogey
  • Genius
  • Avatar de Usuario
  • Registrado: Jul 14, 2005
  • Mensajes: 8211
  • Loc: USA
  • Status: Offline

Nota Agosto 12th, 2008, 11:44 am

He creado un panel de admin de mi sitio que está integrado en phpBB 3. Funciona bien en mi máquina local pero cuando me subirlo a mi sitio, me dice no tengo privilegios administrativos para obtener in me cabe duda de que su código desde el que funciona en mi servidor local...No sé qué es.
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Agosto 12th, 2008, 11:44 am

  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Registrado: Feb 10, 2004
  • Mensajes: 13455
  • Loc: Florida
  • Status: Offline

Nota Agosto 13th, 2008, 2:24 am

¿Cómo integrar, ¿ha utilizado un nuevo módulo de ACP?

Si no, busque en el archivo para que en esa es la "info" carpeta de la carpeta de módulos de los países ACP y saber que usando su permiso, entonces puede guestimate que el permiso que necesita para comprobar.

Por ejemplo, Heres la información de archivo para un Fondo ACP módulo de trabajo en Im.
http://code.google.com/p/bb3-mods/sourc ... e_info.php

Tenga en cuenta la "auth" => "acl_a_phpinfo", , Esa es lo que está buscando. Si tiene un "* * _a_" su autorización administrativa, si es un "* * _m_" su permiso de un moderador, un "* * _U_" es un permiso del usuario.

En el caso de mi módulo, Im piggybacking phpinfo el permiso.
Strong with this one, the sudo is.
  • Bogey
  • Bogey
  • Genius
  • Avatar de Usuario
  • Registrado: Jul 14, 2005
  • Mensajes: 8211
  • Loc: USA
  • Status: Offline

Nota Agosto 13th, 2008, 4:09 pm

¿Qué Im que hace es...(Aquí está toda la página...conjunto página ACP ne...).

Código: [ 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. ?>
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Registrado: Feb 10, 2004
  • Mensajes: 13455
  • Loc: Florida
  • Status: Offline

Nota Agosto 13th, 2008, 7:48 pm

Lo único que viene a la mente es que usted no se ha identificado como un phpBB3 administrador en el sitio remoto, y que lo estás pero no se dan cuenta de que en el sitio local.

¿Ha pensado en realidad la creación de un nuevo módulo para los países ACP?
Strong with this one, the sudo is.
  • Bogey
  • Bogey
  • Genius
  • Avatar de Usuario
  • Registrado: Jul 14, 2005
  • Mensajes: 8211
  • Loc: USA
  • Status: Offline

Nota Agosto 13th, 2008, 8:07 pm

He pero el hecho de que no sé cómo hacer para que me obligó a intentar que de esta manera. Si son tan amables como para mí el punto sobre la manera de hacer eso, quiero ser algo más que encantados de hacerlo como un módulo :D

Y no he recibido la siguiente frase en su entrada:

Joebert escribió:
Lo único que viene a la mente es que usted no se ha identificado como un phpBB3 administrador en el sitio remoto, y que lo estás pero no se dan cuenta de que en el sitio local.


[EDIT:] He encontrado esta página en el phpBB sitio de manera que pasará por la que...Y yo aún no entiendo la cita anterior, aunque :oops: jajaja

[EDIT 2:] Oh...Creo que conseguir ese precio lol. Se me permite ir al foro ACP correctamente y no me dan error que cosa.
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Registrado: Feb 10, 2004
  • Mensajes: 13455
  • Loc: Florida
  • Status: Offline

Nota Agosto 13th, 2008, 9:23 pm

Im que va a crear un "Hello World" derecho ACP módulo aquí y ahora y escribir todo lo que hago como lo hago. Usted debe ser capaz de terminar la integración de sus funciones administrativas más allá de eso. :)

Oh, y BTW, Es una buena idea hacer esto como un administrador de phpBB completo.

---
Inicio mi editor de texto.

Abrir "includes / acp / acp_php_info. php "
Guardar una copia nueva en la misma carpeta que "acp_my_module.php"

Buscar y sustituir "php_info" con "my_module" en todo el archivo.

Reemplazar el "principal" función con el siguiente

Código: [ 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.     }


Guarde el archivo.

Abrir "includes / acp / info / acp_php_info.php"
Guardar una copia nueva en la misma carpeta que "acp_my_module. php "

Buscar y sustituir "php_info" con "my_module" en todo el archivo.

Reemplazar el "módulo" función con el siguiente

Código: [ 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.     }


Guarde el archivo.

Abrir "idioma / es / acp / common.php"

Combinar la entrada de nuevo lenguaje para el título de los módulos al final del archivo, como así

Código: [ 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. ));


Guarde el archivo.

Ingresar a mi ACP, vaya a la pestaña "Sistema".

Haga clic en la "Administración de Panel de control" en virtud de la opción "Módulo de Gestión".

Haga clic en el ". MODS" fila.

Entrar en mi categoría "en el cuadro de texto al lado de la" Crear un nuevo módulo de "botón.

Haga clic en "Crear un nuevo módulo".

Seleccione "Sí" para el "módulo habilitado".

haga clic en "Enviar".

Haga clic en "Volver a la página anterior".

Haga clic en "My Category".

Seleccione "Mi módulos de Título" en el menú desplegable junto a la "Agregar módulo" situado en la parte inferior derecha de la página.

Haga clic en "Agregar módulo" botón.

Haga clic en "Sí".

Haga clic en "Volver a la página anterior".

Haga clic en "Activar" en la parte derecha de la fila "Mi módulos Título".

Haga clic en "Administrador de índice" en la parte superior derecha de la página para actualizar la ACP.

Haga clic en el ". MODS ficha".

Veo la descripción de phpinfo y el texto "Hello World!" en el área de contenido, y mi categoría y mis módulos Título en el menú de la izquierda.

En este punto Im php_info utilizando el archivo de plantilla para conseguir algo rápidamente en condiciones de funcionamiento, tiempo de cambiar eso.

Abrir "adm / style / acp_php_info.html"
Guardar una copia en la misma carpeta que "acp_my_module. html "

Reemplace el contenido con las siguientes

Código: [ 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 -->


Guarde el archivo.

Vuelve a "includes / acp / acp_my_module.php"

Cambiar el valor de "$ this-> tpl_name" a "acp_my_module" por lo que tengo

Código: [ Select ]
$this->tpl_name = 'acp_my_module';


Cambiar la plantilla variable clave "phpinfo" a "hola_mundo" por lo que tengo

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


Guarde el archivo.

En este punto me doy cuenta de Im usando el permiso para establecer "phpinfo" para controlar quién puede acceder a este módulo y en cambio quieren que requieren el mismo permiso como alterar la configuración del panel requiere.

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

Deterine que los permisos que utiliza el módulo mirando autoridades de la "porción" de los diferentes modos.
En este caso, algunos utilizan "acl_a_board" y algunos utilizan "acl_a_server".

Volver a "includes / acp / info / acp_my_module.php"

Quiero que mi permiso para ser un poco menos granulado que se encuentran en acp_board, por lo que Im que va a sustituir a mi módulos de "autoridades" que es "acl_a_phpinfo" a "acl_a_board & & acl_a_server", que requieren tanto de los permisos de acceso a este módulo y dar me las siguientes

Código: [ Select ]
'auth' => 'acl_a_board && acl_a_server',


Guarde el archivo.

Haga clic en "Mi módulos de Título" en el menú "Mis Categorías" en la izquierda.

Yo no veo las cosas phpinfo más, sólo "Mi módulos de Título" en letras grandes, y "Hello World!" en letras más pequeñas debajo de ella.

En este punto, puede hacer modificaciones a los archivos siguientes para terminar la integración de algo.
"includes / acp / acp_my_module.php"
"adm / style / acp_my_module.html"
Strong with this one, the sudo is.
  • Bogey
  • Bogey
  • Genius
  • Avatar de Usuario
  • Registrado: Jul 14, 2005
  • Mensajes: 8211
  • Loc: USA
  • Status: Offline

Nota Agosto 14th, 2008, 8:52 pm

Wow Joebert. Muchas gracias por eso. Agradezco realmente mucho. Gracias por tomarte tu tiempo para crear un mensaje que tutorial para mí.

Ahora haremos exactamente eso :D
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • spork
  • Brewmaster
  • Silver Member
  • Avatar de Usuario
  • Registrado: Sep 22, 2003
  • Mensajes: 6130
  • Loc: Seattle, WA
  • Status: Offline

Nota Agosto 14th, 2008, 9:01 pm

Hmm, ¿ha considerado que la publicación como un tutorial de PHP Joe?
The Beer Monocle. Classy.
  • Bogey
  • Bogey
  • Genius
  • Avatar de Usuario
  • Registrado: Jul 14, 2005
  • Mensajes: 8211
  • Loc: USA
  • Status: Offline

Nota Julio 31st, 2009, 4:05 pm

Sé que no han respondido aquí en mucho tiempo, pero Im que actualmente se enfrenta un problema...No puedo conseguir algunas variables de configuración que se presentará y se guarda...

A continuación se muestra mi includes / acp / acp_notifications.php
PHP Código: [ 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. ?>


Y mi includes / acp / info / acp_notifications.php:
PHP Código: [ 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. ?>

Se muestra todo correctamente, pero lo que no hace en realidad es presentar los valores en la base de datos. Esto se está poniendo un poco frustrante...Yo no sé qué hacer...El siguiente es mi SQL para que...
Código: [ 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');"
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • Bogey
  • Bogey
  • Genius
  • Avatar de Usuario
  • Registrado: Jul 14, 2005
  • Mensajes: 8211
  • Loc: USA
  • Status: Offline

Nota Agosto 2nd, 2009, 1:40 pm

Nadie sabe cómo resolver este problema? ?
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • Bogey
  • Bogey
  • Genius
  • Avatar de Usuario
  • Registrado: Jul 14, 2005
  • Mensajes: 8211
  • Loc: USA
  • Status: Offline

Nota Agosto 3rd, 2009, 7:09 pm

Me las arreglé para resolver el problema...¿Qué le pasaba es que yo no define $ cfg_config...Lo tenía definido antes, pero algo más estaba causando el problema, así que eliminado.

Código: [ 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();

Añadió que inmediatamente después del interruptor y todo funciona bien :D Esperamos que esto ayude a alguien.
"Bring forth therefore fruits meet for repentance:" Matthew 3:8

Publicar Información

  • Total de mensajes en este tema: 11 mensajes
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 280 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC