
Code: Selecteer alles
#################################################################
## Mod Title: Forum width is a forum option mod
## Mod Version: 1.0.0
## Author: Robin van der Markt <msn@robintown.nl> - http://www.robintown.nl/
## Description: Users can chose with this mod how width the forum is via a dropdown menu
## with options (50-100%) in there profile.
##
## Installation Level: Easy
## Installation Time: 10 Minutes
## Files To Edit: 8
## admin/admin_users.php
## includes/usercp_avatar.php
## includes/page_header.php
## includes/usercp_register.php
## language/lang_english/lang_main.php
## templates/subSilver/admin/user_edit_body.tpl
## templates/subSilver/overall_header.tpl
## templates/subSilver/profile_add_body.tpl
## Included Files: n/a
#################################################################
## Author Note:
##
## Thanks to Acid's Modify Profile mod.
##
## Make sure your logo still fits!
##################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################
#
#-----[ SQL ]-------------------------------------------
# change phpbb_ to the database prefix you use
# Replace 100 with your forums default.
ALTER TABLE phpbb_users ADD user_width TINYINT(4) DEFAULT "100"
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_users.php
#
#-----[ FIND ]---------------------------------------------------
#
$interests = ( !empty($HTTP_POST_VARS['interests']) ) ? trim(strip_tags( $HTTP_POST_VARS['interests'] ) ) : '';
#
#-----[ AFTER ADD ]---------------------------------------------------
#
$width = ( !empty($HTTP_POST_VARS['width']) ) ? trim(strip_tags( $HTTP_POST_VARS['width'] ) ) : '';
#
#-----[ FIND (2x) ]--------------------------------------------
#
$interests = htmlspecialchars(stripslashes($interests));
#
#-----[ AFTER ADD (2x) ]---------------------------------------------------
#
$width = htmlspecialchars(stripslashes($width));
#
#-----[ FIND ]---------------------------------------------------
#
$sql = "UPDATE " . USERS_TABLE . "
#
#-----[ ABOVE ADD ]---------------------------------------------------
#
$width = ($width == $lang['width_choice']['0']) ? '' : $width;
#
#-----[ IN-LINE FIND ]---------------------------------------------------
#
$interests) . "'
#
#-----[ IN-LINE AFTER ADD ]---------------------------------------------------
#
, user_width = '" . str_replace("\'", "''", $width) . "'
#
#-----[ FIND ]---------------------------------------------------
#
$interests = htmlspecialchars($this_userdata['user_interests']);
#
#-----[ AFTER ADD ]---------------------------------------------------
#
$width = htmlspecialchars($this_userdata['user_width']);
#
#-----[ FIND ]---------------------------------------------------
#
$s_hidden_fields .= '<input type="hidden" name="interests" value="' . str_replace("\"", """, $interests) . '" />';
#
#-----[ AFTER ADD ]---------------------------------------------------
#
$s_hidden_fields .= '<input type="hidden" name="width" value="' . str_replace("\"", """, $width) . '" />';
#
#-----[ FIND ]---------------------------------------------------
#
$template->set_filenames(array(
"body" => "admin/user_edit_body.tpl")
);
#
#-----[ AFTER ADD ]---------------------------------------------------
#
$s_width = '<select name="width">';
for($i = 0; $i < count($lang['width_choice']); $i++ )
{
$s_width .= '<option value="' . $lang['width_choice'][$i] . '">' . $lang['width_choice'][$i]. '%</option>';
}
$s_width .= '</select>';
$s_width = str_replace("value=\"".$width."\">", "value=\"".$width."\" SELECTED>" ,$s_width);
#
#-----[ FIND ]---------------------------------------------------
#
'INTERESTS' => $interests,
#
#-----[ AFTER ADD ]---------------------------------------------------
#
'S_WIDTH' => $s_width,
'L_WIDTH' => $lang['Width'],
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_avatar.php
#
#-----[ FIND ]---------------------------------------------------
#
function display_avatar_gallery($mode, &$category
#
#-----[ IN-LINE FIND ]---------------------------------------------------
#
&$interests
#
#-----[ IN-LINE AFTER ADD ]---------------------------------------------------
#
, &$width
#
#-----[ FIND ]---------------------------------------------------
#
$params = array('coppa', 'user_id'
#
#-----[ IN-LINE FIND ]---------------------------------------------------
#
'interests'
#
#-----[ IN-LINE AFTER ADD ]---------------------------------------------------
#
, 'width'
#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]---------------------------------------------------
#
//
// Obtain number of new private messages
// if user is logged in
//
#
#-----[ AFTER ADD ]---------------------------------------------------
#
$width = $userdata['user_width'];
#
#-----[ FIND ]---------------------------------------------------
#
'U_MEMBERLIST' => append_sid('memberlist.'.$phpEx),
#
#-----[ AFTER ADD ]---------------------------------------------------
#
'S_WIDTH' => $width,
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]---------------------------------------------------
#
$strip_var_list = array('username' => 'username', 'email' => 'email', 'icq' => 'icq', 'aim' => 'aim', 'msn' => 'msn', 'yim' => 'yim', 'website' => 'website', 'location' => 'location', 'occupation' => 'occupation', 'interests' => 'interests');
#
#-----[ IN-LINE FIND ]---------------------------------------------------
#
'interests' => 'interests'
#
#-----[ IN-LINE AFTER ADD ]---------------------------------------------------
#
, 'width' => 'width'
#
#-----[ FIND (2x) ]---------------------------------------------------
#
$interests = stripslashes($interests);
#
#-----[ AFTER ADD (2x) ]---------------------------------------------------
#
$width = stripslashes($width);
#
#-----[ FIND ]---------------------------------------------------
#
$sql = "UPDATE " . USERS_TABLE . "
#
#-----[ ABOVE ADD ]---------------------------------------------------
#
$width = ($width == $lang['width_choice']['0']) ? '' : $width;
#
#-----[ IN-LINE FIND ]---------------------------------------------------
#
$interests) . "'
#
#-----[ IN-LINE AFTER ADD ]---------------------------------------------------
#
, user_width = '" . str_replace("\'", "''", $width) . "'
#
#-----[ FIND ]---------------------------------------------------
#
$sql = "INSERT INTO " . USERS_TABLE . "
#
#-----[ IN-LINE FIND ]---------------------------------------------------
#
user_interests
#
#-----[ IN-LINE AFTER ADD ]---------------------------------------------------
#
, user_width
#
#-----[ IN-LINE FIND ]---------------------------------------------------
#
$interests) . "'
#
#-----[ IN-LINE AFTER ADD ]---------------------------------------------------
#
, '" . str_replace("\'", "''", $width) . "'
#
#-----[ FIND ]---------------------------------------------------
#
$interests = $userdata['user_interests'];
#
#-----[ AFTER ADD ]---------------------------------------------------
#
$width = $userdata['user_width'];
#
#-----[ FIND ]---------------------------------------------------
#
display_avatar_gallery($mode, $avatar_category
#
#-----[ ABOVE ADD ]---------------------------------------------------
#
$width = ($width == $lang['width_choice']['0']) ? '' : $width;
#
#-----[ IN-LINE FIND ]---------------------------------------------------
#
$interests
#
#-----[ IN-LINE AFTER ADD ]---------------------------------------------------
#
, $width
#
#-----[ FIND ]--------------------------
#
$template->assign_vars(array(
'USERNAME' => $username,
#
#-----[ AFTER ADD ]---------------------------------------------------
#
'S_WIDTH' => $s_width,
'L_WIDTH' => $lang['Width'],
#
#-----[ FIND ]---------------------------------------------------
#
$template->set_filenames(array(
'body' => 'profile_add_body.tpl')
);
#
#-----[ AFTER ADD ]---------------------------------------------------
#
$s_width = '<select name="width">';
for($i = 0; $i < count($lang['width_choice']); $i++ )
{
$s_width .= '<option value="' . $lang['width_choice'][$i] . '">' . $lang['width_choice'][$i]. '%</option>';
}
$s_width .= '</select>';
$s_width = str_replace("value=\"".$width."\">", "value=\"".$width."\" SELECTED>" ,$s_width);
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]---------------------------------------------------
#
$lang['Interests'] =
#
#-----[ BEFORE ADD ]---------------------------------------------------
#
# You can change or delete some numbers when your forum doesn't fit in
# the bowser anymore when the forum is narrower
$lang['width_choice'] = array('-','80','85','90','95','100');
$lang['Width'] = Chose the forum width;
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/user_edit_body.tpl
#
#-----[ FIND ]---------------------------------------------------
#
<tr>
<th class="thSides" colspan="2" height="25" valign="middle">{L_PREFERENCES}</th>
</tr>
#
#-----[ AFTER ADD ]---------------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_WIDTH}</span></td>
<td class="row2"> {S_WIDTH} </td>
</tr>
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/overall_header.tpl
#
#-----[ FIND ]---------------------------------------------------
#
# The 100 can be different
<table width="100%" cellspacing="0" cellpadding="10" border="0" align="center">
#
#-----[ IN-LINE, FIND ]---------------------------------------------------
#
100%
#
#-----[ REPLACE WITH ]---------------------------------------------------
#
{S_WIDTH}
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_add_body.tpl
#
#-----[ FIND ]---------------------------------------------------
#
<tr>
<th class="thSides" colspan="2" height="25" valign="middle">{L_PREFERENCES}</th>
</tr>
#
#-----[ AFTER ADD ]---------------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_WIDTH}:</span></td>
<td class="row2"> {S_WIDTH} </td>
</tr>
#
#-----[ SAVE/CLOSE ]------------------------------------------
#
# EoM
http://www.robintown.nl/Forum_width_is_ ... on_mod.txt
Als het goed is doet alles het
