users tablosunda notif_mail ve notif_sys_mail columnlarını oluşturdum değerleri 0 ile 1 olarak değiştirilecek yani bildirim açma kapatma yapmaya çalışıyorum 0 kapalı 1 açık demek olacak fakat bir türlü beceremedim konu hakkında yardımcı olursanız çok sevinirim.
$lng_set = core::load_lng('settings');
$textl = $lng['settings'];
require('../incfiles/head.php');
/*
-----------------------------------------------------------------
Проверяем права доступа
-----------------------------------------------------------------
*/
if ($user['id'] != $user_id) {
echo functions::display_error($lng['access_forbidden']);
require('../incfiles/end.php');
exit;
}
$menu = array(
(!$mod ? '' . $lng['common_settings'] . '' : '' . $lng['common_settings'] . ''),
($mod == 'forum' ? '' . $lng['forum'] . '' : '' . $lng['forum'] . ''),
($mod == 'mail' ? '' . $lng['mail'] . '' : '' . $lng['mail'] . ''),
($mod == 'bildirim' ? '' . $lng['bildirim'] . '' : '' . $lng['bildirim'] . ''),
);
/*
-----------------------------------------------------------------
Пользовательские настройки
-----------------------------------------------------------------
*/
switch ($mod) {
case 'bildirim':
Buraya ne yazacağımı bilmiyorum. mysql den notif_mail değeri 0 ise kapalı 1 ise açık yazacak hemen altındada notif_sys_mail değeri 0 ise kapalı 1 açık yazacak. kullanıcı istediği zaman açıp kapatabilecek.
break;
case 'mail':
echo '' . $lng['settings'] . ' | ' . $lng['mail'] . '' .
' ';
$set_mail_user = unserialize($datauser['set_mail']);
if (isset($_POST['submit'])) {
$set_mail_user['access'] = isset($_POST['access']) && $_POST['access'] >= 0 && $_POST['access'] <= 2 ? abs(intval($_POST['access'])) : 0;
mysql_query("UPDATE `users` SET `set_mail` = '" . mysql_real_escape_string(serialize($set_mail_user)) . "' WHERE `id` = '$user_id'");
}
echo '' .
' ';
break;
case 'forum':
/*
-----------------------------------------------------------------
Настройки Форума
-----------------------------------------------------------------
*/
echo '' . $lng['settings'] . ' | ' . $lng['forum'] . '' .
' ';
$set_forum = array();
$set_forum = unserialize($datauser['set_forum']);
if (isset($_POST['submit'])) {
$set_forum['farea'] = isset($_POST['farea']);
$set_forum['upfp'] = isset($_POST['upfp']);
$set_forum['preview'] = isset($_POST['preview']);
$set_forum['postclip'] = isset($_POST['postclip']) ? intval($_POST['postclip']) : 1;
if ($set_forum['postclip'] < 0 || $set_forum['postclip'] > 2) {
$set_forum['postclip'] = 1;
}
mysql_query("UPDATE `users` SET `set_forum` = '" . mysql_real_escape_string(serialize($set_forum)) . "' WHERE `id` = '$user_id'");
echo ' ';
}
if (isset($_GET['reset']) || empty($set_forum)) {
$set_forum = array();
$set_forum['farea'] = 0;
$set_forum['upfp'] = 0;
$set_forum['preview'] = 1;
$set_forum['postclip'] = 1;
mysql_query("UPDATE `users` SET `set_forum` = '" . mysql_real_escape_string(serialize($set_forum)) . "' WHERE `id` = '$user_id'");
echo ' ';
}
echo '' .
'';
break;
default:
echo '' . $lng['settings'] . ' | ' . $lng['common_settings'] . '' .
' ';
if (isset($_POST['submit'])) {
/*
-----------------------------------------------------------------
Записываем новые настройки, заданные пользователем
-----------------------------------------------------------------
*/
$set_user['timeshift'] = isset($_POST['timeshift']) ? intval($_POST['timeshift']) : 0;
$set_user['avatar'] = isset($_POST['avatar']);
$set_user['smileys'] = isset($_POST['smileys']);
$set_user['translit'] = isset($_POST['translit']);
$set_user['digest'] = isset($_POST['digest']);
$set_user['direct_url'] = isset($_POST['direct_url']);
$set_user['field_h'] = isset($_POST['field_h']) ? abs(intval($_POST['field_h'])) : 3;
$set_user['kmess'] = isset($_POST['kmess']) ? abs(intval($_POST['kmess'])) : 10;
$set_user['quick_go'] = isset($_POST['quick_go']);
if ($set_user['timeshift'] < -12)
$set_user['timeshift'] = -12;
elseif ($set_user['timeshift'] > 12)
$set_user['timeshift'] = 12;
if ($set_user['kmess'] < 5)
$set_user['kmess'] = 5;
elseif ($set_user['kmess'] > 99)
$set_user['kmess'] = 99;
if ($set_user['field_w'] < 10)
$set_user['field_w'] = 10;
elseif ($set_user['field_w'] > 80)
$set_user['field_w'] = 80;
if ($set_user['field_h'] < 1)
$set_user['field_h'] = 1;
elseif ($set_user['field_h'] > 9)
$set_user['field_h'] = 9;
// Устанавливаем скин
foreach (glob('../theme/*/*.css') as $val)
$theme_list[] = array_pop(explode('/', dirname($val)));
$set_user['skin'] = isset($_POST['skin']) && in_array($_POST['skin'], $theme_list) ? functions::check($_POST['skin']) : $set['skindef'];
// Устанавливаем язык
$lng_select = isset($_POST['iso']) ? trim($_POST['iso']) : false;
if ($lng_select && array_key_exists($lng_select, core::$lng_list)) {
$set_user['lng'] = $lng_select;
unset($_SESSION['lng']);
}
// Записываем настройки
mysql_query("UPDATE `users` SET `set_user` = '" . mysql_real_escape_string(serialize($set_user)) . "' WHERE `id` = '$user_id'");
$_SESSION['set_ok'] = 1;
header('Location: profile.php?act=settings');
exit;
} elseif (isset($_GET['reset']) || empty($set_user)) {
/*
-----------------------------------------------------------------
Задаем настройки по-умолчанию
-----------------------------------------------------------------
*/
mysql_query("UPDATE `users` SET `set_user` = '' WHERE `id` = '$user_id'");
$_SESSION['reset_ok'] = 1;
header('Location: profile.php?act=settings');
exit;
}
/*
-----------------------------------------------------------------
Форма ввода пользовательских настроек
-----------------------------------------------------------------
*/
if (isset($_SESSION['set_ok'])) {
echo ' ';
unset($_SESSION['set_ok']);
}
if (isset($_SESSION['reset_ok'])) {
echo ' ';
unset($_SESSION['reset_ok']);
}
echo '' .
'';
}
users tablom :
id name name_lat password rights failed_login imname sex komm postforum postguest postchat yearofbirth datereg lastdate mail icq skype jabber www about live mibile status ip ip_via_proxy browser preg regadm mailvis dayb monthb sestime total_on_site lastpost rest_code rest_time movings place set_user set_forum set_mail karma_plus karma_minus karma_time karma_off comm_count comm_old smileys balans balans_day balans_time balls prosm_ank bot notif_mail notif_sys_mail