Profile.template.php 123 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013
  1. <?php
  2. /**
  3. * Simple Machines Forum (SMF)
  4. *
  5. * @package SMF
  6. * @author Simple Machines
  7. * @copyright 2011 Simple Machines
  8. * @license http://www.simplemachines.org/about/smf/license.php BSD
  9. *
  10. * @version 2.1 Alpha 1
  11. */
  12. // Template for the profile side bar - goes before any other profile template.
  13. function template_profile_above()
  14. {
  15. global $context, $settings, $options, $scripturl, $modSettings, $txt;
  16. echo '
  17. <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/profile.js"></script>';
  18. // Prevent Chrome from auto completing fields when viewing/editing other members profiles
  19. if (isBrowser('is_chrome') && !$context['user']['is_owner'])
  20. echo '
  21. <script type="text/javascript"><!-- // --><![CDATA[
  22. disableAutoComplete();
  23. // ]]></script>';
  24. // If an error occurred while trying to save previously, give the user a clue!
  25. echo '
  26. ', template_error_message();
  27. // If the profile was update successfully, let the user know this.
  28. if (!empty($context['profile_updated']))
  29. echo '
  30. <div class="infobox">
  31. ', $context['profile_updated'], '
  32. </div>';
  33. }
  34. // Template for closing off table started in profile_above.
  35. function template_profile_below()
  36. {
  37. }
  38. // This template displays users details without any option to edit them.
  39. function template_summary()
  40. {
  41. global $context, $settings, $options, $scripturl, $modSettings, $txt;
  42. // Display the basic information about the user
  43. echo '
  44. <div id="profileview" class="flow_auto">
  45. <div class="cat_bar">
  46. <h3 class="catbg">
  47. <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.png" alt="" class="icon" />', $txt['summary'], '</span>
  48. </h3>
  49. </div>
  50. <div id="basicinfo">
  51. <div class="windowbg">
  52. <span class="topslice"><span></span></span>
  53. <div class="content flow_auto">
  54. <div class="username"><h4>', $context['member']['name'], ' <span class="position">', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '</span></h4></div>
  55. ', $context['member']['avatar']['image'], '
  56. <ul class="reset">';
  57. // @TODO fix the <ul> when no fields are visible
  58. // What about if we allow email only via the forum??
  59. if ($context['member']['show_email'] === 'yes' || $context['member']['show_email'] === 'no_through_forum' || $context['member']['show_email'] === 'yes_permission_override' && $context['can_send_email'])
  60. echo '
  61. <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.png" alt="', $txt['email'], '" /></a></li>';
  62. // Don't show an icon if they haven't specified a website.
  63. if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website']))
  64. echo '
  65. <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.png" alt="' . $context['member']['website']['title'] . '" />' : $txt['www']), '</a></li>';
  66. // Are there any custom profile fields for the summary?
  67. if (!empty($context['custom_fields']))
  68. {
  69. foreach ($context['custom_fields'] as $field)
  70. if (($field['placement'] == 1 || empty($field['output_html'])) && !empty($field['value']))
  71. echo '
  72. <li class="custom_field">', $field['output_html'], '</li>';
  73. }
  74. echo '
  75. ', !isset($context['disabled_fields']['icq']) && !empty($context['member']['icq']['link']) ? '<li>' . $context['member']['icq']['link'] . '</li>' : '', '
  76. ', !isset($context['disabled_fields']['msn']) && !empty($context['member']['msn']['link']) ? '<li>' . $context['member']['msn']['link'] . '</li>' : '', '
  77. ', !isset($context['disabled_fields']['aim']) && !empty($context['member']['aim']['link']) ? '<li>' . $context['member']['aim']['link'] . '</li>' : '', '
  78. ', !isset($context['disabled_fields']['yim']) && !empty($context['member']['yim']['link']) ? '<li>' . $context['member']['yim']['link'] . '</li>' : '', '
  79. </ul>
  80. <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'] . '" class="centericon" />' : $context['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['text'] . '</span>' : '';
  81. // Can they add this member as a buddy?
  82. if (!empty($context['can_have_buddy']) && !$context['user']['is_owner'])
  83. echo '
  84. <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>';
  85. echo '
  86. </span>';
  87. echo '
  88. <p id="infolinks">';
  89. if (!$context['user']['is_owner'] && $context['can_send_pm'])
  90. echo '
  91. <a href="', $scripturl, '?action=pm;sa=send;u=', $context['id_member'], '">', $txt['profile_sendpm_short'], '</a><br />';
  92. echo '
  93. <a href="', $scripturl, '?action=profile;area=showposts;u=', $context['id_member'], '">', $txt['showPosts'], '</a><br />
  94. <a href="', $scripturl, '?action=profile;area=statistics;u=', $context['id_member'], '">', $txt['statPanel'], '</a>
  95. </p>';
  96. echo '
  97. </div>
  98. <span class="botslice"><span></span></span>
  99. </div>
  100. </div>
  101. <div id="detailedinfo">
  102. <div class="windowbg2">
  103. <span class="topslice"><span></span></span>
  104. <div class="content">
  105. <dl>';
  106. if ($context['user']['is_owner'] || $context['user']['is_admin'])
  107. echo '
  108. <dt>', $txt['username'], ': </dt>
  109. <dd>', $context['member']['username'], '</dd>';
  110. if (!isset($context['disabled_fields']['posts']))
  111. echo '
  112. <dt>', $txt['profile_posts'], ': </dt>
  113. <dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>';
  114. if ($context['can_send_email'])
  115. {
  116. // Only show the email address fully if it's not hidden - and we reveal the email.
  117. if ($context['member']['show_email'] == 'yes')
  118. echo '
  119. <dt>', $txt['email'], ': </dt>
  120. <dd><a href="', $scripturl, '?action=emailuser;sa=email;uid=', $context['member']['id'], '">', $context['member']['email'], '</a></dd>';
  121. // ... Or if the one looking at the profile is an admin they can see it anyway.
  122. elseif ($context['member']['show_email'] == 'yes_permission_override')
  123. echo '
  124. <dt>', $txt['email'], ': </dt>
  125. <dd><em><a href="', $scripturl, '?action=emailuser;sa=email;uid=', $context['member']['id'], '">', $context['member']['email'], '</a></em></dd>';
  126. }
  127. if (!empty($modSettings['titlesEnable']) && !empty($context['member']['title']))
  128. echo '
  129. <dt>', $txt['custom_title'], ': </dt>
  130. <dd>', $context['member']['title'], '</dd>';
  131. if (!empty($context['member']['blurb']))
  132. echo '
  133. <dt>', $txt['personal_text'], ': </dt>
  134. <dd>', $context['member']['blurb'], '</dd>';
  135. // If karma enabled show the members karma.
  136. if ($modSettings['karmaMode'] == '1')
  137. echo '
  138. <dt>', $modSettings['karmaLabel'], ' </dt>
  139. <dd>', ($context['member']['karma']['good'] - $context['member']['karma']['bad']), '</dd>';
  140. elseif ($modSettings['karmaMode'] == '2')
  141. echo '
  142. <dt>', $modSettings['karmaLabel'], ' </dt>
  143. <dd>+', $context['member']['karma']['good'], '/-', $context['member']['karma']['bad'], '</dd>';
  144. if (!isset($context['disabled_fields']['gender']) && !empty($context['member']['gender']['name']))
  145. echo '
  146. <dt>', $txt['gender'], ': </dt>
  147. <dd>', $context['member']['gender']['name'], '</dd>';
  148. echo '
  149. <dt>', $txt['age'], ':</dt>
  150. <dd>', $context['member']['age'] . ($context['member']['today_is_birthday'] ? ' &nbsp; <img src="' . $settings['images_url'] . '/cake.png" alt="" />' : ''), '</dd>';
  151. if (!isset($context['disabled_fields']['location']) && !empty($context['member']['location']))
  152. echo '
  153. <dt>', $txt['location'], ':</dt>
  154. <dd>', $context['member']['location'], '</dd>';
  155. echo '
  156. </dl>';
  157. // Any custom fields for standard placement?
  158. if (!empty($context['custom_fields']))
  159. {
  160. $shown = false;
  161. foreach ($context['custom_fields'] as $field)
  162. {
  163. if ($field['placement'] != 0 || empty($field['output_html']))
  164. continue;
  165. if (empty($shown))
  166. {
  167. echo '
  168. <dl>';
  169. $shown = true;
  170. }
  171. echo '
  172. <dt>', $field['name'], ':</dt>
  173. <dd>', $field['output_html'], '</dd>';
  174. }
  175. if (!empty($shown))
  176. echo '
  177. </dl>';
  178. }
  179. echo '
  180. <dl class="noborder">';
  181. // Can they view/issue a warning?
  182. if ($context['can_view_warning'] && $context['member']['warning'])
  183. {
  184. echo '
  185. <dt>', $txt['profile_warning_level'], ': </dt>
  186. <dd>
  187. <a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=', $context['can_issue_warning'] ? 'issuewarning' : 'viewwarning', '">', $context['member']['warning'], '%</a>';
  188. // Can we provide information on what this means?
  189. if (!empty($context['warning_status']))
  190. echo '
  191. <span class="smalltext">(', $context['warning_status'], ')</span>';
  192. echo '
  193. </dd>';
  194. }
  195. // Is this member requiring activation and/or banned?
  196. if (!empty($context['activate_message']) || !empty($context['member']['bans']))
  197. {
  198. // If the person looking at the summary has permission, and the account isn't activated, give the viewer the ability to do it themselves.
  199. if (!empty($context['activate_message']))
  200. echo '
  201. <dt class="clear"><span class="alert">', $context['activate_message'], '</span>&nbsp;(<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>';
  202. // If the current member is banned, show a message and possibly a link to the ban.
  203. if (!empty($context['member']['bans']))
  204. {
  205. echo '
  206. <dt class="clear"><span class="alert">', $txt['user_is_banned'], '</span>&nbsp;[<a href="#" onclick="document.getElementById(\'ban_info\').style.display = document.getElementById(\'ban_info\').style.display == \'none\' ? \'\' : \'none\';return false;">' . $txt['view_ban'] . '</a>]</dt>
  207. <dt class="clear" id="ban_info" style="display: none;">
  208. <strong>', $txt['user_banned_by_following'], ':</strong>';
  209. foreach ($context['member']['bans'] as $ban)
  210. echo '
  211. <br /><span class="smalltext">', $ban['explanation'], '</span>';
  212. echo '
  213. </dt>';
  214. }
  215. }
  216. echo '
  217. <dt>', $txt['date_registered'], ': </dt>
  218. <dd>', $context['member']['registered'], '</dd>';
  219. // If the person looking is allowed, they can check the members IP address and hostname.
  220. if ($context['can_see_ip'])
  221. {
  222. if (!empty($context['member']['ip']))
  223. echo '
  224. <dt>', $txt['ip'], ': </dt>
  225. <dd><a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['member']['ip'], ';u=', $context['member']['id'], '">', $context['member']['ip'], '</a></dd>';
  226. if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip']))
  227. echo '
  228. <dt>', $txt['hostname'], ': </dt>
  229. <dd>', $context['member']['hostname'], '</dd>';
  230. }
  231. echo '
  232. <dt>', $txt['local_time'], ':</dt>
  233. <dd>', $context['member']['local_time'], '</dd>';
  234. if (!empty($modSettings['userLanguage']) && !empty($context['member']['language']))
  235. echo '
  236. <dt>', $txt['language'], ':</dt>
  237. <dd>', $context['member']['language'], '</dd>';
  238. echo '
  239. <dt>', $txt['lastLoggedIn'], ': </dt>
  240. <dd>', $context['member']['last_login'], '</dd>
  241. </dl>';
  242. // Are there any custom profile fields for the summary?
  243. if (!empty($context['custom_fields']))
  244. {
  245. $shown = false;
  246. foreach ($context['custom_fields'] as $field)
  247. {
  248. if ($field['placement'] != 2 || empty($field['output_html']))
  249. continue;
  250. if (empty($shown))
  251. {
  252. $shown = true;
  253. echo '
  254. <div class="custom_fields_above_signature">
  255. <ul class="reset nolist">';
  256. }
  257. echo '
  258. <li>', $field['output_html'], '</li>';
  259. }
  260. if ($shown)
  261. echo '
  262. </ul>
  263. </div>';
  264. }
  265. // Show the users signature.
  266. if ($context['signature_enabled'] && !empty($context['member']['signature']))
  267. echo '
  268. <div class="signature">
  269. <h5>', $txt['signature'], ':</h5>
  270. ', $context['member']['signature'], '
  271. </div>';
  272. echo '
  273. </div>
  274. <span class="botslice"><span></span></span>
  275. </div>
  276. </div>
  277. <div class="clear"></div>
  278. </div>';
  279. }
  280. // Template for showing all the posts of the user, in chronological order.
  281. function template_showPosts()
  282. {
  283. global $context, $settings, $options, $scripturl, $modSettings, $txt;
  284. echo '
  285. <div class="cat_bar">
  286. <h3 class="catbg">
  287. ', (!isset($context['attachments']) && empty($context['is_topics']) ? $txt['showMessages'] : (!empty($context['is_topics']) ? $txt['showTopics'] : $txt['showAttachments'])), ' - ', $context['member']['name'], '
  288. </h3>
  289. </div>
  290. <div class="pagesection">
  291. <span>', $txt['pages'], ': ', $context['page_index'], '</span>
  292. </div>';
  293. // Button shortcuts
  294. $quote_button = create_button('quote.png', 'reply_quote', 'quote', 'class="centericon"');
  295. $reply_button = create_button('reply_sm.png', 'reply', 'reply', 'class="centericon"');
  296. $remove_button = create_button('delete.png', 'remove_message', 'remove', 'class="centericon"');
  297. $notify_button = create_button('notify_sm.png', 'notify_replies', 'notify', 'class="centericon"');
  298. // Are we displaying posts or attachments?
  299. if (!isset($context['attachments']))
  300. {
  301. // For every post to be displayed, give it its own div, and show the important details of the post.
  302. foreach ($context['posts'] as $post)
  303. {
  304. echo '
  305. <div class="topic">
  306. <div class="', $post['alternate'] == 0 ? 'windowbg2' : 'windowbg', ' core_posts">
  307. <span class="topslice"><span></span></span>
  308. <div class="content">
  309. <div class="counter">', $post['counter'], '</div>
  310. <div class="topic_details">
  311. <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>
  312. <span class="smalltext">&#171;&nbsp;<strong>', $txt['on'], ':</strong> ', $post['time'], '&nbsp;&#187;</span>
  313. </div>
  314. <div class="list_posts">';
  315. if (!$post['approved'])
  316. echo '
  317. <div class="approve_post">
  318. <em>', $txt['post_awaiting_approval'], '</em>
  319. </div>';
  320. echo '
  321. ', $post['body'], '
  322. </div>
  323. </div>';
  324. if ($post['can_reply'] || $post['can_mark_notify'] || $post['can_delete'])
  325. echo '
  326. <div class="floatright">
  327. <ul class="reset smalltext quickbuttons">';
  328. // If they *can* reply?
  329. if ($post['can_reply'])
  330. echo '
  331. <li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '" class="reply_button"><span>', $txt['reply'], '</span></a></li>';
  332. // If they *can* quote?
  333. if ($post['can_quote'])
  334. echo '
  335. <li><a href="', $scripturl . '?action=post;topic=', $post['topic'], '.', $post['start'], ';quote=', $post['id'], '" class="quote_button"><span>', $txt['quote'], '</span></a></li>';
  336. // Can we request notification of topics?
  337. if ($post['can_mark_notify'])
  338. echo '
  339. <li><a href="', $scripturl, '?action=notify;topic=', $post['topic'], '.', $post['start'], '" class="notify_button"><span>', $txt['notify'], '</span></a></li>';
  340. // How about... even... remove it entirely?!
  341. if ($post['can_delete'])
  342. echo '
  343. <li><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'], '?\');" class="remove_button"><span>', $txt['remove'], '</span></a></li>';
  344. if ($post['can_reply'] || $post['can_mark_notify'] || $post['can_delete'])
  345. echo '
  346. </ul>
  347. </div>';
  348. echo '
  349. <br class="clear" />
  350. <span class="botslice"><span></span></span>
  351. </div>
  352. </div>';
  353. }
  354. }
  355. else
  356. {
  357. echo '
  358. <table border="0" width="100%" cellspacing="1" cellpadding="2" class="table_grid" align="center">
  359. <thead>
  360. <tr class="titlebg">
  361. <th class="first_th lefttext" scope="col" width="25%">
  362. <a href="', $scripturl, '?action=profile;u=', $context['current_member'], ';area=showposts;sa=attach;sort=filename', ($context['sort_direction'] == 'down' && $context['sort_order'] == 'filename' ? ';asc' : ''), '">
  363. ', $txt['show_attach_filename'], '
  364. ', ($context['sort_order'] == 'filename' ? '<img src="' . $settings['images_url'] . '/sort_' . ($context['sort_direction'] == 'down' ? 'down' : 'up') . '.png" alt="" />' : ''), '
  365. </a>
  366. </th>
  367. <th scope="col" width="12%">
  368. <a href="', $scripturl, '?action=profile;u=', $context['current_member'], ';area=showposts;sa=attach;sort=downloads', ($context['sort_direction'] == 'down' && $context['sort_order'] == 'downloads' ? ';asc' : ''), '">
  369. ', $txt['show_attach_downloads'], '
  370. ', ($context['sort_order'] == 'downloads' ? '<img src="' . $settings['images_url'] . '/sort_' . ($context['sort_direction'] == 'down' ? 'down' : 'up') . '.png" alt="" />' : ''), '
  371. </a>
  372. </th>
  373. <th class="lefttext" scope="col" width="30%">
  374. <a href="', $scripturl, '?action=profile;u=', $context['current_member'], ';area=showposts;sa=attach;sort=subject', ($context['sort_direction'] == 'down' && $context['sort_order'] == 'subject' ? ';asc' : ''), '">
  375. ', $txt['message'], '
  376. ', ($context['sort_order'] == 'subject' ? '<img src="' . $settings['images_url'] . '/sort_' . ($context['sort_direction'] == 'down' ? 'down' : 'up') . '.png" alt="" />' : ''), '
  377. </a>
  378. </th>
  379. <th class="last_th lefttext" scope="col">
  380. <a href="', $scripturl, '?action=profile;u=', $context['current_member'], ';area=showposts;sa=attach;sort=posted', ($context['sort_direction'] == 'down' && $context['sort_order'] == 'posted' ? ';asc' : ''), '">
  381. ', $txt['show_attach_posted'], '
  382. ', ($context['sort_order'] == 'posted' ? '<img src="' . $settings['images_url'] . '/sort_' . ($context['sort_direction'] == 'down' ? 'down' : 'up') . '.png" alt="" />' : ''), '
  383. </a>
  384. </th>
  385. </tr>
  386. </thead>
  387. <tbody>';
  388. // Looks like we need to do all the attachments instead!
  389. $alternate = false;
  390. foreach ($context['attachments'] as $attachment)
  391. {
  392. echo '
  393. <tr class="', $attachment['approved'] ? ($alternate ? 'windowbg' : 'windowbg2') : 'approvebg', '">
  394. <td><a href="', $scripturl, '?action=dlattach;topic=', $attachment['topic'], '.0;attach=', $attachment['id'], '">', $attachment['filename'], '</a>', !$attachment['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : '', '</td>
  395. <td align="center">', $attachment['downloads'], '</td>
  396. <td><a href="', $scripturl, '?topic=', $attachment['topic'], '.msg', $attachment['msg'], '#msg', $attachment['msg'], '" rel="nofollow">', $attachment['subject'], '</a></td>
  397. <td>', $attachment['posted'], '</td>
  398. </tr>';
  399. $alternate = !$alternate;
  400. }
  401. // No posts? Just end the table with a informative message.
  402. if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts'])))
  403. echo '
  404. <tr>
  405. <td class="tborder windowbg2 padding centertext" colspan="4">
  406. ', isset($context['attachments']) ? $txt['show_attachments_none'] : ($context['is_topics'] ? $txt['show_topics_none'] : $txt['show_posts_none']), '
  407. </td>
  408. </tr>';
  409. echo '
  410. </tbody>
  411. </table>';
  412. }
  413. // Show more page numbers.
  414. echo '
  415. <div class="pagesection" style="margin-bottom: 0;">
  416. <span>', $txt['pages'], ': ', $context['page_index'], '</span>
  417. </div>';
  418. }
  419. // Template for showing all the buddies of the current user.
  420. function template_editBuddies()
  421. {
  422. global $context, $settings, $options, $scripturl, $modSettings, $txt;
  423. $disabled_fields = isset($modSettings['disabled_profile_fields']) ? array_flip(explode(',', $modSettings['disabled_profile_fields'])) : array();
  424. $buddy_fields = array('icq', 'aim', 'yim', 'msn');
  425. echo '
  426. <div class="title_bar">
  427. <h3 class="titlebg">
  428. <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/online.png" alt="" class="icon" />', $txt['editBuddies'], '</span>
  429. </h3>
  430. </div>
  431. <table border="0" width="100%" cellspacing="1" cellpadding="4" class="table_grid" align="center">
  432. <tr class="catbg">
  433. <th class="first_th" scope="col" width="20%">', $txt['name'], '</th>
  434. <th scope="col">', $txt['status'], '</th>';
  435. if ($context['can_send_email'])
  436. echo '
  437. <th scope="col">', $txt['email'], '</th>';
  438. // don't show them if they are disabled
  439. foreach ($buddy_fields as $key => $column)
  440. {
  441. if (!isset($disabled_fields[$column]))
  442. echo '
  443. <th scope="col">', $txt[$column], '</th>';
  444. }
  445. echo '
  446. <th class="last_th" scope="col"></th>
  447. </tr>';
  448. // If they don't have any buddies don't list them!
  449. if (empty($context['buddies']))
  450. echo '
  451. <tr class="windowbg2">
  452. <td colspan="8" align="center"><strong>', $txt['no_buddies'], '</strong></td>
  453. </tr>';
  454. // Now loop through each buddy showing info on each.
  455. $alternate = false;
  456. foreach ($context['buddies'] as $buddy)
  457. {
  458. echo '
  459. <tr class="', $alternate ? 'windowbg' : 'windowbg2', '">
  460. <td>', $buddy['link'], '</td>
  461. <td align="center"><a href="', $buddy['online']['href'], '"><img src="', $buddy['online']['image_href'], '" alt="', $buddy['online']['label'], '" title="', $buddy['online']['label'], '" /></a></td>';
  462. if ($context['can_send_email'])
  463. echo '
  464. <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.png" alt="' . $txt['email'] . '" title="' . $txt['email'] . ' ' . $buddy['name'] . '" /></a>'), '</td>';
  465. // If these are off, don't show them
  466. foreach ($buddy_fields as $key => $column)
  467. {
  468. if (!isset($disabled_fields[$column]))
  469. echo '
  470. <td align="center">', $buddy[$column]['link'], '</td>';
  471. }
  472. echo '
  473. <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.png" alt="', $txt['buddy_remove'], '" title="', $txt['buddy_remove'], '" /></a></td>
  474. </tr>';
  475. $alternate = !$alternate;
  476. }
  477. echo '
  478. </table>';
  479. // Add a new buddy?
  480. echo '
  481. <br />
  482. <form action="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=lists;sa=buddies" method="post" accept-charset="', $context['character_set'], '">
  483. <div class="tborder add_buddy">
  484. <div class="title_bar">
  485. <h3 class="titlebg">', $txt['buddy_add'], '</h3>
  486. </div>
  487. <span class="upperframe"><span></span></span>
  488. <div class="roundframe">
  489. <dl class="settings">
  490. <dt>
  491. <label for="new_buddy"><strong>', $txt['who_member'], ':</strong></label>
  492. </dt>
  493. <dd>
  494. <input type="text" name="new_buddy" id="new_buddy" size="30" class="input_text" />
  495. </dd>
  496. </dl>';
  497. if (!empty($context['token_check']))
  498. echo '
  499. <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '" />';
  500. echo '
  501. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  502. <input type="submit" value="', $txt['buddy_add_button'], '" class="button_submit" />
  503. <br class="clear_right" />
  504. </div>
  505. <span class="lowerframe"><span></span></span>
  506. </div>
  507. </form>
  508. <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?alp21"></script>
  509. <script type="text/javascript"><!-- // --><![CDATA[
  510. var oAddBuddySuggest = new smc_AutoSuggest({
  511. sSelf: \'oAddBuddySuggest\',
  512. sSessionId: smf_session_id,
  513. sSessionVar: smf_session_var,
  514. sSuggestId: \'new_buddy\',
  515. sControlId: \'new_buddy\',
  516. sSearchType: \'member\',
  517. sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
  518. bItemList: false
  519. });
  520. // ]]></script>';
  521. }
  522. // Template for showing the ignore list of the current user.
  523. function template_editIgnoreList()
  524. {
  525. global $context, $settings, $options, $scripturl, $modSettings, $txt;
  526. echo '
  527. <div class="title_bar">
  528. <h3 class="titlebg">
  529. <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.png" alt="" class="icon" />', $txt['editIgnoreList'], '</span>
  530. </h3>
  531. </div>
  532. <table border="0" width="100%" cellspacing="1" cellpadding="4" class="table_grid" align="center">
  533. <tr class="catbg">
  534. <th class="first_th" scope="col" width="20%">', $txt['name'], '</th>
  535. <th scope="col">', $txt['status'], '</th>';
  536. if ($context['can_send_email'])
  537. echo '
  538. <th scope="col">', $txt['email'], '</th>';
  539. echo '
  540. <th scope="col">', $txt['icq'], '</th>
  541. <th scope="col">', $txt['aim'], '</th>
  542. <th scope="col">', $txt['yim'], '</th>
  543. <th scope="col">', $txt['msn'], '</th>
  544. <th class="last_th" scope="col"></th>
  545. </tr>';
  546. // If they don't have anyone on their ignore list, don't list it!
  547. if (empty($context['ignore_list']))
  548. echo '
  549. <tr class="windowbg2">
  550. <td colspan="8" align="center"><strong>', $txt['no_ignore'], '</strong></td>
  551. </tr>';
  552. // Now loop through each buddy showing info on each.
  553. $alternate = false;
  554. foreach ($context['ignore_list'] as $member)
  555. {
  556. echo '
  557. <tr class="', $alternate ? 'windowbg' : 'windowbg2', '">
  558. <td>', $member['link'], '</td>
  559. <td align="center"><a href="', $member['online']['href'], '"><img src="', $member['online']['image_href'], '" alt="', $member['online']['label'], '" title="', $member['online']['label'], '" /></a></td>';
  560. if ($context['can_send_email'])
  561. echo '
  562. <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.png" alt="' . $txt['email'] . '" title="' . $txt['email'] . ' ' . $member['name'] . '" /></a>'), '</td>';
  563. echo '
  564. <td align="center">', $member['icq']['link'], '</td>
  565. <td align="center">', $member['aim']['link'], '</td>
  566. <td align="center">', $member['yim']['link'], '</td>
  567. <td align="center">', $member['msn']['link'], '</td>
  568. <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.png" alt="', $txt['ignore_remove'], '" title="', $txt['ignore_remove'], '" /></a></td>
  569. </tr>';
  570. $alternate = !$alternate;
  571. }
  572. echo '
  573. </table>';
  574. // Add to the ignore list?
  575. echo '
  576. <br />
  577. <form action="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=lists;sa=ignore" method="post" accept-charset="', $context['character_set'], '">
  578. <div class="tborder add_buddy">
  579. <div class="title_bar">
  580. <h3 class="titlebg">', $txt['ignore_add'], '</h3>
  581. </div>
  582. <span class="upperframe"><span></span></span>
  583. <div class="roundframe">
  584. <dl class="settings">
  585. <dt>
  586. <label for="new_buddy"><strong>', $txt['who_member'], ':</strong></label>
  587. </dt>
  588. <dd>
  589. <input type="text" name="new_ignore" id="new_ignore" size="25" class="input_text" />
  590. </dd>
  591. </dl>';
  592. if (!empty($context['token_check']))
  593. echo '
  594. <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '" />';
  595. echo '
  596. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  597. <input type="submit" value="', $txt['ignore_add_button'], '" class="button_submit" />
  598. <br class="clear_right" />
  599. </div>
  600. <span class="lowerframe"><span></span></span>
  601. </div>
  602. </form>
  603. <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?alp21"></script>
  604. <script type="text/javascript"><!-- // --><![CDATA[
  605. var oAddIgnoreSuggest = new smc_AutoSuggest({
  606. sSelf: \'oAddIgnoreSuggest\',
  607. sSessionId: \'', $context['session_id'], '\',
  608. sSessionVar: \'', $context['session_var'], '\',
  609. sSuggestId: \'new_ignore\',
  610. sControlId: \'new_ignore\',
  611. sSearchType: \'member\',
  612. sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
  613. bItemList: false
  614. });
  615. // ]]></script>';
  616. }
  617. // This template shows an admin information on a users IP addresses used and errors attributed to them.
  618. function template_trackActivity()
  619. {
  620. global $context, $settings, $options, $scripturl, $txt;
  621. // The first table shows IP information about the user.
  622. echo '
  623. <div class="title_bar">
  624. <h3 class="titlebg"><strong>', $txt['view_ips_by'], ' ', $context['member']['name'], '</strong></h3>
  625. </div>';
  626. // The last IP the user used.
  627. echo '
  628. <div id="tracking" class="windowbg2">
  629. <span class="topslice"><span></span></span>
  630. <div class="content">
  631. <dl class="noborder">
  632. <dt>', $txt['most_recent_ip'], ':
  633. ', (empty($context['last_ip2']) ? '' : '<br />
  634. <span class="smalltext">(<a href="' . $scripturl . '?action=helpadmin;help=whytwoip" onclick="return reqWin(this.href);">' . $txt['why_two_ip_address'] . '</a>)</span>'), '
  635. </dt>
  636. <dd>
  637. <a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip'], ';u=', $context['member']['id'], '">', $context['last_ip'], '</a>';
  638. // Second address detected?
  639. if (!empty($context['last_ip2']))
  640. echo '
  641. , <a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip2'], ';u=', $context['member']['id'], '">', $context['last_ip2'], '</a>';
  642. echo '
  643. </dd>';
  644. // Lists of IP addresses used in messages / error messages.
  645. echo '
  646. <dt>', $txt['ips_in_messages'], ':</dt>
  647. <dd>
  648. ', (count($context['ips']) > 0 ? implode(', ', $context['ips']) : '(' . $txt['none'] . ')'), '
  649. </dd>
  650. <dt>', $txt['ips_in_errors'], ':</dt>
  651. <dd>
  652. ', (count($context['ips']) > 0 ? implode(', ', $context['error_ips']) : '(' . $txt['none'] . ')'), '
  653. </dd>';
  654. // List any members that have used the same IP addresses as the current member.
  655. echo '
  656. <dt>', $txt['members_in_range'], ':</dt>
  657. <dd>
  658. ', (count($context['members_in_range']) > 0 ? implode(', ', $context['members_in_range']) : '(' . $txt['none'] . ')'), '
  659. </dd>
  660. </dl>
  661. </div>
  662. <span class="botslice"><span></span></span>
  663. </div>
  664. <br class="clear" />';
  665. // Show the track user list.
  666. template_show_list('track_user_list');
  667. }
  668. // The template for trackIP, allowing the admin to see where/who a certain IP has been used.
  669. function template_trackIP()
  670. {
  671. global $context, $settings, $options, $scripturl, $txt;
  672. // This function always defaults to the last IP used by a member but can be set to track any IP.
  673. // The first table in the template gives an input box to allow the admin to enter another IP to track.
  674. echo '
  675. <div class="tborder">
  676. <div class="cat_bar">
  677. <h3 class="catbg">', $txt['trackIP'], '</h3>
  678. </div>
  679. <span class="upperframe"><span></span></span>
  680. <div class="roundframe">
  681. <form action="', $context['base_url'], '" method="post" accept-charset="', $context['character_set'], '">
  682. <dl class="settings">
  683. <dt>
  684. <label for="searchip"><strong>', $txt['enter_ip'], ':</strong></label>
  685. </dt>
  686. <dd>
  687. <input type="text" name="searchip" value="', $context['ip'], '" class="input_text" />
  688. </dd>
  689. </dl>
  690. <input type="submit" value="', $txt['trackIP'], '" class="button_submit" />
  691. <br class="clear_right" />
  692. </form>
  693. </div>
  694. <span class="lowerframe"><span></span></span>
  695. </div>
  696. <br class="clear" />';
  697. // The table inbetween the first and second table shows links to the whois server for every region.
  698. if ($context['single_ip'])
  699. {
  700. echo '
  701. <div class="title_bar">
  702. <h3 class="titlebg">', $txt['whois_title'], ' ', $context['ip'], '</h3>
  703. </div>
  704. <div class="windowbg2">
  705. <span class="topslice"><span></span></span>
  706. <div class="padding">';
  707. foreach ($context['whois_servers'] as $server)
  708. echo '
  709. <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 />';
  710. echo '
  711. </div>
  712. <span class="botslice"><span></span></span>
  713. </div>
  714. <br class="clear" />';
  715. }
  716. // The second table lists all the members who have been logged as using this IP address.
  717. echo '
  718. <div class="title_bar">
  719. <h3 class="titlebg">', $txt['members_from_ip'], ' ', $context['ip'], '</h3>
  720. </div>';
  721. if (empty($context['ips']))
  722. echo '
  723. <p class="windowbg2 description"><em>', $txt['no_members_from_ip'], '</em></p>';
  724. else
  725. {
  726. echo '
  727. <table class="table_grid" cellspacing="0" width="100%">
  728. <thead>
  729. <tr class="catbg">
  730. <th class="first_th" scope="col">', $txt['ip_address'], '</th>
  731. <th class="last_th" scope="col">', $txt['display_name'], '</th>
  732. </tr>
  733. </thead>
  734. <tbody>';
  735. // Loop through each of the members and display them.
  736. foreach ($context['ips'] as $ip => $memberlist)
  737. echo '
  738. <tr>
  739. <td class="windowbg2"><a href="', $context['base_url'], ';searchip=', $ip, '">', $ip, '</a></td>
  740. <td class="windowbg2">', implode(', ', $memberlist), '</td>
  741. </tr>';
  742. echo '
  743. </tbody>
  744. </table>
  745. <br />';
  746. }
  747. template_show_list('track_message_list');
  748. echo '<br />';
  749. template_show_list('track_user_list');
  750. }
  751. function template_showPermissions()
  752. {
  753. global $context, $settings, $options, $scripturl, $txt;
  754. echo '
  755. <div class="cat_bar">
  756. <h3 class="catbg">
  757. <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.png" alt="" class="icon" />', $txt['showPermissions'], '</span>
  758. </h3>
  759. </div>';
  760. if ($context['member']['has_all_permissions'])
  761. {
  762. echo '
  763. <p class="windowbg description">', $txt['showPermissions_all'], '</p>';
  764. }
  765. else
  766. {
  767. echo '
  768. <p class="description">',$txt['showPermissions_help'],'</p>
  769. <div id="permissions" class="flow_hidden">';
  770. if (!empty($context['no_access_boards']))
  771. {
  772. echo '
  773. <div class="cat_bar">
  774. <h3 class="catbg">', $txt['showPermissions_restricted_boards'], '</h3>
  775. </div>
  776. <div class="windowbg smalltext">
  777. <span class="topslice"><span></span></span>
  778. <div class="content">', $txt['showPermissions_restricted_boards_desc'], ':<br />';
  779. foreach ($context['no_access_boards'] as $no_access_board)
  780. echo '
  781. <a href="', $scripturl, '?board=', $no_access_board['id'], '.0">', $no_access_board['name'], '</a>', $no_access_board['is_last'] ? '' : ', ';
  782. echo '
  783. </div>
  784. <span class="botslice"><span></span></span>
  785. </div>';
  786. }
  787. // General Permissions section.
  788. echo '
  789. <div class="tborder">
  790. <div class="cat_bar">
  791. <h3 class="catbg">', $txt['showPermissions_general'], '</h3>
  792. </div>';
  793. if (!empty($context['member']['permissions']['general']))
  794. {
  795. echo '
  796. <table class="table_grid" width="100%" cellspacing="0">
  797. <thead>
  798. <tr class="titlebg">
  799. <th class="lefttext first_th" scope="col" width="50%">', $txt['showPermissions_permission'], '</th>
  800. <th class="lefttext last_th" scope="col" width="50%">', $txt['showPermissions_status'], '</th>
  801. </tr>
  802. </thead>
  803. <tbody>';
  804. foreach ($context['member']['permissions']['general'] as $permission)
  805. {
  806. echo '
  807. <tr>
  808. <td class="windowbg" title="', $permission['id'], '">
  809. ', $permission['is_denied'] ? '<del>' . $permission['name'] . '</del>' : $permission['name'], '
  810. </td>
  811. <td class="windowbg2 smalltext">';
  812. if ($permission['is_denied'])
  813. echo '
  814. <span class="alert">', $txt['showPermissions_denied'], ':&nbsp;', implode(', ', $permission['groups']['denied']),'</span>';
  815. else
  816. echo '
  817. ', $txt['showPermissions_given'], ':&nbsp;', implode(', ', $permission['groups']['allowed']);
  818. echo '
  819. </td>
  820. </tr>';
  821. }
  822. echo '
  823. </tbody>
  824. </table>
  825. </div><br />';
  826. }
  827. else
  828. echo '
  829. <p class="windowbg2 description">', $txt['showPermissions_none_general'], '</p>';
  830. // Board permission section.
  831. echo '
  832. <div class="tborder">
  833. <form action="' . $scripturl . '?action=profile;u=', $context['id_member'], ';area=permissions#board_permissions" method="post" accept-charset="', $context['character_set'], '">
  834. <div class="cat_bar">
  835. <h3 class="catbg"><span class="ie6_header floatleft">
  836. <a id="board_permissions"></a>', $txt['showPermissions_select'], ':
  837. <select name="board" onchange="if (this.options[this.selectedIndex].value) this.form.submit();">
  838. <option value="0"', $context['board'] == 0 ? ' selected="selected"' : '', '>', $txt['showPermissions_global'], '&nbsp;</option>';
  839. if (!empty($context['boards']))
  840. echo '
  841. <option value="" disabled="disabled">---------------------------</option>';
  842. // Fill the box with any local permission boards.
  843. foreach ($context['boards'] as $board)
  844. echo '
  845. <option value="', $board['id'], '"', $board['selected'] ? ' selected="selected"' : '', '>', $board['name'], ' (', $board['profile_name'], ')</option>';
  846. echo '
  847. </select></span>
  848. </h3>
  849. </div>
  850. </form>';
  851. if (!empty($context['member']['permissions']['board']))
  852. {
  853. echo '
  854. <table class="table_grid" width="100%" cellspacing="0">
  855. <thead>
  856. <tr class="titlebg">
  857. <th class="lefttext first_th" scope="col" width="50%">', $txt['showPermissions_permission'], '</th>
  858. <th class="lefttext last_th" scope="col" width="50%">', $txt['showPermissions_status'], '</th>
  859. </tr>
  860. </thead>
  861. <tbody>';
  862. foreach ($context['member']['permissions']['board'] as $permission)
  863. {
  864. echo '
  865. <tr>
  866. <td class="windowbg" title="', $permission['id'], '">
  867. ', $permission['is_denied'] ? '<del>' . $permission['name'] . '</del>' : $permission['name'], '
  868. </td>
  869. <td class="windowbg2 smalltext">';
  870. if ($permission['is_denied'])
  871. {
  872. echo '
  873. <span class="alert">', $txt['showPermissions_denied'], ':&nbsp;', implode(', ', $permission['groups']['denied']), '</span>';
  874. }
  875. else
  876. {
  877. echo '
  878. ', $txt['showPermissions_given'], ': &nbsp;', implode(', ', $permission['groups']['allowed']);
  879. }
  880. echo '
  881. </td>
  882. </tr>';
  883. }
  884. echo '
  885. </tbody>
  886. </table>';
  887. }
  888. else
  889. echo '
  890. <p class="windowbg2 description">', $txt['showPermissions_none_board'], '</p>';
  891. echo '
  892. </div>
  893. </div>';
  894. }
  895. }
  896. // Template for user statistics, showing graphs and the like.
  897. function template_statPanel()
  898. {
  899. global $context, $settings, $options, $scripturl, $modSettings, $txt;
  900. // First, show a few text statistics such as post/topic count.
  901. echo '
  902. <div id="profileview">
  903. <div id="generalstats">
  904. <div class="cat_bar">
  905. <h3 class="catbg">
  906. <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/stats_info.png" alt="" class="icon" />
  907. ', $txt['statPanel_generalStats'], ' - ', $context['member']['name'], '
  908. </span>
  909. </h3>
  910. </div>
  911. <div class="windowbg2">
  912. <span class="topslice"><span></span></span>
  913. <div class="content">
  914. <dl>
  915. <dt>', $txt['statPanel_total_time_online'], ':</dt>
  916. <dd>', $context['time_logged_in'], '</dd>
  917. <dt>', $txt['statPanel_total_posts'], ':</dt>
  918. <dd>', $context['num_posts'], ' ', $txt['statPanel_posts'], '</dd>
  919. <dt>', $txt['statPanel_total_topics'], ':</dt>
  920. <dd>', $context['num_topics'], ' ', $txt['statPanel_topics'], '</dd>
  921. <dt>', $txt['statPanel_users_polls'], ':</dt>
  922. <dd>', $context['num_polls'], ' ', $txt['statPanel_polls'], '</dd>
  923. <dt>', $txt['statPanel_users_votes'], ':</dt>
  924. <dd>', $context['num_votes'], ' ', $txt['statPanel_votes'], '</dd>
  925. </dl>
  926. </div>
  927. <span class="botslice"><span></span></span>
  928. </div>
  929. </div>';
  930. // This next section draws a graph showing what times of day they post the most.
  931. echo '
  932. <div id="activitytime" class="flow_hidden">
  933. <div class="cat_bar">
  934. <h3 class="catbg">
  935. <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/stats_history.png" alt="" class="icon" />', $txt['statPanel_activityTime'], '</span>
  936. </h3>
  937. </div>
  938. <div class="windowbg2">
  939. <span class="topslice"><span></span></span>
  940. <div class="content">';
  941. // If they haven't post at all, don't draw the graph.
  942. if (empty($context['posts_by_time']))
  943. echo '
  944. <span class="centertext">', $txt['statPanel_noPosts'], '</span>';
  945. // Otherwise do!
  946. else
  947. {
  948. echo '
  949. <ul class="activity_stats flow_hidden">';
  950. // The labels.
  951. foreach ($context['posts_by_time'] as $time_of_day)
  952. {
  953. echo '
  954. <li', $time_of_day['is_last'] ? ' class="last"' : '', '>
  955. <div class="bar" style="padding-top: ', ((int) (100 - $time_of_day['relative_percent'])), 'px;" title="', sprintf($txt['statPanel_activityTime_posts'], $time_of_day['posts'], $time_of_day['posts_percent']), '">
  956. <div style="height: ', (int) $time_of_day['relative_percent'], 'px;">
  957. <span>', sprintf($txt['statPanel_activityTime_posts'], $time_of_day['posts'], $time_of_day['posts_percent']), '</span>
  958. </div>
  959. </div>
  960. <span class="stats_hour">', $time_of_day['hour_format'], '</span>
  961. </li>';
  962. }
  963. echo '
  964. </ul>';
  965. }
  966. echo '
  967. <span class="clear" />
  968. </div>
  969. <span class="botslice"><span></span></span>
  970. </div>
  971. </div>';
  972. // Two columns with the most popular boards by posts and activity (activity = users posts / total posts).
  973. echo '
  974. <div class="flow_hidden">
  975. <div id="popularposts">
  976. <div class="cat_bar">
  977. <h3 class="catbg">
  978. <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/stats_replies.png" alt="" class="icon" />', $txt['statPanel_topBoards'], '</span>
  979. </h3>
  980. </div>
  981. <div class="windowbg2">
  982. <span class="topslice"><span></span></span>
  983. <div class="content">';
  984. if (empty($context['popular_boards']))
  985. echo '
  986. <span class="centertext">', $txt['statPanel_noPosts'], '</span>';
  987. else
  988. {
  989. echo '
  990. <dl>';
  991. // Draw a bar for every board.
  992. foreach ($context['popular_boards'] as $board)
  993. {
  994. echo '
  995. <dt>', $board['link'], '</dt>
  996. <dd>
  997. <div class="profile_pie" style="background-position: -', ((int) ($board['posts_percent'] / 5) * 20), 'px 0;" title="', sprintf($txt['statPanel_topBoards_memberposts'], $board['posts'], $board['total_posts_member'], $board['posts_percent']), '">
  998. ', sprintf($txt['statPanel_topBoards_memberposts'], $board['posts'], $board['total_posts_member'], $board['posts_percent']), '
  999. </div>
  1000. <span>', empty($context['hide_num_posts']) ? $board['posts'] : '', '</span>
  1001. </dd>';
  1002. }
  1003. echo '
  1004. </dl>';
  1005. }
  1006. echo '
  1007. </div>
  1008. <span class="botslice"><span></span></span>
  1009. </div>
  1010. </div>';
  1011. echo '
  1012. <div id="popularactivity">
  1013. <div class="cat_bar">
  1014. <h3 class="catbg">
  1015. <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/stats_replies.png" alt="" class="icon" />', $txt['statPanel_topBoardsActivity'], '</span>
  1016. </h3>
  1017. </div>
  1018. <div class="windowbg2">
  1019. <span class="topslice"><span></span></span>
  1020. <div class="content">';
  1021. if (empty($context['board_activity']))
  1022. echo '
  1023. <span>', $txt['statPanel_noPosts'], '</span>';
  1024. else
  1025. {
  1026. echo '
  1027. <dl>';
  1028. // Draw a bar for every board.
  1029. foreach ($context['board_activity'] as $activity)
  1030. {
  1031. echo '
  1032. <dt>', $activity['link'], '</dt>
  1033. <dd>
  1034. <div class="profile_pie" style="background-position: -', ((int) ($activity['percent'] / 5) * 20), 'px 0;" title="', sprintf($txt['statPanel_topBoards_posts'], $activity['posts'], $activity['total_posts'], $activity['posts_percent']), '">
  1035. ', sprintf($txt['statPanel_topBoards_posts'], $activity['posts'], $activity['total_posts'], $activity['posts_percent']), '
  1036. </div>
  1037. <span>', $activity['percent'], '%</span>
  1038. </dd>';
  1039. }
  1040. echo '
  1041. </dl>';
  1042. }
  1043. echo '
  1044. </div>
  1045. <span class="botslice"><span></span></span>
  1046. </div>
  1047. </div>
  1048. </div>';
  1049. echo '
  1050. </div>
  1051. <br class="clear" />';
  1052. }
  1053. // Template for editing profile options.
  1054. function template_edit_options()
  1055. {
  1056. global $context, $settings, $options, $scripturl, $modSettings, $txt;
  1057. // The main header!
  1058. echo '
  1059. <form action="', (!empty($context['profile_custom_submit_url']) ? $context['profile_custom_submit_url'] : $scripturl . '?action=profile;area=' . $context['menu_item_selected'] . ';u=' . $context['id_member']), '" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator" enctype="multipart/form-data" onsubmit="return checkProfileSubmit();">
  1060. <div class="cat_bar">
  1061. <h3 class="catbg">
  1062. <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.png" alt="" class="icon" />';
  1063. // Don't say "Profile" if this isn't the profile...
  1064. if (!empty($context['profile_header_text']))
  1065. echo '
  1066. ', $context['profile_header_text'];
  1067. else
  1068. echo '
  1069. ', $txt['profile'];
  1070. echo '
  1071. </span>
  1072. </h3>
  1073. </div>';
  1074. // Have we some description?
  1075. if ($context['page_desc'])
  1076. echo '
  1077. <p class="windowbg description">', $context['page_desc'], '</p>';
  1078. echo '
  1079. <div class="windowbg2">
  1080. <span class="topslice"><span></span></span>
  1081. <div class="content">';
  1082. // Any bits at the start?
  1083. if (!empty($context['profile_prehtml']))
  1084. echo '
  1085. <div>', $context['profile_prehtml'], '</div>';
  1086. if (!empty($context['profile_fields']))
  1087. echo '
  1088. <dl>';
  1089. // Start the big old loop 'of love.
  1090. $lastItem = 'hr';
  1091. foreach ($context['profile_fields'] as $key => $field)
  1092. {
  1093. // We add a little hack to be sure we never get more than one hr in a row!
  1094. if ($lastItem == 'hr' && $field['type'] == 'hr')
  1095. continue;
  1096. $lastItem = $field['type'];
  1097. if ($field['type'] == 'hr')
  1098. {
  1099. echo '
  1100. </dl>
  1101. <hr width="100%" size="1" class="hrcolor clear" />
  1102. <dl>';
  1103. }
  1104. elseif ($field['type'] == 'callback')
  1105. {
  1106. if (isset($field['callback_func']) && function_exists('template_profile_' . $field['callback_func']))
  1107. {
  1108. $callback_func = 'template_profile_' . $field['callback_func'];
  1109. $callback_func();
  1110. }
  1111. }
  1112. else
  1113. {
  1114. echo '
  1115. <dt>
  1116. <strong', !empty($field['is_error']) ? ' class="error"' : '', '>', $field['type'] !== 'label' ? '<label for="' . $key . '">' : '', $field['label'], $field['type'] !== 'label' ? '</label>' : '', '</strong>';
  1117. // Does it have any subtext to show?
  1118. if (!empty($field['subtext']))
  1119. echo '
  1120. <br />
  1121. <span class="smalltext">', $field['subtext'], '</span>';
  1122. echo '
  1123. </dt>
  1124. <dd>';
  1125. // Want to put something infront of the box?
  1126. if (!empty($field['preinput']))
  1127. echo '
  1128. ', $field['preinput'];
  1129. // What type of data are we showing?
  1130. if ($field['type'] == 'label')
  1131. echo '
  1132. ', $field['value'];
  1133. // Maybe it's a text box - very likely!
  1134. elseif (in_array($field['type'], array('int', 'float', 'text', 'password')))
  1135. echo '
  1136. <input type="', $field['type'] == 'password' ? 'password' : 'text', '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" ', $field['input_attr'], ' class="input_', $field['type'] == 'password' ? 'password' : 'text', '" />';
  1137. // You "checking" me out? ;)
  1138. elseif ($field['type'] == 'check')
  1139. echo '
  1140. <input type="hidden" name="', $key, '" value="0" /><input type="checkbox" name="', $key, '" id="', $key, '" ', !empty($field['value']) ? ' checked="checked"' : '', ' value="1" class="input_check" ', $field['input_attr'], ' />';
  1141. // Always fun - select boxes!
  1142. elseif ($field['type'] == 'select')
  1143. {
  1144. echo '
  1145. <select name="', $key, '" id="', $key, '">';
  1146. if (isset($field['options']))
  1147. {
  1148. // Is this some code to generate the options?
  1149. if (!is_array($field['options']))
  1150. $field['options'] = eval($field['options']);
  1151. // Assuming we now have some!
  1152. if (is_array($field['options']))
  1153. foreach ($field['options'] as $value => $name)
  1154. echo '
  1155. <option value="', $value, '" ', $value == $field['value'] ? 'selected="selected"' : '', '>', $name, '</option>';
  1156. }
  1157. echo '
  1158. </select>';
  1159. }
  1160. // Something to end with?
  1161. if (!empty($field['postinput']))
  1162. echo '
  1163. ', $field['postinput'];
  1164. echo '
  1165. </dd>';
  1166. }
  1167. }
  1168. if (!empty($context['profile_fields']))
  1169. echo '
  1170. </dl>';
  1171. // Are there any custom profile fields - if so print them!
  1172. if (!empty($context['custom_fields']))
  1173. {
  1174. if ($lastItem != 'hr')
  1175. echo '
  1176. <hr width="100%" size="1" class="hrcolor clear" />';
  1177. echo '
  1178. <dl>';
  1179. foreach ($context['custom_fields'] as $field)
  1180. {
  1181. echo '
  1182. <dt>
  1183. <strong>', $field['name'], ': </strong><br />
  1184. <span class="smalltext">', $field['desc'], '</span>
  1185. </dt>
  1186. <dd>
  1187. ', $field['input_html'], '
  1188. </dd>';
  1189. }
  1190. echo '
  1191. </dl>';
  1192. }
  1193. // Any closing HTML?
  1194. if (!empty($context['profile_posthtml']))
  1195. echo '
  1196. <div>', $context['profile_posthtml'], '</div>';
  1197. // Only show the password box if it's actually needed.
  1198. if ($context['require_password'])
  1199. echo '
  1200. <dl>
  1201. <dt>
  1202. <strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '><label for="oldpasswrd">', $txt['current_password'], ': </label></strong><br />
  1203. <span class="smalltext">', $txt['required_security_reasons'], '</span>
  1204. </dt>
  1205. <dd>
  1206. <input type="password" name="oldpasswrd" id="oldpasswrd" size="20" style="margin-right: 4ex;" class="input_password" />
  1207. </dd>
  1208. </dl>';
  1209. echo '
  1210. <hr class="hrcolor" />';
  1211. // The button shouldn't say "Change profile" unless we're changing the profile...
  1212. if (!empty($context['submit_button_text']))
  1213. echo '
  1214. <input type="submit" name="save" value="', $context['submit_button_text'], '" class="button_submit" />';
  1215. else
  1216. echo '
  1217. <input type="submit" name="save" value="', $txt['change_profile'], '" class="button_submit" />';
  1218. if (!empty($context['token_check']))
  1219. echo '
  1220. <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '" />';
  1221. echo '
  1222. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  1223. <input type="hidden" name="u" value="', $context['id_member'], '" />
  1224. <input type="hidden" name="sa" value="', $context['menu_item_selected'], '" />
  1225. <br class="clear_right" />
  1226. </div>
  1227. <span class="botslice"><span></span></span>
  1228. </div>
  1229. <br />
  1230. </form>';
  1231. // Some javascript!
  1232. echo '
  1233. <script type="text/javascript"><!-- // --><![CDATA[
  1234. function checkProfileSubmit()
  1235. {';
  1236. // If this part requires a password, make sure to give a warning.
  1237. if ($context['require_password'])
  1238. echo '
  1239. // Did you forget to type your password?
  1240. if (document.forms.creator.oldpasswrd.value == "")
  1241. {
  1242. alert("', $txt['required_security_reasons'], '");
  1243. return false;
  1244. }';
  1245. // Any onsubmit javascript?
  1246. if (!empty($context['profile_onsubmit_javascript']))
  1247. echo '
  1248. ', $context['profile_javascript'];
  1249. echo '
  1250. }';
  1251. // Any totally custom stuff?
  1252. if (!empty($context['profile_javascript']))
  1253. echo '
  1254. ', $context['profile_javascript'];
  1255. echo '
  1256. // ]]></script>';
  1257. // Any final spellchecking stuff?
  1258. if (!empty($context['show_spellchecking']))
  1259. echo '
  1260. <form name="spell_form" id="spell_form" method="post" accept-charset="', $context['character_set'], '" target="spellWindow" action="', $scripturl, '?action=spellcheck"><input type="hidden" name="spellstring" value="" /></form>';
  1261. }
  1262. // Personal Message settings.
  1263. function template_profile_pm_settings()
  1264. {
  1265. global $context, $settings, $options, $scripturl, $modSettings, $txt;
  1266. echo '
  1267. <dt>
  1268. <label for="pm_prefs">', $txt['pm_display_mode'], ':</label>
  1269. </dt>
  1270. <dd>
  1271. <select name="pm_prefs" id="pm_prefs" onchange="if (this.value == 2 &amp;&amp; !document.getElementById(\'copy_to_outbox\').checked) alert(\'', $txt['pm_recommend_enable_outbox'], '\');">
  1272. <option value="0"', $context['display_mode'] == 0 ? ' selected="selected"' : '', '>', $txt['pm_display_mode_all'], '</option>
  1273. <option value="1"', $context['display_mode'] == 1 ? ' selected="selected"' : '', '>', $txt['pm_display_mode_one'], '</option>
  1274. <option value="2"', $context['display_mode'] == 2 ? ' selected="selected"' : '', '>', $txt['pm_display_mode_linked'], '</option>
  1275. </select>
  1276. </dd>
  1277. <dt>
  1278. <label for="view_newest_pm_first">', $txt['recent_pms_at_top'], '</label>
  1279. </dt>
  1280. <dd>
  1281. <input type="hidden" name="default_options[view_newest_pm_first]" value="0" />
  1282. <input type="checkbox" name="default_options[view_newest_pm_first]" id="view_newest_pm_first" value="1"', !empty($context['member']['options']['view_newest_pm_first']) ? ' checked="checked"' : '', ' class="input_check" />
  1283. </dd>
  1284. </dl>
  1285. <hr />
  1286. <dl>
  1287. <dt>
  1288. <label for="pm_receive_from">', $txt['pm_receive_from'], '</label>
  1289. </dt>
  1290. <dd>
  1291. <select name="pm_receive_from" id="pm_receive_from">
  1292. <option value="0"', empty($context['receive_from']) || (empty($modSettings['enable_buddylist']) && $context['receive_from'] < 3) ? ' selected="selected"' : '', '>', $txt['pm_receive_from_everyone'], '</option>';
  1293. if (!empty($modSettings['enable_buddylist']))
  1294. echo '
  1295. <option value="1"', !empty($context['receive_from']) && $context['receive_from'] == 1 ? ' selected="selected"' : '', '>', $txt['pm_receive_from_ignore'], '</option>
  1296. <option value="2"', !empty($context['receive_from']) && $context['receive_from'] == 2 ? ' selected="selected"' : '', '>', $txt['pm_receive_from_buddies'], '</option>';
  1297. echo '
  1298. <option value="3"', !empty($context['receive_from']) && $context['receive_from'] > 2 ? ' selected="selected"' : '', '>', $txt['pm_receive_from_admins'], '</option>
  1299. </select>
  1300. </dd>
  1301. <dt>
  1302. <label for="pm_email_notify">', $txt['email_notify'], '</label>
  1303. </dt>
  1304. <dd>
  1305. <select name="pm_email_notify" id="pm_email_notify">
  1306. <option value="0"', empty($context['send_email']) ? ' selected="selected"' : '', '>', $txt['email_notify_never'], '</option>
  1307. <option value="1"', !empty($context['send_email']) && ($context['send_email'] == 1 || (empty($modSettings['enable_buddylist']) && $context['send_email'] > 1)) ? ' selected="selected"' : '', '>', $txt['email_notify_always'], '</option>';
  1308. if (!empty($modSettings['enable_buddylist']))
  1309. echo '
  1310. <option value="2"', !empty($context['send_email']) && $context['send_email'] > 1 ? ' selected="selected"' : '', '>', $txt['email_notify_buddies'], '</option>';
  1311. echo '
  1312. </select>
  1313. </dd>
  1314. <dt>
  1315. <label for="popup_messages">', $txt['popup_messages'], '</label>
  1316. </dt>
  1317. <dd>
  1318. <input type="hidden" name="default_options[popup_messages]" value="0" />
  1319. <input type="checkbox" name="default_options[popup_messages]" id="popup_messages" value="1"', !empty($context['member']['options']['popup_messages']) ? ' checked="checked"' : '', ' class="input_check" />
  1320. </dd>
  1321. </dl>
  1322. <hr />
  1323. <dl>
  1324. <dt>
  1325. <label for="copy_to_outbox"> ', $txt['copy_to_outbox'], '</label>
  1326. </dt>
  1327. <dd>
  1328. <input type="hidden" name="default_options[copy_to_outbox]" value="0" />
  1329. <input type="checkbox" name="default_options[copy_to_outbox]" id="copy_to_outbox" value="1"', !empty($context['member']['options']['copy_to_outbox']) ? ' checked="checked"' : '', ' class="input_check" />
  1330. </dd>
  1331. <dt>
  1332. <label for="pm_remove_inbox_label">', $txt['pm_remove_inbox_label'], '</label>
  1333. </dt>
  1334. <dd>
  1335. <input type="hidden" name="default_options[pm_remove_inbox_label]" value="0" />
  1336. <input type="checkbox" name="default_options[pm_remove_inbox_label]" id="pm_remove_inbox_label" value="1"', !empty($context['member']['options']['pm_remove_inbox_label']) ? ' checked="checked"' : '', ' class="input_check" />
  1337. </dd>';
  1338. }
  1339. // Template for showing theme settings. Note: template_options() actually adds the theme specific options.
  1340. function template_profile_theme_settings()
  1341. {
  1342. global $context, $settings, $options, $scripturl, $modSettings, $txt;
  1343. echo '
  1344. <dt>
  1345. <label for="show_board_desc">', $txt['board_desc_inside'], '</label>
  1346. </dt>
  1347. <dd>
  1348. <input type="hidden" name="default_options[show_board_desc]" value="0" />
  1349. <input type="checkbox" name="default_options[show_board_desc]" id="show_board_desc" value="1"', !empty($context['member']['options']['show_board_desc']) ? ' checked="checked"' : '', ' class="input_check" />
  1350. </dd>
  1351. <dt>
  1352. <label for="show_children">', $txt['show_children'], '</label>
  1353. </dt>
  1354. <dd>
  1355. <input type="hidden" name="default_options[show_children]" value="0" />
  1356. <input type="checkbox" name="default_options[show_children]" id="show_children" value="1"', !empty($context['member']['options']['show_children']) ? ' checked="checked"' : '', ' class="input_check" />
  1357. </dd>
  1358. <dt>
  1359. <label for="use_sidebar_menu">', $txt['use_sidebar_menu'], '</label>
  1360. </dt>
  1361. <dd>
  1362. <input type="hidden" name="default_options[use_sidebar_menu]" value="0" />
  1363. <input type="checkbox" name="default_options[use_sidebar_menu]" id="use_sidebar_menu" value="1"', !empty($context['member']['options']['use_sidebar_menu']) ? ' checked="checked"' : '', ' class="input_check" />
  1364. </dd>
  1365. <dt>
  1366. <label for="show_no_avatars">', $txt['show_no_avatars'], '</label>
  1367. </dt>
  1368. <dd>
  1369. <input type="hidden" name="default_options[show_no_avatars]" value="0" />
  1370. <input type="checkbox" name="default_options[show_no_avatars]" id="show_no_avatars" value="1"', !empty($context['member']['options']['show_no_avatars']) ? ' checked="checked"' : '', ' class="input_check" />
  1371. </dd>
  1372. <dt>
  1373. <label for="show_no_signatures">', $txt['show_no_signatures'], '</label>
  1374. </dt>
  1375. <dd>
  1376. <input type="hidden" name="default_options[show_no_signatures]" value="0" />
  1377. <input type="checkbox" name="default_options[show_no_signatures]" id="show_no_signatures" value="1"', !empty($context['member']['options']['show_no_signatures']) ? ' checked="checked"' : '', ' class="input_check" />
  1378. </dd>';
  1379. if ($settings['allow_no_censored'])
  1380. echo '
  1381. <dt>
  1382. <label for="show_no_censored">' . $txt['show_no_censored'] . '</label>
  1383. </dt>
  1384. <dd>
  1385. <input type="hidden" name="default_options[show_no_censored]" value="0" />
  1386. <input type="checkbox" name="default_options[show_no_censored]" id="show_no_censored" value="1"' . (!empty($context['member']['options']['show_no_censored']) ? ' checked="checked"' : '') . ' class="input_check" />
  1387. </dd>';
  1388. echo '
  1389. <dt>
  1390. <label for="return_to_post">', $txt['return_to_post'], '</label>
  1391. </dt>
  1392. <dd>
  1393. <input type="hidden" name="default_options[return_to_post]" value="0" />
  1394. <input type="checkbox" name="default_options[return_to_post]" id="return_to_post" value="1"', !empty($context['member']['options']['return_to_post']) ? ' checked="checked"' : '', ' class="input_check" />
  1395. </dd>
  1396. <dt>
  1397. <label for="no_new_reply_warning">', $txt['no_new_reply_warning'], '</label>
  1398. </dt>
  1399. <dd>
  1400. <input type="hidden" name="default_options[no_new_reply_warning]" value="0" />
  1401. <input type="checkbox" name="default_options[no_new_reply_warning]" id="no_new_reply_warning" value="1"', !empty($context['member']['options']['no_new_reply_warning']) ? ' checked="checked"' : '', ' class="input_check" />
  1402. </dd>';
  1403. if (!empty($modSettings['enable_buddylist']))
  1404. echo '
  1405. <dt>
  1406. <label for="posts_apply_ignore_list">', $txt['posts_apply_ignore_list'], '</label>
  1407. </dt>
  1408. <dd>
  1409. <input type="hidden" name="default_options[posts_apply_ignore_list]" value="0" />
  1410. <input type="checkbox" name="default_options[posts_apply_ignore_list]" id="posts_apply_ignore_list" value="1"', !empty($context['member']['options']['posts_apply_ignore_list']) ? ' checked="checked"' : '', ' class="input_check" />
  1411. </dd>';
  1412. echo '
  1413. <dt>
  1414. <label for="view_newest_first">', $txt['recent_posts_at_top'], '</label>
  1415. </dt>
  1416. <dd>
  1417. <input type="hidden" name="default_options[view_newest_first]" value="0" />
  1418. <input type="checkbox" name="default_options[view_newest_first]" id="view_newest_first" value="1"', !empty($context['member']['options']['view_newest_first']) ? ' checked="checked"' : '', ' class="input_check" />
  1419. </dd>';
  1420. // Choose WYSIWYG settings?
  1421. if (empty($modSettings['disable_wysiwyg']))
  1422. echo '
  1423. <dt>
  1424. <label for="wysiwyg_default">', $txt['wysiwyg_default'], '</label>
  1425. </dt>
  1426. <dd>
  1427. <input type="hidden" name="default_options[wysiwyg_default]" value="0" />
  1428. <input type="checkbox" name="default_options[wysiwyg_default]" id="wysiwyg_default" value="1"', !empty($context['member']['options']['wysiwyg_default']) ? ' checked="checked"' : '', ' class="input_check" />
  1429. </dd>';
  1430. if (empty($modSettings['disableCustomPerPage']))
  1431. {
  1432. echo '
  1433. <dt>
  1434. <label for="topics_per_page">', $txt['topics_per_page'], '</label>
  1435. </dt>
  1436. <dd>
  1437. <select name="default_options[topics_per_page]" id="topics_per_page">
  1438. <option value="0"', empty($context['member']['options']['topics_per_page']) ? ' selected="selected"' : '', '>', $txt['per_page_default'], ' (', $modSettings['defaultMaxTopics'], ')</option>
  1439. <option value="5"', !empty($context['member']['options']['topics_per_page']) && $context['member']['options']['topics_per_page'] == 5 ? ' selected="selected"' : '', '>5</option>
  1440. <option value="10"', !empty($context['member']['options']['topics_per_page']) && $context['member']['options']['topics_per_page'] == 10 ? ' selected="selected"' : '', '>10</option>
  1441. <option value="25"', !empty($context['member']['options']['topics_per_page']) && $context['member']['options']['topics_per_page'] == 25 ? ' selected="selected"' : '', '>25</option>
  1442. <option value="50"', !empty($context['member']['options']['topics_per_page']) && $context['member']['options']['topics_per_page'] == 50 ? ' selected="selected"' : '', '>50</option>
  1443. </select>
  1444. </dd>
  1445. <dt>
  1446. <label for="messages_per_page">', $txt['messages_per_page'], '</label>
  1447. </dt>
  1448. <dd>
  1449. <select name="default_options[messages_per_page]" id="messages_per_page">
  1450. <option value="0"', empty($context['member']['options']['messages_per_page']) ? ' selected="selected"' : '', '>', $txt['per_page_default'], ' (', $modSettings['defaultMaxMessages'], ')</option>
  1451. <option value="5"', !empty($context['member']['options']['messages_per_page']) && $context['member']['options']['messages_per_page'] == 5 ? ' selected="selected"' : '', '>5</option>
  1452. <option value="10"', !empty($context['member']['options']['messages_per_page']) && $context['member']['options']['messages_per_page'] == 10 ? ' selected="selected"' : '', '>10</option>
  1453. <option value="25"', !empty($context['member']['options']['messages_per_page']) && $context['member']['options']['messages_per_page'] == 25 ? ' selected="selected"' : '', '>25</option>
  1454. <option value="50"', !empty($context['member']['options']['messages_per_page']) && $context['member']['options']['messages_per_page'] == 50 ? ' selected="selected"' : '', '>50</option>
  1455. </select>
  1456. </dd>';
  1457. }
  1458. if (!empty($modSettings['cal_enabled']))
  1459. echo '
  1460. <dt>
  1461. <label for="calendar_start_day">', $txt['calendar_start_day'], ':</label>
  1462. </dt>
  1463. <dd>
  1464. <select name="default_options[calendar_start_day]" id="calendar_start_day">
  1465. <option value="0"', empty($context['member']['options']['calendar_start_day']) ? ' selected="selected"' : '', '>', $txt['days'][0], '</option>
  1466. <option value="1"', !empty($context['member']['options']['calendar_start_day']) && $context['member']['options']['calendar_start_day'] == 1 ? ' selected="selected"' : '', '>', $txt['days'][1], '</option>
  1467. <option value="6"', !empty($context['member']['options']['calendar_start_day']) && $context['member']['options']['calendar_start_day'] == 6 ? ' selected="selected"' : '', '>', $txt['days'][6], '</option>
  1468. </select>
  1469. </dd>';
  1470. echo '
  1471. <dt>
  1472. <label for="display_quick_reply">', $txt['display_quick_reply'], '</label>
  1473. </dt>
  1474. <dd>
  1475. <select name="default_options[display_quick_reply]" id="display_quick_reply">
  1476. <option value="0"', empty($context['member']['options']['display_quick_reply']) ? ' selected="selected"' : '', '>', $txt['display_quick_reply1'], '</option>
  1477. <option value="1"', !empty($context['member']['options']['display_quick_reply']) && $context['member']['options']['display_quick_reply'] == 1 ? ' selected="selected"' : '', '>', $txt['display_quick_reply2'], '</option>
  1478. <option value="2"', !empty($context['member']['options']['display_quick_reply']) && $context['member']['options']['display_quick_reply'] == 2 ? ' selected="selected"' : '', '>', $txt['display_quick_reply3'], '</option>
  1479. <option value="3"', !empty($context['member']['options']['display_quick_reply']) && $context['member']['options']['display_quick_reply'] == 3 ? ' selected="selected"' : '', '>', $txt['display_quick_reply4'], '</option>
  1480. </select>
  1481. </dd>
  1482. <dt>
  1483. <label for="display_quick_mod">', $txt['display_quick_mod'], '</label>
  1484. </dt>
  1485. <dd>
  1486. <select name="default_options[display_quick_mod]" id="display_quick_mod">
  1487. <option value="0"', empty($context['member']['options']['display_quick_mod']) ? ' selected="selected"' : '', '>', $txt['display_quick_mod_none'], '</option>
  1488. <option value="1"', !empty($context['member']['options']['display_quick_mod']) && $context['member']['options']['display_quick_mod'] == 1 ? ' selected="selected"' : '', '>', $txt['display_quick_mod_check'], '</option>
  1489. <option value="2"', !empty($context['member']['options']['display_quick_mod']) && $context['member']['options']['display_quick_mod'] != 1 ? ' selected="selected"' : '', '>', $txt['display_quick_mod_image'], '</option>
  1490. </select>
  1491. </dd>';
  1492. }
  1493. function template_notification()
  1494. {
  1495. global $context, $settings, $options, $txt, $scripturl, $modSettings;
  1496. // The main containing header.
  1497. echo '
  1498. <form action="', $scripturl, '?action=profile;area=notification;save" method="post" accept-charset="', $context['character_set'], '" id="notify_options" class="flow_hidden">
  1499. <div class="cat_bar">
  1500. <h3 class="catbg">
  1501. <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.png" alt="" class="icon" />', $txt['profile'], '</span>
  1502. </h3>
  1503. </div>
  1504. <p class="windowbg description">', $txt['notification_info'], '</p>
  1505. <div class="windowbg2">
  1506. <span class="topslice"><span></span></span>
  1507. <div class="content">
  1508. <dl class="settings">';
  1509. // Allow notification on announcements to be disabled?
  1510. if (!empty($modSettings['allow_disableAnnounce']))
  1511. echo '
  1512. <dt>
  1513. <label for="notify_announcements">', $txt['notify_important_email'], '</label>
  1514. </dt>
  1515. <dd>
  1516. <input type="hidden" name="notify_announcements" value="0" />
  1517. <input type="checkbox" id="notify_announcements" name="notify_announcements"', !empty($context['member']['notify_announcements']) ? ' checked="checked"' : '', ' class="input_check" />
  1518. </dd>';
  1519. // More notification options.
  1520. echo '
  1521. <dt>
  1522. <label for="auto_notify">', $txt['auto_notify'], '</label>
  1523. </dt>
  1524. <dd>
  1525. <input type="hidden" name="default_options[auto_notify]" value="0" />
  1526. <input type="checkbox" id="auto_notify" name="default_options[auto_notify]" value="1"', !empty($context['member']['options']['auto_notify']) ? ' checked="checked"' : '', ' class="input_check" />
  1527. </dd>';
  1528. if (empty($modSettings['disallow_sendBody']))
  1529. echo '
  1530. <dt>
  1531. <label for="notify_send_body">', $txt['notify_send_body'], '</label>
  1532. </dt>
  1533. <dd>
  1534. <input type="hidden" name="notify_send_body" value="0" />
  1535. <input type="checkbox" id="notify_send_body" name="notify_send_body"', !empty($context['member']['notify_send_body']) ? ' checked="checked"' : '', ' class="input_check" />
  1536. </dd>';
  1537. echo '
  1538. <dt>
  1539. <label for="notify_regularity">', $txt['notify_regularity'], ':</label>
  1540. </dt>
  1541. <dd>
  1542. <select name="notify_regularity" id="notify_regularity">
  1543. <option value="0"', $context['member']['notify_regularity'] == 0 ? ' selected="selected"' : '', '>', $txt['notify_regularity_instant'], '</option>
  1544. <option value="1"', $context['member']['notify_regularity'] == 1 ? ' selected="selected"' : '', '>', $txt['notify_regularity_first_only'], '</option>
  1545. <option value="2"', $context['member']['notify_regularity'] == 2 ? ' selected="selected"' : '', '>', $txt['notify_regularity_daily'], '</option>
  1546. <option value="3"', $context['member']['notify_regularity'] == 3 ? ' selected="selected"' : '', '>', $txt['notify_regularity_weekly'], '</option>
  1547. </select>
  1548. </dd>
  1549. <dt>
  1550. <label for="notify_types">', $txt['notify_send_types'], ':</label>
  1551. </dt>
  1552. <dd>
  1553. <select name="notify_types" id="notify_types">
  1554. <option value="1"', $context['member']['notify_types'] == 1 ? ' selected="selected"' : '', '>', $txt['notify_send_type_everything'], '</option>
  1555. <option value="2"', $context['member']['notify_types'] == 2 ? ' selected="selected"' : '', '>', $txt['notify_send_type_everything_own'], '</option>
  1556. <option value="3"', $context['member']['notify_types'] == 3 ? ' selected="selected"' : '', '>', $txt['notify_send_type_only_replies'], '</option>
  1557. <option value="4"', $context['member']['notify_types'] == 4 ? ' selected="selected"' : '', '>', $txt['notify_send_type_nothing'], '</option>
  1558. </select>
  1559. </dd>
  1560. </dl>
  1561. <hr class="hrcolor" />
  1562. <div>
  1563. <input id="notify_submit" type="submit" value="', $txt['notify_save'], '" class="button_submit" />
  1564. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  1565. <input type="hidden" name="u" value="', $context['id_member'], '" />
  1566. <input type="hidden" name="sa" value="', $context['menu_item_selected'], '" />
  1567. </div>
  1568. <br class="clear_right" />
  1569. </div>
  1570. <span class="botslice"><span></span></span>
  1571. </div>
  1572. </form>
  1573. <br />';
  1574. template_show_list('topic_notification_list');
  1575. echo '
  1576. <br />';
  1577. template_show_list('board_notification_list');
  1578. }
  1579. // Template for choosing group membership.
  1580. function template_groupMembership()
  1581. {
  1582. global $context, $settings, $options, $scripturl, $modSettings, $txt;
  1583. // The main containing header.
  1584. echo '
  1585. <form action="', $scripturl, '?action=profile;area=groupmembership;save" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator">
  1586. <div class="cat_bar">
  1587. <h3 class="catbg">
  1588. <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.png" alt="" class="icon" />', $txt['profile'], '</span>
  1589. </h3>
  1590. </div>
  1591. <p class="description">', $txt['groupMembership_info'], '</p>';
  1592. // Do we have an update message?
  1593. if (!empty($context['update_message']))
  1594. echo '
  1595. <div class="infobox">
  1596. ', $context['update_message'], '.
  1597. </div>';
  1598. // Requesting membership to a group?
  1599. if (!empty($context['group_request']))
  1600. {
  1601. echo '
  1602. <div class="groupmembership">
  1603. <div class="cat_bar">
  1604. <h3 class="catbg">', $txt['request_group_membership'], '</h3>
  1605. </div>
  1606. <span class="upperframe"><span></span></span>
  1607. <div class="roundframe"><div class="innerframe">
  1608. ', $txt['request_group_membership_desc'], ':
  1609. <textarea name="reason" rows="4" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 99%; min-width: 99%' : 'width: 99%') . ';"></textarea>
  1610. <div class="righttext" style="margin: 0.5em 0.5% 0 0.5%;">
  1611. <input type="hidden" name="gid" value="', $context['group_request']['id'], '" />
  1612. <input type="submit" name="req" value="', $txt['submit_request'], '" class="button_submit" />
  1613. </div>
  1614. </div></div>
  1615. <span class="lowerframe"><span></span></span>
  1616. </div>';
  1617. }
  1618. else
  1619. {
  1620. echo '
  1621. <table border="0" width="100%" cellspacing="0" cellpadding="4" class="table_grid">
  1622. <thead>
  1623. <tr class="catbg">
  1624. <th class="first_th" scope="col" ', $context['can_edit_primary'] ? ' colspan="2"' : '', '>', $txt['current_membergroups'], '</th>
  1625. <th class="last_th" scope="col"></th>
  1626. </tr>
  1627. </thead>
  1628. <tbody>';
  1629. $alternate = true;
  1630. foreach ($context['groups']['member'] as $group)
  1631. {
  1632. echo '
  1633. <tr class="', $alternate ? 'windowbg' : 'windowbg2', '" id="primdiv_', $group['id'], '">';
  1634. if ($context['can_edit_primary'])
  1635. echo '
  1636. <td width="4%">
  1637. <input type="radio" name="primary" id="primary_', $group['id'], '" value="', $group['id'], '" ', $group['is_primary'] ? 'checked="checked"' : '', ' onclick="highlightSelected(\'primdiv_' . $group['id'] . '\');" ', $group['can_be_primary'] ? '' : 'disabled="disabled"', ' class="input_radio" />
  1638. </td>';
  1639. echo '
  1640. <td>
  1641. <label for="primary_', $group['id'], '"><strong>', (empty($group['color']) ? $group['name'] : '<span style="color: ' . $group['color'] . '">' . $group['name'] . '</span>'), '</strong>', (!empty($group['desc']) ? '<br /><span class="smalltext">' . $group['desc'] . '</span>' : ''), '</label>
  1642. </td>
  1643. <td width="15%" class="righttext">';
  1644. // Can they leave their group?
  1645. if ($group['can_leave'])
  1646. echo '
  1647. <a href="' . $scripturl . '?action=profile;save;u=' . $context['id_member'] . ';area=groupmembership;' . $context['session_var'] . '=' . $context['session_id'] . ';gid=' . $group['id'] . ';', $context[$context['token_check'] . '_token_var'], '=', $context[$context['token_check'] . '_token'], '">' . $txt['leave_group'] . '</a>';
  1648. echo '
  1649. </td>
  1650. </tr>';
  1651. $alternate = !$alternate;
  1652. }
  1653. echo '
  1654. </tbody>
  1655. </table>';
  1656. if ($context['can_edit_primary'])
  1657. echo '
  1658. <div class="padding righttext">
  1659. <input type="submit" value="', $txt['make_primary'], '" class="button_submit" />
  1660. </div>';
  1661. // Any groups they can join?
  1662. if (!empty($context['groups']['available']))
  1663. {
  1664. echo '
  1665. <br />
  1666. <table border="0" width="100%" cellspacing="0" cellpadding="4" class="table_grid">
  1667. <thead>
  1668. <tr class="catbg">
  1669. <th class="first_th" scope="col">
  1670. ', $txt['available_groups'], '
  1671. </th>
  1672. <th class="last_th" scope="col"></th>
  1673. </tr>
  1674. </thead>
  1675. <tbody>';
  1676. $alternate = true;
  1677. foreach ($context['groups']['available'] as $group)
  1678. {
  1679. echo '
  1680. <tr class="', $alternate ? 'windowbg' : 'windowbg2', '">
  1681. <td>
  1682. <strong>', (empty($group['color']) ? $group['name'] : '<span style="color: ' . $group['color'] . '">' . $group['name'] . '</span>'), '</strong>', (!empty($group['desc']) ? '<br /><span class="smalltext">' . $group['desc'] . '</span>' : ''), '
  1683. </td>
  1684. <td width="15%" class="lefttext">';
  1685. if ($group['type'] == 3)
  1686. echo '
  1687. <a href="', $scripturl, '?action=profile;save;u=', $context['id_member'], ';area=groupmembership;', $context['session_var'], '=', $context['session_id'], ';gid=', $group['id'], ';', $context[$context['token_check'] . '_token_var'], '=', $context[$context['token_check'] . '_token'], '">', $txt['join_group'], '</a>';
  1688. elseif ($group['type'] == 2 && $group['pending'])
  1689. echo '
  1690. ', $txt['approval_pending'];
  1691. elseif ($group['type'] == 2)
  1692. echo '
  1693. <a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=groupmembership;request=', $group['id'], '">', $txt['request_group'], '</a>';
  1694. // <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '" />';
  1695. echo '
  1696. </td>
  1697. </tr>';
  1698. $alternate = !$alternate;
  1699. }
  1700. echo '
  1701. </tbody>
  1702. </table>';
  1703. }
  1704. // Javascript for the selector stuff.
  1705. echo '
  1706. <script type="text/javascript"><!-- // --><![CDATA[
  1707. var prevClass = "";
  1708. var prevDiv = "";
  1709. function highlightSelected(box)
  1710. {
  1711. if (prevClass != "")
  1712. {
  1713. prevDiv.className = prevClass;
  1714. }
  1715. prevDiv = document.getElementById(box);
  1716. prevClass = prevDiv.className;
  1717. prevDiv.className = "highlight2";
  1718. }';
  1719. if (isset($context['groups']['member'][$context['primary_group']]))
  1720. echo '
  1721. highlightSelected("primdiv_' . $context['primary_group'] . '");';
  1722. echo '
  1723. // ]]></script>';
  1724. }
  1725. if (!empty($context['token_check']))
  1726. echo '
  1727. <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '" />';
  1728. echo '
  1729. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  1730. <input type="hidden" name="u" value="', $context['id_member'], '" />
  1731. </form>';
  1732. }
  1733. function template_ignoreboards()
  1734. {
  1735. global $context, $txt, $settings, $scripturl;
  1736. // The main containing header.
  1737. echo '
  1738. <form action="', $scripturl, '?action=profile;area=ignoreboards;save" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator">
  1739. <div class="cat_bar">
  1740. <h3 class="catbg">
  1741. <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.png" alt="" class="icon" />', $txt['profile'], '</span>
  1742. </h3>
  1743. </div>
  1744. <p class="description">', $txt['ignoreboards_info'], '</p>
  1745. <div class="windowbg2">
  1746. <span class="topslice"><span></span></span>
  1747. <div class="content flow_hidden">
  1748. <ul class="ignoreboards floatleft">';
  1749. $i = 0;
  1750. $limit = ceil($context['num_boards'] / 2);
  1751. foreach ($context['categories'] as $category)
  1752. {
  1753. if ($i == $limit)
  1754. {
  1755. echo '
  1756. </ul>
  1757. <ul class="ignoreboards floatright">';
  1758. $i++;
  1759. }
  1760. echo '
  1761. <li class="category">
  1762. <a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), '], \'creator\'); return false;">', $category['name'], '</a>
  1763. <ul>';
  1764. foreach ($category['boards'] as $board)
  1765. {
  1766. if ($i == $limit)
  1767. echo '
  1768. </ul>
  1769. </li>
  1770. </ul>
  1771. <ul class="ignoreboards floatright">
  1772. <li class="category">
  1773. <ul>';
  1774. echo '
  1775. <li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">
  1776. <label for="ignore_brd', $board['id'], '"><input type="checkbox" id="ignore_brd', $board['id'], '" name="ignore_brd[', $board['id'], ']" value="', $board['id'], '"', $board['selected'] ? ' checked="checked"' : '', ' class="input_check" /> ', $board['name'], '</label>
  1777. </li>';
  1778. $i++;
  1779. }
  1780. echo '
  1781. </ul>
  1782. </li>';
  1783. }
  1784. echo '
  1785. </ul>
  1786. <br class="clear" />';
  1787. // Show the standard "Save Settings" profile button.
  1788. template_profile_save();
  1789. echo '
  1790. </div>
  1791. <span class="botslice"><span></span></span>
  1792. </div>
  1793. </form>
  1794. <br />';
  1795. }
  1796. // Simple load some theme variables common to several warning templates.
  1797. function template_load_warning_variables()
  1798. {
  1799. global $modSettings, $context;
  1800. $context['warningBarWidth'] = 200;
  1801. // Setup the colors - this is a little messy for theming.
  1802. $context['colors'] = array(
  1803. 0 => 'green',
  1804. $modSettings['warning_watch'] => 'darkgreen',
  1805. $modSettings['warning_moderate'] => 'orange',
  1806. $modSettings['warning_mute'] => 'red',
  1807. );
  1808. // Work out the starting color.
  1809. $context['current_color'] = $context['colors'][0];
  1810. foreach ($context['colors'] as $limit => $color)
  1811. if ($context['member']['warning'] >= $limit)
  1812. $context['current_color'] = $color;
  1813. }
  1814. // Show all warnings of a user?
  1815. function template_viewWarning()
  1816. {
  1817. global $context, $txt, $scripturl, $settings;
  1818. template_load_warning_variables();
  1819. echo '
  1820. <div class="cat_bar">
  1821. <h3 class="catbg">
  1822. <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.png" alt="" class="icon" />
  1823. ', sprintf($txt['profile_viewwarning_for_user'], $context['member']['name']), '
  1824. </span>
  1825. </h3>
  1826. </div>
  1827. <p class="description">', $txt['viewWarning_help'], '</p>
  1828. <div class="windowbg">
  1829. <span class="topslice"><span></span></span>
  1830. <div class="content">
  1831. <dl class="settings">
  1832. <dt>
  1833. <strong>', $txt['profile_warning_name'], ':</strong>
  1834. </dt>
  1835. <dd>
  1836. ', $context['member']['name'], '
  1837. </dd>
  1838. <dt>
  1839. <strong>', $txt['profile_warning_level'], ':</strong>
  1840. </dt>
  1841. <dd>
  1842. <div>
  1843. <div>
  1844. <div style="font-size: 8pt; height: 12pt; width: ', $context['warningBarWidth'], 'px; border: 1px solid black; background-color: white; padding: 1px; position: relative;">
  1845. <div id="warning_text" style="padding-top: 1pt; width: 100%; z-index: 2; color: black; position: absolute; text-align: center; font-weight: bold;">', $context['member']['warning'], '%</div>
  1846. <div id="warning_progress" style="width: ', $context['member']['warning'], '%; height: 12pt; z-index: 1; background-color: ', $context['current_color'], ';">&nbsp;</div>
  1847. </div>
  1848. </div>
  1849. </div>
  1850. </dd>';
  1851. // There's some impact of this?
  1852. if (!empty($context['level_effects'][$context['current_level']]))
  1853. echo '
  1854. <dt>
  1855. <strong>', $txt['profile_viewwarning_impact'], ':</strong>
  1856. </dt>
  1857. <dd>
  1858. ', $context['level_effects'][$context['current_level']], '
  1859. </dd>';
  1860. echo '
  1861. </dl>
  1862. </div>
  1863. <span class="botslice"><span></span></span>
  1864. </div>';
  1865. template_show_list('view_warnings');
  1866. }
  1867. // Show a lovely interface for issuing warnings.
  1868. function template_issueWarning()
  1869. {
  1870. global $context, $settings, $options, $scripturl, $modSettings, $txt;
  1871. template_load_warning_variables();
  1872. echo '
  1873. <script type="text/javascript"><!-- // --><![CDATA[
  1874. function setWarningBarPos(curEvent, isMove, changeAmount)
  1875. {
  1876. barWidth = ', $context['warningBarWidth'], ';
  1877. // Are we passing the amount to change it by?
  1878. if (changeAmount)
  1879. {
  1880. if (document.getElementById(\'warning_level\').value == \'SAME\')
  1881. percent = ', $context['member']['warning'], ' + changeAmount;
  1882. else
  1883. percent = parseInt(document.getElementById(\'warning_level\').value) + changeAmount;
  1884. }
  1885. // If not then it\'s a mouse thing.
  1886. else
  1887. {
  1888. if (!curEvent)
  1889. var curEvent = window.event;
  1890. // If it\'s a movement check the button state first!
  1891. if (isMove)
  1892. {
  1893. if (!curEvent.button || curEvent.button != 1)
  1894. return false
  1895. }
  1896. // Get the position of the container.
  1897. contain = document.getElementById(\'warning_contain\');
  1898. position = 0;
  1899. while (contain != null)
  1900. {
  1901. position += contain.offsetLeft;
  1902. contain = contain.offsetParent;
  1903. }
  1904. // Where is the mouse?
  1905. if (curEvent.pageX)
  1906. {
  1907. mouse = curEvent.pageX;
  1908. }
  1909. else
  1910. {
  1911. mouse = curEvent.clientX;
  1912. mouse += document.documentElement.scrollLeft != "undefined" ? document.documentElement.scrollLeft : document.body.scrollLeft;
  1913. }
  1914. // Is this within bounds?
  1915. if (mouse < position || mouse > position + barWidth)
  1916. return;
  1917. percent = Math.round(((mouse - position) / barWidth) * 100);
  1918. // Round percent to the nearest 5 - by kinda cheating!
  1919. percent = Math.round(percent / 5) * 5;
  1920. }
  1921. // What are the limits?
  1922. minLimit = ', $context['min_allowed'], ';
  1923. maxLimit = ', $context['max_allowed'], ';
  1924. percent = Math.max(percent, minLimit);
  1925. percent = Math.min(percent, maxLimit);
  1926. size = barWidth * (percent/100);
  1927. setInnerHTML(document.getElementById(\'warning_text\'), percent + "%");
  1928. document.getElementById(\'warning_text\').innerHTML = percent + "%";
  1929. document.getElementById(\'warning_level\').value = percent;
  1930. document.getElementById(\'warning_progress\').style.width = size + "px";
  1931. // Get the right color.
  1932. color = "black"';
  1933. foreach ($context['colors'] as $limit => $color)
  1934. echo '
  1935. if (percent >= ', $limit, ')
  1936. color = "', $color, '";';
  1937. echo '
  1938. document.getElementById(\'warning_progress\').style.backgroundColor = color;
  1939. // Also set the right effect.
  1940. effectText = "";';
  1941. foreach ($context['level_effects'] as $limit => $text)
  1942. echo '
  1943. if (percent >= ', $limit, ')
  1944. effectText = "', $text, '";';
  1945. echo '
  1946. setInnerHTML(document.getElementById(\'cur_level_div\'), effectText);
  1947. }
  1948. // Disable notification boxes as required.
  1949. function modifyWarnNotify()
  1950. {
  1951. disable = !document.getElementById(\'warn_notify\').checked;
  1952. document.getElementById(\'warn_sub\').disabled = disable;
  1953. document.getElementById(\'warn_body\').disabled = disable;
  1954. document.getElementById(\'warn_temp\').disabled = disable;
  1955. document.getElementById(\'new_template_link\').style.display = disable ? \'none\' : \'\';
  1956. document.getElementById(\'preview_button\').style.display = disable ? \'none\' : \'\';
  1957. }
  1958. function changeWarnLevel(amount)
  1959. {
  1960. setWarningBarPos(false, false, amount);
  1961. }
  1962. // Warn template.
  1963. function populateNotifyTemplate()
  1964. {
  1965. index = document.getElementById(\'warn_temp\').value;
  1966. if (index == -1)
  1967. return false;
  1968. // Otherwise see what we can do...';
  1969. foreach ($context['notification_templates'] as $k => $type)
  1970. echo '
  1971. if (index == ', $k, ')
  1972. document.getElementById(\'warn_body\').value = "', strtr($type['body'], array('"' => "'", "\n" => '\\n', "\r" => '')), '";';
  1973. echo '
  1974. }
  1975. // ]]></script>';
  1976. echo '
  1977. <form action="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=issuewarning" method="post" class="flow_hidden" accept-charset="', $context['character_set'], '">
  1978. <div class="cat_bar">
  1979. <h3 class="catbg">
  1980. <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.png" alt="" class="icon" />
  1981. ', $context['user']['is_owner'] ? $txt['profile_warning_level'] : $txt['profile_issue_warning'], '
  1982. </span>
  1983. </h3>
  1984. </div>';
  1985. if (!$context['user']['is_owner'])
  1986. echo '
  1987. <p class="description">', $txt['profile_warning_desc'], '</p>';
  1988. echo '
  1989. <div class="windowbg">
  1990. <span class="topslice"><span></span></span>
  1991. <div class="content">
  1992. <dl class="settings">';
  1993. if (!$context['user']['is_owner'])
  1994. echo '
  1995. <dt>
  1996. <strong>', $txt['profile_warning_name'], ':</strong>
  1997. </dt>
  1998. <dd>
  1999. <strong>', $context['member']['name'], '</strong>
  2000. </dd>';
  2001. echo '
  2002. <dt>
  2003. <strong>', $txt['profile_warning_level'], ':</strong>';
  2004. // Is there only so much they can apply?
  2005. if ($context['warning_limit'])
  2006. echo '
  2007. <br /><span class="smalltext">', sprintf($txt['profile_warning_limit_attribute'], $context['warning_limit']), '</span>';
  2008. echo '
  2009. </dt>
  2010. <dd>
  2011. <div id="warndiv1" style="display: none;">
  2012. <div>
  2013. <span class="floatleft" style="padding: 0 0.5em"><a href="#" onclick="changeWarnLevel(-5); return false;">[-]</a></span>
  2014. <div class="floatleft" id="warning_contain" style="font-size: 8pt; height: 12pt; width: ', $context['warningBarWidth'], 'px; border: 1px solid black; background-color: white; padding: 1px; position: relative;" onmousedown="setWarningBarPos(event, true);" onmousemove="setWarningBarPos(event, true);" onclick="setWarningBarPos(event);">
  2015. <div id="warning_text" style="padding-top: 1pt; width: 100%; z-index: 2; color: black; position: absolute; text-align: center; font-weight: bold;">', $context['member']['warning'], '%</div>
  2016. <div id="warning_progress" style="width: ', $context['member']['warning'], '%; height: 12pt; z-index: 1; background-color: ', $context['current_color'], ';">&nbsp;</div>
  2017. </div>
  2018. <span class="floatleft" style="padding: 0 0.5em"><a href="#" onclick="changeWarnLevel(5); return false;">[+]</a></span>
  2019. <div class="clear_left smalltext">', $txt['profile_warning_impact'], ': <span id="cur_level_div">', $context['level_effects'][$context['current_level']], '</span></div>
  2020. </div>
  2021. <input type="hidden" name="warning_level" id="warning_level" value="SAME" />
  2022. </div>
  2023. <div id="warndiv2">
  2024. <input type="text" name="warning_level_nojs" size="6" maxlength="4" value="', $context['member']['warning'], '" class="input_text" />&nbsp;', $txt['profile_warning_max'], '
  2025. <div class="smalltext">', $txt['profile_warning_impact'], ':<br />';
  2026. // For non-javascript give a better list.
  2027. foreach ($context['level_effects'] as $limit => $effect)
  2028. echo '
  2029. ', sprintf($txt['profile_warning_effect_text'], $limit, $effect), '<br />';
  2030. echo '
  2031. </div>
  2032. </div>
  2033. </dd>';
  2034. if (!$context['user']['is_owner'])
  2035. {
  2036. echo '
  2037. <dt>
  2038. <strong>', $txt['profile_warning_reason'], ':</strong><br />
  2039. <span class="smalltext">', $txt['profile_warning_reason_desc'], '</span>
  2040. </dt>
  2041. <dd>
  2042. <input type="text" name="warn_reason" id="warn_reason" value="', $context['warning_data']['reason'], '" size="50" style="width: 80%;" class="input_text" />
  2043. </dd>
  2044. </dl>
  2045. <hr />
  2046. <div id="box_preview"', !empty($context['warning_data']['body_preview']) ? '' : ' style="display:none"', '>
  2047. <dl class="settings">
  2048. <dt>
  2049. <strong>', $txt['preview'] , '</strong>
  2050. </dt>
  2051. <dd id="body_preview">
  2052. ', !empty($context['warning_data']['body_preview']) ? $context['warning_data']['body_preview'] : '', '
  2053. </dd>
  2054. </dl>
  2055. <hr />
  2056. </div>
  2057. <dl class="settings">
  2058. <dt>
  2059. <strong><label for="warn_notify">', $txt['profile_warning_notify'], ':</label></strong>
  2060. </dt>
  2061. <dd>
  2062. <input type="checkbox" name="warn_notify" id="warn_notify" onclick="modifyWarnNotify();" ', $context['warning_data']['notify'] ? 'checked="checked"' : '', ' class="input_check" />
  2063. </dd>
  2064. <dt>
  2065. <strong><label for="warn_sub">', $txt['profile_warning_notify_subject'], ':</label></strong>
  2066. </dt>
  2067. <dd>
  2068. <input type="text" name="warn_sub" id="warn_sub" value="', empty($context['warning_data']['notify_subject']) ? $txt['profile_warning_notify_template_subject'] : $context['warning_data']['notify_subject'], '" size="50" style="width: 80%;" class="input_text" />
  2069. </dd>
  2070. <dt>
  2071. <strong><label for="warn_temp">', $txt['profile_warning_notify_body'], ':</label></strong>
  2072. </dt>
  2073. <dd>
  2074. <select name="warn_temp" id="warn_temp" disabled="disabled" onchange="populateNotifyTemplate();" style="font-size: x-small;">
  2075. <option value="-1">', $txt['profile_warning_notify_template'], '</option>
  2076. <option value="-1">------------------------------</option>';
  2077. foreach ($context['notification_templates'] as $id_template => $template)
  2078. echo '
  2079. <option value="', $id_template, '">', $template['title'], '</option>';
  2080. echo '
  2081. </select>
  2082. <span class="smalltext" id="new_template_link" style="display: none;">[<a href="', $scripturl, '?action=moderate;area=warnings;sa=templateedit;tid=0" target="_blank" class="new_win">', $txt['profile_warning_new_template'], '</a>]</span><br />
  2083. <textarea name="warn_body" id="warn_body" cols="40" rows="8" style="min-width: 50%; max-width: 99%;">', $context['warning_data']['notify_body'], '</textarea>
  2084. </dd>';
  2085. }
  2086. echo '
  2087. </dl>
  2088. <div class="righttext">';
  2089. if (!empty($context['token_check']))
  2090. echo '
  2091. <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '" />';
  2092. echo '
  2093. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  2094. <input type="submit" name="preview" id="preview_button" value="', $txt['preview'], '" class="button_submit" />
  2095. <input type="submit" name="save" value="', $context['user']['is_owner'] ? $txt['change_profile'] : $txt['profile_warning_issue'], '" class="button_submit" />
  2096. </div>
  2097. <br class="clear" />
  2098. </div>
  2099. <span class="botslice"><span></span></span>
  2100. </div>
  2101. </form>';
  2102. // Previous warnings?
  2103. template_show_list('view_warnings');
  2104. // Do our best to get pretty javascript enabled.
  2105. echo '
  2106. <script type="text/javascript"><!-- // --><![CDATA[
  2107. document.getElementById(\'warndiv1\').style.display = "";
  2108. document.getElementById(\'preview_button\').style.display = "none";
  2109. document.getElementById(\'warndiv2\').style.display = "none";';
  2110. if (!$context['user']['is_owner'])
  2111. echo '
  2112. modifyWarnNotify();
  2113. $(document).ready(function() {
  2114. $("#preview_button").click(function() {
  2115. return ajax_getTemplatePreview();
  2116. });
  2117. });
  2118. function ajax_getTemplatePreview ()
  2119. {
  2120. $.ajax({
  2121. type: "POST",
  2122. url: "' . $scripturl . '?action=xmlhttp;sa=previews;xml",
  2123. data: {item: "warning_preview", title: $("#warn_sub").val(), body: $("#warn_body").val(), issuing: true},
  2124. context: document.body,
  2125. success: function(request){
  2126. $("#box_preview").css({display:""});
  2127. $("#body_preview").html($(request).find(\'body\').text());
  2128. if ($(request).find("error").text() != \'\')
  2129. {
  2130. $("#profile_error").css({display:""});
  2131. var errors_html = \'<span>\' + $("#profile_error").find("span").html() + \'</span>\' + \'<ul class="list_errors" class="reset">\';
  2132. var errors = $(request).find(\'error\').each(function() {
  2133. errors_html += \'<li>\' + $(this).text() + \'</li>\';
  2134. });
  2135. errors_html += \'</ul>\';
  2136. $("#profile_error").html(errors_html);
  2137. }
  2138. else
  2139. {
  2140. $("#profile_error").css({display:"none"});
  2141. $("#error_list").html(\'\');
  2142. }
  2143. return false;
  2144. },
  2145. });
  2146. return false;
  2147. }';
  2148. echo '
  2149. // ]]></script>';
  2150. }
  2151. // Template to show for deleting a users account - now with added delete post capability!
  2152. function template_deleteAccount()
  2153. {
  2154. global $context, $settings, $options, $scripturl, $txt, $scripturl;
  2155. // The main containing header.
  2156. echo '
  2157. <form action="', $scripturl, '?action=profile;area=deleteaccount;save" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator">
  2158. <div class="title_bar">
  2159. <h3 class="titlebg">
  2160. <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.png" alt="" class="icon" />', $txt['deleteAccount'], '</span>
  2161. </h3>
  2162. </div>';
  2163. // If deleting another account give them a lovely info box.
  2164. if (!$context['user']['is_owner'])
  2165. echo '
  2166. <p class="windowbg2 description">', $txt['deleteAccount_desc'], '</p>';
  2167. echo '
  2168. <div class="windowbg2">
  2169. <span class="topslice"><span></span></span>
  2170. <div class="content">';
  2171. // If they are deleting their account AND the admin needs to approve it - give them another piece of info ;)
  2172. if ($context['needs_approval'])
  2173. echo '
  2174. <div class="errorbox">', $txt['deleteAccount_approval'], '</div>';
  2175. // If the user is deleting their own account warn them first - and require a password!
  2176. if ($context['user']['is_owner'])
  2177. {
  2178. echo '
  2179. <div class="alert">', $txt['own_profile_confirm'], '</div>
  2180. <div>
  2181. <strong', (isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : ''), '>', $txt['current_password'], ': </strong>
  2182. <input type="password" name="oldpasswrd" size="20" class="input_password" />&nbsp;&nbsp;&nbsp;&nbsp;
  2183. <input type="submit" value="', $txt['yes'], '" class="button_submit" />';
  2184. if (!empty($context['token_check']))
  2185. echo '
  2186. <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '" />';
  2187. echo '
  2188. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  2189. <input type="hidden" name="u" value="', $context['id_member'], '" />
  2190. <input type="hidden" name="sa" value="', $context['menu_item_selected'], '" />
  2191. </div>';
  2192. }
  2193. // Otherwise an admin doesn't need to enter a password - but they still get a warning - plus the option to delete lovely posts!
  2194. else
  2195. {
  2196. echo '
  2197. <div class="alert">', $txt['deleteAccount_warning'], '</div>';
  2198. // Only actually give these options if they are kind of important.
  2199. if ($context['can_delete_posts'])
  2200. echo '
  2201. <div>
  2202. ', $txt['deleteAccount_posts'], ':
  2203. <select name="remove_type">
  2204. <option value="none">', $txt['deleteAccount_none'], '</option>
  2205. <option value="posts">', $txt['deleteAccount_all_posts'], '</option>
  2206. <option value="topics">', $txt['deleteAccount_topics'], '</option>
  2207. </select>
  2208. </div>';
  2209. echo '
  2210. <div>
  2211. <label for="deleteAccount"><input type="checkbox" name="deleteAccount" id="deleteAccount" value="1" class="input_check" onclick="if (this.checked) return confirm(\'', $txt['deleteAccount_confirm'], '\');" /> ', $txt['deleteAccount_member'], '.</label>
  2212. </div>
  2213. <div>
  2214. <input type="submit" value="', $txt['delete'], '" class="button_submit" />';
  2215. if (!empty($context['token_check']))
  2216. echo '
  2217. <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '" />';
  2218. echo '
  2219. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  2220. <input type="hidden" name="u" value="', $context['id_member'], '" />
  2221. <input type="hidden" name="sa" value="', $context['menu_item_selected'], '" />
  2222. </div>';
  2223. }
  2224. echo '
  2225. </div>
  2226. <span class="botslice"><span></span></span>
  2227. </div>
  2228. <br />
  2229. </form>';
  2230. }
  2231. // Template for the password box/save button stuck at the bottom of every profile page.
  2232. function template_profile_save()
  2233. {
  2234. global $context, $settings, $options, $txt;
  2235. echo '
  2236. <hr width="100%" size="1" class="hrcolor clear" />';
  2237. // Only show the password box if it's actually needed.
  2238. if ($context['require_password'])
  2239. echo '
  2240. <dl>
  2241. <dt>
  2242. <strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '>', $txt['current_password'], ': </strong><br />
  2243. <span class="smalltext">', $txt['required_security_reasons'], '</span>
  2244. </dt>
  2245. <dd>
  2246. <input type="password" name="oldpasswrd" size="20" style="margin-right: 4ex;" class="input_password" />
  2247. </dd>
  2248. </dl>';
  2249. echo '
  2250. <div class="righttext">
  2251. <input type="submit" value="', $txt['change_profile'], '" class="button_submit" />
  2252. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  2253. <input type="hidden" name="u" value="', $context['id_member'], '" />
  2254. <input type="hidden" name="sa" value="', $context['menu_item_selected'], '" />
  2255. </div>';
  2256. }
  2257. // Small template for showing an error message upon a save problem in the profile.
  2258. function template_error_message()
  2259. {
  2260. global $context, $txt;
  2261. echo '
  2262. <div class="errorbox" ', empty($context['post_errors']) ? 'style="display:none" ' : '', 'id="profile_error">';
  2263. if (!empty($context['post_errors']))
  2264. {
  2265. echo '
  2266. <span>', !empty($context['custom_error_title']) ? $context['custom_error_title'] : $txt['profile_errors_occurred'], ':</span>
  2267. <ul id="list_errors">';
  2268. // Cycle through each error and display an error message.
  2269. foreach ($context['post_errors'] as $error)
  2270. echo '
  2271. <li>', isset($txt['profile_error_' . $error]) ? $txt['profile_error_' . $error] : $error, '</li>';
  2272. echo '
  2273. </ul>';
  2274. }
  2275. echo '
  2276. </div>';
  2277. }
  2278. // Display a load of drop down selectors for allowing the user to change group.
  2279. function template_profile_group_manage()
  2280. {
  2281. global $context, $txt, $scripturl;
  2282. echo '
  2283. <dt>
  2284. <strong>', $txt['primary_membergroup'], ': </strong><br />
  2285. <span class="smalltext">[<a href="', $scripturl, '?action=helpadmin;help=moderator_why_missing" onclick="return reqWin(this.href);">', $txt['moderator_why_missing'], '</a>]</span>
  2286. </dt>
  2287. <dd>
  2288. <select name="id_group" ', ($context['user']['is_owner'] && $context['member']['group_id'] == 1 ? 'onchange="if (this.value != 1 &amp;&amp; !confirm(\'' . $txt['deadmin_confirm'] . '\')) this.value = 1;"' : ''), '>';
  2289. // Fill the select box with all primary member groups that can be assigned to a member.
  2290. foreach ($context['member_groups'] as $member_group)
  2291. if (!empty($member_group['can_be_primary']))
  2292. echo '
  2293. <option value="', $member_group['id'], '"', $member_group['is_primary'] ? ' selected="selected"' : '', '>
  2294. ', $member_group['name'], '
  2295. </option>';
  2296. echo '
  2297. </select>
  2298. </dd>
  2299. <dt>
  2300. <strong>', $txt['additional_membergroups'], ':</strong>
  2301. </dt>
  2302. <dd>
  2303. <span id="additional_groupsList">
  2304. <input type="hidden" name="additional_groups[]" value="0" />';
  2305. // For each membergroup show a checkbox so members can be assigned to more than one group.
  2306. foreach ($context['member_groups'] as $member_group)
  2307. if ($member_group['can_be_additional'])
  2308. echo '
  2309. <label for="additional_groups-', $member_group['id'], '"><input type="checkbox" name="additional_groups[]" value="', $member_group['id'], '" id="additional_groups-', $member_group['id'], '"', $member_group['is_additional'] ? ' checked="checked"' : '', ' class="input_check" /> ', $member_group['name'], '</label><br />';
  2310. echo '
  2311. </span>
  2312. <a href="javascript:void(0);" onclick="document.getElementById(\'additional_groupsList\').style.display = \'block\'; document.getElementById(\'additional_groupsLink\').style.display = \'none\'; return false;" id="additional_groupsLink" style="display: none;">', $txt['additional_membergroups_show'], '</a>
  2313. <script type="text/javascript"><!-- // --><![CDATA[
  2314. document.getElementById("additional_groupsList").style.display = "none";
  2315. document.getElementById("additional_groupsLink").style.display = "";
  2316. // ]]></script>
  2317. </dd>';
  2318. }
  2319. // Callback function for entering a birthdate!
  2320. function template_profile_birthdate()
  2321. {
  2322. global $txt, $context;
  2323. // Just show the pretty box!
  2324. echo '
  2325. <dt>
  2326. <strong>', $txt['dob'], ':</strong><br />
  2327. <span class="smalltext">', $txt['dob_year'], ' - ', $txt['dob_month'], ' - ', $txt['dob_day'], '</span>
  2328. </dt>
  2329. <dd>
  2330. <input type="text" name="bday3" size="4" maxlength="4" value="', $context['member']['birth_date']['year'], '" class="input_text" /> -
  2331. <input type="text" name="bday1" size="2" maxlength="2" value="', $context['member']['birth_date']['month'], '" class="input_text" /> -
  2332. <input type="text" name="bday2" size="2" maxlength="2" value="', $context['member']['birth_date']['day'], '" class="input_text" />
  2333. </dd>';
  2334. }
  2335. // Show the signature editing box?
  2336. function template_profile_signature_modify()
  2337. {
  2338. global $txt, $context, $settings, $scripturl;
  2339. echo '
  2340. <dt id="current_signature"', !isset($context['member']['current_signature']) ? ' style="display:none"' : '', '>
  2341. <strong>', $txt['current_signature'], ':</strong>
  2342. </dt>
  2343. <dd id="current_signature_display"', !isset($context['member']['current_signature']) ? ' style="display:none"' : '', '>
  2344. ', isset($context['member']['current_signature']) ? $context['member']['current_signature'] : '', '<hr />
  2345. </dd>';
  2346. echo '
  2347. <dt id="preview_signature"', !isset($context['member']['signature_preview']) ? ' style="display:none"' : '', '>
  2348. <strong>', $txt['signature_preview'], ':</strong>
  2349. </dt>
  2350. <dd id="preview_signature_display"', !isset($context['member']['signature_preview']) ? ' style="display:none"' : '', '>
  2351. ', isset($context['member']['signature_preview']) ? $context['member']['signature_preview'] : '', '<hr />
  2352. </dd>';
  2353. echo '
  2354. <dt>
  2355. <strong>', $txt['signature'], ':</strong><br />
  2356. <span class="smalltext">', $txt['sig_info'], '</span><br />
  2357. <br />';
  2358. if ($context['show_spellchecking'])
  2359. echo '
  2360. <input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'creator\', \'signature\');" class="button_submit" />';
  2361. echo '
  2362. </dt>
  2363. <dd>
  2364. <textarea class="editor" onkeyup="calcCharLeft();" id="signature" name="signature" rows="5" cols="50" style="min-width: 50%; max-width: 99%;">', $context['member']['signature'], '</textarea><br />';
  2365. // If there is a limit at all!
  2366. if (!empty($context['signature_limits']['max_length']))
  2367. echo '
  2368. <span class="smalltext">', sprintf($txt['max_sig_characters'], $context['signature_limits']['max_length']), ' <span id="signatureLeft">', $context['signature_limits']['max_length'], '</span></span><br />';
  2369. if (!empty($context['show_preview_button']))
  2370. echo '
  2371. <input type="submit" name="preview_signature" id="preview_button" value="', $txt['preview_signature'], '" class="button_submit" />';
  2372. if ($context['signature_warning'])
  2373. echo '
  2374. <span class="smalltext">', $context['signature_warning'], '</span>';
  2375. // Load the spell checker?
  2376. if ($context['show_spellchecking'])
  2377. echo '
  2378. <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/spellcheck.js"></script>';
  2379. // Some javascript used to count how many characters have been used so far in the signature.
  2380. echo '
  2381. <script type="text/javascript"><!-- // --><![CDATA[
  2382. var maxLength = ', $context['signature_limits']['max_length'], ';
  2383. $(document).ready(function() {
  2384. calcCharLeft();
  2385. $("#preview_button").click(function() {
  2386. return ajax_getSignaturePreview(true);
  2387. });
  2388. });
  2389. // ]]></script>
  2390. </dd>';
  2391. }
  2392. function template_profile_avatar_select()
  2393. {
  2394. global $context, $txt, $modSettings;
  2395. // Start with the upper menu
  2396. echo '
  2397. <dt>
  2398. <strong id="personal_picture"><label for="avatar_upload_box">', $txt['personal_picture'], '</label></strong>
  2399. <input type="radio" onclick="swap_avatar(this); return true;" name="avatar_choice" id="avatar_choice_none" value="none"' . ($context['member']['avatar']['choice'] == 'none' ? ' checked="checked"' : '') . ' class="input_radio" /><label for="avatar_choice_none"' . (isset($context['modify_error']['bad_avatar']) ? ' class="error"' : '') . '>' . $txt['no_avatar'] . '</label><br />
  2400. ', !empty($context['member']['avatar']['allow_server_stored']) ? '<input type="radio" onclick="swap_avatar(this); return true;" name="avatar_choice" id="avatar_choice_server_stored" value="server_stored"' . ($context['member']['avatar']['choice'] == 'server_stored' ? ' checked="checked"' : '') . ' class="input_radio" /><label for="avatar_choice_server_stored"' . (isset($context['modify_error']['bad_avatar']) ? ' class="error"' : '') . '>' . $txt['choose_avatar_gallery'] . '</label><br />' : '', '
  2401. ', !empty($context['member']['avatar']['allow_external']) ? '<input type="radio" onclick="swap_avatar(this); return true;" name="avatar_choice" id="avatar_choice_external" value="external"' . ($context['member']['avatar']['choice'] == 'external' ? ' checked="checked"' : '') . ' class="input_radio" /><label for="avatar_choice_external"' . (isset($context['modify_error']['bad_avatar']) ? ' class="error"' : '') . '>' . $txt['my_own_pic'] . '</label><br />' : '', '
  2402. ', !empty($context['member']['avatar']['allow_upload']) ? '<input type="radio" onclick="swap_avatar(this); return true;" name="avatar_choice" id="avatar_choice_upload" value="upload"' . ($context['member']['avatar']['choice'] == 'upload' ? ' checked="checked"' : '') . ' class="input_radio" /><label for="avatar_choice_upload"' . (isset($context['modify_error']['bad_avatar']) ? ' class="error"' : '') . '>' . $txt['avatar_will_upload'] . '</label>' : '', '
  2403. </dt>
  2404. <dd>';
  2405. // If users are allowed to choose avatars stored on the server show selection boxes to choice them from.
  2406. if (!empty($context['member']['avatar']['allow_server_stored']))
  2407. {
  2408. echo '
  2409. <div id="avatar_server_stored">
  2410. <div>
  2411. <select name="cat" id="cat" size="10" onchange="changeSel(\'\');" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'server_stored\');">';
  2412. // This lists all the file catergories.
  2413. foreach ($context['avatars'] as $avatar)
  2414. echo '
  2415. <option value="', $avatar['filename'] . ($avatar['is_dir'] ? '/' : ''), '"', ($avatar['checked'] ? ' selected="selected"' : ''), '>', $avatar['name'], '</option>';
  2416. echo '
  2417. </select>
  2418. </div>
  2419. <div>
  2420. <select name="file" id="file" size="10" style="display: none;" onchange="showAvatar()" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'server_stored\');" disabled="disabled"><option></option></select>
  2421. </div>
  2422. <div><img name="avatar" id="avatar" src="', !empty($context['member']['avatar']['allow_external']) && $context['member']['avatar']['choice'] == 'external' ? $context['member']['avatar']['external'] : $modSettings['avatar_url'] . '/blank.png', '" alt="Do Nothing" /></div>
  2423. <script type="text/javascript"><!-- // --><![CDATA[
  2424. var files = ["' . implode('", "', $context['avatar_list']) . '"];
  2425. var avatar = document.getElementById("avatar");
  2426. var cat = document.getElementById("cat");
  2427. var selavatar = "' . $context['avatar_selected'] . '";
  2428. var avatardir = "' . $modSettings['avatar_url'] . '/";
  2429. var size = avatar.alt.substr(3, 2) + " " + avatar.alt.substr(0, 2) + String.fromCharCode(117, 98, 116);
  2430. var file = document.getElementById("file");
  2431. var maxHeight = ', !empty($modSettings['avatar_max_height_external']) ? $modSettings['avatar_max_height_external'] : 0, ';
  2432. var maxWidth = ', !empty($modSettings['avatar_max_width_external']) ? $modSettings['avatar_max_width_external'] : 0, ';
  2433. if (avatar.src.indexOf("blank.png") > -1)
  2434. changeSel(selavatar);
  2435. else
  2436. previewExternalAvatar(avatar.src)
  2437. // ]]></script>
  2438. </div>';
  2439. }
  2440. // If the user can link to an off server avatar, show them a box to input the address.
  2441. if (!empty($context['member']['avatar']['allow_external']))
  2442. {
  2443. echo '
  2444. <div id="avatar_external">
  2445. <div class="smalltext">', $txt['avatar_by_url'], '</div>
  2446. <input type="text" name="userpicpersonal" size="45" value="', $context['member']['avatar']['external'], '" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'external\');" onchange="if (typeof(previewExternalAvatar) != \'undefined\') previewExternalAvatar(this.value);" class="input_text" />
  2447. </div>';
  2448. }
  2449. // If the user is able to upload avatars to the server show them an upload box.
  2450. if (!empty($context['member']['avatar']['allow_upload']))
  2451. {
  2452. echo '
  2453. <div id="avatar_upload">
  2454. <input type="file" size="44" name="attachment" id="avatar_upload_box" value="" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'upload\');" class="input_file" />
  2455. ', ($context['member']['avatar']['id_attach'] > 0 ? '<br /><br /><img src="' . $context['member']['avatar']['href'] . (strpos($context['member']['avatar']['href'], '?') === false ? '?' : '&amp;') . 'time=' . time() . '" alt="" /><input type="hidden" name="id_attach" value="' . $context['member']['avatar']['id_attach'] . '" />' : ''), '
  2456. </div>';
  2457. }
  2458. echo '
  2459. <script type="text/javascript"><!-- // --><![CDATA[
  2460. ', !empty($context['member']['avatar']['allow_server_stored']) ? 'document.getElementById("avatar_server_stored").style.display = "' . ($context['member']['avatar']['choice'] == 'server_stored' ? '' : 'none') . '";' : '', '
  2461. ', !empty($context['member']['avatar']['allow_external']) ? 'document.getElementById("avatar_external").style.display = "' . ($context['member']['avatar']['choice'] == 'external' ? '' : 'none') . '";' : '', '
  2462. ', !empty($context['member']['avatar']['allow_upload']) ? 'document.getElementById("avatar_upload").style.display = "' . ($context['member']['avatar']['choice'] == 'upload' ? '' : 'none') . '";' : '', '
  2463. function swap_avatar(type)
  2464. {
  2465. switch(type.id)
  2466. {
  2467. case "avatar_choice_server_stored":
  2468. ', !empty($context['member']['avatar']['allow_server_stored']) ? 'document.getElementById("avatar_server_stored").style.display = "";' : '', '
  2469. ', !empty($context['member']['avatar']['allow_external']) ? 'document.getElementById("avatar_external").style.display = "none";' : '', '
  2470. ', !empty($context['member']['avatar']['allow_upload']) ? 'document.getElementById("avatar_upload").style.display = "none";' : '', '
  2471. break;
  2472. case "avatar_choice_external":
  2473. ', !empty($context['member']['avatar']['allow_server_stored']) ? 'document.getElementById("avatar_server_stored").style.display = "none";' : '', '
  2474. ', !empty($context['member']['avatar']['allow_external']) ? 'document.getElementById("avatar_external").style.display = "";' : '', '
  2475. ', !empty($context['member']['avatar']['allow_upload']) ? 'document.getElementById("avatar_upload").style.display = "none";' : '', '
  2476. break;
  2477. case "avatar_choice_upload":
  2478. ', !empty($context['member']['avatar']['allow_server_stored']) ? 'document.getElementById("avatar_server_stored").style.display = "none";' : '', '
  2479. ', !empty($context['member']['avatar']['allow_external']) ? 'document.getElementById("avatar_external").style.display = "none";' : '', '
  2480. ', !empty($context['member']['avatar']['allow_upload']) ? 'document.getElementById("avatar_upload").style.display = "";' : '', '
  2481. break;
  2482. case "avatar_choice_none":
  2483. ', !empty($context['member']['avatar']['allow_server_stored']) ? 'document.getElementById("avatar_server_stored").style.display = "none";' : '', '
  2484. ', !empty($context['member']['avatar']['allow_external']) ? 'document.getElementById("avatar_external").style.display = "none";' : '', '
  2485. ', !empty($context['member']['avatar']['allow_upload']) ? 'document.getElementById("avatar_upload").style.display = "none";' : '', '
  2486. break;
  2487. }
  2488. }
  2489. // ]]></script>
  2490. </dd>';
  2491. }
  2492. // Callback for modifying karam.
  2493. function template_profile_karma_modify()
  2494. {
  2495. global $context, $modSettings, $txt;
  2496. echo '
  2497. <dt>
  2498. <strong>', $modSettings['karmaLabel'], '</strong>
  2499. </dt>
  2500. <dd>
  2501. ', $modSettings['karmaApplaudLabel'], ' <input type="text" name="karma_good" size="4" value="', $context['member']['karma']['good'], '" onchange="setInnerHTML(document.getElementById(\'karmaTotal\'), this.value - this.form.karma_bad.value);" style="margin-right: 2ex;" class="input_text" /> ', $modSettings['karmaSmiteLabel'], ' <input type="text" name="karma_bad" size="4" value="', $context['member']['karma']['bad'], '" onchange="this.form.karma_good.onchange();" class="input_text" /><br />
  2502. (', $txt['total'], ': <span id="karmaTotal">', ($context['member']['karma']['good'] - $context['member']['karma']['bad']), '</span>)
  2503. </dd>';
  2504. }
  2505. // Select the time format!
  2506. function template_profile_timeformat_modify()
  2507. {
  2508. global $context, $modSettings, $txt, $scripturl, $settings;
  2509. echo '
  2510. <dt>
  2511. <strong><label for="easyformat">', $txt['time_format'], ':</label></strong><br />
  2512. <a href="', $scripturl, '?action=helpadmin;help=time_format" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" alt="', $txt['help'], '" class="floatleft" /></a>
  2513. <span class="smalltext">&nbsp;<label for="time_format">', $txt['date_format'], '</label></span>
  2514. </dt>
  2515. <dd>
  2516. <select name="easyformat" id="easyformat" onchange="document.forms.creator.time_format.value = this.options[this.selectedIndex].value;" style="margin-bottom: 4px;">';
  2517. // Help the user by showing a list of common time formats.
  2518. foreach ($context['easy_timeformats'] as $time_format)
  2519. echo '
  2520. <option value="', $time_format['format'], '"', $time_format['format'] == $context['member']['time_format'] ? ' selected="selected"' : '', '>', $time_format['title'], '</option>';
  2521. echo '
  2522. </select><br />
  2523. <input type="text" name="time_format" id="time_format" value="', $context['member']['time_format'], '" size="30" class="input_text" />
  2524. </dd>';
  2525. }
  2526. // Time offset?
  2527. function template_profile_timeoffset_modify()
  2528. {
  2529. global $txt, $context;
  2530. echo '
  2531. <dt>
  2532. <strong', (isset($context['modify_error']['bad_offset']) ? ' class="error"' : ''), '><label for="time_offset">', $txt['time_offset'], ':</label></strong><br />
  2533. <span class="smalltext">', $txt['personal_time_offset'], '</span>
  2534. </dt>
  2535. <dd>
  2536. <input type="text" name="time_offset" id="time_offset" size="5" maxlength="5" value="', $context['member']['time_offset'], '" class="input_text" /> ', $txt['hours'], ' [<a href="javascript:void(0);" onclick="currentDate = new Date(', $context['current_forum_time_js'], '); document.getElementById(\'time_offset\').value = autoDetectTimeOffset(currentDate); return false;">', $txt['timeoffset_autodetect'], '</a>]<br />', $txt['current_time'], ': <em>', $context['current_forum_time'], '</em>
  2537. </dd>';
  2538. }
  2539. // Theme?
  2540. function template_profile_theme_pick()
  2541. {
  2542. global $txt, $context, $scripturl;
  2543. echo '
  2544. <dt>
  2545. <strong>', $txt['current_theme'], ':</strong>
  2546. </dt>
  2547. <dd>
  2548. ', $context['member']['theme']['name'], ' [<a href="', $scripturl, '?action=theme;sa=pick;u=', $context['id_member'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['change'], '</a>]
  2549. </dd>';
  2550. }
  2551. // Smiley set picker.
  2552. function template_profile_smiley_pick()
  2553. {
  2554. global $txt, $context, $modSettings, $settings;
  2555. echo '
  2556. <dt>
  2557. <strong><label for="smiley_set">', $txt['smileys_current'], ':</label></strong>
  2558. </dt>
  2559. <dd>
  2560. <select name="smiley_set" id="smiley_set" onchange="document.getElementById(\'smileypr\').src = this.selectedIndex == 0 ? \'', $settings['images_url'], '/blank.png\' : \'', $modSettings['smileys_url'], '/\' + (this.selectedIndex != 1 ? this.options[this.selectedIndex].value : \'', !empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default'], '\') + \'/smiley.gif\';">';
  2561. foreach ($context['smiley_sets'] as $set)
  2562. echo '
  2563. <option value="', $set['id'], '"', $set['selected'] ? ' selected="selected"' : '', '>', $set['name'], '</option>';
  2564. echo '
  2565. </select> <img id="smileypr" class="centericon" src="', $context['member']['smiley_set']['id'] != 'none' ? $modSettings['smileys_url'] . '/' . ($context['member']['smiley_set']['id'] != '' ? $context['member']['smiley_set']['id'] : (!empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default'])) . '/smiley.gif' : $settings['images_url'] . '/blank.png', '" alt=":)" style="padding-left: 20px;" />
  2566. </dd>';
  2567. }
  2568. // Change the way you login to the forum.
  2569. function template_authentication_method()
  2570. {
  2571. global $context, $settings, $options, $scripturl, $modSettings, $txt;
  2572. // The main header!
  2573. echo '
  2574. <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/register.js"></script>
  2575. <form action="', $scripturl, '?action=profile;area=authentication;save" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator" enctype="multipart/form-data">
  2576. <div class="cat_bar">
  2577. <h3 class="catbg">
  2578. <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.png" alt="" class="icon" />', $txt['authentication'], '</span>
  2579. </h3>
  2580. </div>
  2581. <p class="windowbg description">', $txt['change_authentication'], '</p>
  2582. <div class="windowbg2">
  2583. <span class="topslice"><span></span></span>
  2584. <div class="content">
  2585. <dl>
  2586. <dt>
  2587. <input type="radio" onclick="updateAuthMethod();" name="authenticate" value="openid" id="auth_openid"', $context['auth_method'] == 'openid' ? ' checked="checked"' : '', ' class="input_radio" /><label for="auth_openid"><strong>', $txt['authenticate_openid'], '</strong></label>&nbsp;<em><a href="', $scripturl, '?action=helpadmin;help=register_openid" onclick="return reqWin(this.href);" class="help">(?)</a></em><br />
  2588. <input type="radio" onclick="updateAuthMethod();" name="authenticate" value="passwd" id="auth_pass"', $context['auth_method'] == 'password' ? ' checked="checked"' : '', ' class="input_radio" /><label for="auth_pass"><strong>', $txt['authenticate_password'], '</strong></label>
  2589. </dt>
  2590. <dd>
  2591. <dl id="auth_openid_div">
  2592. <dt>
  2593. <em>', $txt['authenticate_openid_url'], ':</em>
  2594. </dt>
  2595. <dd>
  2596. <input type="text" name="openid_identifier" id="openid_url" size="30" tabindex="', $context['tabindex']++, '" value="', $context['member']['openid_uri'], '" class="input_text openid_login" />
  2597. </dd>
  2598. </dl>
  2599. <dl id="auth_pass_div">
  2600. <dt>
  2601. <em>', $txt['choose_pass'], ':</em>
  2602. </dt>
  2603. <dd>
  2604. <input type="password" name="passwrd1" id="smf_autov_pwmain" size="30" tabindex="', $context['tabindex']++, '" class="input_password" />
  2605. <span id="smf_autov_pwmain_div" style="display: none;"><img id="smf_autov_pwmain_img" src="', $settings['images_url'], '/icons/field_invalid.png" alt="*" /></span>
  2606. </dd>
  2607. <dt>
  2608. <em>', $txt['verify_pass'], ':</em>
  2609. </dt>
  2610. <dd>
  2611. <input type="password" name="passwrd2" id="smf_autov_pwverify" size="30" tabindex="', $context['tabindex']++, '" class="input_password" />
  2612. <span id="smf_autov_pwverify_div" style="display: none;"><img id="smf_autov_pwverify_img" src="', $settings['images_url'], '/icons/field_valid.png" alt="*" /></span>
  2613. </dd>
  2614. </dl>
  2615. </dd>
  2616. </dl>';
  2617. if ($context['require_password'])
  2618. echo '
  2619. <hr width="100%" size="1" class="hrcolor clear" />
  2620. <dl>
  2621. <dt>
  2622. <strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '>', $txt['current_password'], ': </strong><br />
  2623. <span class="smalltext">', $txt['required_security_reasons'], '</span>
  2624. </dt>
  2625. <dd>
  2626. <input type="password" name="oldpasswrd" tabindex="', $context['tabindex']++, '" size="20" style="margin-right: 4ex;" class="input_password" />
  2627. </dd>
  2628. </dl>';
  2629. echo '
  2630. <hr class="hrcolor" />';
  2631. if (!empty($context['token_check']))
  2632. echo '
  2633. <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '" />';
  2634. echo '
  2635. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  2636. <input type="hidden" name="u" value="', $context['id_member'], '" />
  2637. <input type="hidden" name="sa" value="', $context['menu_item_selected'], '" />
  2638. <input type="submit" value="', $txt['change_profile'], '" class="button_submit" />
  2639. <br class="clear_right" />
  2640. </div>
  2641. <span class="botslice"><span></span></span>
  2642. </div>
  2643. </form>';
  2644. // The password stuff.
  2645. echo '
  2646. <script type="text/javascript"><!-- // --><![CDATA[
  2647. var regTextStrings = {
  2648. "password_short": "', $txt['registration_password_short'], '",
  2649. "password_reserved": "', $txt['registration_password_reserved'], '",
  2650. "password_numbercase": "', $txt['registration_password_numbercase'], '",
  2651. "password_no_match": "', $txt['registration_password_no_match'], '",
  2652. "password_valid": "', $txt['registration_password_valid'], '"
  2653. };
  2654. var verificationHandle = new smfRegister("creator", ', empty($modSettings['password_strength']) ? 0 : $modSettings['password_strength'], ', regTextStrings);
  2655. var currentAuthMethod = \'passwd\';
  2656. updateAuthMethod();
  2657. // ]]></script>';
  2658. }
  2659. ?>