https://www.icyphoenix.com/viewtopic.php?f=26&t=1152 ----------------------------------- krisbfunk Sat 17 Feb, 2007 22:03 FAP CUSTOMIZATION - Assistance Modding The Comment Section To Show Usergroups ----------------------------------- hi, The rest of my forum has usergroups displayed in viewtopic, and i would like to be able to keep the consistancy within the gallery comments as well. Here is the mod, can someone help me add it to album_showpage.php? [code] ## EasyMod 0.0.7 compliant ############################################################## ## MOD Title: Groups on Viewtopic ## MOD Author: onyxraven < onyxraven@eqii.com > (Justin Hart) http://www.eqii.com ## MOD Description: This mod (based on the usergroups in profile mod) shows the non-hidden groups a user is a member of with each post ## MOD Version: 1.0.0 ## ## Installation Level: Easy ## Installation Time: 3 minutes. ## Files To Edit: language/lang_english/lang_main.php ## viewtopic.php ## templates/subSilver/viewtopic_body.tpl ## Included Files: ############################################################## ## 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: I use this mod to allow status for donators and other leaders throughout the boards. ############################################################## ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD ############################################################## # #-----[ OPEN ]------------------------------------------ # language/lang_english/lang_main.php # #-----[ FIND ]------------------------------------------ # $lang['Posts'] = 'Posts'; # #-----[ AFTER, ADD ]------------------------------------------ # $lang['GroupMemberOf'] = 'Member of'; # #-----[ OPEN ]------------------------------------------ # viewtopic.php # #-----[ FIND ]------------------------------------------ # $poster_posts = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Posts'] . ': ' . $postrow[$i]['user_posts'] : ''; # #-----[ AFTER, ADD ]------------------------------------------ # //Get the groups user is a member of, non hidden $poster_groups =''; $group_sql = "SELECT g.group_name, g.group_id FROM " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug WHERE ug.user_id = '" . $poster_id . "' AND g.group_id = ug.group_id AND g.group_single_user <> " . TRUE . " AND ug.user_pending <> ".TRUE . " AND g.group_type <> '".GROUP_HIDDEN."' ORDER BY g.group_name"; if(!$group_result = $db->sql_query($group_sql)) message_die(GENERAL_ERROR, "Error getting group information", "", __LINE__, __FILE__, $group_sql); if($group_list = $db->sql_fetchrowset($group_result)) { $poster_groups .= $lang['GroupMemberOf'] . ":
"; for($j = 0; $j < count($group_list); $j++) $poster_groups .= ' && '.$group_list[$j]['group_name'].'
'; } # #-----[ FIND ]------------------------------------------ # 'POSTER_POSTS' => $poster_posts, # #-----[ AFTER, ADD ]------------------------------------------ # 'POSTER_GROUPS' => $poster_groups, # #-----[ OPEN ]------------------------------------------ # templates/subSilver/viewtopic_body.tpl # #-----[ FIND ]------------------------------------------ # {postrow.POSTER_NAME} # #-----[ IN-LINE FIND ]------------------------------------------ # {postrow.POSTER_AVATAR}
# #-----[ IN-LINE AFTER, ADD ]------------------------------------------ # {postrow.POSTER_GROUPS} # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # # EoM[/code] ----------------------------------- lefty74 Sun 18 Feb, 2007 17:44 Re: Assistance Modding The Comment Section To Show Usergroup ----------------------------------- Hi this seems to work [code linenumbers=false]# #-----[ OPEN ]------------------------------------------ # language/lang_english/lang_main.php # #-----[ FIND ]------------------------------------------ # $lang['Posts'] = 'Posts'; # #-----[ AFTER, ADD ]------------------------------------------ # $lang['GroupMemberOf'] = 'Member of'; # #-----[ OPEN ]------------------------------------------ # album_showpage.php # #-----[ FIND ]------------------------------------------ # $template->assign_block_vars('commentrow', array( # #-----[ BEFORE, ADD ]------------------------------------------ # //Get the groups user is a member of, non hidden $poster_idc = $commentrow[$i]['user_id']; $poster_groups =''; $group_sql = "SELECT g.group_name, g.group_id FROM " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug WHERE ug.user_id = '" . $poster_idc . "' AND g.group_id = ug.group_id AND g.group_single_user <> " . TRUE . " AND ug.user_pending <> ".TRUE . " AND g.group_type <> '".GROUP_HIDDEN."' ORDER BY g.group_name"; if(!$group_result = $db->sql_query($group_sql)) message_die(GENERAL_ERROR, "Error getting group information", "", __LINE__, __FILE__, $group_sql); if($group_list = $db->sql_fetchrowset($group_result)) { $poster_groups .= $lang['GroupMemberOf'] . ":
"; for($j = 0; $j < count($group_list); $j++) $poster_groups .= ' && '.$group_list[$j]['group_name'].'
'; } # #-----[ FIND ]------------------------------------------ # 'POSTER_POSTS' => # #-----[ AFTER, ADD ]------------------------------------------ # 'POSTER_GROUPS' => $poster_groups, # #-----[ OPEN ]------------------------------------------ # templates/subSilver/album_showpage_body.tpl # #-----[ FIND ]------------------------------------------ # {commentrow.POSTER_AVATAR}

# #-----[ IN-LINE FIND ]------------------------------------------ # {commentrow.POSTER_AVATAR}
# #-----[ IN-LINE AFTER, ADD ]------------------------------------------ # {commentrow.POSTER_GROUPS} # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # # EoM[/code] ----------------------------------- krisbfunk Wed 28 Feb, 2007 05:11 Re: Assistance Modding The Comment Section To Show Usergroup ----------------------------------- thanks lefty, that worked great! ----------------------------------- Mighty Gorgon Sun 04 Mar, 2007 13:27 Re: Assistance Modding The Comment Section To Show Usergroup ----------------------------------- Wow, great job [b]lefty74[/b]. :shock: You deserve the Staff rank for the good job you are doing... :wink: Thank you. ----------------------------------- lefty74 Sun 04 Mar, 2007 22:01 Re: Assistance Modding The Comment Section To Show Usergroup ----------------------------------- wow, thanks a lot MG [img]http://www.icyphoenix.com/images/smiles/0056.gif[/img]