|
@@ -28,30 +28,37 @@ class Content
|
|
|
$uri = Uri::$value;
|
|
|
|
|
|
$id = Dever::input('id');
|
|
|
- if ($uri == 'xnr-detail') {
|
|
|
- $data = Dever::db('content/xuniren')->one($id);
|
|
|
- } elseif ($uri == 'zwz-detail') {
|
|
|
- $data = Dever::db('content/creater')->one($id);
|
|
|
- } else {
|
|
|
- $data = Dever::db('content/news')->one($id);
|
|
|
- }
|
|
|
+ $config = Dever::load('main/content.config');
|
|
|
+ if ($id) {
|
|
|
+ if ($uri == 'xnr-detail') {
|
|
|
+ $data = Dever::db('content/xuniren')->one($id);
|
|
|
+ } elseif ($uri == 'zwz-detail') {
|
|
|
+ $data = Dever::db('content/creater')->one($id);
|
|
|
+ } else {
|
|
|
+ $data = Dever::db('content/news')->one($id);
|
|
|
+ }
|
|
|
|
|
|
- if (isset($data['share_title']) && $data['share_title']) {
|
|
|
- $title = $data['share_title'];
|
|
|
- } else {
|
|
|
- $title = $data['name'];
|
|
|
- }
|
|
|
+ if (isset($data['share_title']) && $data['share_title']) {
|
|
|
+ $title = $data['share_title'];
|
|
|
+ } else {
|
|
|
+ $title = $data['name'];
|
|
|
+ }
|
|
|
|
|
|
- if (isset($data['share_pic']) && $data['share_pic']) {
|
|
|
- $title = $data['share_pic'];
|
|
|
+ if (isset($data['share_pic']) && $data['share_pic']) {
|
|
|
+ $pic = $data['share_pic'];
|
|
|
+ } else {
|
|
|
+ $pic = $data['pic'];
|
|
|
+ }
|
|
|
} else {
|
|
|
- $title = $data['pic'];
|
|
|
+ $title = $config['name'];
|
|
|
+ $pic = $config['logo'];
|
|
|
}
|
|
|
+
|
|
|
|
|
|
$ralateUid = '';
|
|
|
$appkey = '';
|
|
|
$url = Dever::url();
|
|
|
- $config = Dever::load('main/content.config');
|
|
|
+
|
|
|
$share = 'config.wbshare = {
|
|
|
title: "'.$title.'",
|
|
|
url: "'.$url.'",
|
|
@@ -62,7 +69,8 @@ class Content
|
|
|
|
|
|
|
|
|
$share .= 'config.ins="'.$config['ins'].'"';
|
|
|
-
|
|
|
+ $share .= 'config.douyin="'.$config['douyin_qrcode'].'"';
|
|
|
+ $share .= 'config.bili="'.$config['bilibili'].'"';
|
|
|
|
|
|
return $share;
|
|
|
}
|