2
0

Profile.template.php 123 KB

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