plugins/SpecialUserPrefs.php
changeset 1081 745200a9cc2a
parent 1079 fcc42560afe6
child 1083 ef2dbcac5d56
equal deleted inserted replaced
1080:6358f769ecb1 1081:745200a9cc2a
    10 }
    10 }
    11 **!*/
    11 **!*/
    12 
    12 
    13 /*
    13 /*
    14  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
    14  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
    15  * Version 1.1.6 (Caoineag beta 1)
    15  * Copyright (C) 2006-2009 Dan Fuhry
    16  * Copyright (C) 2006-2008 Dan Fuhry
       
    17  *
    16  *
    18  * This program is Free Software; you can redistribute it and/or modify it under the terms of the GNU General Public License
    17  * This program is Free Software; you can redistribute it and/or modify it under the terms of the GNU General Public License
    19  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
    18  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
    20  *
    19  *
    21  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
    20  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
   452         $occupation = $db->escape($occupation);
   451         $occupation = $db->escape($occupation);
   453         
   452         
   454         $hobbies = htmlspecialchars($_POST['hobbies']);
   453         $hobbies = htmlspecialchars($_POST['hobbies']);
   455         $hobbies = $db->escape($hobbies);
   454         $hobbies = $db->escape($hobbies);
   456         
   455         
       
   456         $date_format = $db->escape(htmlspecialchars($_POST['date_format']));
       
   457         $time_format = $db->escape(htmlspecialchars($_POST['time_format']));
       
   458         
   457         $email_public = ( isset($_POST['email_public']) ) ? '1' : '0';
   459         $email_public = ( isset($_POST['email_public']) ) ? '1' : '0';
   458         $disable_js_fx = ( isset($_POST['disable_js_fx']) ) ? '1' : '0';
   460         $disable_js_fx = ( isset($_POST['disable_js_fx']) ) ? '1' : '0';
   459         
   461         
   460         $session->real_name = $real_name;
   462         $session->real_name = $real_name;
   461         
   463         
   481         $session->user_extra['user_homepage'] = $homepage;
   483         $session->user_extra['user_homepage'] = $homepage;
   482         $session->user_extra['user_location'] = $location;
   484         $session->user_extra['user_location'] = $location;
   483         $session->user_extra['user_job'] = $occupation;
   485         $session->user_extra['user_job'] = $occupation;
   484         $session->user_extra['user_hobbies'] = $hobbies;
   486         $session->user_extra['user_hobbies'] = $hobbies;
   485         $session->user_extra['email_public'] = intval($email_public);
   487         $session->user_extra['email_public'] = intval($email_public);
       
   488         $session->date_format = $date_format;
       
   489         $session->time_format = $time_format;
   486         
   490         
   487         // user title
   491         // user title
   488         $user_title_col = '';
   492         $user_title_col = '';
   489         if ( $session->get_permissions('custom_user_title') && isset($_POST['user_title']) )
   493         if ( $session->get_permissions('custom_user_title') && isset($_POST['user_title']) )
   490         {
   494         {
   534         if ( !$q )
   538         if ( !$q )
   535           $db->_die();
   539           $db->_die();
   536         
   540         
   537         $q = $db->sql_query('UPDATE '.table_prefix."users_extra SET user_aim='$imaddr_aim',user_yahoo='$imaddr_yahoo',user_msn='$imaddr_msn',
   541         $q = $db->sql_query('UPDATE '.table_prefix."users_extra SET user_aim='$imaddr_aim',user_yahoo='$imaddr_yahoo',user_msn='$imaddr_msn',
   538                                user_xmpp='$imaddr_xmpp',user_homepage='$homepage',user_location='$location',user_job='$occupation',
   542                                user_xmpp='$imaddr_xmpp',user_homepage='$homepage',user_location='$location',user_job='$occupation',
   539                                user_hobbies='$hobbies',email_public=$email_public,disable_js_fx=$disable_js_fx
   543                                user_hobbies='$hobbies',email_public=$email_public,disable_js_fx=$disable_js_fx,date_format='$date_format',
       
   544                                time_format='$time_format'
   540                                WHERE user_id=$session->user_id;");
   545                                WHERE user_id=$session->user_id;");
   541         
   546         
   542         if ( !$q )
   547         if ( !$q )
   543           $db->_die();
   548           $db->_die();
   544         
   549         
   628             <td class="row1"><?php echo $lang_box; ?></td>
   633             <td class="row1"><?php echo $lang_box; ?></td>
   629           </tr>
   634           </tr>
   630           <tr>
   635           <tr>
   631             <td class="row2"><?php echo $lang->get('usercp_publicinfo_field_changetheme_title'); ?></td>
   636             <td class="row2"><?php echo $lang->get('usercp_publicinfo_field_changetheme_title'); ?></td>
   632             <td class="row1"><?php echo $lang->get('usercp_publicinfo_field_changetheme_hint'); ?> <a href="<?php echo makeUrlNS('Special', 'ChangeStyle/' . $paths->page); ?>" onclick="ajaxChangeStyle(); return false;"><?php echo $lang->get('usercp_publicinfo_field_changetheme'); ?></a></td>
   637             <td class="row1"><?php echo $lang->get('usercp_publicinfo_field_changetheme_hint'); ?> <a href="<?php echo makeUrlNS('Special', 'ChangeStyle/' . $paths->page); ?>" onclick="ajaxChangeStyle(); return false;"><?php echo $lang->get('usercp_publicinfo_field_changetheme'); ?></a></td>
       
   638           </tr>
       
   639           <tr>
       
   640             <td class="row2"><?php echo $lang->get('usercp_publicinfo_field_dateformat'); ?></td>
       
   641             <td class="row1">
       
   642             <select name="date_format">
       
   643               <?php
       
   644               foreach ( array(DATE_1, DATE_2, DATE_3, DATE_4) as $format )
       
   645               {
       
   646                 $selected = $format === $session->date_format ? ' selected="selected"' : '';
       
   647                 echo '<option value="' . $format . '"' . $selected . '>' . enano_date($format) . '</option>';
       
   648               }
       
   649               ?>
       
   650             </select>
       
   651             </td>
       
   652           </tr>
       
   653           <tr>
       
   654             <td class="row2"><?php echo $lang->get('usercp_publicinfo_field_timeformat'); ?></td>
       
   655             <td class="row1">
       
   656             <select name="time_format">
       
   657               <?php
       
   658               foreach ( array(TIME_12_NS, TIME_12_S, TIME_24_NS, TIME_24_S) as $format )
       
   659               {
       
   660                 $selected = $format === $session->time_format ? ' selected="selected"' : '';
       
   661                 echo '<option value="' . $format . '"' . $selected . '>' . enano_date($format) . '</option>';
       
   662               }
       
   663               ?>
       
   664             </select>
       
   665             </td>
   633           </tr>
   666           </tr>
   634           <tr>
   667           <tr>
   635             <td class="row3" colspan="2"><?php echo $lang->get('usercp_publicinfo_field_timezone'); ?> <?php echo $tz_select; ?><br /><small><?php echo $lang->get('usercp_publicinfo_field_timezone_hint'); ?></small></td>
   668             <td class="row3" colspan="2"><?php echo $lang->get('usercp_publicinfo_field_timezone'); ?> <?php echo $tz_select; ?><br /><small><?php echo $lang->get('usercp_publicinfo_field_timezone_hint'); ?></small></td>
   636           </tr>
   669           </tr>
   637           <tr>
   670           <tr>