Profile.template.php 121 KB

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