PHP Web Host - Quality Web Hosting For All PHP Applications Sign up for PayPal and start accepting credit card payments instantly
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
TheosEleos
Moderator


Joined: Sep 18, 2003
Posts: 958
Location: Missouri

PostPosted: Sat Oct 11, 2003 10:46 pm Reply with quote Back to top

I would like to make it possible for people to assign custom titles to themselves.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger ICQ Number
fury
Worker
Worker


Joined: Sep 09, 2003
Posts: 165

PostPosted: Sat Oct 11, 2003 10:53 pm Reply with quote Back to top

as far as I know the only wa a title can be assigned is via the forum admin panel, I dont know of any hack or ability to assign it any other way. But I can look around for you and let you know.
Thanks
Fury
View user's profile Send private message
TheosEleos
Moderator


Joined: Sep 18, 2003
Posts: 958
Location: Missouri

PostPosted: Sun Oct 12, 2003 7:27 am Reply with quote Back to top

Can I use any of the phpbb hacks or do I have to use nuke hacks?
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger ICQ Number
fury
Worker
Worker


Joined: Sep 09, 2003
Posts: 165

PostPosted: Sun Oct 12, 2003 8:25 am Reply with quote Back to top

well the title is only displayed in the forums so you could probably get away with a phpbb hack if you can find one and if you do please post it here for I would like to have it also.
Thanks
Fury
View user's profile Send private message
TheosEleos
Moderator


Joined: Sep 18, 2003
Posts: 958
Location: Missouri

PostPosted: Sun Oct 12, 2003 1:37 pm Reply with quote Back to top

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 <
Only registered users can see links on this board!
Get registered or login to the forums!
> (JW Frazier)
Only registered users can see links on this board!
Get registered or login to the forums!

## 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:
Only registered users can see links on this board!
Get registered or login to the forums!
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:
Only registered users can see links on this board!
Get registered or login to the forums!

##############################################################
## 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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger ICQ Number
fury
Worker
Worker


Joined: Sep 09, 2003
Posts: 165

PostPosted: Sun Oct 12, 2003 3:00 pm Reply with quote Back to top

Quote:
## 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!
##############################################################


um what was the error would it possibly have something to do with the sql, let me know please
Thanks
Fury
View user's profile Send private message
TheosEleos
Moderator


Joined: Sep 18, 2003
Posts: 958
Location: Missouri

PostPosted: Sun Oct 12, 2003 3:35 pm Reply with quote Back to top

will that sql destroy my nuke databse?
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger ICQ Number
TheosEleos
Moderator


Joined: Sep 18, 2003
Posts: 958
Location: Missouri

PostPosted: Sun Oct 12, 2003 3:51 pm Reply with quote Back to top

OK, I ran the sql and now there is no error. I don't see an option in the profile for the custom title though. I wonder if I need to change something on nuke somewhere.

I bet if we get this working right a lot of people would like to use it.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger ICQ Number
TheosEleos
Moderator


Joined: Sep 18, 2003
Posts: 958
Location: Missouri

PostPosted: Sun Oct 12, 2003 4:28 pm Reply with quote Back to top

I needed to put some of the files in themes/theme name/forums for it to work. The only problem now is that I can't find 'viewtopic.php' in the theme directory to get the title to show up in a post.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger ICQ Number
fury
Worker
Worker


Joined: Sep 09, 2003
Posts: 165

PostPosted: Sun Oct 12, 2003 6:36 pm Reply with quote Back to top

viewtopic.php is in the forums directory
View user's profile Send private message
TheosEleos
Moderator


Joined: Sep 18, 2003
Posts: 958
Location: Missouri

PostPosted: Sun Oct 12, 2003 8:08 pm Reply with quote Back to top

I changed it in that location and it did not work. I wonder if I need to find it in the Nuke theme somewhere.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger ICQ Number
fury
Worker
Worker


Joined: Sep 09, 2003
Posts: 165

PostPosted: Sun Oct 12, 2003 8:15 pm Reply with quote Back to top

what theme are you using and try this one modules/Forums/themes/your them name/viewtopic.php and see if that helps if not post the theme so i can check the path.
Thanks
Fury
View user's profile Send private message
TheosEleos
Moderator


Joined: Sep 18, 2003
Posts: 958
Location: Missouri

PostPosted: Sun Oct 12, 2003 8:22 pm Reply with quote Back to top

There is no theme in the modules/forums directory. There are other directories in there that have the default phpbb theme. The problem is that the forum gets its theme from the themes/mytheme/forums directory. I am zipping up my theme for you to look at.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger ICQ Number
TheosEleos
Moderator


Joined: Sep 18, 2003
Posts: 958
Location: Missouri

PostPosted: Sun Oct 12, 2003 8:49 pm Reply with quote Back to top

Here ya go.

Thanks!!
Only registered users can see links on this board!
Get registered or login to the forums!
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger ICQ Number
fury
Worker
Worker


Joined: Sep 09, 2003
Posts: 165

PostPosted: Sun Oct 12, 2003 9:51 pm Reply with quote Back to top

Theos I apologize i was not thinking. The viewtopic.php is in the modules/Forums directory this is a phpbb file. This does not come with a theme. I am sorry about this.
Thanks
Fury
View user's profile Send private message
TheosEleos
Moderator


Joined: Sep 18, 2003
Posts: 958
Location: Missouri

PostPosted: Sun Oct 12, 2003 10:13 pm Reply with quote Back to top

It's ok buddy. For some reason the custom title does not show up in the post. Do you have any idea why this would be?

It has got to be the viewtopic.php file. I think the theme I am using bypasses that file. I wonder if there is another file I need to edit.

I was thinking maybe the themes/mytheme/forums/viewtopic_body.tpl but I am not really sure.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger ICQ Number
fury
Worker
Worker


Joined: Sep 09, 2003
Posts: 165

PostPosted: Mon Oct 13, 2003 12:11 am Reply with quote Back to top

For some reason that doesnt make sense to me, y would they do a call to a topic file instead of a forum system file. This is the only thing i can come up with in the tpl file but it just doenst make sense.
Code:
BEGIN postrow -->
        <tr align="center">
          <td class="tableborder" >
            <table width="100%" border="0" cellspacing="1" cellpadding="4">
              <tr>
                <td width="186" valign="top" class="{postrow.ROW_CLASS}" nowrap> <span class="largetext"><a name="{postrow.U_POST_ID}"></a><b>{postrow.POSTER_NAME}</b></span><br>
                  <span class="smalltext">{postrow.POSTER_RANK}<br>
                  {postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}<br>
                  <br>
                  {postrow.POSTER_JOINED}<br>
                  {postrow.POSTER_POSTS}<br>
                  {postrow.POSTER_FROM}</span></td>
                <td valign="top" class="{postrow.ROW_CLASS}"> <span class="smalltext"><b>{postrow.POST_SUBJECT}</b></span>
                  <p><span class="largetext">{postrow.MESSAGE}{postrow.SIGNATURE}</span><span class="smalltext">{postrow.EDITED_MESSAGE}</span></p>
                </td>



this is what I would look into in the viewtopic.php

Code:
$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
        FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt
        WHERE p.topic_id = $topic_id
                $limit_posts_time
                AND pt.post_id = p.post_id
                AND u.user_id = p.poster_id
        ORDER BY p.post_time $post_time_order
        LIMIT $start, ".$board_config['posts_per_page'];
if ( !($result = $db->sql_query($sql)) )
{


try this but make backups first,
Thanks
Fury
View user's profile Send private message
TheosEleos
Moderator


Joined: Sep 18, 2003
Posts: 958
Location: Missouri

PostPosted: Mon Oct 13, 2003 8:59 am Reply with quote Back to top

I tried your viewtopic.php code and there was no change. I am not getting any errors. The title is just not showing up in the post. I can set the title in my usercp. I may need to go back over all that code and make sure I made the changes.

I am at a loss.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger ICQ Number
TheosEleos
Moderator


Joined: Sep 18, 2003
Posts: 958
Location: Missouri

PostPosted: Tue Oct 14, 2003 9:14 am Reply with quote Back to top

This is all I have left as far as current issues. Once this is resolved I can go 'live' with my site.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger ICQ Number
TheosEleos
Moderator


Joined: Sep 18, 2003
Posts: 958
Location: Missouri

PostPosted: Thu Oct 16, 2003 3:32 pm Reply with quote Back to top

Raven I know you are busy with other issues including (but not limited to) the avatar problem. Laughing

If this is something you do not have time for or/and are not interested in could you give me an idea where to go to get this worked out?


Thanks!!
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger ICQ Number
TheosEleos
Moderator


Joined: Sep 18, 2003
Posts: 958
Location: Missouri

PostPosted: Mon Oct 20, 2003 6:23 pm Reply with quote Back to top

Hey Fury, this is what I did to the viewtopic_body.tpl file.

Code:
<!-- BEGIN postrow -->
   <tr>
      <td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}"><span class="name"><a name="{postrow.U_POST_ID}"></a><b>{postrow.POSTER_NAME}</b><br>{postrow.CUSTOM_TITLE}<br /></span><br /><span class="postdetails">{postrow.POSTER_RANK}<br />{postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}<br /><br /><i>{postrow.USER_CUSTOM_TITLE}</i><br />{postrow.POSTER_JOINED}<br />{postrow.POSTER_POSTS}<br />{postrow.POSTER_FROM}</span><br /></td>
      <td class="{postrow.ROW_CLASS}" width="100%" height="28" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
         <tr>
            <td width="100%"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails">{L_POSTED}: {postrow.POST_DATE}<span class="gen">&nbsp;</span>&nbsp; &nbsp;{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td>
            <td valign="top" align="right" nowrap="nowrap">{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}</td>
         </tr>
         <tr>
            <td colspan="2"><hr /></td>
         </tr>
         <tr>
            <td colspan="2"><span class="postbody">{postrow.MESSAGE}{postrow.SIGNATURE}</span><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td>
         </tr>
      </table></td>
   </tr>
   <tr>
      <td class="{postrow.ROW_CLASS}" width="150" align="left" valign="middle"><span class="nav"><a href="#top" class="nav">{L_BACK_TO_TOP}</a></span></td>
      <td class="{postrow.ROW_CLASS}" width="100%" height="28" valign="bottom" nowrap="nowrap"><table cellspacing="0" cellpadding="0" border="0" height="18" width="18">
         <tr>
            <td valign="middle" nowrap="nowrap">{postrow.PROFILE_IMG} {postrow.PM_IMG} {postrow.EMAIL_IMG} {postrow.WWW_IMG} {postrow.AIM_IMG} {postrow.YIM_IMG} {postrow.MSN_IMG}<script language="JavaScript" type="text/javascript"><!--

   if ( navigator.userAgent.toLowerCase().indexOf('mozilla') != -1 && navigator.userAgent.indexOf('5.') == -1 )
      document.write(' {postrow.ICQ_IMG}');
   else
      document.write('</td><td>&nbsp;</td><td valign="top" nowrap="nowrap"><div style="position:relative"><div style="position:absolute">{postrow.ICQ_IMG}</div><div style="position:absolute;left:3px;top:-1px">{postrow.ICQ_STATUS_IMG}</div></div>');
            
            //--></script><noscript>{postrow.ICQ_IMG}</noscript></td>
         </tr>
      </table></td>
   </tr>
   <tr>
      <td class="spaceRow" colspan="2" height="1"><img src="themes/BlackW/forums/images/spacer.gif" alt="" width="1" height="1" /></td>
   </tr>
   <!-- END postrow -->



I don't know if I put 'postrow.CUSTOM_TITLE' in the right place though.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger ICQ Number
Display posts from previous:       
Post new topic   Reply to topic