Changeset 316 for my.php

Show
Ignore:
Timestamp:
06/22/10 18:52:19 (2 years ago)
Author:
Nafania
Message:

Апдейт добавляет возможность получать уведомление на мыло о новых комментариях, и небольшие изменения с уведомлениями в панели управления.
Мелкие фиксы.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • my.php

    r276 r316  
    4141        if ( isset($_POST['submit']) ) { 
    4242                $updateset = array(); 
     43                $notifs = ''; 
    4344                $full_cats = $cache->obtain_cats(); 
    4445 
     
    6364                $updateset['savepms'] = ( isset($_POST['savepms']) ? 1 : 0 ); 
    6465 
    65                 $pmnotif = ( isset($_POST['pmnotif']) ? 1 : 0 ); 
    66                 $notifs = ( $pmnotif  ? '[pm]' : '' ); 
    67  
    68                 $updateset['notify_forum'] = ( isset($_POST['notif_forum']) ? 1 : 0 ); 
     66                $user_notify = request_var('user_notify', array(''=>0)); 
     67                foreach ( $user_notify AS $key => $val ) { 
     68                        $notifs .= '[' . $key . ']'; 
     69                } 
    6970 
    7071                $comment_pm = request_var('commentpm', 0); 
     
    380381                } 
    381382 
     383                $notifs = array('pm', 'forum', 'comments'); 
     384 
     385                $notifs_options = ''; 
     386                foreach ( $notifs AS $_null => $val ) { 
     387                        $name = 'user_notify[' . $val . ']'; 
     388                        $notifs_options .= '<input type="checkbox" id="' . $name . '" name="' . $name . '"' . ( strpos($userdata['notifs'], '[' . $val . ']') !== false ? ' checked="checked"' : '' ) . ' value="1" /> ' . $lang['email_notifis_' . $val] . '<br />'; 
     389                } 
     390 
    382391                $template->assign_vars(array( 
    383392                                'LANG_INPUT' => $lang_select, 
     
    390399                                'BIRTHDAY_OPTIONS' => $birthday_select, 
    391400                                'PRIVACY_INPUT' => $privacy_input, 
    392                                 'EMAIL_NOTIFIS_INPUT' => '<input type="checkbox" id="pmnotif" name="pmnotif"' . (strpos($userdata['notifs'], "[pm]") !== false ? ' checked="checked"' : "") . ' value="yes" /> ' . $lang['email_notifis_pm'] . '<br /><input type="checkbox" id="notif_forum" name="notif_forum"' . (($userdata['notify_forum'] == 1)? ' checked="checked"' : '') . ' value="yes" /> ' . $lang['email_notifis_forum'] . "<br />\n") 
    393                 )
     401                                'EMAIL_NOTIFIS_INPUT' => $notifs_options 
     402                ))
    394403        } 
    395404