TheosEleos

|
Posted:
Sun Oct 12, 2003 1:37 pm |
|
I will paste a hack in here that I found. Let me know if you see any problems with it. I tried it and got an error. I may have missed something though. Let me know what you think.
Quote: | ##############################################################
## MOD Title: Custom Title
## MOD Author: Fubonis < php@fubonis.com > (JW Frazier) http://www.fubonis.com
## MOD Description: Users can add their own custom title
## MOD Version: Beta 1.1.0
##
## Installation Level: Easy
## Installation Time: 10 Minutes
## Files To Edit: admin/admin_users.php, includes/usercp_register.php, includes/usercp_viewprofile.php, language/lang_english/lang_main.php, templates/subSilver/admin/user_edit_body.tpl, templates/subSilver/profile_add_body.tpl, viewtopic.php
## 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:
## You need to run this SQL command. Add your prefix if neccessary.
## ALTER TABLE users ADD user_custom_title VARCHAR(25) NOT NULL AFTER username;
## And no, this isn't the other custom title/rank mod. I made my own because...uh...away!
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_users.php
#
#-----[ FIND ]------------------------------------------
#
SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) . "', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", $aim) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_sig_bbcode_uid = '$signature_bbcode_uid', user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowavatar = $user_allowavatar, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_allow_pm = $user_allowpm, user_notify_pm = $notifypm, user_popup_pm = $popuppm, user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_active = $user_status, user_rank = $user_rank" . $avatar_sql . "
#
#-----[ IN-LINE, ADD ]------------------------------------------
#
, user_custom_title = '$user_custom_title'
#
#-----[ FIND ]------------------------------------------
#
$user_allowpm = $this_userdata['user_allow_pm'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
$user_custom_title = $this_userdata['user_custom_title']; // Custom Title Mod
#
#-----[ FIND ]------------------------------------------
#
'RANK_SELECT_BOX' => $rank_select_box,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'CUSTOM_TITLE' => $user_custom_title, // Custom Title Mod
#
#-----[ FIND ]------------------------------------------
#
'L_SELECT_RANK' => $lang['Rank_title'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_CUSTOM_TITLE' => $lang['Custom_Title'], // Custom Title Mod
#
#-----[ 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, ADD ]------------------------------------------
#
, 'user_custom_title' => 'user_custom_title'
#
#-----[ FIND ]------------------------------------------
#
if ( !isset($HTTP_POST_VARS['cancelavatar']))
{
$user_avatar = $user_avatar_local;
$user_avatar_type = USER_AVATAR_GALLERY;
}
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
$user_custom_title = htmlspecialchars($user_custom_title); // Custom Title Mod
#
#-----[ FIND ]------------------------------------------
#
SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) ."', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_sig_bbcode_uid = '$signature_bbcode_uid', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_notify_pm = $notifypm, user_popup_pm = $popuppm, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_active = $user_active, user_actkey = '" . str_replace("\'", "''", $user_actkey) . "'" . $avatar_sql . "
#
#-----[ IN-LINE, ADD ]------------------------------------------
#
, user_custom_title = '$user_custom_title'
#
#-----[ FIND ]------------------------------------------
#
$user_dateformat = $userdata['user_dateformat'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
$user_custom_title = htmlspecialchars($userdata['user_custom_title']); // Custom Title Mod
#
#-----[ FIND ]------------------------------------------
#
'SMILIES_STATUS' => $smilies_status,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'CUSTOM_TITLE' => $user_custom_title, // Custom Title Mod
#
#-----[ FIND ]------------------------------------------
#
'L_EMAIL_ADDRESS' => $lang['Email_address'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_CUSTOM_TITLE' => $lang['Custom_Title'], // Custom Title Mod
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_viewprofile.php
#
#-----[ FIND ]------------------------------------------
#
$poster_rank = $ranksrow[$i]['rank_title'];
#
#-----[ REPLACE WITH ]------------------------------------------
#
$poster_rank = ( !empty($profiledata['user_custom_title']) ) ? $profiledata['user_custom_title'] : $ranksrow[$i]['rank_title'];
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!
// -------------------------------------------------
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Custom Title Mod
$lang['Custom_Title'] = 'Custom Title';
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/user_edit_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<td class="row1"><span class="gen">{L_SIGNATURE}</span><br />
<span class="gensmall">{L_SIGNATURE_EXPLAIN}<br />
<br />
{HTML_STATUS}<br />
{BBCODE_STATUS}<br />
{SMILIES_STATUS}</span></td>
<td class="row2">
<textarea name="signature" rows="6" cols="45">{SIGNATURE}</textarea>
</td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_CUSTOM_TITLE}</span></td>
<td class="row2"><input type="text" name="user_custom_title" value="{CUSTOM_TITLE}" maxlength="25" /></td>
</tr>
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_add_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1" width="38%"><span class="gen">{L_USERNAME}: *</span></td>
<td class="row2"><input type="text" class="post" style="width:200px" name="username" size="25" maxlength="40" value="{USERNAME}" /></td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<td class="row1" width="38%"><span class="gen">{L_CUSTOM_TITLE}:</span></td>
<td class="row2"><input type="text" class="post" style="width:200px" name="user_custom_title" size="25" maxlength="25" value="{CUSTOM_TITLE}" /></td>
</tr>
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid
#
#-----[ IN-LINE, ADD ]------------------------------------------
#
, u.user_custom_title
#
#-----[ FIND ]------------------------------------------
#
else if ( $postrow[$i]['user_rank'] )
{
for($j = 0; $j < count($ranksrow); $j++)
{
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Custom Title Mod
if ( !empty($postrow[$i]['user_custom_title']) )
{
$poster_rank = $postrow[$i]['user_custom_title'];
break;
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM |
|
|
|