Browse Source

add index page for tajian

master
filesite 7 months ago
parent
commit
ca1fcf3b84
  1. 2
      conf/app.php
  2. 2
      conf/custom_config_tajian.json
  3. 15
      themes/tajian/controller/FrontapiController.php
  4. 32
      themes/tajian/controller/SiteController.php
  5. 57
      themes/tajian/views/layout/index.php
  6. 4
      themes/tajian/views/layout/main.php
  7. 2
      themes/tajian/views/site/index.php
  8. 65
      themes/tajian/views/site/tajian.php
  9. 23
      www/css/tajian.css
  10. BIN
      www/img/download.png
  11. BIN
      www/img/favorite.png
  12. 4
      www/img/info.svg

2
conf/app.php

@ -14,7 +14,7 @@ $configs = array( @@ -14,7 +14,7 @@ $configs = array(
//并自动把用户ID加入到数据目录content_directory路径后面
'multipleUserUriParse' => false,
//只有上面这个开关开启,此默认用户ID才会被使用
'defaultUserId' => '1000',
'defaultUserId' => '',
//文档站皮肤
//'content_directory' => 'content/', //directory of contents in /www/

2
conf/custom_config_tajian.json

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
"theme": "tajian",
"content_directory": "tajian/",
"multipleUserUriParse": true,
"defaultUserId": "1000",
"defaultUserId": "",
"heroUnionEnable": true,
"heroUnion": {
"server_url": "https://herounion.filesite.io",

15
themes/tajian/controller/FrontapiController.php

@ -361,20 +361,15 @@ eof; @@ -361,20 +361,15 @@ eof;
return $this->renderJson(compact('code', 'msg', 'err'));
}
//TODO: 采用邀请制注册
//新用户注册
public function actionRegister() {
//TODO: 把自己的收藏视频压缩成zip包
protected function createZip() {
}
//用户登陆
public function actionLogin() {
}
//打包下载自己的收藏记录
//TODO: 打包下载自己的收藏记录
public function actionDownloadfavs() {
$this->createZip();
exit;
}
}

32
themes/tajian/controller/SiteController.php

@ -12,6 +12,16 @@ Class SiteController extends Controller { @@ -12,6 +12,16 @@ Class SiteController extends Controller {
throw new Exception('Please install php extension php-mbstring first!', 500);
}
//如果没有开启多用户支持,或者当前用户不为空
if (empty(FSC::$app['config']['multipleUserUriParse']) || !empty(FSC::$app['user_id'])) {
return $this->renderFavVideos();
}else {
return $this->renderTajianIndex();
}
}
//显示当前用户收藏的视频
protected function renderFavVideos() {
//获取数据
$menus = array(); //菜单,一级目录
$htmlReadme = ''; //Readme.md 内容,底部网站详细介绍
@ -79,6 +89,18 @@ Class SiteController extends Controller { @@ -79,6 +89,18 @@ Class SiteController extends Controller {
return $this->render($viewName, $params, $pageTitle);
}
//显示TA荐首页
protected function renderTajianIndex() {
$pageTitle = "Ta荐:好用的视频收藏夹,分享精彩视频给朋友,帮TA节省刷视频的时间吧!";
$this->layout = 'index';
$viewName = 'tajian';
$params = compact(
'pageTitle'
);
return $this->render($viewName, $params, $pageTitle);
}
//获取tag分类
protected function getTags($dirTree, $noFiles = false) {
$tags = array();
@ -194,5 +216,15 @@ Class SiteController extends Controller { @@ -194,5 +216,15 @@ Class SiteController extends Controller {
return $this->render($viewName, $params, $pageTitle);
}
//TODO: 采用邀请制注册
//新用户注册
public function actionRegister() {
}
//用户登陆
public function actionLogin() {
}
}

57
themes/tajian/views/layout/index.php

@ -0,0 +1,57 @@ @@ -0,0 +1,57 @@
<?php
//常用方法
require_once __DIR__ . '/../../../../plugins/Html.php';
$linkPrefix = '';
//多用户路径支持
if (!empty(FSC::$app['config']['multipleUserUriParse']) && !empty(FSC::$app['user_id'])) {
$linkPrefix = '/' . FSC::$app['user_id'];
}
?><!DocType html>
<html>
<head>
<meta charset="utf-8">
<title><?php echo $pageTitle;?></title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
<link rel="icon" type="image/x-icon" href="/favicon.ico?v1.0">
<link href="/css/tajian.css?v<?=Html::getStaticFileVersion('tajian.css', 'css')?>" rel="stylesheet">
</head>
<body>
<div class="app_recommend" id="app_recommend">
<header class="top_nav elementBlock vercenter">
<a class="log_tn clearfix" href="/">
<span class="verMiddle">Ta荐</span>
- TaJian.tv
</a>
</header>
<?php
//### Render view file
if (!empty($viewFile) && file_exists($viewFile)) {
include_once $viewFile;
}
?>
<div class="footer">
<div class="copyright">
<?php if (!empty(FSC::$app['config']['theme'])) { ?>
Theme name <strong><?php echo FSC::$app['config']['theme']; ?></strong>
<br>
<?php } ?>
<a href="https://filesite.io" target="_blank">&copy;FileSite.io</a> 2022 - execute time: {page_time_cost} ms
<br>
数据采集由
<a href="https://herounion.filesite.io" target="_blank">HeroUnion英雄联盟</a>
提供技术支持
<br>
从GitHub下 <a href="https://github.com/filesite-io/machete" target="_blank">Machete源码</a> 快速克隆本站
</div>
</div>
</div><!--app_recommend-->
<script src="/js/jquery-3.6.0.min.js"></script>
<script src="/js/lazyload.js"></script>
<script src="/js/tajian.js?v<?=Html::getStaticFileVersion('tajian.js', 'js')?>"></script>
</body>
</html>

4
themes/tajian/views/layout/main.php

@ -117,11 +117,11 @@ if (!empty($viewFile) && file_exists($viewFile)) { @@ -117,11 +117,11 @@ if (!empty($viewFile) && file_exists($viewFile)) {
<?php } ?>
<a href="https://filesite.io" target="_blank">&copy;FileSite.io</a> 2022 - execute time: {page_time_cost} ms
<br>
<a href="https://github.com/filesite-io/machete" target="_blank">Machete源码</a>搭建私有网址导航、文档、图片、视频网站
<br>
数据采集由
<a href="https://herounion.filesite.io" target="_blank">HeroUnion英雄联盟</a>
提供技术支持
<br>
从GitHub下 <a href="https://github.com/filesite-io/machete" target="_blank">Machete源码</a> 快速克隆本站
</div>
</div>
</div><!--app_recommend-->

2
themes/tajian/views/site/index.php

@ -85,4 +85,4 @@ eof; @@ -85,4 +85,4 @@ eof;
}
?>
</div>
</div>
</main>

65
themes/tajian/views/site/tajian.php

@ -0,0 +1,65 @@ @@ -0,0 +1,65 @@
<?php
//常用方法
require_once __DIR__ . '/../../../../plugins/Html.php';
$imgPreffix = '/' . FSC::$app['config']['content_directory'] . FSC::$app['config']['tajian']['data_dir'];
$linkPrefix = '';
//多用户路径支持
if (!empty(FSC::$app['config']['multipleUserUriParse']) && !empty(FSC::$app['user_id'])) {
$linkPrefix = '/' . FSC::$app['user_id'];
}
?>
<style>
body{background-color:#e5f1f3}
</style>
<main class="tajian_index">
<h1 class="h1title vercenter">
一个好用的视频收藏夹
<small>- 分享喜欢的视频给朋友,帮TA节省刷视频的时间吧!</small>
</h1>
<div class="btns clearfix">
<div class="favbtn">
<a href="###">
<img src="/img/favorite.png" alt="Create your favorite tajian link." width="100">
<br>
创建专属收藏夹
</a>
</div>
<div class="downbtn">
<a href="https://github.com/filesite-io/machete" target="_blank">
<img src="/img/download.png" alt="Download machete source code" width="100">
<br>
下载Machete源码
</a>
</div>
</div>
<h3 class="h3title pl20">使用方法</h3>
<div class="pl20 lh18">
1. 点上面“创建专属收藏夹”,
<br>&nbsp;&nbsp;&nbsp;&nbsp;用手机号码 + 邀请码(朋友手机号码末6位)<a href="###" class="loginbtn">注册</a>
<br class="hidden-xs">
&nbsp;&nbsp;&nbsp;&nbsp;还可以加客服微信索要注册邀请码
<img src="/tajian/wx_jialuoma.jpeg" alt="Ta荐客服微信二维码" width="200" class="kfwx">
<br class="hidden-xs">
2. 用手机号码 <a href="###" class="loginbtn">登录</a>
<br class="hidden-xs">
3. 从各大视频App、网站复制分享链接
<br>
4. 在“添加”里粘贴后保存
<br>
5. 分享你的专属链接给朋友
</div>
<h3 class="h3title pl20">支持的视频App/网站</h3>
<ul class="ulist pl20">
<li>抖音</li>
<li>B站 - Bilibili</li>
<li>快手</li>
<li>西瓜视频</li>
</ul>
<p class="pl20 pt20">其它App和网站将陆续增加。。。</p>
</main>

23
www/css/tajian.css

@ -23,6 +23,25 @@ a:link{text-decoration:none;} @@ -23,6 +23,25 @@ a:link{text-decoration:none;}
.breadcrumbs{padding-left:1em;padding-top:1em}
.footer{margin:7em auto 6em auto;text-align:center}
/* TaJian首页 */
.tajian_index{max-width:640px;margin:0 auto;padding:10px}
.tajian_index .h1title{margin-top:65px;font-size:17px;color:#444}
.tajian_index .h3title{margin-top:30px;margin-bottom:10px;padding-bottom:8px;border-bottom:1px solid #DDD}
.tajian_index .ulist{margin-top:10px}
.tajian_index .ulist li{list-style:circle;margin-left:26px;padding-left:8px;line-height:1.8}
.tajian_index .btns{margin-top:30px;text-align:center}
.tajian_index .btns img{width:90px;opacity:0.8}
.tajian_index .btns .favbtn{float:left;width:50%}
.tajian_index .btns .downbtn{float:right;width:50%}
.tajian_index .btns a{color:#3e3edc}
.tajian_index .btns a:hover{color:blue}
.tajian_index .btns a:hover img{opacity:1}
.tajian_index .pl20{padding-left:20px}
.tajian_index .pt20{padding-top:20px}
.tajian_index .lh18{line-height:1.8}
.tajian_index .kfwx{float:right;border-radius:6px}
.tajian_index .loginbtn{border:1px solid #50509d;background-color:#50509d;color:#FFF;padding:3px 10px;border-radius:4px}
/* 首页 start*/
.g_app_lay{padding:56px 0 0 200px;}
/* 顶部导航 */
@ -219,6 +238,10 @@ a:link{text-decoration:none;} @@ -219,6 +238,10 @@ a:link{text-decoration:none;}
.menu_ls>a{flex:1;text-align:center;padding:10px 0;margin:0;}
.menu_ls>a img{margin:0;}
.g_form_style{padding:0 12% 0 10%;width:100%;}
.tajian_index .h1title small{display:block}
.tajian_index .kfwx{float:none;width:130px;display:block;margin-left:1em}
.tajian_index .loginbtn{display:block;width:80%;margin-left:1em;text-align:center}
.hidden-xs{display:none}
}
.hide{display:none}

BIN
www/img/download.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
www/img/favorite.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

4
www/img/info.svg

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-info">
<path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path>
</svg>

After

Width:  |  Height:  |  Size: 454 B

Loading…
Cancel
Save