1<?php
2/*
3 * e107 website system
4 *
5 * Copyright (C) 2008-2009 e107 Inc (e107.org)
6 * Released under the terms and conditions of the
7 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
8 *
9 *
10 *
11 * $Source: /cvs_backup/e107_0.8/e107_themes/templates/user_template.php,v $
12 * $Revision$
13 * $Date$
14 * $Author$
15 */
16
17if (!defined('e107_INIT')) { exit; }
18
19
20/*
21global $user_shortcodes, $pref, $user;
22//Set this to TRUE if you would like any extended user field that is empty to NOT be shown on the profile page
23define("HIDE_EMPTY_FIELDS", FALSE);
24
25
26
27
28/// --------------------- Start of Legacy Code --------------------------------------- //
29
30$EXTENDED_CATEGORY_START = "<tr><td colspan='2' class='forumheader center'>{EXTENDED_NAME}</td></tr>";
31
32$EXTENDED_CATEGORY_TABLE = "
33	<tr>
34		<td style='width:30%' class='forumheader3'>{EXTENDED_ICON}{EXTENDED_NAME}
35		</td>
36		<td style='width:70%' class='forumheader3'>{EXTENDED_VALUE}</td>
37	</tr>
38	";
39
40$EXTENDED_CATEGORY_END = "";
41
42
43// Preparing for huge markup/css changes
44
45$USER_SHORT_TEMPLATE_START = "
46	<div class='content user-list'>
47	<div class='center'>".LAN_USER_56." {TOTAL_USERS}
48	<br />
49	<br />
50	{USER_FORM_START}
51	<div class='form-inline'>
52	".LAN_SHOW.": {USER_FORM_RECORDS} ".LAN_USER_57." {USER_FORM_ORDER}
53	{USER_FORM_SUBMIT}
54	</div>
55	{USER_FORM_END}
56	</div>
57	<br />
58	<br />
59	<table style='".USER_WIDTH."' class='table fborder e-list'>
60	<thead>
61	<tr>
62	<th class='fcaption' style='width:2%'>&nbsp;</th>
63	<th class='fcaption' style='width:20%'>".LAN_USER_58."</th>
64	<th class='fcaption' style='width:20%'>".LAN_USER_60."</th>
65	<th class='fcaption' style='width:20%'>".LAN_USER_59."</th>
66	</tr>
67	</thead>
68	<tbody>
69	{SETIMAGE: w=40}
70";
71$USER_SHORT_TEMPLATE_END = "
72</tbody>
73</table>
74</div>
75";
76
77$USER_SHORT_TEMPLATE = "
78<tr>
79	<td class='forumheader3' style='width:2%'>{USER_PICTURE}</td>
80	<td class='forumheader3' style='width:20%'>{USER_ID}: {USER_NAME_LINK}</td>
81	<td class='forumheader3' style='width:20%'>{USER_EMAIL}</td>
82	<td class='forumheader3' style='width:20%'>{USER_JOIN}</td>
83</tr>
84";
85
86$sc_style['USER_SIGNATURE']['pre'] = "<tr><td colspan='2' class='forumheader3 left'>";
87$sc_style['USER_SIGNATURE']['post'] = "</td></tr>";
88
89$sc_style['USER_COMMENTS_LINK']['pre'] = "<tr><td colspan='2' class='forumheader3 left'>";
90$sc_style['USER_COMMENTS_LINK']['post'] = "</td></tr>";
91
92$sc_style['USER_FORUM_LINK']['pre'] = "<tr><td colspan='2' class='forumheader3 left'>";
93$sc_style['USER_FORUM_LINK']['post'] = "</td></tr>";
94
95$sc_style['USER_UPDATE_LINK']['pre'] = "<tr><td colspan='2' class='forumheader3 center'>";
96$sc_style['USER_UPDATE_LINK']['post'] = "</td></tr>";
97
98$sc_style['USER_RATING']['pre'] = "<tr><td colspan='2' class='forumheader3'><div class='f-left'>".LAN_RATING."</div><div class='f-right'>";
99$sc_style['USER_RATING']['post'] = "</div></td></tr>";
100
101$sc_style['USER_LOGINNAME']['pre'] = " : ";
102
103$sc_style['USER_COMMENTPOSTS']['pre'] = "<tr><td style='width:30%' class='forumheader3'>".LAN_USER_68."</td><td style='width:70%' class='forumheader3'>";
104$sc_style['USER_COMMENTPOSTS']['post'] = "";
105
106$sc_style['USER_COMMENTPER']['pre'] = " ( ";
107$sc_style['USER_COMMENTPER']['post'] = "% )</td></tr>";
108
109
110if(isset($pref['photo_upload']) && $pref['photo_upload'])
111{
112	$user_picture =  "{USER_PICTURE}";
113	$colspan = " colspan='2'";
114	$main_colspan = "";
115}
116else
117{
118	$user_picture =  "";
119	$colspan = "";
120	$main_colspan = " colspan = '2' ";
121}
122
123$sc_style['USER_SENDPM']['pre'] = "<tr><td colspan='2' class='forumheader3'><div class='f-left'>";
124$sc_style['USER_SENDPM']['post'] = "</div><div class='f-right'>".LAN_USER_62."</div></td></tr>";
125
126// Determine which other bits are installed; let photo span those rows (can't do signature - will vary with user)
127$span = 4;
128if (e107::getParser()->parseTemplate("{USER_SENDPM}", FALSE, $user_shortcodes)) $span++;
129$span = " rowspan='".$span."' ";
130
131//$sc_style['USER_PICTURE']['pre']="<td {$span} class='forumheader3 center middle' style='width:20%'>";
132//$sc_style['USER_PICTURE']['post']="</td>";
133
134
135
136
137
138$USER_FULL_TEMPLATE = "{SETIMAGE: w=250}
139<div class='content user'>
140<table style='".USER_WIDTH."' class='table fborder'>
141<tr>
142	<td colspan='2' class='fcaption center'>".LAN_USER_58." {USER_ID} : {USER_NAME}{USER_LOGINNAME}</td>
143</tr>
144<tr>
145	<td {$span} class='forumheader3 center middle' style='width:20%'>{USER_PICTURE}</td>
146	<td {$main_colspan} class='forumheader3'>
147		<div class='f-left'>{USER_ICON=realname} ".LAN_USER_63."</div>
148		<div class='f-right right'>{USER_REALNAME}</div>
149	</td>
150</tr>
151
152<tr>
153	<td  {$main_colspan} class='forumheader3'>
154		<div class='f-left'>{USER_ICON=email} ".LAN_USER_60."</div>
155		<div class='f-right right'>{USER_EMAIL}</div>
156	</td>
157</tr>
158
159<tr>
160	<td  {$main_colspan} class='forumheader3'>
161		<div class='f-left'>{USER_ICON=level} ".LAN_USER_54.":</div>
162		<div class='f-right right'>{USER_LEVEL}</div>
163	</td>
164</tr>
165
166<tr>
167	<td  {$main_colspan} class='forumheader3'>
168		<div class='f-left'>{USER_ICON=lastvisit} ".LAN_USER_65.":&nbsp;&nbsp;</div>
169		<div class='f-right right'>{USER_LASTVISIT}<br />{USER_LASTVISIT_LAPSE}</div>
170	</td>
171</tr>
172{USER_SENDPM}
173{USER_RATING}
174{USER_SIGNATURE}
175{USER_EXTENDED_ALL}
176<tr>
177	<td colspan='2' class='forumheader'>".LAN_USER_64."</td>
178</tr>
179
180<tr>
181	<td style='width:30%' class='forumheader3'>".LAN_USER_59."</td>
182	<td style='width:70%' class='forumheader3'>{USER_JOIN}<br />{USER_DAYSREGGED}</td>
183</tr>
184
185<tr>
186	<td style='width:30%' class='forumheader3'>".LAN_USER_66."</td>
187	<td style='width:70%' class='forumheader3'>{USER_VISITS}</td>
188</tr>
189
190{USER_ADDONS}
191
192{USER_COMMENTPOSTS}
193{USER_COMMENTPER}
194
195
196{USER_UPDATE_LINK}
197</table>
198 <ul class='pager user-view-nextprev'>
199    <li class='previous'>
200    	{USER_JUMP_LINK=prev}
201    </li>
202	<li>
203    	<!-- Back to List? -->
204    </li>
205    <li class='next'>
206    	{USER_JUMP_LINK=next}
207    </li>
208    </ul>
209</div>
210{PROFILE_COMMENTS}
211{PROFILE_COMMENT_FORM}
212";
213
214$USER_EMBED_USERPROFILE_TEMPLATE = "
215<tr>
216	<td class='forumheader3'>{USER_ADDON_LABEL}</td>
217	<td class='forumheader3'>{USER_ADDON_TEXT}</td>
218</tr>";
219
220
221// Convert Shortcode Wrappers from v1.x to v2.x standards.
222$USER_TEMPLATE['view'] 				        = $USER_FULL_TEMPLATE;
223$USER_WRAPPER['view']['USER_COMMENTS_LINK'] = $sc_style['USER_COMMENTS_LINK']['pre']."{---}".$sc_style['USER_COMMENTS_LINK']['post'];
224$USER_WRAPPER['view']['USER_SIGNATURE'] 	= $sc_style['USER_SIGNATURE']['pre']."{---}".$sc_style['USER_SIGNATURE']['post'];
225$USER_WRAPPER['view']['USER_UPDATE_LINK'] 	= $sc_style['USER_UPDATE_LINK']['pre']."{---}".$sc_style['USER_UPDATE_LINK']['post'];
226$USER_WRAPPER['view']['USER_FORUM_LINK'] 	= $sc_style['USER_FORUM_LINK']['pre']."{---}".$sc_style['USER_FORUM_LINK']['post'];
227$USER_WRAPPER['view']['USER_RATING'] 		= $sc_style['USER_RATING']['pre']."{---}".$sc_style['USER_RATING']['post'];
228$USER_WRAPPER['view']['USER_SENDPM'] 		= $sc_style['USER_SENDPM']['pre']."{---}".$sc_style['USER_SENDPM']['post'];
229$USER_WRAPPER['view']['USER_LOGINNAME'] 	= $sc_style['USER_LOGINNAME']['pre']."{---}";
230
231$USER_WRAPPER['view']['USER_COMMENTPOSTS'] 	= $sc_style['USER_COMMENTPOSTS']['pre']."{---}";
232$USER_WRAPPER['view']['USER_COMMENTPER'] 	= $sc_style['USER_COMMENTPER']['pre']."{---}".$sc_style['USER_COMMENTPER']['post'];
233
234$USER_TEMPLATE['addon'] 			        = $USER_EMBED_USERPROFILE_TEMPLATE;
235$USER_TEMPLATE['extended']['start']         = $EXTENDED_CATEGORY_START;
236$USER_TEMPLATE['extended']['item'] 	        = $EXTENDED_CATEGORY_TABLE ;
237$USER_TEMPLATE['extended']['start']         = $EXTENDED_CATEGORY_END;
238$USER_TEMPLATE['list']['start'] 	        = $USER_SHORT_TEMPLATE_START;
239$USER_TEMPLATE['list']['item'] 		        = $USER_SHORT_TEMPLATE;
240$USER_TEMPLATE['list']['end'] 		        = $USER_SHORT_TEMPLATE_END;
241*/
242
243// ------------ End of Legacy Code ------------------------------- //
244
245//  v2.x Standards.
246
247
248	$USER_TEMPLATE = array(); // reset the legacy template above.
249	$USER_WRAPPER = array(); // reset all the legacy wrappers above.
250
251
252	$USER_TEMPLATE['addon']  = '
253		<div class="row">
254			<div class="col-xs-12 col-md-4">{USER_ADDON_LABEL}</div>
255			<div class="col-xs-12 col-md-8">{USER_ADDON_TEXT}</div>
256		 </div>
257		';
258
259	$USER_TEMPLATE['extended']['start'] = '';
260	$USER_TEMPLATE['extended']['end']   = '';
261
262	$USER_TEMPLATE['extended']['item'] = '
263		<div class="row {EXTENDED_ID}">
264		    <div class="ue-label col-xs-12 col-md-4">{EXTENDED_NAME}</div>
265		    <div class="ue-value col-xs-12 col-md-8">{EXTENDED_VALUE}</div>
266		</div>
267		';
268
269
270	$USER_TEMPLATE['list']['start']  = "
271		<div class='content user-list'>
272		<div class='center'>".LAN_USER_56." {TOTAL_USERS}
273		<br />
274		<br />
275		{USER_FORM_START}
276		<div class='form-inline'>
277		".LAN_SHOW.": {USER_FORM_RECORDS} ".LAN_USER_57." {USER_FORM_ORDER}
278		{USER_FORM_SUBMIT}
279		</div>
280		{USER_FORM_END}
281		</div>
282		<br />
283		<br />
284		<table style='".USER_WIDTH."' class='table fborder e-list'>
285		<thead>
286		<tr>
287		<th class='fcaption' style='width:2%'>&nbsp;</th>
288		<th class='fcaption' style='width:20%'>".LAN_USER_58."</th>
289		<th class='fcaption' style='width:20%'>".LAN_USER_60."</th>
290		<th class='fcaption' style='width:20%'>".LAN_USER_59."</th>
291		</tr>
292		</thead>
293		<tbody>
294		{SETIMAGE: w=40}
295	";
296
297
298	$USER_TEMPLATE['list']['item']  = "
299	<tr>
300		<td class='forumheader3' style='width:2%'>{USER_PICTURE}</td>
301		<td class='forumheader3' style='width:20%'>{USER_ID}: {USER_NAME_LINK}</td>
302		<td class='forumheader3' style='width:20%'>{USER_EMAIL}</td>
303		<td class='forumheader3' style='width:20%'>{USER_JOIN}</td>
304	</tr>
305	";
306
307	$USER_TEMPLATE['list']['end']  = "
308	</tbody>
309	</table>
310	</div>
311	";
312
313
314	// View shortcode wrappers.
315	$USER_WRAPPER['view']['USER_COMMENTPOSTS']      = '<div class="col-xs-12 col-md-4">'.LAN_USER_68.'</div><div class="col-xs-12 col-md-8">{---}';
316	$USER_WRAPPER['view']['USER_COMMENTPER']        = ' ( {---}% )</div>';
317	$USER_WRAPPER['view']['USER_SIGNATURE']         = '<div>{---}</div>';
318	$USER_WRAPPER['view']['USER_RATING']            = '<div>{---}</div>';
319	$USER_WRAPPER['view']['USER_SENDPM']            = '<div>{---}</div>';
320	$USER_WRAPPER['view']['PROFILE_COMMENTS']       = '<div class="clearfix">{---}</div>';
321//	$USER_WRAPPER['view']['PROFILE_COMMENT_FORM']   = '{---} </div>';
322
323	$USER_TEMPLATE['view'] 				= '
324	{SETIMAGE: w=600}
325	<div class="user-profile row">
326	    <div class="col-md-12">
327	        <div class="panel panel-default panel-profile clearfix">
328	            <div class="panel-heading" style="height:180px; background-size: cover;background-image: url( {USER_PHOTO: type=url});">
329	                <h5 class="user-id">'.LAN_USER_58.' {USER_ID}</h5>
330	            </div>
331	            <div class="panel-body text-center">
332	                {SETIMAGE: w=200&h=200&crop=1}
333	                {USER_PICTURE: shape=circle&link=1}
334	                <div class="profile-header">
335	                    <h4>{USER_NAME}</h4>
336	                    {USER_SIGNATURE}
337	                    {USER_RATING}
338	                    {USER_SENDPM}
339	                </div>
340	            </div>
341	            <div class="panel-body">
342	                <div class="row"><div class="col-xs-12 col-md-4">'.LAN_USER_63.'</div><div class="col-xs-12 col-md-8">{USER_REALNAME}</div></div>
343	                <div class="row"><div class="col-xs-12 col-md-4">'.LAN_USER_02.'</div><div class="col-xs-12 col-md-8">{USER_LOGINNAME}</div></div>
344	                <div class="row"><div class="col-xs-12 col-md-4">'.LAN_USER_60.'</div><div class="col-xs-12 col-md-8">{USER_EMAIL}</div></div>
345	                <div class="row"><div class="col-xs-12 col-md-4">'.LAN_USER_54.'</div><div class="col-xs-12 col-md-8">{USER_LEVEL}</div></div>
346	                <div class="row"><div class="col-xs-12 col-md-4">'.LAN_USER_65.'</div><div class="col-xs-12 col-md-8">{USER_LASTVISIT}<br /><small class="padding-left">{USER_LASTVISIT_LAPSE}</small></div></div>
347	                <div class="row"><div class="col-xs-12 col-md-4">'.LAN_USER_59.'</div><div class="col-xs-12 col-md-8">{USER_JOIN}<br /><small class="padding-left">{USER_DAYSREGGED}</small></div></div>
348	                <div class="row"><div class="col-xs-12 col-md-4">'.LAN_USER_66.'</div><div class="col-xs-12 col-md-8">{USER_VISITS}</div></div>
349	                {USER_ADDONS}
350	                <div class="row">{USER_COMMENTPOSTS} {USER_COMMENTPER}</div>
351	                {USER_EXTENDED_ALL}
352	                <div class="row"></div>
353	            </div>
354	            <div class="panel-body text-center">
355	                {USER_UPDATE_LINK}
356	            </div>
357	            <div class="panel-body">
358	                <ul class="pager user-view-nextprev">
359	                    <li class="previous">
360	                       {USER_JUMP_LINK=prev}
361	                    </li>
362		               <li>
363	                       <!-- Back to List? -->
364	                    </li>
365	                    <li class="next">
366	                       {USER_JUMP_LINK=next}
367	                    </li>
368	                </ul>
369	            </div>
370	        </div>
371
372
373
374
375	    </div>
376	</div>
377		<!-- Start Comments -->
378	  {PROFILE_COMMENTS}
379	  <!-- End Comments -->
380
381	';
382
383
384
385
386
387
388
389
390