Profile.template.php 123 KB

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