############################################################## ## MOD Title: Profile Control Panel - adding a field part III ## MOD Author: Ptirhiik < admin@rpgnet-fr.com > (Pierre) http://www.rpgnet-fr.com ## MOD Description: This mod is a tuto about adding fields to the PCP : admin level field ## MOD Version: 1.0.0 ## ## Installation Level: easy ## Installation Time: 10 Minutes ## Files To Edit: ## ## Language part ## language/lang_english/lang_main.php ## ## ## Input part ## profilcp/profilcp_profil_admin.php ## templates/subSilver/profilcp/profil_admin_body.tpl ## ## ## Display part ## profilcp/profilcp_public_base.php ## templates/subSilver/profilcp/public_base_body.tpl ## viewtopic.php ## templates/subSilver/viewtopic_body.tpl ## ## ## Buddy/member list part ## profilcp/profilcp_buddy.php ## ## ## Included Files: n/a ############################################################## ## For Security Purposes, Please Check: http://www.phpbb.com/mods/ 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/ ############################################################## ## Author Notes: ## ## A field can be classified in some categories, relative to its purpose : ## ## - internal field, also called "preference" : it can be use to set an option (ie display option) ## - public field : ## o web relative : ie a prefered website, and alternative email adress, and so, ## o messanger : a messanger like trillian, and others, ## o real life relative : description, color hair, and so ## - admin level : information set only by the users admin : special rank, other options, ## ## ## ## ## In this part we will add an admin level field input and display. For the example, we will add ## a VIP title, linked to web informations : user_vip_title, displayed on user base info, ## viewtopic and memberlist. ## ## This field will be input in the Profile/Admin sub-menu, and will allow HTML tags. ## ## ## nb.: replace the name of the field and the language key with what you need :) ## ############################################################## ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD ############################################################## # #-----[ SQL ]------------------------------------------------- # ALTER TABLE phpbb_users ADD user_vip_title TEXT; ########################### LANGUAGE ########################### # #-----[ OPEN ]------------------------------------------------ # language/lang_english/lang_main.php # #-----[ FIND ]------------------------------------------------ # // // That's all, Folks! // ------------------------------------------------- # #-----[ BEFORE, ADD ]----------------------------------------- # //-- mod : PCP - tuto 3 ---------------------------------------------------------------------------- //-- add $lang['VIP_title'] = 'V.I.P. Title'; //-- fin mod : PCP - tuto 3 ------------------------------------------------------------------------ ########################## INPUT PART ########################## # #-----[ OPEN ]------------------------------------------------ # profilcp/profilcp_profil_admin.php # #-----[ FIND ]------------------------------------------------ # $user_rank = intval($HTTP_POST_VARS['user_rank']); # #-----[ AFTER, ADD ]------------------------------------------ # //-- mod : PCP - tuto 3 ---------------------------------------------------------------------------- //-- add $user_vip_title = trim(str_replace("\'", "''", $HTTP_POST_VARS['user_vip_title'])); //-- fin mod : PCP - tuto 3 ------------------------------------------------------------------------ # #-----[ FIND ]------------------------------------------------ # // // field added (last first) : # #-----[ AFTER, ADD ]------------------------------------------ # # Replace the field name by yours :) # // - user_vip_title : mod : PCP - tuto 3 # #-----[ FIND ]------------------------------------------------ # $sql = "UPDATE " . USERS_TABLE . " SET # #-----[ AFTER, ADD ]------------------------------------------ # user_vip_title = '" . $user_vip_title . "', # #-----[ FIND ]------------------------------------------------ # 'L_SUBMIT' => $lang['Submit'], # #-----[ BEFORE, ADD ]----------------------------------------- # //-- mod : PCP - tuto 3 ---------------------------------------------------------------------------- //-- add 'L_VIP_TITLE' => $lang['VIP_title'], //-- fin mod : PCP - tuto 3 ------------------------------------------------------------------------ # #-----[ FIND ]------------------------------------------------ # // value $template->assign_vars(array( # #-----[ BEFORE, ADD ]----------------------------------------- # //-- mod : PCP - tuto 3 ---------------------------------------------------------------------------- //-- add $user_vip_title = $view_userdata['user_vip_title']; //-- fin mod : PCP - tuto 3 ------------------------------------------------------------------------ # #-----[ FIND ]------------------------------------------------ # // value $template->assign_vars(array( # #-----[ AFTER, ADD ]------------------------------------------ # //-- mod : PCP - tuto 3 ---------------------------------------------------------------------------- //-- add 'VIP_TITLE' => $user_vip_title, //-- fin mod : PCP - tuto 3 ------------------------------------------------------------------------ # #-----[ OPEN ]------------------------------------------------ # templates/subSilver/profilcp/profil_admin_body.tpl # #-----[ FIND ]------------------------------------------------ # # #-----[ BEFORE, ADD ]----------------------------------------- # {L_VIP_TITLE}: ######################### DISPLAY PART ######################### # #-----[ OPEN ]------------------------------------------------ # profilcp/profilcp_public_base.php # #-----[ FIND ]------------------------------------------------ # // // ranks & avatar // # #-----[ AFTER, ADD ]------------------------------------------ # //-- mod : PCP - tuto 3 ---------------------------------------------------------------------------- //-- add // vip title $vip_title = ($www_display) ? $view_userdata['user_vip_title'] . '
' : ''; //-- fin mod : PCP - tuto 3 ------------------------------------------------------------------------ # #-----[ FIND ]------------------------------------------------ # // legend $template->assign_vars(array( # #-----[ AFTER, ADD ]------------------------------------------ # //-- mod : PCP - tuto 3 ---------------------------------------------------------------------------- //-- add 'L_VIP_TITLE' => $lang['VIP_title'], //-- fin mod : PCP - tuto 3 ------------------------------------------------------------------------ # #-----[ FIND ]------------------------------------------------ # // value $template->assign_vars(array( # #-----[ AFTER, ADD ]------------------------------------------ # //-- mod : PCP - tuto 3 ---------------------------------------------------------------------------- //-- add 'VIP_TITLE' => $vip_title, //-- fin mod : PCP - tuto 3 ------------------------------------------------------------------------ # #-----[ OPEN ]------------------------------------------------ # templates/subSilver/profilcp/public_base_body.tpl # #-----[ FIND ]------------------------------------------------ # {AVATAR_IMG}
{RANK_IMAGE}{POSTER_RANK} # #-----[ IN-LINE FIND ]---------------------------------------- # {AVATAR_IMG} # #-----[ IN-LINE BEFORE, ADD ]--------------------------------- # {VIP_TITLE} # #-----[ OPEN ]------------------------------------------------ # viewtopic.php # #-----[ FIND ]------------------------------------------------ # $rank_image = ($rank_data['rank_image'] != '') ? $rank_data['rank_image'] . '
' : ''; } # #-----[ AFTER, ADD ]------------------------------------------ # //-- mod : PCP - tuto 3 ---------------------------------------------------------------------------- //-- add $poster_vip_title = ($www_display) ? $postrow[$i]['user_vip_title'] . '
': ''; //-- fin mod : PCP - tuto 3 ------------------------------------------------------------------------ # #-----[ FIND ]------------------------------------------------ # 'POSTER_GENDER' => $poster_gender, # #-----[ AFTER, ADD ]------------------------------------------ # //-- mod : PCP - tuto 3 ---------------------------------------------------------------------------- //-- add 'POSTER_VIP_TITLE' => $poster_vip_title, //-- fin mod : PCP - tuto 3 ------------------------------------------------------------------------ # #-----[ OPEN ]------------------------------------------------ # templates/subSilver/viewtopic_body.tpl # #-----[ FIND ]------------------------------------------------ # {postrow.POSTER_NAME} {postrow.ONLINE_IMG}
{postrow.POSTER_RANK}
{postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}

{postrow.POSTER_JOINED}
{postrow.POSTER_POSTS}
{postrow.POSTER_FROM}{postrow.POSTER_AGE}{postrow.POSTER_GENDER}

# #-----[ IN-LINE FIND ]---------------------------------------- # {postrow.POSTER_RANK} # #-----[ IN-LINE BEFORE, ADD ]--------------------------------- # {postrow.POSTER_VIP_TITLE} ###################### BUDDY/MEMBER LIST ####################### # #-----[ OPEN ]------------------------------------------------ # profilcp/profilcp_buddy.php # #-----[ FIND ]------------------------------------------------ # # This one may be different, depending on how many fields you have already add # Add +1 to this number to get the value for the new field and replace the # field name with your new field name to have the whole list of added fields # // // last field pos = 27 # #-----[ REPLACE WITH ]---------------------------------------- # // - user_vip_title : mod : PCP - tuto 3 // // last field pos = 28 # #-----[ FIND ]------------------------------------------------ # # The insert point can be different depending on where you want the new field # to appear in the field list. # Use the number last field pos for the 'ind' => value # 'user_rank_title' => array( 'leg' => $lang['Poster_rank'], 'ind' => 27, 'class' => 'special', 'type' => 'VARCHAR' ), # #-----[ AFTER, ADD ]------------------------------------------ # //-- mod : PCP - tuto 3 ---------------------------------------------------------------------------- //-- add 'user_vip_title' => array( 'leg' => $lang['VIP_title'], 'ind' => 28, 'class' => 'webdisplay', 'type' => 'VARCHAR' ), //-- fin mod : PCP - tuto 3 ------------------------------------------------------------------------ # #-----[ SAVE/CLOSE ALL FILES ]-------------------------------- # # EoM