Contenido del mod
Código PHP:
#################################################################
## Title: Change Style for Smartor's ezPortal
## Author: Tom Cioffe Jr < [email protected] >
## Integrated by: Smartor <[email protected]> - http://smartor.is-root.com
## Description: This file explains you how to change style on ezPortal
## Required "Change style on Index" Mod of Tom Cioffe Jr < [email protected] >
##
## Files To Edit: 2
## portal.php
## templates/subSilver/portal_body.tpl
##
## Included Files: N/A
##
#################################################################
#
#-----[ OPEN ]---------------------------------------------
#
portal.php
#
#-----[ FIND ]----------------------------------------
#
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'fetchposts.'.$phpEx);
#
#-----[ AFTER ADD ]-----------------------------------
#
// Change Style
include($phpbb_root_path . 'includes/functions_selects.'.$phpEx);
#
#-----[ FIND ]----------------------------------------
#
$template->assign_vars(array(
'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
#
#-----[ BEFORE ADD ]-----------------------------------
#
// Change Style
$fpage_style = $userdata['user_style'];
if(isset($HTTP_POST_VARS['fpage_theme']))
{
$fpage_theme = intval($HTTP_POST_VARS['fpage_theme']);
$fpuser_id = $userdata['user_id'];
$fp_sql = "UPDATE " . USERS_TABLE . " SET user_style = '$fpage_theme' WHERE user_id = $fpuser_id";
if ( !($fp_result = $db->sql_query($fp_sql)) )
{
message_die(GENERAL_ERROR, 'Could not update users table ' . "$user_id $fpage_theme", '', __LINE__, __FILE__, $sql);
}
else
{
$fp_message = $lang['Profile_updated'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
message_die(GENERAL_MESSAGE, $fp_message);
}
}
#
#-----[ FIND ]----------------------------------------
#
'L_VOTE_BUTTON' => $lang['Vote'],
#
#-----[ AFTER ADD ]-----------------------------------
#
// Change Style
'TEMPLATE_SELECT' => style_select($board_config['default_style'], 'template'),
'L_SELECT_STYLE' => $lang['Change_style'],
'L_CHANGE_NOW' => $lang['Go'],
'FPAGE_STYLE' => style_select($fpage_style, 'fpage_theme'),
#
#-----[ OPEN ]---------------------------------------------
#
templates/subSilver/portal_body.tpl
#
#-----[ FIND ]----------------------------------------
#
<!-- BEGIN switch_user_logged_in -->
<center><br />{AVATAR_IMG}</center>
<br />{LAST_VISIT_DATE}<br />
<!-- END switch_user_logged_in -->
<br />{CURRENT_TIME}<br /><br />{S_TIMEZONE}
#
#-----[ AFTER ADD ]-----------------------------------
#
<form method="post" action="{U_PORTAL}">{L_SELECT_STYLE}:<br /><br />
<!-- BEGIN switch_user_logged_out -->
{TEMPLATE_SELECT} <input type="submit" class="mainoption" name="cangenow" value="{L_CHANGE_NOW}" />
<!-- END switch_user_logged_out -->
<!-- BEGIN switch_user_logged_in -->
{FPAGE_STYLE} <input type="submit" class="mainoption" name="fpcangenow" value="{L_CHANGE_NOW}" />
<!-- END switch_user_logged_in -->
</form>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoF