Просмотр файла includes/usercp_editconfig.php

Размер файла: 20.33Kb
  1. <?php
  2. /***************************************************************************
  3. * mides.ru
  4. * -------------------
  5. ***************************************************************************/
  6. if ( !defined('IN_PHPBB') )
  7. {
  8. die("Hacking attempt");
  9. exit;
  10. }
  11.  
  12. $unhtml_specialchars_match = array('#&gt;#', '#&lt;#', '#&quot;#', '#&amp;#');
  13. $unhtml_specialchars_replace = array('>', '<', '"', '&');
  14.  
  15. $error = FALSE;
  16. $error_msg = '';
  17.  
  18. if (
  19. isset($HTTP_POST_VARS['submit']) ||
  20. isset($HTTP_POST_VARS['avatargallery']) ||
  21. isset($HTTP_POST_VARS['submitavatar']) ||
  22. isset($HTTP_POST_VARS['cancelavatar']) )
  23. {
  24. include($phpbb_root_path . 'includes/functions_validate.'.$phpEx);
  25. include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
  26. include($phpbb_root_path . 'includes/functions_post.'.$phpEx);
  27.  
  28. if (isset($HTTP_POST_VARS['topics_per_page']) )
  29. {
  30. $user_topics_per_page = ( intval($HTTP_POST_VARS['topics_per_page']) == 0 ) ? $board_config['topics_per_page'] : intval($HTTP_POST_VARS['topics_per_page']);
  31. $user_topics_per_page = ( $user_topics_per_page > $board_config['max_user_topics_per_page'] ) ? $board_config['topics_per_page'] : $user_topics_per_page;
  32. }
  33. if (isset($HTTP_POST_VARS['posts_per_page']) )
  34. {
  35. $user_posts_per_page = ( intval($HTTP_POST_VARS['topics_per_page']) == 0 ) ? $board_config['posts_per_page'] : intval($HTTP_POST_VARS['posts_per_page']);
  36. $user_posts_per_page = ( $user_topics_per_page > $board_config['max_user_posts_per_page'] ) ? $board_config['posts_per_page'] : $user_posts_per_page;
  37. }
  38.  
  39. $viewemail = ( isset($HTTP_POST_VARS['viewemail']) ) ? ( ($HTTP_POST_VARS['viewemail']) ? TRUE : 0 ) : 0;
  40. $allowviewonline = ( isset($HTTP_POST_VARS['hideonline']) ) ? ( ($HTTP_POST_VARS['hideonline']) ? 0 : TRUE ) : TRUE;
  41. $notifyreply = ( isset($HTTP_POST_VARS['notifyreply']) ) ? ( ($HTTP_POST_VARS['notifyreply']) ? TRUE : 0 ) : 0;
  42. $notifypm = ( isset($HTTP_POST_VARS['notifypm']) ) ? ( ($HTTP_POST_VARS['notifypm']) ? TRUE : 0 ) : TRUE;
  43. $popup_pm = ( isset($HTTP_POST_VARS['popup_pm']) ) ? ( ($HTTP_POST_VARS['popup_pm']) ? TRUE : 0 ) : TRUE;
  44.  
  45. $attachsig = ( isset($HTTP_POST_VARS['attachsig']) ) ? ( ($HTTP_POST_VARS['attachsig']) ? TRUE : 0 ) : $userdata['user_attachsig'];
  46. $allowhtml = ( isset($HTTP_POST_VARS['allowhtml']) ) ? ( ($HTTP_POST_VARS['allowhtml']) ? TRUE : 0 ) : $userdata['user_allowhtml'];
  47. $allowbbcode = ( isset($HTTP_POST_VARS['allowbbcode']) ) ? ( ($HTTP_POST_VARS['allowbbcode']) ? TRUE : 0 ) : $userdata['user_allowbbcode'];
  48. $allowsmilies = ( isset($HTTP_POST_VARS['allowsmilies']) ) ? ( ($HTTP_POST_VARS['allowsmilies']) ? TRUE : 0 ) : $userdata['user_allowsmile'];
  49. $on_off = ( isset($HTTP_POST_VARS['on_off']) ) ? ( ($HTTP_POST_VARS['on_off']) ? TRUE : 0 ) : 1;
  50. $attach_on = ( isset($HTTP_POST_VARS['attach_on']) ) ? ( ($HTTP_POST_VARS['attach_on']) ? TRUE : 0 ) : 1;
  51. $quick_answer = ( isset($HTTP_POST_VARS['quick_answer']) ) ? ( ($HTTP_POST_VARS['quick_answer']) ? TRUE : 0 ) : 1;
  52. $icq_send = ( isset($HTTP_POST_VARS['icq_send']) ) ? ( ($HTTP_POST_VARS['icq_send']) ? TRUE : 0 ) : 1;
  53. $index_spisok = ( isset($HTTP_POST_VARS['index_spisok']) ) ? ( ($HTTP_POST_VARS['index_spisok']) ? TRUE : 0 ) : 1;
  54. $posl_red = ( isset($HTTP_POST_VARS['posl_red']) ) ? ( ($HTTP_POST_VARS['posl_red']) ? TRUE : 0 ) : 1;
  55. $post_leng = ( isset($HTTP_POST_VARS['post_leng']) ) ? intval($HTTP_POST_VARS['post_leng']) : $userdata['user_post_leng'];
  56.  
  57. $user_timezone = ( isset($HTTP_POST_VARS['timezone']) ) ? doubleval($HTTP_POST_VARS['timezone']) : $board_config['board_timezone'];
  58.  
  59. $sql = "SELECT config_value
  60. FROM " . CONFIG_TABLE . "
  61. WHERE config_name = 'default_dateformat'";
  62. if ( !($result = $db->sql_query($sql)) )
  63. {
  64. message_die(GENERAL_ERROR, 'Could not select default dateformat', '', __LINE__, __FILE__, $sql);
  65. }
  66. $row = $db->sql_fetchrow($result);
  67. $board_config['default_dateformat'] = $row['config_value'];
  68. $user_dateformat = ( !empty($HTTP_POST_VARS['dateformat']) ) ? trim(htmlspecialchars($HTTP_POST_VARS['dateformat'])) : $board_config['default_dateformat'];
  69.  
  70. $user_avatar_local = ( isset($HTTP_POST_VARS['avatarselect']) && !empty($HTTP_POST_VARS['submitavatar']) && $board_config['allow_avatar_local'] ) ? htmlspecialchars($HTTP_POST_VARS['avatarselect']) : ( ( isset($HTTP_POST_VARS['avatarlocal']) ) ? htmlspecialchars($HTTP_POST_VARS['avatarlocal']) : '' );
  71. $user_avatar_category = ( isset($HTTP_POST_VARS['avatarcatname']) && $board_config['allow_avatar_local'] ) ? htmlspecialchars($HTTP_POST_VARS['avatarcatname']) : '' ;
  72.  
  73. $user_avatar_remoteurl = ( !empty($HTTP_POST_VARS['avatarremoteurl']) ) ? trim(htmlspecialchars($HTTP_POST_VARS['avatarremoteurl'])) : '';
  74.  
  75. if ( $result_ua )
  76. {
  77. $opera_mini = "./opera_mini";
  78. $uploadedfile = $HTTP_POST_VARS['fileupload'];
  79.  
  80. if ( strlen($uploadedfile) )
  81. {
  82. $array = explode('file=', $uploadedfile);
  83. $tmp_name = $array[0];
  84. $filebase64 = $array[1];
  85. }
  86.  
  87. $tmp_name = basename($tmp_name);
  88.  
  89. if ( strlen($filebase64) )
  90. {
  91. $filedata = base64_decode($filebase64);
  92. }
  93.  
  94. $fileom = @fopen($opera_mini . "/" . $tmp_name, "wb");
  95.  
  96. if ( $fileom )
  97. {
  98. if ( flock($fileom, LOCK_EX) )
  99. {
  100. fwrite($fileom, $filedata);
  101. flock($fileom, LOCK_UN);
  102. }
  103. fclose($fileom);
  104. }
  105.  
  106. $file = $opera_mini . "/" . $tmp_name;
  107. $size = @filesize($file);
  108. $tmp_name_type = strrchr($tmp_name, '.');
  109. $repl=array("."=>"");
  110. $type = strtr($tmp_name_type, $repl);
  111. $user_avatar_upload = ( !empty($HTTP_POST_VARS['avatarurl']) ) ? trim($HTTP_POST_VARS['avatarurl']) : ( ( $file != $opera_mini . "/") ? $file : '' );
  112. $user_avatar_name = ( !empty($tmp_name) ) ? $tmp_name : '';
  113. $user_avatar_size = ( !empty($size) ) ? $size : 0;
  114. $user_avatar_filetype = ( !empty($type) ) ? 'image/'.$type : '';
  115. } else {
  116. $user_avatar_upload = ( !empty($HTTP_POST_VARS['avatarurl']) ) ? trim($HTTP_POST_VARS['avatarurl']) : ( ( $HTTP_POST_FILES['avatar']['tmp_name'] != "none") ? $HTTP_POST_FILES['avatar']['tmp_name'] : '' );
  117. $user_avatar_name = ( !empty($HTTP_POST_FILES['avatar']['name']) ) ? $HTTP_POST_FILES['avatar']['name'] : '';
  118. $user_avatar_size = ( !empty($HTTP_POST_FILES['avatar']['size']) ) ? $HTTP_POST_FILES['avatar']['size'] : 0;
  119. $user_avatar_filetype = ( !empty($HTTP_POST_FILES['avatar']['type']) ) ? $HTTP_POST_FILES['avatar']['type'] : '';
  120. }
  121.  
  122. $user_avatar = ( empty($user_avatar_local) ) ? $userdata['user_avatar'] : '';
  123. $user_avatar_type = ( empty($user_avatar_local) ) ? $userdata['user_avatar_type'] : '';
  124.  
  125. if ( (isset($HTTP_POST_VARS['avatargallery']) || isset($HTTP_POST_VARS['submitavatar']) || isset($HTTP_POST_VARS['cancelavatar'])) && (!isset($HTTP_POST_VARS['submit'])) )
  126. {
  127. if ( !isset($HTTP_POST_VARS['cancelavatar']))
  128. {
  129. $user_avatar = $user_avatar_category . '../' . $user_avatar_local;
  130. $user_avatar_type = USER_AVATAR_GALLERY;
  131. }
  132. }
  133. }
  134.  
  135. if ( isset($HTTP_POST_VARS['submit']) )
  136. {
  137. include($phpbb_root_path . 'includes/usercp_avatar.'.$phpEx);
  138.  
  139. $user_id = intval($HTTP_POST_VARS['user_id']);
  140. if ( $user_id != $userdata['user_id'] )
  141. {
  142. $error = TRUE;
  143. $error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Wrong_Profile'];
  144. }
  145.  
  146. $avatar_sql = '';
  147.  
  148. if ( isset($HTTP_POST_VARS['avatardel']) )
  149. {
  150. $avatar_sql = user_avatar_delete($userdata['user_avatar_type'], $userdata['user_avatar']);
  151. }
  152. else
  153. if ( ( !empty($user_avatar_upload) || !empty($user_avatar_name) ) && $board_config['allow_avatar_upload'] )
  154. {
  155. if ( !empty($user_avatar_upload) )
  156. {
  157. $avatar_mode = (empty($user_avatar_name)) ? 'remote' : 'local';
  158. $avatar_sql = user_avatar_upload($mode, $avatar_mode, $userdata['user_avatar'], $userdata['user_avatar_type'], $error, $error_msg, $user_avatar_upload, $user_avatar_name, $user_avatar_size, $user_avatar_filetype);
  159. }
  160. else if ( !empty($user_avatar_name) )
  161. {
  162. $l_avatar_size = sprintf($lang['Avatar_filesize'], round($board_config['avatar_filesize'] / 1024));
  163.  
  164. $error = true;
  165. $error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $l_avatar_size;
  166. }
  167. }
  168. else if ( $user_avatar_remoteurl != '' && $board_config['allow_avatar_remote'] )
  169. {
  170. user_avatar_delete($userdata['user_avatar_type'], $userdata['user_avatar']);
  171. $avatar_sql = user_avatar_url($mode, $error, $error_msg, $user_avatar_remoteurl);
  172. }
  173. else if ( $user_avatar_local != '' && $board_config['allow_avatar_local'] )
  174. {
  175. user_avatar_delete($userdata['user_avatar_type'], $userdata['user_avatar']);
  176. $avatar_sql = user_avatar_gallery($mode, $error, $error_msg, $user_avatar_local, $user_avatar_category);
  177. }
  178.  
  179. if ( !$error )
  180. {
  181. $user_active = 1;
  182. $user_actkey = '';
  183.  
  184. $sql = "UPDATE " . USERS_TABLE . "
  185. SET user_topics_per_page = '$user_topics_per_page', user_posts_per_page = '$user_posts_per_page', user_viewemail = $viewemail, user_on_off = '$on_off', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_notify_pm = $notifypm, user_popup_pm = $popup_pm, user_timezone = $user_timezone, user_lang = 'russian', user_attach_mod = '$attach_on', user_icq_send = '$icq_send', user_index_spisok = '$index_spisok', user_posl_red = '$posl_red', user_post_leng = '$post_leng', user_active = $user_active, user_actkey = '" . str_replace("\'", "''", $user_actkey) . "'" . $avatar_sql . "
  186. WHERE user_id = $user_id";
  187. if ( !($result = $db->sql_query($sql)) )
  188. {
  189. message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
  190. }
  191.  
  192. $message = 'Настройки успешно изменены!' . '';
  193.  
  194. $template->assign_vars(array(
  195. "META" => '<meta http-equiv="refresh" content="3;url=' . append_sid("menu.$phpEx") . '">')
  196. );
  197.  
  198. message_die(GENERAL_MESSAGE, $message);
  199. }
  200. }
  201.  
  202.  
  203. if ( $error )
  204. {
  205. $user_topics_per_page = $userdata['user_topics_per_page'];
  206. $user_posts_per_page = $userdata['user_posts_per_page'];
  207. $post_leng = $userdata['user_post_leng'];
  208. }
  209. else if ( !isset($HTTP_POST_VARS['avatargallery']) && !isset($HTTP_POST_VARS['submitavatar']) && !isset($HTTP_POST_VARS['cancelavatar']) )
  210. {
  211. $user_id = $userdata['user_id'];
  212.  
  213. $viewemail = $userdata['user_viewemail'];
  214. $notifypm = $userdata['user_notify_pm'];
  215. $popup_pm = $userdata['user_popup_pm'];
  216. $notifyreply = $userdata['user_notify'];
  217. $attachsig = $userdata['user_attachsig'];
  218. $allowhtml = $userdata['user_allowhtml'];
  219. $allowbbcode = $userdata['user_allowbbcode'];
  220. $allowsmilies = $userdata['user_allowsmile'];
  221. $allowviewonline = $userdata['user_allow_viewonline'];
  222.  
  223. $user_avatar = ( $userdata['user_allowavatar'] ) ? $userdata['user_avatar'] : '';
  224. $user_avatar_type = ( $userdata['user_allowavatar'] ) ? $userdata['user_avatar_type'] : USER_AVATAR_NONE;
  225.  
  226. $user_timezone = $userdata['user_timezone'];
  227. $user_topics_per_page = $userdata['user_topics_per_page'];
  228. $user_posts_per_page = $userdata['user_posts_per_page'];
  229. $post_leng = $userdata['user_post_leng'];
  230. }
  231.  
  232. include($phpbb_root_path . 'includes/page_header.'.$phpEx);
  233.  
  234. $user_id = ( !empty($HTTP_POST_VARS['user_id']) ) ? intval($HTTP_POST_VARS['user_id']) : $user_id;
  235. if ( $user_id != $userdata['user_id'] )
  236. {
  237. $error = TRUE;
  238. $error_msg = $lang['Wrong_Profile'];
  239. }
  240.  
  241. if( isset($HTTP_POST_VARS['avatargallery']) && !$error )
  242. {
  243. include($phpbb_root_path . 'includes/usercp_avatar.'.$phpEx);
  244.  
  245. $avatar_category = ( !empty($HTTP_POST_VARS['avatarcategory']) ) ? htmlspecialchars($HTTP_POST_VARS['avatarcategory']) : '';
  246.  
  247. $template->set_filenames(array(
  248. 'body' => 'profile_avatar_gallery.tpl')
  249. );
  250.  
  251. $allowviewonline = !$allowviewonline;
  252.  
  253. display_avatar_gallery($mode, $avatar_category, $user_id, $viewemail, $notifypm, $popup_pm, $notifyreply, $attachsig, $allowhtml, $allowbbcode, $allowsmilies, $allowviewonline, $user_style, $user_lang, $user_timezone, $userdata['session_id'], $user_topics_per_page, $user_posts_per_page, $birthday, $gender);
  254. }
  255. else
  256. {
  257. include($phpbb_root_path . 'includes/functions_selects.'.$phpEx);
  258.  
  259. if ( !isset($coppa) )
  260. {
  261. $coppa = FALSE;
  262. }
  263.  
  264. if ( !isset($user_style) )
  265. {
  266. $user_style = $board_config['default_style'];
  267. }
  268.  
  269. $avatar_img = '';
  270. if ( $user_avatar_type )
  271. {
  272. switch( $user_avatar_type )
  273. {
  274. case USER_AVATAR_UPLOAD:
  275. $avatar_img = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $user_avatar . '" alt="" /><br/><input type="checkbox" name="avatardel" /> '.$lang['Delete_Image'].'<br/>' : '';
  276. break;
  277. case USER_AVATAR_REMOTE:
  278. $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $user_avatar . '" alt="" /><br/><input type="checkbox" name="avatardel" /> '.$lang['Delete_Image'].'<br/>' : '';
  279. break;
  280. case USER_AVATAR_GALLERY:
  281. $avatar_img = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $user_avatar . '" alt="" /><br/><input type="checkbox" name="avatardel" /> '.$lang['Delete_Image'].'<br/>' : '';
  282. break;
  283. }
  284. }
  285.  
  286. $s_hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '" /><input type="hidden" name="agreed" value="true" /><input type="hidden" name="coppa" value="' . $coppa . '" />';
  287. $s_hidden_fields .= '<input type="hidden" name="user_id" value="' . $userdata['user_id'] . '" />';
  288. $s_hidden_fields .= '<input type="hidden" name="current_email" value="' . $userdata['user_email'] . '" />';
  289.  
  290. if ( !empty($user_avatar_local) )
  291. {
  292. $s_hidden_fields .= '<input type="hidden" name="avatarlocal" value="' . $user_avatar_local . '" /><input type="hidden" name="avatarcatname" value="' . $user_avatar_category . '" />';
  293. }
  294.  
  295. $html_status = ( $userdata['user_allowhtml'] && $board_config['allow_html'] ) ? $lang['HTML_is_ON'] : $lang['HTML_is_OFF'];
  296. $bbcode_status = ( $userdata['user_allowbbcode'] && $board_config['allow_bbcode'] ) ? $lang['BBCode_is_ON'] : $lang['BBCode_is_OFF'];
  297. $smilies_status = ( $userdata['user_allowsmile'] && $board_config['allow_smilies'] ) ? $lang['Smilies_are_ON'] : $lang['Smilies_are_OFF'];
  298.  
  299. if ( $error )
  300. {
  301. $template->set_filenames(array(
  302. 'reg_header' => 'error_body.tpl')
  303. );
  304. $template->assign_vars(array(
  305. 'ERROR_MESSAGE' => $error_msg)
  306. );
  307. $template->assign_var_from_handle('ERROR_BOX', 'reg_header');
  308. }
  309.  
  310. $template->set_filenames(array(
  311. 'body' => 'profile_add_config.tpl')
  312. );
  313.  
  314. $ini_val = ( phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var';
  315. $form_enctype = ( @$ini_val('file_uploads') == '0' || strtolower(@$ini_val('file_uploads') == 'off') || phpversion() == '4.0.4pl1' || !$board_config['allow_avatar_upload'] || ( phpversion() < '4.0.3' && @$ini_val('open_basedir') != '' ) ) ? '' : 'enctype="multipart/form-data"';
  316.  
  317. $template->assign_vars(array(
  318. 'VIEW_EMAIL_YES' => ( $viewemail ) ? 'checked="checked"' : '',
  319. 'VIEW_EMAIL_NO' => ( !$viewemail ) ? 'checked="checked"' : '',
  320. 'HIDE_USER_YES' => ( !$allowviewonline ) ? 'checked="checked"' : '',
  321. 'HIDE_USER_NO' => ( $allowviewonline ) ? 'checked="checked"' : '',
  322. 'NOTIFY_PM_YES' => ( $notifypm ) ? 'checked="checked"' : '',
  323. 'NOTIFY_PM_NO' => ( !$notifypm ) ? 'checked="checked"' : '',
  324. 'POPUP_PM_YES' => ( $popup_pm ) ? 'checked="checked"' : '',
  325. 'POPUP_PM_NO' => ( !$popup_pm ) ? 'checked="checked"' : '',
  326. 'ALWAYS_ADD_SIGNATURE_YES' => ( $attachsig ) ? 'checked="checked"' : '',
  327. 'ALWAYS_ADD_SIGNATURE_NO' => ( !$attachsig ) ? 'checked="checked"' : '',
  328. 'NOTIFY_REPLY_YES' => ( $notifyreply ) ? 'checked="checked"' : '',
  329. 'NOTIFY_REPLY_NO' => ( !$notifyreply ) ? 'checked="checked"' : '',
  330. 'ALWAYS_ALLOW_BBCODE_YES' => ( $allowbbcode ) ? 'checked="checked"' : '',
  331. 'ALWAYS_ALLOW_BBCODE_NO' => ( !$allowbbcode ) ? 'checked="checked"' : '',
  332. 'ALWAYS_ALLOW_HTML_YES' => ( $allowhtml ) ? 'checked="checked"' : '',
  333. 'ALWAYS_ALLOW_HTML_NO' => ( !$allowhtml ) ? 'checked="checked"' : '',
  334. 'ALWAYS_ALLOW_SMILIES_YES' => ( $allowsmilies ) ? 'checked="checked"' : '',
  335. 'ALWAYS_ALLOW_SMILIES_NO' => ( !$allowsmilies ) ? 'checked="checked"' : '',
  336. 'ON_OFF_YES' => ( $userdata['user_on_off'] ) ? 'checked="checked"' : '',
  337. 'ON_OFF_NO' => ( !$userdata['user_on_off'] ) ? 'checked="checked"' : '',
  338. 'ATTACH_ON_NO' => ( !$userdata['user_attach_mod'] ) ? 'checked="checked"' : '',
  339. 'ATTACH_ON_YES' => ( $userdata['user_attach_mod'] ) ? 'checked="checked"' : '',
  340. 'ICQ_SEND_NO' => ( !$userdata['user_icq_send'] ) ? 'checked="checked"' : '',
  341. 'ICQ_SEND_YES' => ( $userdata['user_icq_send'] ) ? 'checked="checked"' : '',
  342. 'INDEX_SPISOK_NO' => ( !$userdata['user_index_spisok'] ) ? 'checked="checked"' : '',
  343. 'INDEX_SPISOK_YES' => ( $userdata['user_index_spisok'] ) ? 'checked="checked"' : '',
  344. 'POSL_RED_NO' => ( !$userdata['user_posl_red'] ) ? 'checked="checked"' : '',
  345. 'POSL_RED_YES' => ( $userdata['user_posl_red'] ) ? 'checked="checked"' : '',
  346. 'ALLOW_AVATAR' => $board_config['allow_avatar_upload'],
  347. 'AVATAR' => $avatar_img,
  348. 'AVATAR_SIZE' => $board_config['avatar_filesize'],
  349. 'LANGUAGE_SELECT' => language_select($user_lang, 'language'),
  350. 'STYLE_SELECT' => style_select($user_style, 'style'),
  351. 'TIMEZONE_SELECT' => tz_select($user_timezone, 'timezone'),
  352. 'HTML_STATUS' => $html_status,
  353. 'SMILIES_STATUS' => $smilies_status,
  354. 'TOPICS_PER_PAGE' => $user_topics_per_page,
  355. 'POSTS_PER_PAGE' => $user_posts_per_page,
  356. 'POST_LENG' => $post_leng,
  357.  
  358. 'L_SUBMIT' => $lang['Submit'],
  359. 'L_BOARD_LANGUAGE' => $lang['Board_lang'],
  360. 'L_TIMEZONE' => $lang['Timezone'],
  361. 'L_DATE_FORMAT' => $lang['Date_format'],
  362. 'L_DATE_FORMAT_EXPLAIN' => $lang['Date_format_explain'],
  363. 'L_YES' => $lang['Yes'],
  364. 'L_NO' => $lang['No'],
  365.  
  366. 'L_GENDER' =>$lang['Gender'],
  367. 'L_GENDER_MALE' =>$lang['Male'],
  368. 'L_GENDER_FEMALE' =>$lang['Female'],
  369. 'L_GENDER_NOT_SPECIFY' =>$lang['No_gender_specify'],
  370. 'L_BIRTHDAY' => $lang['Birthday'],
  371.  
  372. 'L_ALWAYS_ALLOW_SMILIES' => $lang['Always_smile'],
  373. 'L_ALWAYS_ALLOW_BBCODE' => $lang['Always_bbcode'],
  374. 'L_ALWAYS_ALLOW_HTML' => $lang['Always_html'],
  375. 'L_HIDE_USER' => $lang['Hide_user'],
  376. 'L_ALWAYS_ADD_SIGNATURE' => $lang['Always_add_sig'],
  377.  
  378. 'L_AVATAR_PANEL' => $lang['Avatar_panel'],
  379. 'L_AVATAR_EXPLAIN' => sprintf($lang['Avatar_explain'], $board_config['avatar_max_width'], $board_config['avatar_max_height'], (round($board_config['avatar_filesize'] / 1024))),
  380. 'L_UPLOAD_AVATAR_FILE' => $lang['Upload_Avatar_file'],
  381. 'L_UPLOAD_AVATAR_URL' => $lang['Upload_Avatar_URL'],
  382. 'L_UPLOAD_AVATAR_URL_EXPLAIN' => $lang['Upload_Avatar_URL_explain'],
  383. 'L_AVATAR_GALLERY' => $lang['Select_from_gallery'],
  384. 'L_SHOW_GALLERY' => $lang['View_avatar_gallery'],
  385. 'L_LINK_REMOTE_AVATAR' => $lang['Link_remote_Avatar'],
  386. 'L_LINK_REMOTE_AVATAR_EXPLAIN' => $lang['Link_remote_Avatar_explain'],
  387. 'L_CURRENT_IMAGE' => $lang['Current_Image'],
  388.  
  389. 'L_NOTIFY_ON_REPLY' => $lang['Always_notify'],
  390. 'L_NOTIFY_ON_REPLY_EXPLAIN' => $lang['Always_notify_explain'],
  391. 'L_NOTIFY_ON_PRIVMSG' => $lang['Notify_on_privmsg'],
  392. 'L_POPUP_ON_PRIVMSG' => $lang['Popup_on_privmsg'],
  393. 'L_POPUP_ON_PRIVMSG_EXPLAIN' => $lang['Popup_on_privmsg_explain'],
  394. 'L_PREFERENCES' => $lang['Preferences'],
  395. 'L_PUBLIC_VIEW_EMAIL' => $lang['Public_view_email'],
  396. 'L_ITEMS_REQUIRED' => $lang['Items_required'],
  397. 'L_TOPICS_PER_PAGE' => $lang['Topics_per_page'],
  398. 'L_POSTS_PER_PAGE' => $lang['Posts_per_page'],
  399.  
  400. 'S_ALLOW_AVATAR_UPLOAD' => $board_config['allow_avatar_upload'],
  401. 'S_ALLOW_AVATAR_LOCAL' => $board_config['allow_avatar_local'],
  402. 'S_ALLOW_AVATAR_REMOTE' => $board_config['allow_avatar_remote'],
  403. 'S_HIDDEN_FIELDS' => $s_hidden_fields,
  404. 'S_FORM_ENCTYPE' => $form_enctype,
  405. 'S_PROFILE_ACTION' => append_sid("profile.$phpEx"))
  406. );
  407.  
  408. if ( $userdata['user_allowavatar'] && ( $board_config['allow_avatar_upload'] || $board_config['allow_avatar_local'] || $board_config['allow_avatar_remote'] ) )
  409. {
  410. $template->assign_block_vars('switch_avatar_block', array() );
  411.  
  412. if ( $board_config['allow_avatar_upload'] && file_exists(@phpbb_realpath('./' . $board_config['avatar_path'])) )
  413. {
  414. if ( !$result_ua && $form_enctype != '' )
  415. {
  416. $template->assign_block_vars('switch_avatar_block.switch_avatar_local_upload', array() );
  417. } elseif ( $result_ua && $form_enctype != '' ) {
  418. $template->assign_block_vars('switch_avatar_block.switch_avatar_local_upload_om', array() );
  419. }
  420. $template->assign_block_vars('switch_avatar_block.switch_avatar_remote_upload', array() );
  421. }
  422.  
  423. if ( $board_config['allow_avatar_remote'] )
  424. {
  425. $template->assign_block_vars('switch_avatar_block.switch_avatar_remote_link', array() );
  426. }
  427.  
  428. if ( $board_config['allow_avatar_local'] && file_exists(@phpbb_realpath('./' . $board_config['avatar_gallery_path'])) )
  429. {
  430. $template->assign_block_vars('switch_avatar_block.switch_avatar_local_gallery', array() );
  431. }
  432. }
  433. }
  434.  
  435. $template->pparse('body');
  436.  
  437. include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
  438.  
  439. ?>