Código PHP:
<?php
define('IN_PHPBB', true);
$phpbb_root_path = '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/acp/acp_modules.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
$user->add_lang('mods/info_acp_lp');
$new_mod_version = '1.9.1';
$page_title = 'Last Post Titles v' . $new_mod_version;
$log_name = 'Modification "Last Post Titles"' . $new_mod_version;
$mode = request_var('mode', 'else', true);
function split_sql_file($sql, $delimiter)
{
$sql = str_replace("\r" , '', $sql);
$data = preg_split('/' . preg_quote($delimiter, '/') . '$/m', $sql);
$data = array_map('trim', $data);
// The empty case
$end_data = end($data);
if (empty($end_data))
{
unset($data[key($data)]);
}
return $data;
}
function lp_create_index($table, $column)
{
global $db;
switch ($db->sql_layer)
{
case 'firebird':
case 'postgres':
case 'oracle':
case 'sqlite':
$sql = 'CREATE INDEX ' . $table . "_$column ON " . TOPICS_TABLE . "($column)";
break;
case 'mysql':
case 'mysqli':
case 'mysql4':
$sql = "ALTER TABLE `" . $table . "` ADD INDEX (`$column`)";
break;
case 'mssql':
case 'mssql_odbc':
$sql = "CREATE INDEX $column ON " . $table . "($column) ON [PRIMARY]";
break;
default:
trigger_error("Your database ({$db->sql_layer})is not supported by phpbb3 itself.");
break;
}
$db->sql_query($sql);
}
function add_module($array)
{
global $user;
$modules = new acp_modules();
$failed = $modules->update_module_data($array, true);
if ($failed == 'PARENT_NO_EXIST')
{
$user->add_lang('mods/info_acp_lp');
trigger_error(sprintf($user->lang['MISSING_PARENT_MODULE'], $array['parent_id'], $user->lang[$array['module_langname']]));
}
}
$install = request_var('install', 0);
switch ($mode)
{
case 'install':
$installed = false;
if ($install == 1)
{
set_config('lp_enabled', 1);
set_config('lp_slide', 0);
set_config('lp_avatar', 0);
set_config('lp_amount', 5);
set_config('lp_version', $new_mod_version);
// create the acp modules
$modules = new acp_modules();
/*$lp = array('module_basename' => '', 'module_enabled' => 1, 'module_display' => 1, 'parent_id' => 31, 'module_class' => 'acp', 'module_langname' => 'LP_TITLE', 'module_mode' => '', 'module_auth' => '');
add_module($lp);*/
$sql = 'SELECT module_id FROM ' . MODULES_TABLE . " WHERE module_langname = 'LP_TITLE' LIMIT 1";
$result = $db->sql_query($sql);
$lp = $db->sql_fetchrow($result);
$config_lp = array('module_basename' => 'lp', 'module_enabled' => 1, 'module_display' => 1, 'parent_id' => 0, 'module_class' => 'acp', 'module_langname' => 'LP_CONFIG', 'module_mode' => 'overview', 'module_auth' => '');
add_module($config_lp);
// clear cache and log what we did
$cache->purge();
add_log('admin', 'LOG_INSTALL_INSTALLED', $log_name);
add_log('admin', 'LOG_PURGE_CACHE');
$installed = true;
}
break;
default:
//nothing
break;
}
include($phpbb_root_path . 'install_lp/layout.'.$phpEx);
?>
Código PHP:
set_config('lp_enabled', 1);
set_config('lp_slide', 0);
set_config('lp_avatar', 0);
set_config('lp_amount', 5);
set_config('lp_version', $new_mod_version);
Código:
y al limpiar el cache obtengo lo siguiente:Parse error: syntax error, unexpected $end in /home/audition/public_html/foro/cache/tpl_BlueSuavity_index_body.html.php on line 65
Código:
Al parecer el error sólo se da en el index porque el admincp y las secciones de los foros se ven normalmente (entrando directamente).Parse error: syntax error, unexpected $end in /home/audition/public_html/foro/includes/template.php(230) : eval()'d code on line 65
Disculpen que lo ponga en PHP pero creo que es la sección más indicada.
Gracias desde ya.