-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProfile.template.php
3024 lines (2662 loc) · 124 KB
/
Profile.template.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
*/
// Template for the profile side bar - goes before any other profile template.
function template_profile_above()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
echo '
<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/profile.js"></script>';
// Prevent Chrome from auto completing fields when viewing/editing other members profiles
if ($context['browser']['is_chrome'] && !$context['user']['is_owner'])
echo '
<script type="text/javascript"><!-- // --><![CDATA[
disableAutoComplete();
// ]]></script>';
// If an error occurred while trying to save previously, give the user a clue!
if (!empty($context['post_errors']))
echo '
', template_error_message();
// If the profile was update successfully, let the user know this.
if (!empty($context['profile_updated']))
echo '
<div class="windowbg" id="profile_success">
', $context['profile_updated'], '
</div>';
}
// Template for closing off table started in profile_above.
function template_profile_below()
{
}
// This template displays users details without any option to edit them.
function template_summary()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
// Display the basic information about the user
echo '
<div id="profileview" class="flow_auto">
<div class="cat_bar">
<h3 class="catbg">
<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />', $txt['summary'], '</span>
</h3>
</div>
<div id="basicinfo">
<div class="windowbg">
<span class="topslice"><span></span></span>
<div class="content flow_auto">
<div class="username"><h4>', $context['member']['name'], ' <span class="position">', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '</span></h4></div>
', $context['member']['avatar']['image'], '
<ul class="reset">';
// What about if we allow email only via the forum??
if ($context['member']['show_email'] === 'yes' || $context['member']['show_email'] === 'no_through_forum' || $context['member']['show_email'] === 'yes_permission_override')
echo '
<li><a href="', $scripturl, '?action=emailuser;sa=email;uid=', $context['member']['id'], '" title="', $context['member']['show_email'] == 'yes' || $context['member']['show_email'] == 'yes_permission_override' ? $context['member']['email'] : '', '" rel="nofollow"><img src="', $settings['images_url'], '/email_sm.gif" alt="', $txt['email'], '" /></a></li>';
// Don't show an icon if they haven't specified a website.
if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website']))
echo '
<li><a href="', $context['member']['website']['url'], '" title="' . $context['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/www_sm.gif" alt="' . $context['member']['website']['title'] . '" />' : $txt['www']), '</a></li>';
// Are there any custom profile fields for the summary?
if (!empty($context['custom_fields']))
{
foreach ($context['custom_fields'] as $field)
if (($field['placement'] == 1 || empty($field['output_html'])) && !empty($field['value']))
echo '
<li class="custom_field">', $field['output_html'], '</li>';
}
echo '
', !isset($context['disabled_fields']['icq']) && !empty($context['member']['icq']['link']) ? '<li>' . $context['member']['icq']['link'] . '</li>' : '', '
', !isset($context['disabled_fields']['msn']) && !empty($context['member']['msn']['link']) ? '<li>' . $context['member']['msn']['link'] . '</li>' : '', '
', !isset($context['disabled_fields']['aim']) && !empty($context['member']['aim']['link']) ? '<li>' . $context['member']['aim']['link'] . '</li>' : '', '
', !isset($context['disabled_fields']['yim']) && !empty($context['member']['yim']['link']) ? '<li>' . $context['member']['yim']['link'] . '</li>' : '', '
</ul>
<span id="userstatus">', $context['can_send_pm'] ? '<a href="' . $context['member']['online']['href'] . '" title="' . $context['member']['online']['label'] . '" rel="nofollow">' : '', $settings['use_image_buttons'] ? '<img src="' . $context['member']['online']['image_href'] . '" alt="' . $context['member']['online']['text'] . '" align="middle" />' : $context['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['text'] . '</span>' : '';
// Can they add this member as a buddy?
if (!empty($context['can_have_buddy']) && !$context['user']['is_owner'])
echo '
<br /><a href="', $scripturl, '?action=buddy;u=', $context['id_member'], ';', $context['session_var'], '=', $context['session_id'], '">[', $txt['buddy_' . ($context['member']['is_buddy'] ? 'remove' : 'add')], ']</a>';
echo '
</span>';
echo '
<p id="infolinks">';
if (!$context['user']['is_owner'] && $context['can_send_pm'])
echo '
<a href="', $scripturl, '?action=pm;sa=send;u=', $context['id_member'], '">', $txt['profile_sendpm_short'], '</a><br />';
echo '
<a href="', $scripturl, '?action=profile;area=showposts;u=', $context['id_member'], '">', $txt['showPosts'], '</a><br />
<a href="', $scripturl, '?action=profile;area=statistics;u=', $context['id_member'], '">', $txt['statPanel'], '</a>
</p>';
echo '
</div>
<span class="botslice"><span></span></span>
</div>
</div>
<div id="detailedinfo">
<div class="windowbg2">
<span class="topslice"><span></span></span>
<div class="content">
<dl>';
if ($context['user']['is_owner'] || $context['user']['is_admin'])
echo '
<dt>', $txt['username'], ': </dt>
<dd>', $context['member']['username'], '</dd>';
if (!isset($context['disabled_fields']['posts']))
echo '
<dt>', $txt['profile_posts'], ': </dt>
<dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>';
// Only show the email address fully if it's not hidden - and we reveal the email.
if ($context['member']['show_email'] == 'yes')
echo '
<dt>', $txt['email'], ': </dt>
<dd><a href="', $scripturl, '?action=emailuser;sa=email;uid=', $context['member']['id'], '">', $context['member']['email'], '</a></dd>';
// ... Or if the one looking at the profile is an admin they can see it anyway.
elseif ($context['member']['show_email'] == 'yes_permission_override')
echo '
<dt>', $txt['email'], ': </dt>
<dd><em><a href="', $scripturl, '?action=emailuser;sa=email;uid=', $context['member']['id'], '">', $context['member']['email'], '</a></em></dd>';
if (!empty($modSettings['titlesEnable']) && !empty($context['member']['title']))
echo '
<dt>', $txt['custom_title'], ': </dt>
<dd>', $context['member']['title'], '</dd>';
if (!empty($context['member']['blurb']))
echo '
<dt>', $txt['personal_text'], ': </dt>
<dd>', $context['member']['blurb'], '</dd>';
// If karma enabled show the members karma.
if ($modSettings['karmaMode'] == '1')
echo '
<dt>', $modSettings['karmaLabel'], ' </dt>
<dd>', ($context['member']['karma']['good'] - $context['member']['karma']['bad']), '</dd>';
elseif ($modSettings['karmaMode'] == '2')
echo '
<dt>', $modSettings['karmaLabel'], ' </dt>
<dd>+', $context['member']['karma']['good'], '/-', $context['member']['karma']['bad'], '</dd>';
if (!isset($context['disabled_fields']['gender']) && !empty($context['member']['gender']['name']))
echo '
<dt>', $txt['gender'], ': </dt>
<dd>', $context['member']['gender']['name'], '</dd>';
echo '
<dt>', $txt['age'], ':</dt>
<dd>', $context['member']['age'] . ($context['member']['today_is_birthday'] ? ' <img src="' . $settings['images_url'] . '/cake.png" alt="" />' : ''), '</dd>';
if (!isset($context['disabled_fields']['location']) && !empty($context['member']['location']))
echo '
<dt>', $txt['location'], ':</dt>
<dd>', $context['member']['location'], '</dd>';
echo '
</dl>';
// Any custom fields for standard placement?
if (!empty($context['custom_fields']))
{
$shown = false;
foreach ($context['custom_fields'] as $field)
{
if ($field['placement'] != 0 || empty($field['output_html']))
continue;
if (empty($shown))
{
echo '
<dl>';
$shown = true;
}
echo '
<dt>', $field['name'], ':</dt>
<dd>', $field['output_html'], '</dd>';
}
if (!empty($shown))
echo '
</dl>';
}
echo '
<dl class="noborder">';
// Can they view/issue a warning?
if ($context['can_view_warning'] && $context['member']['warning'])
{
echo '
<dt>', $txt['profile_warning_level'], ': </dt>
<dd>
<a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=', $context['can_issue_warning'] ? 'issuewarning' : 'viewwarning', '">', $context['member']['warning'], '%</a>';
// Can we provide information on what this means?
if (!empty($context['warning_status']))
echo '
<span class="smalltext">(', $context['warning_status'], ')</span>';
echo '
</dd>';
}
// Is this member requiring activation and/or banned?
if (!empty($context['activate_message']) || !empty($context['member']['bans']))
{
// If the person looking at the summary has permission, and the account isn't activated, give the viewer the ability to do it themselves.
if (!empty($context['activate_message']))
echo '
<dt class="clear"><span class="alert">', $context['activate_message'], '</span> (<a href="' . $scripturl . '?action=profile;save;area=activateaccount;u=' . $context['id_member'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '"', ($context['activate_type'] == 4 ? ' onclick="return confirm(\'' . $txt['profileConfirm'] . '\');"' : ''), '>', $context['activate_link_text'], '</a>)</dt>';
// If the current member is banned, show a message and possibly a link to the ban.
if (!empty($context['member']['bans']))
{
echo '
<dt class="clear"><span class="alert">', $txt['user_is_banned'], '</span> [<a href="#" onclick="document.getElementById(\'ban_info\').style.display = document.getElementById(\'ban_info\').style.display == \'none\' ? \'\' : \'none\';return false;">' . $txt['view_ban'] . '</a>]</dt>
<dt class="clear" id="ban_info" style="display: none;">
<strong>', $txt['user_banned_by_following'], ':</strong>';
foreach ($context['member']['bans'] as $ban)
echo '
<br /><span class="smalltext">', $ban['explanation'], '</span>';
echo '
</dt>';
}
}
echo '
<dt>', $txt['date_registered'], ': </dt>
<dd>', $context['member']['registered'], '</dd>';
// If the person looking is allowed, they can check the members IP address and hostname.
if ($context['can_see_ip'])
{
if (!empty($context['member']['ip']))
echo '
<dt>', $txt['ip'], ': </dt>
<dd><a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['member']['ip'], ';u=', $context['member']['id'], '">', $context['member']['ip'], '</a></dd>';
if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip']))
echo '
<dt>', $txt['hostname'], ': </dt>
<dd>', $context['member']['hostname'], '</dd>';
}
echo '
<dt>', $txt['local_time'], ':</dt>
<dd>', $context['member']['local_time'], '</dd>';
if (!empty($modSettings['userLanguage']) && !empty($context['member']['language']))
echo '
<dt>', $txt['language'], ':</dt>
<dd>', $context['member']['language'], '</dd>';
echo '
<dt>', $txt['lastLoggedIn'], ': </dt>
<dd>', $context['member']['last_login'], '</dd>
</dl>';
// Are there any custom profile fields for the summary?
if (!empty($context['custom_fields']))
{
$shown = false;
foreach ($context['custom_fields'] as $field)
{
if ($field['placement'] != 2 || empty($field['output_html']))
continue;
if (empty($shown))
{
$shown = true;
echo '
<div class="custom_fields_above_signature">
<ul class="reset nolist">';
}
echo '
<li>', $field['output_html'], '</li>';
}
if ($shown)
echo '
</ul>
</div>';
}
// Show the users signature.
if ($context['signature_enabled'] && !empty($context['member']['signature']))
echo '
<div class="signature">
<h5>', $txt['signature'], ':</h5>
', $context['member']['signature'], '
</div>';
echo '
</div>
<span class="botslice"><span></span></span>
</div>
</div>
<div class="clear"></div>
</div>';
}
// Template for showing all the posts of the user, in chronological order.
function template_showPosts()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
echo '
<div class="cat_bar">
<h3 class="catbg">
', (!isset($context['attachments']) && empty($context['is_topics']) ? $txt['showMessages'] : (!empty($context['is_topics']) ? $txt['showTopics'] : $txt['showAttachments'])), ' - ', $context['member']['name'], '
</h3>
</div>
<div class="pagesection">
<span>', $txt['pages'], ': ', $context['page_index'], '</span>
</div>';
// Button shortcuts
$quote_button = create_button('quote.gif', 'reply_quote', 'quote', 'align="middle"');
$reply_button = create_button('reply_sm.gif', 'reply', 'reply', 'align="middle"');
$remove_button = create_button('delete.gif', 'remove_message', 'remove', 'align="middle"');
$notify_button = create_button('notify_sm.gif', 'notify_replies', 'notify', 'align="middle"');
// Are we displaying posts or attachments?
if (!isset($context['attachments']))
{
// For every post to be displayed, give it its own div, and show the important details of the post.
foreach ($context['posts'] as $post)
{
echo '
<div class="topic">
<div class="', $post['alternate'] == 0 ? 'windowbg2' : 'windowbg', ' core_posts">
<span class="topslice"><span></span></span>
<div class="content">
<div class="counter">', $post['counter'], '</div>
<div class="topic_details">
<h5><strong><a href="', $scripturl, '?board=', $post['board']['id'], '.0">', $post['board']['name'], '</a> / <a href="', $scripturl, '?topic=', $post['topic'], '.', $post['start'], '#msg', $post['id'], '">', $post['subject'], '</a></strong></h5>
<span class="smalltext">« <strong>', $txt['on'], ':</strong> ', $post['time'], ' »</span>
</div>
<div class="list_posts">';
if (!$post['approved'])
echo '
<div class="approve_post">
<em>', $txt['post_awaiting_approval'], '</em>
</div>';
echo '
', $post['body'], '
</div>
</div>';
if ($post['can_reply'] || $post['can_mark_notify'] || $post['can_delete'])
echo '
<div class="floatright">
<ul class="reset smalltext quickbuttons">';
// If they *can* reply?
if ($post['can_reply'])
echo '
<li class="reply_button"><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '"><span>', $txt['reply'], '</span></a></li>';
// If they *can* quote?
if ($post['can_quote'])
echo '
<li class="quote_button"><a href="', $scripturl . '?action=post;topic=', $post['topic'], '.', $post['start'], ';quote=', $post['id'], '"><span>', $txt['quote'], '</span></a></li>';
// Can we request notification of topics?
if ($post['can_mark_notify'])
echo '
<li class="notify_button"><a href="', $scripturl, '?action=notify;topic=', $post['topic'], '.', $post['start'], '"><span>', $txt['notify'], '</span></a></li>';
// How about... even... remove it entirely?!
if ($post['can_delete'])
echo '
<li class="remove_button"><a href="', $scripturl, '?action=deletemsg;msg=', $post['id'], ';topic=', $post['topic'], ';profile;u=', $context['member']['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['remove_message'], '?\');"><span>', $txt['remove'], '</span></a></li>';
if ($post['can_reply'] || $post['can_mark_notify'] || $post['can_delete'])
echo '
</ul>
</div>';
echo '
<br class="clear" />
<span class="botslice"><span></span></span>
</div>
</div>';
}
}
else
{
echo '
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="table_grid" align="center">
<thead>
<tr class="titlebg">
<th class="first_th lefttext" scope="col" width="25%">
<a href="', $scripturl, '?action=profile;u=', $context['current_member'], ';area=showposts;sa=attach;sort=filename', ($context['sort_direction'] == 'down' && $context['sort_order'] == 'filename' ? ';asc' : ''), '">
', $txt['show_attach_filename'], '
', ($context['sort_order'] == 'filename' ? '<img src="' . $settings['images_url'] . '/sort_' . ($context['sort_direction'] == 'down' ? 'down' : 'up') . '.gif" alt="" />' : ''), '
</a>
</th>
<th scope="col" width="12%">
<a href="', $scripturl, '?action=profile;u=', $context['current_member'], ';area=showposts;sa=attach;sort=downloads', ($context['sort_direction'] == 'down' && $context['sort_order'] == 'downloads' ? ';asc' : ''), '">
', $txt['show_attach_downloads'], '
', ($context['sort_order'] == 'downloads' ? '<img src="' . $settings['images_url'] . '/sort_' . ($context['sort_direction'] == 'down' ? 'down' : 'up') . '.gif" alt="" />' : ''), '
</a>
</th>
<th class="lefttext" scope="col" width="30%">
<a href="', $scripturl, '?action=profile;u=', $context['current_member'], ';area=showposts;sa=attach;sort=subject', ($context['sort_direction'] == 'down' && $context['sort_order'] == 'subject' ? ';asc' : ''), '">
', $txt['message'], '
', ($context['sort_order'] == 'subject' ? '<img src="' . $settings['images_url'] . '/sort_' . ($context['sort_direction'] == 'down' ? 'down' : 'up') . '.gif" alt="" />' : ''), '
</a>
</th>
<th class="last_th lefttext" scope="col">
<a href="', $scripturl, '?action=profile;u=', $context['current_member'], ';area=showposts;sa=attach;sort=posted', ($context['sort_direction'] == 'down' && $context['sort_order'] == 'posted' ? ';asc' : ''), '">
', $txt['show_attach_posted'], '
', ($context['sort_order'] == 'posted' ? '<img src="' . $settings['images_url'] . '/sort_' . ($context['sort_direction'] == 'down' ? 'down' : 'up') . '.gif" alt="" />' : ''), '
</a>
</th>
</tr>
</thead>
<tbody>';
// Looks like we need to do all the attachments instead!
$alternate = false;
foreach ($context['attachments'] as $attachment)
{
echo '
<tr class="', $attachment['approved'] ? ($alternate ? 'windowbg' : 'windowbg2') : 'approvebg', '">
<td><a href="', $scripturl, '?action=dlattach;topic=', $attachment['topic'], '.0;attach=', $attachment['id'], '">', $attachment['filename'], '</a>', !$attachment['approved'] ? ' <em>(' . $txt['awaiting_approval'] . ')</em>' : '', '</td>
<td align="center">', $attachment['downloads'], '</td>
<td><a href="', $scripturl, '?topic=', $attachment['topic'], '.msg', $attachment['msg'], '#msg', $attachment['msg'], '" rel="nofollow">', $attachment['subject'], '</a></td>
<td>', $attachment['posted'], '</td>
</tr>';
$alternate = !$alternate;
}
// No posts? Just end the table with a informative message.
if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts'])))
echo '
<tr>
<td class="tborder windowbg2 padding centertext" colspan="4">
', isset($context['attachments']) ? $txt['show_attachments_none'] : ($context['is_topics'] ? $txt['show_topics_none'] : $txt['show_posts_none']), '
</td>
</tr>';
echo '
</tbody>
</table>';
}
// Show more page numbers.
echo '
<div class="pagesection" style="margin-bottom: 0;">
<span>', $txt['pages'], ': ', $context['page_index'], '</span>
</div>';
}
// Template for showing all the buddies of the current user.
function template_editBuddies()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
echo '
<div class="title_bar">
<h3 class="titlebg">
<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/online.gif" alt="" class="icon" />', $txt['editBuddies'], '</span>
</h3>
</div>
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="table_grid" align="center">
<tr class="catbg">
<th class="first_th lefttext" scope="col" width="20%">', $txt['name'], '</th>
<th scope="col">', $txt['status'], '</th>
<th scope="col">', $txt['email'], '</th>
<th scope="col">', $txt['icq'], '</th>
<th scope="col">', $txt['aim'], '</th>
<th scope="col">', $txt['yim'], '</th>
<th scope="col">', $txt['msn'], '</th>
<th class="last_th" scope="col"></th>
</tr>';
// If they don't have any buddies don't list them!
if (empty($context['buddies']))
echo '
<tr class="windowbg2">
<td colspan="8" align="center"><strong>', $txt['no_buddies'], '</strong></td>
</tr>';
// Now loop through each buddy showing info on each.
$alternate = false;
foreach ($context['buddies'] as $buddy)
{
echo '
<tr class="', $alternate ? 'windowbg' : 'windowbg2', '">
<td>', $buddy['link'], '</td>
<td align="center"><a href="', $buddy['online']['href'], '"><img src="', $buddy['online']['image_href'], '" alt="', $buddy['online']['label'], '" title="', $buddy['online']['label'], '" /></a></td>
<td align="center">', ($buddy['show_email'] == 'no' ? '' : '<a href="' . $scripturl . '?action=emailuser;sa=email;uid=' . $buddy['id'] . '" rel="nofollow"><img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt['email'] . '" title="' . $txt['email'] . ' ' . $buddy['name'] . '" /></a>'), '</td>
<td align="center">', $buddy['icq']['link'], '</td>
<td align="center">', $buddy['aim']['link'], '</td>
<td align="center">', $buddy['yim']['link'], '</td>
<td align="center">', $buddy['msn']['link'], '</td>
<td align="center"><a href="', $scripturl, '?action=profile;area=lists;sa=buddies;u=', $context['id_member'], ';remove=', $buddy['id'], ';', $context['session_var'], '=', $context['session_id'], '"><img src="', $settings['images_url'], '/icons/delete.gif" alt="', $txt['buddy_remove'], '" title="', $txt['buddy_remove'], '" /></a></td>
</tr>';
$alternate = !$alternate;
}
echo '
</table>';
// Add a new buddy?
echo '
<br />
<form action="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=lists;sa=buddies" method="post" accept-charset="', $context['character_set'], '">
<div class="tborder add_buddy">
<div class="title_bar">
<h3 class="titlebg">', $txt['buddy_add'], '</h3>
</div>
<span class="upperframe"><span></span></span>
<div class="roundframe">
<label for="new_buddy">
<strong>', $txt['who_member'], ':</strong>
</label>
<input type="text" name="new_buddy" id="new_buddy" size="25" class="input_text" />
<input type="submit" value="', $txt['buddy_add_button'], '" class="button_submit" />
</div>
<span class="lowerframe"><span></span></span>
</div>
</form>
<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?fin20"></script>
<script type="text/javascript"><!-- // --><![CDATA[
var oAddBuddySuggest = new smc_AutoSuggest({
sSelf: \'oAddBuddySuggest\',
sSessionId: \'', $context['session_id'], '\',
sSessionVar: \'', $context['session_var'], '\',
sSuggestId: \'new_buddy\',
sControlId: \'new_buddy\',
sSearchType: \'member\',
sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
bItemList: false
});
// ]]></script>';
}
// Template for showing the ignore list of the current user.
function template_editIgnoreList()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
echo '
<div class="title_bar">
<h3 class="titlebg">
<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />', $txt['editIgnoreList'], '</span>
</h3>
</div>
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="table_grid" align="center">
<tr class="catbg">
<th class="first_th" scope="col" width="20%">', $txt['name'], '</th>
<th scope="col">', $txt['status'], '</th>
<th scope="col">', $txt['email'], '</th>
<th scope="col">', $txt['icq'], '</th>
<th scope="col">', $txt['aim'], '</th>
<th scope="col">', $txt['yim'], '</th>
<th scope="col">', $txt['msn'], '</th>
<th class="last_th" scope="col"></th>
</tr>';
// If they don't have anyone on their ignore list, don't list it!
if (empty($context['ignore_list']))
echo '
<tr class="windowbg2">
<td colspan="8" align="center"><strong>', $txt['no_ignore'], '</strong></td>
</tr>';
// Now loop through each buddy showing info on each.
$alternate = false;
foreach ($context['ignore_list'] as $member)
{
echo '
<tr class="', $alternate ? 'windowbg' : 'windowbg2', '">
<td>', $member['link'], '</td>
<td align="center"><a href="', $member['online']['href'], '"><img src="', $member['online']['image_href'], '" alt="', $member['online']['label'], '" title="', $member['online']['label'], '" /></a></td>
<td align="center">', ($member['show_email'] == 'no' ? '' : '<a href="' . $scripturl . '?action=emailuser;sa=email;uid=' . $member['id'] . '" rel="nofollow"><img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt['email'] . '" title="' . $txt['email'] . ' ' . $member['name'] . '" /></a>'), '</td>
<td align="center">', $member['icq']['link'], '</td>
<td align="center">', $member['aim']['link'], '</td>
<td align="center">', $member['yim']['link'], '</td>
<td align="center">', $member['msn']['link'], '</td>
<td align="center"><a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=lists;sa=ignore;remove=', $member['id'], ';', $context['session_var'], '=', $context['session_id'], '"><img src="', $settings['images_url'], '/icons/delete.gif" alt="', $txt['ignore_remove'], '" title="', $txt['ignore_remove'], '" /></a></td>
</tr>';
$alternate = !$alternate;
}
echo '
</table>';
// Add a new buddy?
echo '
<br />
<form action="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=lists;sa=ignore" method="post" accept-charset="', $context['character_set'], '">
<div class="tborder add_buddy">
<div class="title_bar">
<h3 class="titlebg">', $txt['ignore_add'], '</h3>
</div>
<span class="upperframe"><span></span></span>
<div class="roundframe">
<label for="new_buddy">
<strong>', $txt['who_member'], ':</strong>
</label>
<input type="text" name="new_ignore" id="new_ignore" size="25" class="input_text" />
<input type="submit" value="', $txt['ignore_add_button'], '" class="button_submit" />
</div>
<span class="lowerframe"><span></span></span>
</div>
</form>
<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?fin20"></script>
<script type="text/javascript"><!-- // --><![CDATA[
var oAddIgnoreSuggest = new smc_AutoSuggest({
sSelf: \'oAddIgnoreSuggest\',
sSessionId: \'', $context['session_id'], '\',
sSessionVar: \'', $context['session_var'], '\',
sSuggestId: \'new_ignore\',
sControlId: \'new_ignore\',
sSearchType: \'member\',
sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
bItemList: false
});
// ]]></script>';
}
// This template shows an admin information on a users IP addresses used and errors attributed to them.
function template_trackActivity()
{
global $context, $settings, $options, $scripturl, $txt;
// The first table shows IP information about the user.
echo '
<div class="title_bar">
<h3 class="titlebg"><strong>', $txt['view_ips_by'], ' ', $context['member']['name'], '</strong></h3>
</div>';
// The last IP the user used.
echo '
<div id="tracking" class="windowbg2">
<span class="topslice"><span></span></span>
<div class="content">
<dl class="noborder">
<dt>', $txt['most_recent_ip'], ':
', (empty($context['last_ip2']) ? '' : '<br />
<span class="smalltext">(<a href="' . $scripturl . '?action=helpadmin;help=whytwoip" onclick="return reqWin(this.href);">' . $txt['why_two_ip_address'] . '</a>)</span>'), '
</dt>
<dd>
<a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip'], ';u=', $context['member']['id'], '">', $context['last_ip'], '</a>';
// Second address detected?
if (!empty($context['last_ip2']))
echo '
, <a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip2'], ';u=', $context['member']['id'], '">', $context['last_ip2'], '</a>';
echo '
</dd>';
// Lists of IP addresses used in messages / error messages.
echo '
<dt>', $txt['ips_in_messages'], ':</dt>
<dd>
', (count($context['ips']) > 0 ? implode(', ', $context['ips']) : '(' . $txt['none'] . ')'), '
</dd>
<dt>', $txt['ips_in_errors'], ':</dt>
<dd>
', (count($context['ips']) > 0 ? implode(', ', $context['error_ips']) : '(' . $txt['none'] . ')'), '
</dd>';
// List any members that have used the same IP addresses as the current member.
echo '
<dt>', $txt['members_in_range'], ':</dt>
<dd>
', (count($context['members_in_range']) > 0 ? implode(', ', $context['members_in_range']) : '(' . $txt['none'] . ')'), '
</dd>
</dl>
</div>
<span class="botslice"><span></span></span>
</div>
<br />';
// Show the track user list.
template_show_list('track_user_list');
}
// The template for trackIP, allowing the admin to see where/who a certain IP has been used.
function template_trackIP()
{
global $context, $settings, $options, $scripturl, $txt;
// This function always defaults to the last IP used by a member but can be set to track any IP.
// The first table in the template gives an input box to allow the admin to enter another IP to track.
echo '
<div class="cat_bar">
<h3 class="catbg">', $txt['trackIP'], '</h3>
</div>
<div class="windowbg2">
<span class="topslice"><span></span></span>
<form action="', $context['base_url'], '" method="post" accept-charset="', $context['character_set'], '">
<div class="padding">', $txt['enter_ip'], ': <input type="text" name="searchip" value="', $context['ip'], '" class="input_text" /> <input type="submit" value="', $txt['trackIP'], '" class="button_submit" /></div>
</form>
<span class="botslice"><span></span></span>
</div>
<br />';
// The table inbetween the first and second table shows links to the whois server for every region.
if ($context['single_ip'])
{
echo '
<div class="title_bar">
<h3 class="titlebg">', $txt['whois_title'], ' ', $context['ip'], '</h3>
</div>
<div class="windowbg2">
<span class="topslice"><span></span></span>
<div class="padding">';
foreach ($context['whois_servers'] as $server)
echo '
<a href="', $server['url'], '" target="_blank" class="new_win"', isset($context['auto_whois_server']) && $context['auto_whois_server']['name'] == $server['name'] ? ' style="font-weight: bold;"' : '', '>', $server['name'], '</a><br />';
echo '
</div>
<span class="botslice"><span></span></span>
</div>
<br />';
}
// The second table lists all the members who have been logged as using this IP address.
echo '
<div class="title_bar">
<h3 class="titlebg">', $txt['members_from_ip'], ' ', $context['ip'], '</h3>
</div>';
if (empty($context['ips']))
echo '
<p class="windowbg2 description"><em>', $txt['no_members_from_ip'], '</em></p>';
else
{
echo '
<table class="table_grid" cellspacing="0" width="100%">
<thead>
<tr class="catbg">
<th class="first_th" scope="col">', $txt['ip_address'], '</th>
<th class="last_th" scope="col">', $txt['display_name'], '</th>
</tr>
</thead>
<tbody>';
// Loop through each of the members and display them.
foreach ($context['ips'] as $ip => $memberlist)
echo '
<tr>
<td class="windowbg2"><a href="', $context['base_url'], ';searchip=', $ip, '">', $ip, '</a></td>
<td class="windowbg2">', implode(', ', $memberlist), '</td>
</tr>';
echo '
</tbody>
</table>
<br />';
}
template_show_list('track_message_list');
echo '<br />';
template_show_list('track_user_list');
}
function template_showPermissions()
{
global $context, $settings, $options, $scripturl, $txt;
echo '
<div class="cat_bar">
<h3 class="catbg">
<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />', $txt['showPermissions'], '</span>
</h3>
</div>';
if ($context['member']['has_all_permissions'])
{
echo '
<p class="windowbg description">', $txt['showPermissions_all'], '</p>';
}
else
{
echo '
<p class="description">',$txt['showPermissions_help'],'</p>
<div id="permissions" class="flow_hidden">';
if (!empty($context['no_access_boards']))
{
echo '
<div class="cat_bar">
<h3 class="catbg">', $txt['showPermissions_restricted_boards'], '</h3>
</div>
<div class="windowbg smalltext">
<span class="topslice"><span></span></span>
<div class="content">', $txt['showPermissions_restricted_boards_desc'], ':<br />';
foreach ($context['no_access_boards'] as $no_access_board)
echo '
<a href="', $scripturl, '?board=', $no_access_board['id'], '.0">', $no_access_board['name'], '</a>', $no_access_board['is_last'] ? '' : ', ';
echo '
</div>
<span class="botslice"><span></span></span>
</div>';
}
// General Permissions section.
echo '
<div class="tborder">
<div class="cat_bar">
<h3 class="catbg">', $txt['showPermissions_general'], '</h3>
</div>';
if (!empty($context['member']['permissions']['general']))
{
echo '
<table class="table_grid" width="100%" cellspacing="0">
<thead>
<tr class="titlebg">
<th class="lefttext first_th" scope="col" width="50%">', $txt['showPermissions_permission'], '</th>
<th class="lefttext last_th" scope="col" width="50%">', $txt['showPermissions_status'], '</th>
</tr>
</thead>
<tbody>';
foreach ($context['member']['permissions']['general'] as $permission)
{
echo '
<tr>
<td class="windowbg" title="', $permission['id'], '">
', $permission['is_denied'] ? '<del>' . $permission['name'] . '</del>' : $permission['name'], '
</td>
<td class="windowbg2 smalltext">';
if ($permission['is_denied'])
echo '
<span class="alert">', $txt['showPermissions_denied'], ': ', implode(', ', $permission['groups']['denied']),'</span>';
else
echo '
', $txt['showPermissions_given'], ': ', implode(', ', $permission['groups']['allowed']);
echo '
</td>
</tr>';
}
echo '
</tbody>
</table>
</div><br />';
}
else
echo '
<p class="windowbg2 description">', $txt['showPermissions_none_general'], '</p>';
// Board permission section.
echo '
<div class="tborder">
<form action="' . $scripturl . '?action=profile;u=', $context['id_member'], ';area=permissions#board_permissions" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h3 class="catbg"><span class="ie6_header floatleft">
<a id="board_permissions"></a>', $txt['showPermissions_select'], ':
<select name="board" onchange="if (this.options[this.selectedIndex].value) this.form.submit();">
<option value="0"', $context['board'] == 0 ? ' selected="selected"' : '', '>', $txt['showPermissions_global'], ' </option>';
if (!empty($context['boards']))
echo '
<option value="" disabled="disabled">---------------------------</option>';
// Fill the box with any local permission boards.
foreach ($context['boards'] as $board)
echo '
<option value="', $board['id'], '"', $board['selected'] ? ' selected="selected"' : '', '>', $board['name'], ' (', $board['profile_name'], ')</option>';
echo '
</select></span>
</h3>
</div>
</form>';
if (!empty($context['member']['permissions']['board']))
{
echo '
<table class="table_grid" width="100%" cellspacing="0">
<thead>
<tr class="titlebg">
<th class="lefttext first_th" scope="col" width="50%">', $txt['showPermissions_permission'], '</th>
<th class="lefttext last_th" scope="col" width="50%">', $txt['showPermissions_status'], '</th>
</tr>
</thead>
<tbody>';
foreach ($context['member']['permissions']['board'] as $permission)
{
echo '
<tr>
<td class="windowbg" title="', $permission['id'], '">
', $permission['is_denied'] ? '<del>' . $permission['name'] . '</del>' : $permission['name'], '
</td>
<td class="windowbg2 smalltext">';
if ($permission['is_denied'])
{
echo '
<span class="alert">', $txt['showPermissions_denied'], ': ', implode(', ', $permission['groups']['denied']), '</span>';
}
else
{
echo '
', $txt['showPermissions_given'], ': ', implode(', ', $permission['groups']['allowed']);
}
echo '
</td>
</tr>';
}
echo '
</tbody>
</table>';
}
else
echo '
<p class="windowbg2 description">', $txt['showPermissions_none_board'], '</p>';
echo '
</div>
</div>';
}
}
// Template for user statistics, showing graphs and the like.
function template_statPanel()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
// First, show a few text statistics such as post/topic count.
echo '
<div id="profileview">
<div id="generalstats">
<div class="cat_bar">
<h3 class="catbg">
<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/stats_info.gif" alt="" class="icon" />
', $txt['statPanel_generalStats'], ' - ', $context['member']['name'], '
</span>
</h3>
</div>
<div class="windowbg2">
<span class="topslice"><span></span></span>
<div class="content">
<dl>
<dt>', $txt['statPanel_total_time_online'], ':</dt>
<dd>', $context['time_logged_in'], '</dd>
<dt>', $txt['statPanel_total_posts'], ':</dt>
<dd>', $context['num_posts'], ' ', $txt['statPanel_posts'], '</dd>
<dt>', $txt['statPanel_total_topics'], ':</dt>
<dd>', $context['num_topics'], ' ', $txt['statPanel_topics'], '</dd>
<dt>', $txt['statPanel_users_polls'], ':</dt>
<dd>', $context['num_polls'], ' ', $txt['statPanel_polls'], '</dd>
<dt>', $txt['statPanel_users_votes'], ':</dt>
<dd>', $context['num_votes'], ' ', $txt['statPanel_votes'], '</dd>
</dl>
</div>
<span class="botslice"><span></span></span>
</div>
</div>';
// This next section draws a graph showing what times of day they post the most.
echo '
<div id="activitytime" class="flow_hidden">
<div class="cat_bar">
<h3 class="catbg">
<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/stats_history.gif" alt="" class="icon" />', $txt['statPanel_activityTime'], '</span>
</h3>
</div>
<div class="windowbg2">
<span class="topslice"><span></span></span>
<div class="content">';