Browse Source

vip rights update

master
filesite 6 months ago
parent
commit
467753c2fa
  1. 3
      conf/app.php
  2. 18
      themes/tajian/controller/FrontapiController.php
  3. 21
      themes/tajian/controller/MyController.php
  4. 12
      themes/tajian/views/my/createdir.php
  5. 4
      themes/tajian/views/my/sharedir.php
  6. 4
      themes/tajian/views/site/new.php

3
conf/app.php

@ -64,7 +64,8 @@ $configs = array(
'tag_dir' => 'tags/', //tag分类目录 'tag_dir' => 'tags/', //tag分类目录
'task_dir' => 'task/', //分享视频下载任务文件保存目录 'task_dir' => 'task/', //分享视频下载任务文件保存目录
'task_log' => 'tasks.log', //分享视频下载任务文件日志文件 'task_log' => 'tasks.log', //分享视频下载任务文件日志文件
'max_dir_num' => 20, //一个手机可创建的最大收藏夹数量 'max_dir_num' => 3, //普通用户:一个手机可创建的最大收藏夹数量
'max_dir_num_vip' => 50, //VIP用户:一个手机可创建的最大收藏夹数量
'supportedPlatforms' => array( 'supportedPlatforms' => array(
'B站', 'B站',
'抖音', '抖音',

18
themes/tajian/controller/FrontapiController.php

@ -1208,9 +1208,7 @@ eof;
} }
//VIP身份判断 //VIP身份判断
if (empty($loginedUser['cellphone']) || !in_array($loginedUser['cellphone'], FSC::$app['config']['tajian_vip_user'])) { $isVipUser = Common::isVipUser($loginedUser);
throw new Exception('Oops,你还不是VIP,请联系首页底部客服邮箱开通。');
}
//返回给视图的变量 //返回给视图的变量
@ -1231,8 +1229,13 @@ eof;
if (empty($err)) { //如果数据检查通过,尝试保存 if (empty($err)) { //如果数据检查通过,尝试保存
//已经创建的收藏夹数量检查 //已经创建的收藏夹数量检查
//每个手机号最多创建 20 个收藏夹 //普通用户:每个手机号最多创建 3 个收藏夹
$max_num = !empty(FSC::$app['config']['tajian']['max_dir_num']) ? FSC::$app['config']['tajian']['max_dir_num'] : 10; $max_num = !empty(FSC::$app['config']['tajian']['max_dir_num']) ? FSC::$app['config']['tajian']['max_dir_num'] : 3;
//VIP用户:每个手机号最多创建 20 个收藏夹
if ($isVipUser) { //vip用户判断
$max_num = !empty(FSC::$app['config']['tajian']['max_dir_num_vip']) ? FSC::$app['config']['tajian']['max_dir_num_vip'] : 20;
}
$myDirs = Common::getMyDirs($loginedUser['cellphone'], $loginedUser['username']); $myDirs = Common::getMyDirs($loginedUser['cellphone'], $loginedUser['username']);
if (count($myDirs) >= $max_num) { if (count($myDirs) >= $max_num) {
$err = "你已经创建了 {$max_num} 个账号,已达到最大数量"; $err = "你已经创建了 {$max_num} 个账号,已达到最大数量";
@ -1276,11 +1279,6 @@ eof;
throw new Exception('Oops,请求地址有误'); throw new Exception('Oops,请求地址有误');
} }
//VIP身份判断
if (empty($loginedUser['cellphone']) || !in_array($loginedUser['cellphone'], FSC::$app['config']['tajian_vip_user'])) {
throw new Exception('Oops,你还不是VIP,请联系首页底部客服邮箱开通。');
}
//返回给视图的变量 //返回给视图的变量
$code = 0; $code = 0;

21
themes/tajian/controller/MyController.php

@ -148,14 +148,19 @@ Class MyController extends SiteController {
public function actionCreatedir() { public function actionCreatedir() {
//VIP身份判断 //VIP身份判断
$loginedUser = Common::getUserFromSession(); $loginedUser = Common::getUserFromSession();
$isVipUser = true; $isVipUser = Common::isVipUser($loginedUser);
if (empty($loginedUser['cellphone']) || !in_array($loginedUser['cellphone'], FSC::$app['config']['tajian_vip_user'])) {
$isVipUser = false; //普通用户:每个手机号最多创建 3 个收藏夹
$max_num = !empty(FSC::$app['config']['tajian']['max_dir_num']) ? FSC::$app['config']['tajian']['max_dir_num'] : 3;
$max_num_vip = 20;
//VIP用户:每个手机号最多创建 20 个收藏夹
if ($isVipUser) { //vip用户判断
$max_num = $max_num_vip = !empty(FSC::$app['config']['tajian']['max_dir_num_vip']) ? FSC::$app['config']['tajian']['max_dir_num_vip'] : 20;
} }
$defaultTitle = "添加账号"; $defaultTitle = "添加账号";
$viewName = 'createdir'; $viewName = 'createdir';
return $this->actionIndex($viewName, $defaultTitle, compact('isVipUser')); return $this->actionIndex($viewName, $defaultTitle, compact('isVipUser', 'max_num', 'max_num_vip'));
} }
//共享收藏夹 //共享收藏夹
@ -175,15 +180,9 @@ Class MyController extends SiteController {
$myShareDirs = Common::getMyShareDirs($loginedUser['cellphone'], $loginedUser['username']); $myShareDirs = Common::getMyShareDirs($loginedUser['cellphone'], $loginedUser['username']);
//VIP身份判断
$isVipUser = true;
if (empty($loginedUser['cellphone']) || !in_array($loginedUser['cellphone'], FSC::$app['config']['tajian_vip_user'])) {
$isVipUser = false;
}
$defaultTitle = "共享账号"; $defaultTitle = "共享账号";
$viewName = 'sharedir'; $viewName = 'sharedir';
return $this->actionIndex($viewName, $defaultTitle, compact('myDirs', 'myNicks', 'isMine', 'myShareDirs', 'isVipUser')); return $this->actionIndex($viewName, $defaultTitle, compact('myDirs', 'myNicks', 'isMine', 'myShareDirs'));
} }
} }

12
themes/tajian/views/my/createdir.php

@ -5,20 +5,20 @@ if (!empty(FSC::$app['config']['multipleUserUriParse']) && !empty(FSC::$app['use
$linkPrefix = '/' . FSC::$app['user_id']; $linkPrefix = '/' . FSC::$app['user_id'];
} }
$max_num = !empty(FSC::$app['config']['tajian']['max_dir_num']) ? FSC::$app['config']['tajian']['max_dir_num'] : 10;
?><main class="g_main_lay"> ?><main class="g_main_lay">
<div class="breadcrumbs"> <div class="breadcrumbs">
<a href="<?=$linkPrefix?>/my/">&lt;&lt;返回</a> <a href="<?=$linkPrefix?>/my/">&lt;&lt;返回</a>
</div> </div>
<form class="g_form_style mt65" id="dir_new_form" action="" method="POST"> <form class="g_form_style mt65" id="dir_new_form" action="" method="POST">
<?php if (empty($viewData['isVipUser'])) { ?>
<div class="alert warning">此功能限VIP使用,限时免费开通请联系客服哦</div>
<?php } ?>
<div class="mb-3 pt20"> <div class="mb-3 pt20">
<label for="text_input_dir" class="form-label">账号昵称</label> <label for="text_input_dir" class="form-label">账号昵称</label>
<input id="text_input_dir" name="nickname" placeholder="请填写 2 - 5 个汉字" value=""> <input id="text_input_dir" name="nickname" placeholder="请填写 2 - 5 个汉字" value="">
<p class="mt10">说明:<br>一个手机号码最多添加 <strong><?=$max_num?></strong> 个账号。</p> <p class="mt10">
<strong>说明:</strong>
<br>
VIP可以添加 <strong><?=$viewData['max_num_vip']?></strong> 个账号,
当前可添加 <strong><?=$viewData['max_num']?></strong> 个账号。
</p>
</div> </div>
<div class="avform_bt"> <div class="avform_bt">
<button class="jsbtn" aria-label="保存" type="submit"> <button class="jsbtn" aria-label="保存" type="submit">

4
themes/tajian/views/my/sharedir.php

@ -12,10 +12,6 @@ $max_num = !empty(FSC::$app['config']['tajian']['max_dir_num']) ? FSC::$app['con
</div> </div>
<div class="g_form_style mt65"> <div class="g_form_style mt65">
<form id="share_dir_form" action="" method="POST"> <form id="share_dir_form" action="" method="POST">
<?php if (empty($viewData['isVipUser'])) { ?>
<div class="alert warning">此功能限VIP使用,限时免费开通请联系客服哦</div>
<?php } ?>
<div class="mb-3 pt20"> <div class="mb-3 pt20">
<label for="text_input_phone" class="form-label">朋友手机号码</label> <label for="text_input_phone" class="form-label">朋友手机号码</label>
<input id="text_input_phone" name="cellphone" placeholder="请填写朋友的手机号码" value=""> <input id="text_input_phone" name="cellphone" placeholder="请填写朋友的手机号码" value="">

4
themes/tajian/views/site/new.php

@ -9,7 +9,9 @@
$supportPlatforms = FSC::$app['config']['tajian']['supportedPlatforms']; $supportPlatforms = FSC::$app['config']['tajian']['supportedPlatforms'];
echo implode(',', array_slice($supportPlatforms, 0, -1)); echo implode(',', array_slice($supportPlatforms, 0, -1));
?> ?>
,如需支持其它平台或<strong>任意网址</strong>,以及<strong>搭建视频分享网站</strong>,请 <a href="mailto://[email protected]">Email联系</a> <br>
VIP可收藏<strong>任意网址</strong>,开通VIP、<strong>搭建视频网站</strong>
<a href="mailto://[email protected]">👉Email联系</a>
</p> </p>
</div> </div>
<div class="mb-3 mt20"> <div class="mb-3 mt20">

Loading…
Cancel
Save