编辑主题文件:/wp-content/themes/ripro/parts/navbar-hover.php 如果有用子主题的就把代码放到子主题的目录 如:/wp-content/themes/子主题目录/parts/navbar-hover.php 如果用子主题没有这个【navbar-hover.php】文件就放到ripro的:/wp-content/themes/ripro/parts/navbar-hover.php 原本头部PHP代码: - <?php
- global $current_user;
- $CaoUser = new CaoUser($current_user->ID);
- $site_money_ua = _cao('site_money_ua');
- ?>
复制代码 替换为下面代码
- <?php
- global $current_user;
- $CaoUser = new CaoUser($current_user->ID);
- $site_money_ua = _cao('site_money_ua');
- session_start();
- if($_SESSION['cao_from_user_id']>=1 and $_SESSION['cao_from_user_id']!=$current_user->ID){
- update_user_meta($current_user->ID, 'cao_ref_from',$_SESSION['cao_from_user_id']);
- }
-
- if (!$CaoUser->vip_status()) {
- update_user_meta($current_user->ID, 'cao_user_type','vip');
-
- //增加会员一年时间 不懂这个strtotime("+1 month")的看这个网址https://blog.csdn.net/qq_25600055/article/details/79862421
- $vidtime=date("Y-m-d",strtotime("+1 month"));
- update_user_meta($current_user->ID, 'cao_vip_end_time',$vidtime);
- echo "<script language="javascript">alert('会员领取成功,".$CaoUser->vip_name()."到期时间:{$vidtime});</script>";
- }
-
- ?>
复制代码
|