Icy Phoenix


Archived phpBB Topics (Styles, Mods, Support) - FAP CUSTOMIZATION - Assistance Modding The Comment Section To Show Usergroups



krisbfunk [ Sat 17 Feb, 2007 22:03 ]
Post subject: 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: [Hide]
  1. ## EasyMod 0.0.7 compliant  
  2. ##############################################################  
  3. ## MOD Title: Groups on Viewtopic  
  4. ## MOD Author: onyxraven < onyxraven@eqii.com > (Justin Hart) http://www.eqii.com  
  5. ## 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  
  6. ## MOD Version: 1.0.0  
  7. ##  
  8. ## Installation Level: Easy  
  9. ## Installation Time: 3 minutes.  
  10. ## Files To Edit: language/lang_english/lang_main.php  
  11. ## viewtopic.php  
  12. ## templates/subSilver/viewtopic_body.tpl  
  13. ## Included Files:  
  14. ##############################################################  
  15. ## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the  
  16. ## latest version of this MOD. Downloading this MOD from other sites could cause malicious code  
  17. ## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered  
  18. ## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/  
  19. ##############################################################  
  20. ## Author Notes: I use this mod to allow status for donators and other leaders throughout the boards.  
  21. ##############################################################  
  22. ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD  
  23. ##############################################################  
  24.  
  25. #  
  26. #-----[ OPEN ]------------------------------------------  
  27. #  
  28. language/lang_english/lang_main.php  
  29. #  
  30. #-----[ FIND ]------------------------------------------  
  31. #  
  32. $lang['Posts'] = 'Posts';  
  33. #  
  34. #-----[ AFTER, ADD ]------------------------------------------  
  35. #  
  36. $lang['GroupMemberOf'] = 'Member of';  
  37.  
  38.  
  39. #  
  40. #-----[ OPEN ]------------------------------------------  
  41. #  
  42. viewtopic.php  
  43. #  
  44. #-----[ FIND ]------------------------------------------  
  45. #  
  46. $poster_posts = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Posts'] . ': ' . $postrow[$i]['user_posts'] : '';  
  47. #  
  48. #-----[ AFTER, ADD ]------------------------------------------  
  49. #  
  50. //Get the groups user is a member of, non hidden  
  51. $poster_groups ='';  
  52. $group_sql = "SELECT g.group_name, g.group_id FROM " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug  
  53. WHERE ug.user_id = '" . $poster_id . "'  
  54. AND g.group_id = ug.group_id  
  55. AND g.group_single_user <> " . TRUE . "  
  56. AND ug.user_pending <> ".TRUE . " AND g.group_type <> '".GROUP_HIDDEN."'  
  57. ORDER BY g.group_name";  
  58. if(!$group_result = $db->sql_query($group_sql))  
  59. message_die(GENERAL_ERROR, "Error getting group information", "", __LINE__, __FILE__, $group_sql);  
  60. if($group_list = $db->sql_fetchrowset($group_result))  
  61. {  
  62. $poster_groups .= $lang['GroupMemberOf'] . ":<br />";  
  63. for($j = 0; $j < count($group_list); $j++)  
  64. $poster_groups .= ' && <a href="' . append_sid("groupcp.$phpEx?g=".$group_list[$j]['group_id']).'"><span class="postdetails">'.$group_list[$j]['group_name'].'</span></a><br />';  
  65. }  
  66. #  
  67. #-----[ FIND ]------------------------------------------  
  68. #  
  69. 'POSTER_POSTS' => $poster_posts,  
  70. #  
  71. #-----[ AFTER, ADD ]------------------------------------------  
  72. #  
  73. 'POSTER_GROUPS' => $poster_groups,  
  74.  
  75.  
  76. #  
  77. #-----[ OPEN ]------------------------------------------  
  78. #  
  79. templates/subSilver/viewtopic_body.tpl  
  80. #  
  81. #-----[ FIND ]------------------------------------------  
  82. #  
  83. <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></span>  
  84. #  
  85. #-----[ IN-LINE FIND ]------------------------------------------  
  86. #  
  87. {postrow.POSTER_AVATAR}<br />  
  88. #  
  89. #-----[ IN-LINE AFTER, ADD ]------------------------------------------  
  90. #  
  91. {postrow.POSTER_GROUPS}  
  92. #  
  93. #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------  
  94. #  
  95. # EoM 


lefty74 [ Sun 18 Feb, 2007 17:44 ]
Post subject: Re: Assistance Modding The Comment Section To Show Usergroup
Hi

this seems to work

Code: [Hide] [Select]
#
#-----[ 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'] . ":<br />";
for($j = 0; $j < count($group_list); $j++)
$poster_groups .= ' && <a href="' . append_sid("groupcp.$phpEx?g=".$group_list[$j]['group_id']).'"><span class="postdetails">'.$group_list[$j]['group_name'].'</span></a><br />';
}
#
#-----[ FIND ]------------------------------------------
#
'POSTER_POSTS' =>
#
#-----[ AFTER, ADD ]------------------------------------------
#
'POSTER_GROUPS' => $poster_groups,


#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/album_showpage_body.tpl
#
#-----[ FIND ]------------------------------------------
#
{commentrow.POSTER_AVATAR}<br /><br />
#
#-----[ IN-LINE FIND ]------------------------------------------
#
{commentrow.POSTER_AVATAR}<br />
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
{commentrow.POSTER_GROUPS}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM


krisbfunk [ Wed 28 Feb, 2007 05:11 ]
Post subject: Re: Assistance Modding The Comment Section To Show Usergroup
thanks lefty, that worked great!


Mighty Gorgon [ Sun 04 Mar, 2007 13:27 ]
Post subject: Re: Assistance Modding The Comment Section To Show Usergroup
Wow, great job lefty74.

You deserve the Staff rank for the good job you are doing...

Thank you.


lefty74 [ Sun 04 Mar, 2007 22:01 ]
Post subject: Re: Assistance Modding The Comment Section To Show Usergroup
wow, thanks a lot MG 0056




Powered by Icy Phoenix