Limited time Donation special — first come, first serve!
Please visit the thread below for more details.

CLICK HERE

Contact @Davlin with questions or comments.

Jump to content
Salazar

Primary Group and Group Icon in Staff Page

Recommended Posts

Salazar    23

Primary Group in Staff Page

This will display the primary group of the user instead of the member title on the forum team page

Go to: ACP > Customization > Themes > YourTheme (Edit HTML/CSS) - find: core > front > staffdirectory > layout_blocks and click for edit

REPLACE ALL CONTENT WITH:

{{$count=0;}}
{{foreach $users as $user}}
	{{if $count%4 == 0}}
		<div class='ipsGrid ipsGrid_collapsePhone cStaffDirectory_blocks'>
	{{endif}}
		<div class='ipsGrid_span3 ipsType_center ipsAreaBackground_light ipsPad'>
			{template="userPhoto" app="core" group="global" params="$user->member(), 'small'"}
			<h3 class='ipsType_sectionHead'>
				{{if \IPS\Member::loggedIn()->language()->checkKeyExists( "core_staff_directory_name_{$user->id}" ) }}
					{{if member.canAccessModule( \IPS\Application\Module::get( 'core', 'members' ) )}}
						<a href='{$user->member()->url()}'>{lang="core_staff_directory_name_{$user->id}" escape="true"}</a>
					{{else}}
						{lang="core_staff_directory_name_{$user->id}" escape="true"}
					{{endif}}
				{{else}}
					{$user->member()->link()|raw}
				{{endif}}
			</h3>
			<p class='ipsType_reset ipsType_normal ipsType_light'>
				{{if \IPS\Member::loggedIn()->language()->checkKeyExists( "core_staff_directory_title_{$user->id}" )}}
					{lang="core_staff_directory_title_{$user->id}" escape="true"}
				{{else}}
					{expression="\IPS\Member\Group::load( $user->member()->member_group_id )->formattedName" raw="true"}
				{{endif}}
			</p>
			{{if !member.members_disable_pm AND !$user->member()->members_disable_pm AND \IPS\Member::loggedIn()->member_id AND \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'messaging' ) )}}
				<br>
				<a href='{url="app=core&module=messaging&controller=messenger&do=compose&to={$user->member()->member_id}" seoTemplate="messenger_compose"}' data-ipsDialog data-ipsDialog-title='{lang="compose_new"}' data-ipsDialog-forceReload data-ipsDialog-remoteSubmit data-ipsDialog-flashMessage="{lang="message_sent"}"><i class='fa fa-envelope'></i> {lang="message_send"}</a>
			{{endif}}
		</div>
	{{$count++;}}
	{{if $count%4 == 0}}
		</div>
		<br>
	{{endif}}
{{endforeach}}
{{if $count%4 != 0}}
	</div>
	<br>
{{endif}}

results:

staffdir.thumb.png.83516f57ffa43f2ada23dbcb1283af00.png

GROUP ICON IMAGE ON STAFF PAGE

This will show the group's image / icon (if any), defined in ACP> Members> Groups> GroupName> Group Icon

GO TO: ACP > Customization > Themes > YourTheme (Edit HTML/CSS) - find core > front > staffdirectory > layout_blocks

REPLACE ALL CONTENT WITH:

{{$count=0;}}
{{foreach $users as $user}}
	{{if $count%4 == 0}}
		<div class='ipsGrid ipsGrid_collapsePhone cStaffDirectory_blocks'>
	{{endif}}
		<div class='ipsGrid_span3 ipsType_center ipsAreaBackground_light ipsPad'>
			{template="userPhoto" app="core" group="global" params="$user->member(), 'small'"}
			<h3 class='ipsType_sectionHead'>
				{{if \IPS\Member::loggedIn()->language()->checkKeyExists( "core_staff_directory_name_{$user->id}" ) }}
					{{if member.canAccessModule( \IPS\Application\Module::get( 'core', 'members' ) )}}
						<a href='{$user->member()->url()}'>{lang="core_staff_directory_name_{$user->id}" escape="true"}</a>
					{{else}}
						{lang="core_staff_directory_name_{$user->id}" escape="true"}
					{{endif}}
				{{else}}
					{$user->member()->link()|raw}
				{{endif}}
			</h3>
			<p class='ipsType_reset ipsType_normal ipsType_light'>
				{{if \IPS\Member::loggedIn()->language()->checkKeyExists( "core_staff_directory_title_{$user->id}" )}}
					{lang="core_staff_directory_title_{$user->id}" escape="true"}
				{{else}}
					{expression="\IPS\Member\Group::load( $user->member()->member_group_id )->formattedName" raw="true"}
					{{if \IPS\Member\Group::load( $user->member()->member_group_id )->g_icon }}
						<li style="list-style:none" class='ipsResponsive_hidePhone'><img src='{file="$user->member()->group['g_icon']" extension="core_Theme"}' alt='' class='cAuthorGroupIcon'></li>
					{{endif}}
				{{endif}}
			</p>
			{{if !member.members_disable_pm AND !$user->member()->members_disable_pm AND \IPS\Member::loggedIn()->member_id AND \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'messaging' ) )}}
				<br>
				<a href='{url="app=core&module=messaging&controller=messenger&do=compose&to={$user->member()->member_id}" seoTemplate="messenger_compose"}' data-ipsDialog data-ipsDialog-title='{lang="compose_new"}' data-ipsDialog-forceReload data-ipsDialog-remoteSubmit data-ipsDialog-flashMessage="{lang="message_sent"}"><i class='fa fa-envelope'></i> {lang="message_send"}</a>
			{{endif}}
		</div>
	{{$count++;}}
	{{if $count%4 == 0}}
		</div>
		<br>
	{{endif}}
{{endforeach}}
{{if $count%4 != 0}}
	</div>
	<br>
{{endif}}

RESULTS:

groupicon.thumb.png.df91659ddf1128b5c6f20af51f044f60.png

In spoiler, is the code for the other layouts of the directory staff. (You can choose 3 layouts in ACP settings and all have to be changed for group primary to be displayed)

 

VERTICAL LAYOUT (layout full):

GO TO: ACP > Customization > Themes > YourTheme (Edit HTML/CSS) - find core > front > staffdirectory > layout_full

REPLACE ALL CONTENT WITH:

{{foreach $users as $user}}
	<div class='ipsAreaBackground_light ipsPad ipsPhotoPanel ipsPhotoPanel_small ipsSpacer_bottom ipsSpacer_half cStaffDirectory_full'>
		{template="userPhoto" app="core" group="global" params="$user->member(), 'small'"}
		<div>
			<h3 class='ipsType_sectionHead'>
				{{if \IPS\Member::loggedIn()->language()->checkKeyExists( "core_staff_directory_name_{$user->id}" ) }}
					{{if member.canAccessModule( \IPS\Application\Module::get( 'core', 'members' ) )}}
						<a href='{$user->member()->url()}'>{lang="core_staff_directory_name_{$user->id}" escape="true"}</a>
					{{else}}
						{lang="core_staff_directory_name_{$user->id}" escape="true"}
					{{endif}}
				{{else}}
					{$user->member()->link()|raw}
				{{endif}}
			</h3>
			<p class='ipsType_reset ipsType_normal ipsType_light'>
				{{if \IPS\Member::loggedIn()->language()->checkKeyExists( "core_staff_directory_title_{$user->id}" )}}
					{lang="core_staff_directory_title_{$user->id}" escape="true"}
				{{else}}
					{expression="\IPS\Member\Group::load( $user->member()->member_group_id )->formattedName" raw="true"}
				{{endif}}
			</p>
			{{if \IPS\Member::loggedIn()->language()->checkKeyExists( "core_staff_directory_bio_{$user->id}" )}}
				<br>
				<div class='ipsType_richText ipsType_normal' data-ipsTruncate data-ipsTruncate-size="4 lines" data-ipsTruncate-type="hide">{lang="core_staff_directory_bio_{$user->id}"}</div>
			{{endif}}			
			{{if !member.members_disable_pm AND !$user->member()->members_disable_pm AND \IPS\Member::loggedIn()->member_id AND \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'messaging' ) )}}
				<br>
			<a href='{url="app=core&module=messaging&controller=messenger&do=compose&to={$user->member()->member_id}" seoTemplate="messenger_compose"}' data-ipsDialog data-ipsDialog-title='{lang="compose_new"}' data-ipsDialog-forceReload data-ipsDialog-remoteSubmit data-ipsDialog-flashMessage="{lang="message_sent"}"><i class='fa fa-envelope'></i> {lang="message_send"}</a>
			{{endif}}
		</div>
	</div>
{{endforeach}}

LAYOUT HALF

GO TO: ACP > Customization > Theme > YourTheme (EDIT HTML/CSS) - find - core > front > staffdirectory > layout_half

REPLACE ALL CONTENT WITH :

{{$count=0;}}
{{foreach $users as $user}}
	{{if $count%2 == 0}}
		<div class='ipsGrid ipsGrid_collapsePhone ipsSpacer_bottom cStaffDirectory_half'>
	{{endif}}
			<div class='ipsGrid_span6 ipsPhotoPanel ipsPhotoPanel_small ipsAreaBackground_light ipsPad'>
				{template="userPhoto" app="core" group="global" params="$user->member(), 'small'"}
				<div>
					<h3 class='ipsType_sectionHead'>
						{{if \IPS\Member::loggedIn()->language()->checkKeyExists( "core_staff_directory_name_{$user->id}" ) }}
							{{if member.canAccessModule( \IPS\Application\Module::get( 'core', 'members' ) )}}
								<a href='{$user->member()->url()}'>{lang="core_staff_directory_name_{$user->id}" escape="true"}</a>
							{{else}}
								{lang="core_staff_directory_name_{$user->id}" escape="true"}
							{{endif}}
						{{else}}
							{$user->member()->link()|raw}
						{{endif}}
					</h3>
					<p class='ipsType_light ipsType_normal ipsType_reset'>
						{{if \IPS\Member::loggedIn()->language()->checkKeyExists( "core_staff_directory_title_{$user->id}" ) }}
							{lang="core_staff_directory_title_{$user->id}" escape="true"}
						{{else}}
							{expression="\IPS\Member\Group::load( $user->member()->member_group_id )->formattedName" raw="true"}
						{{endif}}
					</p>
					{{if \IPS\Member::loggedIn()->language()->checkKeyExists( "core_staff_directory_bio_{$user->id}" )}}
						<br>
						<div class='ipsType_richText ipsType_normal' data-ipsTruncate data-ipsTruncate-size="4 lines" data-ipsTruncate-type="hide">{lang="core_staff_directory_bio_{$user->id}"}</div>
					{{endif}}			
					{{if !member.members_disable_pm AND !$user->member()->members_disable_pm AND \IPS\Member::loggedIn()->member_id AND \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'messaging' ) )}}
						<br>
						<a href='{url="app=core&module=messaging&controller=messenger&do=compose&to={$user->member()->member_id}" seoTemplate="messenger_compose"}' data-ipsDialog data-ipsDialog-title='{lang="compose_new"}' data-ipsDialog-forceReload data-ipsDialog-remoteSubmit data-ipsDialog-flashMessage="{lang="message_sent"}"><i class='fa fa-envelope'></i> {lang="message_send"}</a>
					{{endif}}
				</div>
			</div>
	{{$count++;}}
	{{if $count%2 == 0}}
		</div>
	{{endif}}
{{endforeach}}
{{if $count%2 != 0}}
	</div>
{{endif}}

 

Edited by Salazar
  • Upvote 4

Share this post


Link to post
Share on other sites
Stormie    8

Very cool, thank you for this. I would prefer this than my post ranks, I'll probably use it!

  • Upvote 1

Share this post


Link to post
Share on other sites
Comendator    73

cool, how to create this page? staff directory ?

Edited by Comendator

Share this post


Link to post
Share on other sites
Salazar    23

Thanks Stormie :)

4 hours ago, Comendator said:

cool, how to create this page? staff directory ?

This page is default, it already exists. But you can define which groups or members will appear in it in ACP> Members> Staff Directory

  • Upvote 1

Share this post


Link to post
Share on other sites
Salazar    23

Hello!

I updated the first post and now it is possible to display the primary group and the group icon / image in staff directory. :)

I hope you like it!

  • Upvote 1

Share this post


Link to post
Share on other sites
Cookie Monster    724

Great guide for when people want to add that! :D Thanks for helping out @Salazar
Personally I will not be using it, as the staff directory kind of says each group. But could possible be cool to add their group image etc.

  • Upvote 1

Share this post


Link to post
Share on other sites
Salazar    23
11 minutes ago, Cookie Monster said:

Great guide for when people want to add that! :D Thanks for helping out @Salazar
Personally I will not be using it, as the staff directory kind of says each group. But could possible be cool to add their group image etc.

Thanks, Cookie Monster! :)

I am happy to help everyone as I am helped here. IPB is still a little new to me, but having a basic notion of HTML and PHP can make quite a snippet :)

  • Upvote 1

Share this post


Link to post
Share on other sites
Comendator    73
4 hours ago, Salazar said:

Thanks Stormie :)

This page is default, it already exists. But you can define which groups or members will appear in it in ACP> Members> Staff Directory

how to see this page?

Share this post


Link to post
Share on other sites
Salazar    23
2 minutes ago, Comendator said:

in my forum dont exist, this page.

What version of IPB are you using?

If possible, PM me with the link of your forum.

Share this post


Link to post
Share on other sites
Cookie Monster    724
6 minutes ago, Comendator said:

in my forum dont exist, this page.

It depends if you have FURL (Friendly URL) enabled or not. See below to enable it

If enabled it is by default /staff if its not enabled i belive its
 

yourdomain.com/index.php?app=core&module=staffdirectory&controller=directory
4 minutes ago, Salazar said:

What version of IPB are you using?

If possible, PM me with the link of your forum.

I belive he hasnt enabled FURL

 

AdminCP > System > Site Promotion > Search Engine Optimization

Enable Rewrite URL's, download the htaccess file, upload it to the root of your forum and rename it to .htaccess note the dot infront of the file

What is FURL Read about it here

Edited by Cookie Monster
Added how to enable FURL
  • Upvote 2

Share this post


Link to post
Share on other sites
Comendator    73
8 minutes ago, Cookie Monster said:

yourdomain.com/index.php?app=core&module=staffdirectory&controller=directory

work, thanks kkkk

Share this post


Link to post
Share on other sites
What do you think? Remember the human.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.

×