############################################################## ## 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 ]----------------------------------------- #