|
Page 1 of 1
|
krisbfunk 
Joined: December 2006
Posts: 95
Location:
|
 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?
- ## 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'] . ":<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' => $poster_posts,
- #
- #-----[ AFTER, ADD ]------------------------------------------
- #
- 'POSTER_GROUPS' => $poster_groups,
-
-
- #
- #-----[ OPEN ]------------------------------------------
- #
- templates/subSilver/viewtopic_body.tpl
- #
- #-----[ FIND ]------------------------------------------
- #
- <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>
- #
- #-----[ IN-LINE FIND ]------------------------------------------
- #
- {postrow.POSTER_AVATAR}<br />
- #
- #-----[ IN-LINE AFTER, ADD ]------------------------------------------
- #
- {postrow.POSTER_GROUPS}
- #
- #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
- #
- # EoM
|
#1 Sat 17 Feb, 2007 22:03 |
|
Sponsors

|
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.
|
|
lefty74 
Joined: January 2007
Posts: 137
|
 Re: Assistance Modding The Comment Section To Show Usergroup
Hi
this seems to work
#
#-----[ 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
|
#2 Sun 18 Feb, 2007 17:44 |
|
krisbfunk 
Joined: December 2006
Posts: 95
Location:
|
 Re: Assistance Modding The Comment Section To Show Usergroup
thanks lefty, that worked great!
|
#3 Wed 28 Feb, 2007 05:11 |
|
Mighty Gorgon 
Luca Libralato
Joined: August 2006
Posts: 7192
Location:  Borgo San Michele
|
 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.
____________ Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
|
#4 Sun 04 Mar, 2007 13:27 |
|
lefty74 
Joined: January 2007
Posts: 137
|
 Re: Assistance Modding The Comment Section To Show Usergroup
wow, thanks a lot MG
|
#5 Sun 04 Mar, 2007 22:01 |
|
|
Page 1 of 1
|
Was this topic useful?
Was this topic useful?
Link this topic |
URL |
|
BBCode |
|
HTML |
|
You cannot post new topics You cannot reply to topics You cannot edit your posts You cannot delete your posts You cannot vote in polls You cannot attach files You can download files You cannot post calendar events
|
|
|
|