//启用用户的个人设置 Monxin专用(PHP代码函数)
//本代码基于Monxin 运行
//代码来源:Monxin ./config/functions.php
function send_user_set_cookie($pdo){
$sql="select * from ".$pdo->index_pre."user_set_item";
$r=$pdo->query($sql,2);
foreach($r as $v){
$sql2="select `item_value` from ".$pdo->index_pre."user_set where `user_id`='".@$_SESSION['monxin']['id']."' and `item_variable`='".$v['variable']."'";
$r2=$pdo->query($sql2,2)->fetch(2);
if($r2['item_value']==''){$value=$v['default_value'];}else{$value=$r2['item_value'];}
setcookie($v['variable'],$value);
}
}