##############################################################
## MOD Title: Flavor text MOD
## MOD Author: Cyberpunk, http://www.phoenixrpg.com, cyberpunk@matrixmail.net
## MOD Description: This mod adds a flavor text for each user under their avatar
##
##
## MOD Version: 1.0.1
##
## Installation Level: Easy
## Installation Time: 10-15 Minutes
## Files To Edit: : admin/admin_board.php
## templates/subSilver/admin/board_config_body.tpl
## language/lang_english/lang_admin.php
## admin/admin_users.php
## templates/subSilver/admin/user_edit_body.tpl
## language/lang_english/lang_main.php
## includes/usercp_register.php
## includes/usercp_viewprofile.php
## includes/usercp_avatar.php
## templates/subSilver/profile_add_body.tpl
## templates/subSilver/profile_view_body.tpl
## viewtopic.php
## templates/subSilver/viewtopic_body.tpl
##
##
## Included Files: n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
##############################################################
## Author Notes:
##
##############################################################
## MOD History:
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[SQL_QUERY]----------------------------------------
#
ALTER TABLE `phpbb_users` ADD `user_flavor_text` varchar(255) NULL;
INSERT INTO phpbb_config (config_name, config_value) VALUES ('flavor_text_maxl', '255');
#where 'phpbb_' is your $table_prefix
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]------------------------------------------
#
"L_ENABLE_GZIP" => $lang['Enable_gzip'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
"L_FLAVOR_TEXT_SETTINGS" => $lang['Flavor_text_settings'],
"L_FLAVOR_TEXT_MAXL" => $lang['Flavor_text_maxl'],
"L_FLAVOR_TEXT_MAXL_EXPLAIN" => $lang['Flavor_text_maxl_explain'],
#
#-----[ FIND ]------------------------------------------
#
"GZIP_NO" => $gzip_no,
#
#-----[ AFTER, ADD ]------------------------------------------
#
"FLAVOR_TEXT_MAXL" => $new['flavor_text_maxl'],
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1">{L_ENABLE_PRUNE}</td>
<td class="row2"><input type="radio" name="prune_enable" value="1" {PRUNE_YES} /> {L_YES} <input type="radio" name="prune_enable" value="0" {PRUNE_NO} /> {L_NO}</td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<th class="thHead" colspan="2">{L_FLAVOR_TEXT_SETTINGS}</th>
</tr>
<tr>
<td class="row1">{L_FLAVOR_TEXT_MAXL}<br /><span class="gensmall">{L_FLAVOR_TEXT_MAXL_EXPLAIN}</span></td>
<td class="row2"><input type="text" name="flavor_text_maxl" value="{FLAVOR_TEXT_MAXL}" /></td>
</tr>
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!
//
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//
// Flavor Text MOD
//
$lang['Flavor_text_settings'] = 'Flavor text settings';
$lang['Flavor_text_maxl'] = 'Maximum length';
$lang['Flavor_text_maxl_explain'] = 'How long the flavor text may be?Enter a number from 0 to 255';
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_users.php
#
#-----[ FIND ]------------------------------------------
#
$interests = ( !empty($HTTP_POST_VARS['interests']) ) ? trim(strip_tags( $HTTP_POST_VARS['interests'] ) ) : '';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$flavor_text = ( !empty($HTTP_POST_VARS['flavor_text']) ) ? trim(strip_tags( $HTTP_POST_VARS['flavor_text'] ) ) : '';
#
#-----[ FIND ]------------------------------------------
#
$interests = htmlspecialchars(stripslashes($interests));
#
#-----[ AFTER, ADD ]------------------------------------------
#
$flavor_text = htmlspecialchars(stripslashes($flavor_text));
#
#-----[ FIND ]------------------------------------------
#
# Find this in general
#
$sql = "UPDATE " . USERS
SET
#
#-----[ IN-LINE FIND ]------------------------------------------
#
user_interests = '" . str_replace("\'", "''", $interests) . "',
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
user_flavor_text = '" . str_replace("\'", "''", $flavor_text) . "',
#
#-----[ FIND ]------------------------------------------
#
#Again!
#
$interests = htmlspecialchars(stripslashes($interests));
#
#-----[ AFTER, ADD ]------------------------------------------
#
$flavor_text = htmlspecialchars(stripslashes($flavor_text));
#
#-----[ FIND ]------------------------------------------
#
$interests = htmlspecialchars($this_userdata['user_interests']);
#
#-----[ AFTER, ADD ]------------------------------------------
#
$flavor_text = htmlspecialchars($this_userdata['user_flavor_text']);
#
#-----[ FIND ]------------------------------------------
#
$s_hidden_fields .= '<input type="hidden" name="interests" value="' . str_replace("\"", """, $interests) . '" />';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$s_hidden_fields .= '<input type="hidden" name="flavor_text" value="' . str_replace("\"", """, $flavor_text) . '" />';
#
#-----[ FIND ]------------------------------------------
#
'INTERESTS' => $interests,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'FLAVOR_TEXT' => $flavor_text,
#
#-----[ FIND ]------------------------------------------
#
'L_INTERESTS' => $lang['Interests'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_FLAVOR_TEXT' => $lang['Flavor_text'],
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/user_edit_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_INTERESTS}</span></td>
<td class="row2">
<input class="post" type="text" name="interests" size="35" maxlength="150" value="{INTERESTS}" />
</td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_FLAVOR_TEXT}</span></td>
<td class="row2">
<input class="post" type="text" name="flavor_text" size="35" maxlength="255" value="{FLAVOR_TEXT}" />
</td>
</tr>
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all, Folks!
//
#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// Flavor Text Mod
//
$lang['Flavor_text'] = 'Flavor Text';
$lang['Flavor_text_long'] = 'Flavor text you entered was too long.';
$lang['Flavor_text_explain'] = 'Adds a flavor text to your posts under avatar. There is a %s character limit.';
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------
#
$strip_var_list = array(
#
#-----[ IN-LINE FIND ]------------------------------------------
#
'interests' => 'interests'
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, 'flavor_text' => 'flavor_text'
#
#-----[ FIND ]------------------------------------------
#
$signature = str_replace('<br />', "\n", $signature);
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Check the length of the flavor text.
if (strlen($flavor_text) > $board_config['flavor_text_maxl'])
{
if ($flavor_text != addslashes($userdata['user_flavor_text'])) {
$flavor_text = addslashes($userdata['user_flavor_text']);
$error = TRUE;
if (isset($error_msg)) $error_msg .= '<br />';
$error_msg .= $lang['Flavor_text_long'];
}
}
#
#-----[ FIND ]------------------------------------------
#
$interests = stripslashes($interests);
#
#-----[ AFTER, ADD ]------------------------------------------
#
$flavor_text = stripslashes($flavor_text);
#
#-----[ FIND ]------------------------------------------
#
$sql = "UPDATE " . USERS_TABLE
SET
#
#-----[ IN-LINE FIND ]------------------------------------------
#
user_interests = '" . str_replace("\'", "''", $interests) . "',
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
user_flavor_text = '" . str_replace("\'", "''", $flavor_text) . "',
#
#
#-----[ FIND ]------------------------------------------
#
$sql = "INSERT INTO " . USERS
VALUES
#
#-----[ IN-LINE FIND ]------------------------------------------
#
user_interests,
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
user_flavor_text,
#
#-----[ IN-LINE FIND ]------------------------------------------
#
str_replace("\'", "''", $interests) . "', '" .
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
str_replace("\'", "''", $flavor_text) . "','" .
#
#-----[ FIND ]------------------------------------------
#
$interests = stripslashes($interests);
#
#-----[ AFTER, ADD ]------------------------------------------
#
$flavor_text = stripslashes($flavor_text);
#
#-----[ FIND ]------------------------------------------
#
$interests = $userdata['user_interests'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
$flavor_text = $userdata['user_flavor_text'];
#
#
#-----[ FIND ]------------------------------------------
#
display_avatar_gallery($
#
#-----[ IN-LINE FIND ]------------------------------------------
#
$interests,
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
$flavor_text,
#
#
#-----[ FIND ]------------------------------------------
#
'INTERESTS' =>
#
#-----[ AFTER, ADD ]------------------------------------------
#
'FLAVOR_TEXT' => $flavor_text,
'FLAVOR_TEXT_MAXL' => $board_config['flavor_text_maxl'],
#
#-----[ FIND ]------------------------------------------
#
'L_INTERESTS' =>
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_FLAVOR_TEXT' => $lang['Flavor_text'],
'L_FLAVOR_TEXT_EXPLAIN' => sprintf($lang['Flavor_text_explain'], $board_config['flavor_text_maxl']),
#
#-----[ FIND ]------------------------------------------
#Yes, find it again
#
'INTERESTS' =>
#
#-----[ AFTER, ADD ]------------------------------------------
#
'FLAVOR_TEXT' => $flavor_text,
#
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_viewprofile.php
#
#-----[ FIND ]------------------------------------------
#
$rank_image = '';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$flavor_text = $profiledata['user_flavor_text'];
#
#
#-----[ FIND ]------------------------------------------
#
'RANK_IMAGE' => $rank_image,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'FLAVOR_TEXT' => $flavor_text,
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_avatar.phpl
#
#-----[ FIND ]------------------------------------------
#
function display_avatar_gallery($mode
#
#-----[ IN-LINE FIND ]------------------------------------------
#
&$interests,
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
&$flavor_text,
#
#
#-----[ FIND ]------------------------------------------
#
$params = array('
#
#-----[ IN-LINE FIND ]------------------------------------------
#
'interests',
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
'flavor_text',
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_add_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_INTERESTS}:</span></td>
<td class="row2">
<input type="text" class="post"style="width: 200px" name="interests" size="35" maxlength="150" value="{INTERESTS}" />
</td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_FLAVOR_TEXT}:</span><br /><span class="gensmall">{L_FLAVOR_TEXT_EXPLAIN}</span></td>
<td class="row2">
<input type="text" class="post"style="width: 200px" name="flavor_text" size="45" maxlength="{FLAVOR_TEXT_MAXL}" value="{FLAVOR_TEXT}" />
</td>
</tr>
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_view_body.tpl
#
#
#-----[ IN-LINE FIND ]------------------------------------------
#
<span class="postdetails">{POSTER_RANK}
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
<br /><i>"{FLAVOR_TEXT}"</i>
#
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
//
$sql = "SELECT u.
#
#-----[ IN-LINE FIND ]------------------------------------------
#
u.user_posts,
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
u.user_flavor_text,
#
#-----[ FIND ]------------------------------------------
#
//
$poster_rank = '';
$rank_image = '';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$flavor_text = $postrow[$i]['user_flavor_text'];
#
#
#-----[ FIND ]------------------------------------------
#
'POSTER_NAME' =>
#
#-----[ AFTER, ADD ]------------------------------------------
#
'FLAVOR_TEXT' => $flavor_text,
#
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<!-- BEGIN postrow -->
<tr>
<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}">
#
#-----[ IN-LINE FIND ]------------------------------------------
#
{postrow.POSTER_AVATAR}<br />
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
<center><i>"{postrow.FLAVOR_TEXT}"</i></center>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Tip:
In the last line of the mod
<center><i>"{postrow.FLAVOR_TEXT}"</i></center>
If a user has no flavor text it will display "" in the post.To avoid this just remove "" from the line.
It should be like this
<center><i>{postrow.FLAVOR_TEXT}</i></center>