實(shí)現(xiàn)成員可用(只顯示該成員的分享)

2024-07-17 23:50 更新

為了獲取更多最新內(nèi)容及功能更新,請(qǐng)直接訪問我們的首頁以查看DzzOffice筆記的最新地址。

最重要的一步:

將admin\share文件夾移入\dzz\目錄下

第二步:

打開\dzz\share\index.php文件,以下步驟均在此文件中操作!

  1. 將if (!defined('IN_DZZ') || !defined('IN_ADMIN')) {修改為if (!defined('IN_DZZ')) {
  2. uid = intval(_GET['uid']);后面添加$uid1=$_G['uid'];
if ($count = DB::result_first("SELECT COUNT(*) FROM %t WHERE $sql", $param)) { $list = DB::fetch_all("SELECT * FROM %t WHERE $sql $orderby limit $start,$perpage", $param); foreach ($list as $k=> $value) { $value['sharelink'] = C::t('shorturl')->getShortUrl(getglobal('siteurl').'index.php?mod=shares&sid='.dzzencode($value['id'])); if ($value['dateline']) $value['fdateline'] = dgmdate($value['dateline']); if ($value['password']) $value['password'] = dzzdecode($value['password']); if ($value['endtime']) $value['fendtime'] = dgmdate($value['endtime'], 'Y-m-d'); $value['fsize'] = formatsize($value['size']); $value['ftype'] = getFileTypeName($value['type'], $value['ext']); if ($value['type'] == 'folder') $value['img'] = 'dzz/images/extimg/folder.png'; if ($value['img']) $value['img'] = str_replace('dzz/images/extimg/', 'dzz/images/extimg_small/', $value['img']); if ($value['type'] == 'image' && $value['status'] == -3) $value['img'] = ''; $value['fstatus'] = $sharestatus[$value['status']]; if (is_file($_G['setting']['attachdir'] . './qrcode/' . $value['sid'][0] . '/' . $value['sid'] . '.png')) $value['qrcode'] = $_G['setting']['attachurl'] . './qrcode/' . $value['sid'][0] . '/' . $value['sid'] . '.png'; $value['shareurl'] = $_G['siteurl'] . 's.php?sid=' . $value['sid']; $list[$k] = $value; } $multi = multi($count, $perpage, $page, $theurl, 'pull-right'); }

將上面的代碼替換為下面的代碼

if ($_G['adminid']) { if ($count = DB::result_first("SELECT COUNT(*) FROM %t WHERE $sql", $param)) { $list = DB::fetch_all("SELECT * FROM %t WHERE $sql $orderby limit $start,$perpage", $param); } }else{ if ($count = DB::result_first("SELECT COUNT(*) FROM %t WHERE uid =$uid1 and $sql", $param)) { $list = DB::fetch_all("SELECT * FROM %t WHERE uid =$uid1 and $sql $orderby limit $start,$perpage", $param); } } foreach ($list as $k=> $value) { $value['sharelink'] = C::t('shorturl')->getShortUrl(getglobal('siteurl').'index.php?mod=shares&sid='.dzzencode($value['id'])); if ($value['dateline']) $value['fdateline'] = dgmdate($value['dateline']); if ($value['password']) $value['password'] = dzzdecode($value['password']); if ($value['endtime']) $value['fendtime'] = dgmdate($value['endtime'], 'Y-m-d'); $value['ftype'] = getFileTypeName($value['type'], $value['ext']); if ($value['type'] == 'folder') $value['img'] = 'dzz/images/extimg/folder.png'; if ($value['img']) $value['img'] = str_replace('dzz/images/extimg/', 'dzz/images/extimg_small/', $value['img']); if ($value['type'] == 'image' && $value['status'] == -3) $value['img'] = ''; $value['fstatus'] = $sharestatus[$value['status']]; if (is_file($_G['setting']['attachdir'] . './qrcode/' . $value['sid'][0] . '/' . $value['sid'] . '.png')) $value['qrcode'] = $_G['setting']['attachurl'] . './qrcode/' . $value['sid'][0] . '/' . $value['sid'] . '.png'; $value['shareurl'] = $_G['siteurl'] . 's.php?sid=' . $value['sid']; $list[$k] = $value; } $multi = multi($count, $perpage, $page, $theurl, 'pull-right');

第三步:

打開\dzz\share\template\share.htm文件:

  1. 將文件中出現(xiàn)的所有{ADMINSCRIPT}修改為{DZZSCRIPT}
  2. 在{lang del_share}</span> </button>后面添加<!--{if $_G[adminid]==1}-->,
  3. 在{lang cancel_shielding}</span> </button>后面添加<!--{/if}-->

第四步:

后臺(tái)應(yīng)用市場中編輯文件管理,修改以下參數(shù):

應(yīng)用路徑:dzz應(yīng)用地址:{dzzscript}?mod=share組權(quán)限:成員可用

在權(quán)限管理管理中將文件管理的默認(rèn)位置設(shè)置為開始菜單

第五步:

打開\admin\language\zh-cn\lang.php文件,將下面的代碼都移至\dzz\share\language\zh-cn\lang.php文件中:

'sharing_file'=>'分享文件','share_time'=>'分享時(shí)間','share_user'=>'分享用戶','private_share'=>'私密分享','share_title'=>'分享標(biāo)題','stop_sharing'=>'取消分享','stop_sharing_success'=>'取消分享成功','affirm_stop_sharing'=>'確定取消分享','del_share'=>'刪除分享','screen_share'=>'屏蔽分享','affirm_screen_share'=>'確定屏蔽分享','share_screen'=>'分享屏蔽','share_screen_success'=>'分享屏蔽成功','share_screen_failure'=>'分享屏蔽失敗','shielding_failure'=>'屏蔽失敗','cancel_shielding'=>'取消屏蔽','cancel_shielding_success'=>'取消屏蔽成功','cancel_shielding_failure'=>'取消屏蔽失敗','affirm_cancel_shielding'=>'確定取消屏蔽','scon_code_send_mobile'=>'掃描二維碼,發(fā)送到手機(jī)','expiration_time'=>'到期時(shí)間','limited_number'=>'限制次數(shù)','extract_password'=>'提取密碼','been_blocked'=>'已屏蔽','file_been_deleted'=>'文件已刪除','degree_exhaust'=>'次數(shù)用盡',// admin/share/share.html'share_file_content'=>'好東西要曬出來,快把你的文件分享給身邊的朋友們吧。','share_stop_sharing1'=>'<p class="text-center">取消分享后,該條分享記錄將被刪除,將無法再訪問此分享鏈接。</p><p class="text-center">你確認(rèn)要取消分享嗎?</p>','share_stop_sharing2'=>'<p class="text-center">該條分享記錄將被屏蔽,將無法再訪問此分享鏈接。</p><p class="text-center">你確認(rèn)要屏蔽該條分享嗎?</p>','share_stop_sharing3'=>'<p class="text-center">該條分享記錄將被恢復(fù)訪問。</p><p class="text-center">你確認(rèn)要取消屏蔽該條分享嗎?</p>','attachment' => '附件','other' => '其他',

第六步:

打開\dzz\share\ajax.php文件

elseif ($_GET['do'] == 'forbidden' ) { $sids = $_GET['sids']; if ($_GET['flag'] == 'forbidden') { $status = -4; } else { $status = 0; } if ($sids && C::t('shares') -> update($sids, array('status' => $status))) { exit(json_encode(array('msg' => 'success'))); } else { exit(json_encode(array('error' => lang('share_screen_failure')))); } } //將上面的代碼替換為下面的代碼 elseif ($_GET['do'] == 'forbidden' && $_G['adminid']) { $sids = $_GET['sids']; if ($_GET['flag'] == 'forbidden') { $status = -4; } else { $status = 0; } if ($sids && C::t('shares') -> update($sids, array('status' => $status))) { exit(json_encode(array('msg' => 'success'))); } else { exit(json_encode(array('error' => lang('share_screen_failure')))); } }else{ exit(json_encode(array('error' => '非法操作'))); }

第七步:

后臺(tái)系統(tǒng)工具中清理緩存即可



以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)