1{if "$userwatch" eq "$user" }
2	{include file='tiki-mytiki_bar.tpl'}
3{/if}
4{if $infoPublic eq 'y' || true}
5	<div class="clearfix">
6		<div class="float-sm-right">
7			{if $tiki_p_admin eq 'y' or $userinfo.object_id eq $user}
8				{if $tiki_p_admin eq 'y'}
9					<a class="link tips" href="tiki-assignuser.php?assign_user={$userwatch|escape:"url"}" title=":{tr}Assign group{/tr}">
10						{icon name='group' align="right" alt="{tr}Assign Group{/tr}"}
11					</a>
12				{/if}
13				<a class="link tips" href="tiki-user_preferences.php?user={$userwatch|escape:url}" title=":{tr}Change user preferences{/tr}">
14					{icon name='wrench' align="right" alt="{tr}Change user preferences{/tr}"}
15				</a>
16			{/if}
17		</div>
18	</div>
19	<div class="row">
20		<div class="col-md-9">
21			<div class="row">
22				<div class="col-md-4 profile-left-bar">
23					<div class="profile-avatar text-center">
24						{if $user eq $userwatch}<a href="tiki-pick_avatar.php">{/if}
25						{if false and isset($user_picture_id)}
26							{wikiplugin _name="img" fileId="$user_picture_id"}{/wikiplugin}
27						{else}
28							{$userwatch|avatarize:"":"":false}
29						{/if}
30						{if $user eq $userwatch}</a>{/if}
31						<p class="profile-username">{$userwatch|username}</p>
32					</div>
33					{if $prefs['feature_display_my_to_others'] eq 'y'}
34						<ul class="list-group profile-navigation">
35							<a id="tab_show_user" data-target="#tab_user" href="#" class="tab_option list-group-item active">{tr}User Information{/tr}</a>
36							{if $prefs['feature_wiki'] eq 'y'}<a id="tab_show_wikis" data-target="#tab_wikis" href="#" class="tab_option list-group-item">{tr}Wikis{/tr}</a>{/if}
37							{if $prefs['feature_blogs'] eq 'y'}<a id="tab_show_blogs" data-target="#tab_blogs" href="#" class="tab_option list-group-item">{tr}Blogs{/tr}</a>{/if}
38							{if $prefs['feature_galleries'] eq 'y'}<a id="tab_show_galleries" data-target="#tab_galleries" href="#" class="tab_option list-group-item">{tr}Galleries{/tr}</a>{/if}
39							{if $prefs['feature_trackers'] eq 'y'}<a id="tab_show_trackers" data-target="#tab_trackers" href="#" class="tab_option list-group-item">{tr}Trackers{/tr}</a>{/if}
40							{if $prefs['feature_articles'] eq 'y'}<a id="tab_show_articles" data-target="#tab_articles" href="#" class="tab_option list-group-item">{tr}Articles{/tr}</a>{/if}
41							{if $prefs['feature_forums'] eq 'y'}<a id="tab_show_forums" data-target="#tab_forums" href="#" class="tab_option list-group-item">{tr}Forum Threads{/tr}</a>{/if}
42						</ul>
43					{/if}
44				</div>
45				{* Content *}
46				<div class="col-md-8">
47					{* User Information Tab *}
48					<div id="tab_user" class="profile-tab-content">
49						<h2>User Information</h2>
50						<table class="table table-borderless profile-info-table">
51						{if $userinfo['user_realName'] && $prefs['user_show_realnames'] == 'n'}
52							<tr class="profile-info">
53								<td class="profile-info-label">{tr}Real Name{/tr}</td>
54								<td class="profile-info-value">{$userinfo['user_realName']|escape}</td>
55							</tr>
56						{/if}
57						{if $userinfo['user_realName'] && $prefs['user_show_realnames'] == 'y'}
58							<tr class="profile-info">
59								<td class="profile-info-label">{tr}Username:{/tr}</td>
60								<td class="profile-info-value">{$userwatch|escape}</td>
61							</tr>
62						{/if}
63						{if not empty($userinfo['user_country']) and $userinfo['user_country'] != 'Other'}
64							<tr class="profile-info">
65								<td class="profile-info-label">{tr}Country:{/tr}</td>
66								<td class="profile-info-value">{$userwatch|countryflag} {tr}{$userinfo['user_country']|stringfix}{/tr}</td>
67							</tr>
68						{/if}
69						{if $prefs.feature_community_gender eq 'y' and $gender neq 'Hidden' and $gender}
70							<tr class="profile-info">
71								<td class="profile-info-label">{tr}Gender:{/tr}</td>
72								<td class="profile-info-value">{tr}{$userinfo['user_gender']}{/tr}</td>
73							</tr>
74						{/if}
75						{if $email_isPublic neq 'n' and $userinfo.email neq ''}
76							<tr class="profile-info">
77								<td class="profile-info-label">{tr}Email:{/tr}</td>
78								<td class="profile-info-value">{mailto address=$userinfo.email text=$scrambledEmail encode="javascript"}</td>
79							</tr>
80						{elseif $email_isPublic eq 'n' and $userinfo.email neq '' and $tiki_p_admin eq 'y'}
81							<tr class="profile-info">
82								<td class="profile-info-label">{tr}Email:{/tr}</td>
83								<td class="profile-info-value">{mailto address=$userinfo.email encode="javascript"} <i>{tr}(non public){/tr}</i></td>
84							</tr>
85						{/if}
86						{if $prefs.change_theme ne 'n'}
87							<tr class="profile-info">
88								<td class="profile-info-label">{tr}Theme:{/tr}</td>
89								<td class="profile-info-value">{$userinfo['user_style']}</td>
90							</tr>
91						{/if}
92						{if $prefs.change_language eq 'y'}
93							<tr class="profile-info">
94								<td class="profile-info-label">{tr}Language:{/tr}</td>
95								<td class="profile-info-value">{', '|implode:$userinfo['user_language']}</td>
96
97							</tr>
98						{/if}
99						{if $userinfo['user_homepage']}
100							<tr class="profile-info">
101								<td class="profile-info-label">{tr}Homepage:{/tr}</td>
102								<td class="profile-info-value">
103									<a href="{$userinfo['user_homepage']|escape}" class="link" title="{tr}User's homepage{/tr}">
104										{$userinfo['user_homepage']|escape}
105									</a>
106								</td>
107							</tr>
108						{/if}
109						{if $prefs.feature_score eq 'y'}
110							<tr class="profile-info">
111								<td class="profile-info-label">{tr}Score:{/tr}</td>
112								<td class="profile-info-value">{$userinfo.score|star}{$userinfo.score}</td>
113							</tr>
114						{/if}
115						{if $prefs.feature_wiki eq 'y' && $prefs.feature_wiki_userpage eq 'y' && (not empty($userinfo['user_page']) or $user == $userinfo.object_id)}
116							<tr class="profile-info">
117								<td class="profile-info-label">{tr}Personal Wiki Page:{/tr}</td>
118								<td class="profile-info-value">
119									{if not empty($userinfo['user_page'])}
120										<a class="link" href="tiki-index.php?page={$prefs.feature_wiki_userpage_prefix|escape:'url'}{$userinfo.object_id|escape:'url'}">
121											{$prefs.feature_wiki_userpage_prefix}{$userinfo.object_id}
122										</a>
123									{elseif $user == $userinfo.object_id}
124										{$prefs.feature_wiki_userpage_prefix}{$userinfo.object_id}
125										<a class="link" href="tiki-editpage.php?page={$prefs.feature_wiki_userpage_prefix|escape:'url'}{$userinfo.object_id|escape:'url'}"
126											title="{tr}Create Page{/tr}">?</a>
127									{else}&nbsp;{/if}
128								</td>
129							</tr>
130						{/if}
131						<tr class="profile-info">
132							<td class="profile-info-label">{tr}Last login:{/tr}</td>
133							<td class="profile-info-value">{$userinfo.lastLogin|tiki_short_datetime}</td>
134						</tr>
135
136						{foreach $template_fields as $field}
137							<tr class="profile-info">
138								<td class="profile-info-label">{$field.label}:</td>
139								<td class="profile-info-value">{$userinfo["tracker_field_`$field.permName`"]}</td>
140							</tr>
141						{/foreach}
142					</table>
143					</div>
144
145					{* Wikis Tab *}
146					<div id="tab_wikis" class="profile-tab-content collapse">
147						<h2>{tr}Wiki Pages{/tr}</h2>
148						<p>{tr}This user has contributed to the following wiki pages{/tr}:</p>
149						<div class="card">
150							<div class="card-body">
151								{wikiplugin _name="list"}
152								{literal}
153									{filter type="wiki page"}
154									{filter exact="{/literal}{$userwatch}{literal}" field="contributors"}
155									{ALTERNATE()}{tr}This user has not contributed to any wiki pages yet{/tr}.{ALTERNATE}
156								{/literal}
157								{/wikiplugin}
158							</div>
159						</div>
160					</div>
161
162					{* Blogs Tab *}
163					<div id="tab_blogs" class="profile-tab-content collapse">
164						<h2>{tr}Wiki Pages{/tr}</h2>
165						<p>{tr}This user has contributed to the following wiki pages{/tr}:</p>
166						<div class="card">
167							<div class="card-body">
168								{wikiplugin _name="list"}
169								{literal}
170									{filter type="blog post"}
171									{filter exact="{/literal}{$userwatch}{literal}" field="contributors"}
172									{ALTERNATE()}{tr}This user has not contributed any blog posts yet{/tr}.{ALTERNATE}
173								{/literal}
174								{/wikiplugin}
175							</div>
176						</div>
177					</div>
178
179					{* Galleries Tab *}
180					<div id="tab_galleries" class="profile-tab-content collapse">
181						<h2>{tr}Wiki Pages{/tr}</h2>
182						<p>{tr}This user has contributed to the following wiki pages{/tr}:</p>
183						<div class="card">
184							<div class="card-body">
185								{wikiplugin _name="list"}
186								{literal}
187									{filter type="file"}
188									{filter exact="{/literal}{$userwatch}{literal}" field="contributors"}
189									{ALTERNATE()}{tr}This user has not contributed any blog posts yet{/tr}.{ALTERNATE}
190								{/literal}
191								{/wikiplugin}
192							</div>
193						</div>
194					</div>
195
196					{* Trackers Tab *}
197					<div id="tab_trackers" class="profile-tab-content collapse">
198						<h2>Tracker Items</h2>
199						<p>{tr}This user has contributed to the following tracker items{/tr}:</p>
200						<div class="card">
201							<div class="card-body">
202								{wikiplugin _name="list"}
203								{literal}
204									{filter type="trackeritem"}
205									{filter exact="{/literal}{$userwatch}{literal}" field="contributors"}
206									{ALTERNATE()}{tr}This user has not contributed to any tracker items yet{/tr}.{ALTERNATE}
207								{/literal}
208								{/wikiplugin}
209							</div>
210						</div>
211					</div>
212
213					{* Articles Tab *}
214					<div id="tab_articles" class="profile-tab-content collapse">
215						<h2>{tr}Articles{/tr}</h2>
216						<p>{tr}This user has contributed to the following articles{/tr}:</p>
217						<div class="card">
218							<div class="card-body">
219								{wikiplugin _name="list"}
220								{literal}
221									{filter type="article"}
222									{filter exact="{/literal}{$userwatch}{literal}" field="contributors"}
223									{ALTERNATE()}{tr}This user has not contributed to any articles yet{/tr}.{ALTERNATE}
224								{/literal}
225								{/wikiplugin}
226							</div>
227						</div>
228					</div>
229
230					{* Forum Posts Tab *}
231					<div id="tab_forums" class="profile-tab-content collapse">
232						<h2>{tr}Forum Threads{/tr}</h2>
233						<p>{tr}This user has started to the following forum threads{/tr}:</p>
234						<div class="card">
235							<div class="card-body">
236								{wikiplugin _name="list"}
237								{literal}
238									{filter type="forum post"}
239									{filter field="parent_thread_id" exact="0"}
240									{filter exact="{/literal}{$userwatch}{literal}" field="contributors"}
241									{ALTERNATE()}{tr}This user has not contributed to any forums yet{/tr}.{ALTERNATE}
242								{/literal}
243								{/wikiplugin}
244							</div>
245						</div>
246					</div>
247				</div>
248			</div>
249		</div>
250		{* Friends *}
251		<div class="col-md-3 profile-right-bar">
252			{if $user and $prefs.feature_messages eq 'y' and $tiki_p_messages eq 'y' and $userinfo['user_allowmsgs'] eq 'y'}
253				<div class="profile-buttons">
254					<a href="{bootstrap_modal controller=user action=send_message userwatch=$userwatch}" class="btn btn-primary">
255						<i class="far fa-envelope"></i>
256						{tr}Send me a message{/tr}
257					</a>
258					{if $prefs.feature_friends eq 'y'}
259						{if $user neq $userinfo.object_id}
260							{wikiplugin _name="friend" other_user="{$userinfo.object_id}"
261							add_button_text="{tr}Add to Network{/tr}"
262							remove_button_text="{tr}Remove from Network{/tr}"}
263							{/wikiplugin}
264						{/if}
265					{/if}
266				</div>
267			{/if}
268
269			{if $prefs.feature_friends eq 'y'}
270				{if $user eq $userinfo.object_id}
271				<div class="card">
272				<div class="card-header">
273					<h3 class="card-title">{tr}Friendship Network{/tr}</h3>
274				</div>
275				<div class="card-body">
276					{module module=friend_list nobox=y}
277				</div>
278				{/if}
279			</div>
280			{/if}
281		</div>
282	</div>
283{else}{* infoPublic eq 'n' *}
284	<div>
285		{remarksbox type="info" title="Private"}{tr}The user has chosen to make his information private{/tr}{/remarksbox}
286	</div>
287{/if}
288{jq}
289	$('.tab_option').click(function(e){
290		e.preventDefault();
291		$('.tab_option').removeClass('active');
292		$('.profile-tab-content').hide();
293
294		$(this).addClass('active');
295		$($(this).data('target')).show();
296	});
297{/jq}
298