File: /var/www/dk/wp-content/themes/food/header-competition.php
<?php
$error_msg = '';
if (isset($_POST['action']) && $_POST['action'] == 'login') {
$rv = login_by_type($_POST['user_login_name'], $_POST['user_pass']);
if ($rv->rc > 0) {
echo "<script>alert('" . $rv->msg . "')</script>";
}
}
if (isset($_POST['action']) && $_POST['action'] == 'loginout') {
user_login_out();
}
$current_user = wp_get_current_user();
// 获取当前用户的ID
$user_id = $current_user->ID;
// 获取当前用户的用户名
$user_login = $current_user->user_login;
// 获取当前用户的邮箱
$user_email = $current_user->user_email;
// 获取当前用户的显示名称
$display_name = $current_user->display_name;
//update_user_meta($user->ID, 'wp_user_display_name', $display_name);
if ($display_name == '') {
$display_name = $user_login;
}
//电话
$phone = get_user_meta($user_id, 'phone', true);
//年龄
$birthday = get_user_meta($user_id, 'birthday', true);
$declaration = get_user_meta($user_id, 'declaration', true);
//echo $birthday . ' ' . $declaration;
$wpuseravatarID = get_user_meta($user_id, 'wp_user_avatar_id', true); //用户头像id
$wpuseravatar = wp_get_attachment_url($wpuseravatarID);
$wp_user_avatar_url = get_user_meta($user_id, 'wp_user_avatar_url', true); //用户头像id
if ($wp_user_avatar_url == '') {
$wp_user_avatar_url = get_template_directory_uri() . '/food-app/img/user.png';
}
$user_info = get_login_user();
$user_info['display_name'] = $display_name;
$user_info['wp_user_avatar_url'] = $wp_user_avatar_url;
//print_r($user_info);
$vueVersion = time();
?>
<script>
const user_info = JSON.parse('<?php echo json_encode($user_info) ?>')
</script>
<!DOCTYPE html>
<!--<html lang="en">-->
<html lang="cmn-Hant-HK" style="height: 100%">
<!--<html lang="zh-CN">-->
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- <meta name="x5-fullscreen" content="true"> -->
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta content="telephone=no" name="format-detection"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">
<!-- <meta name="full-screen" content="yes"> -->
<title>比賽</title>
<meta name="description" content="">
<!-- <link rel="shortcut icon" href="-->
<?php //bloginfo('template_directory'); ?><!--/food-app/img/logo.png" type="image/x-icon">-->
<link rel="shortcut icon"
href="<?php bloginfo('template_directory'); ?>/food-app/img/MedicalMediaChannel/favicon.ico"
type="image/x-icon">
<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/food-app/css/antd.min.css">
<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/css/style.css?v=<?php echo time(); ?>">
<script src="<?php bloginfo('template_directory'); ?>/food-app/js/qs.js"></script>
<script src="<?php bloginfo('template_directory'); ?>/food-app/js/vue.min.js"></script>
<script src="<?php bloginfo('template_directory'); ?>/food-app/js/httpVueLoader.js"></script>
<script src="<?php bloginfo('template_directory'); ?>/food-app/js/moment.min.js"></script>
<script src="<?php bloginfo('template_directory'); ?>/food-app/js/antd.min.js"></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>-->
<script src="<?php echo get_template_directory_uri(); ?>/food-app/ranking/creating_page_js/axios.min.js"></script>
</head>
<style>
body {
min-height: 100%;
/*display: flex;*/
flex-direction: column;
height: 100%;
}
/*#banner {*/
/* !*background-color: lightgreen;*!*/
/* height: 500px;*/
/*}*/
@media only screen and (max-width: 1200px) {
/*#banner {*/
/* height: 300px;*/
/*}*/
}
.logo_img {
width: 188px;
}
.header_location_img {
width: 20px;
}
.topLink_center_slider {
float: left;
height: 100%;
line-height: 32px;
font-size: 13px;
color: #6d6d6d;
/*background: url(img/top_icon.gif) no-repeat right center;*/
padding-right: 24px;
cursor: pointer;
}
.topLink_center_slider .topLink_center_slider_btn {
margin-top: 16px;
margin-left: 20px;
padding: 5px 10px;
}
.hdSearch {
height: 40px;
background: rgba(255, 255, 255, 0.39);
border: 1px solid #009B96;
opacity: 1;
border-radius: 20px;
}
.hdSearch .hdSearch_input {
text-indent: 10px;
margin-right: 10px;
}
.hdSearch .hdSearch_btn {
width: 100px;
height: 40px;
border-top-right-radius: 20px;
border-bottom-right-radius: 20px;
}
.header_mobile_menu_img {
width: 48px;
height: 48px;
}
/*.header_menu {*/
/* display: none;*/
/* font-size: 16px;*/
/*}*/
.header_menu_icon_nav .header_menu_icon_nav_img {
width: 36px;
height: 36px;
}
.header_mobile_menu {
/*display: none;*/
}
@media only screen and (min-width: 768px) {
.header_mobile_menu {
display: none;
}
.header_menu {
display: flex;
}
}
#app {
min-height: 100%;
display: flex; /* 容器为flex布局 */
flex-direction: column; /* 方向为纵向,保持正常的从上到下文档流 */
}
footer {
margin-top: auto; /* 设置footer的上外边距为auto */
/*background-color: #457B9D;*/
}
</style>
<body>
<!--<div class="bg-MMC-main-color border-MMC-main-color"></div>-->
<script>
function setAutoSize() {
var htmlDom = document.getElementsByTagName('html')[0]
var temp_w = document.body.clientWidth
if (document.body.clientWidth >= 1280) {
htmlDom.style.fontSize = '80px'
} else if (document.body.clientWidth >= 768) {
htmlDom.style.fontSize = '50px'
} else {
nowSize = (temp_w / 750) * 100
htmlDom.style.fontSize = nowSize + 'px'
}
}
window.onresize = setAutoSize
setAutoSize()
</script>