迅睿CMS框架是一款PHP8高性能·簡(jiǎn)單易用的CMS開源開發(fā)框架,基于MIT開源許可協(xié)議發(fā)布,免費(fèi)且不限制商業(yè)使用,是免費(fèi)開源的產(chǎn)品,以萬(wàn)端互聯(lián)為設(shè)計(jì)理念,支持的微信公眾號(hào)、小程序、APP客戶端、移動(dòng)端網(wǎng)站、PC網(wǎng)站等多終端式管理系統(tǒng)。
聯(lián)系官方銷售客服
1835022288
028-61286886
這個(gè)瀏覽有分頁(yè)嗎,沒找到,如果圖片多的話怎么看到以前的圖片
不支持的,只顯示最多30個(gè),可以按ID來(lái)搜索
回復(fù)迅睿框架創(chuàng)始人
問題是ID是啥都不知道
名字有可能是亂七八糟的字母
這就很尷尬
不會(huì)是讓在附件管理看下ID好,然后搜吧
回復(fù)迅??蚣軇?chuàng)始人
這樣的控制器能進(jìn)行重寫嗎?
不能,記住core,fcms都不能修改,會(huì)影響升級(jí),其他地方可以隨便改
回復(fù)@張益達(dá)
回復(fù)@易學(xué)習(xí)
我知道核心的東西不能修改,我的意思是能不能通過和重寫 My/Model 一樣重寫這個(gè)
我記得應(yīng)用市場(chǎng)有一個(gè)組件可以
回復(fù)@開黑嗎我玩輔助
找了一下貌似沒找到
在模板里面寫標(biāo)簽實(shí)現(xiàn)分頁(yè)啊,不難的
回復(fù)@眼鏡
我看這個(gè)貌似不行啊
通過標(biāo)簽?zāi)軐?shí)現(xiàn)嗎?
public function input_file_list() { $p = $this->_get_upload_params(); $c = (int)\Phpcmf\Service::L('input')->get('ct'); // 當(dāng)已有數(shù)量 $ct = max(1, (int)$p['count']); // 可上傳數(shù)量 if (IS_AJAX_POST) { $p = (int)\Phpcmf\Service::L('input')->post('is_page'); $ids = \Phpcmf\Service::L('input')->get_post_ids($p ? 'ids1' : 'ids0'); if (!$ids) { $this->_json(0, dr_lang('至少要選擇一個(gè)文件')); } elseif (dr_count($ids) > $ct - $c) { $this->_json(0, dr_lang('只能選擇%s個(gè)文件,你已經(jīng)選擇%s個(gè)', $ct - $c, dr_count($ids))); } $list = []; $temp = \Phpcmf\Service::M()->table($p ? 'attachment_data' : 'attachment_unused')->where('uid', $this->uid)->where_in('id', $ids)->limit_page(); foreach ($temp as $t) { $list[] = [ 'id' => $t['id'], 'name' => $t['filename'], 'file' => $t['attachment'], 'url' => dr_get_file($t['id']), 'preview' => dr_file_preview_html(dr_get_file_url($t)), 'upload' => '<input type="file" name="file_data"></button>', ]; } $data = [ 'count' => dr_count($ids), 'result' => $list, ]; $this->_json(1, dr_lang('已選擇%s個(gè)文件', $data['count']), $data); } $num = 14; $exts = dr_safe_replace($p['exts']); $list = [ 'used' => [], 'unused' => $exts ? \Phpcmf\Service::M()->table('attachment_unused')->where('uid', $this->uid)->where_in('fileext', explode(',', $exts))->order_by('id desc')->getAll($num) : \Phpcmf\Service::M()->table('attachment_unused')->order_by('id desc')->getAll($num), ]; $sfield = [ 'id' => dr_lang('附件ID'), 'filename' => dr_lang('附件名稱'), ]; // 搜索附件 $search_url = '/index.php?is_ajax=1&s=api&c=file&m=input_file_list&p='.\Phpcmf\Service::L('input')->get('p') .'&fid='.\Phpcmf\Service::L('input')->get('fid').'&ct='.\Phpcmf\Service::L('input')->get('ct').'&page={page}'; $config = require CMSPATH.'Config/Apage.php'; $total = \Phpcmf\Service::M()->table('attachment_data')->where('uid', $this->uid)->where_in('fileext', explode(',', $exts))->order_by('id desc')->limit_page($num)[1]; $name = \Phpcmf\Service::L('input')->get('name'); $value = dr_safe_replace(\Phpcmf\Service::L('input')->get('value')); if ($name && isset($sfield[$name]) && $value) { $db = \Phpcmf\Service::M()->table('attachment_data'); $exts && $db->where_in('fileext', explode(',', $exts)); $where = !$this->member['is_admin'] ? 'uid = '.$this->uid : '1'; if ($name == 'id') { $where.= ' AND id='.intval($value); } else { $where.= ' AND '.$name.' LIKE "%'.$value.'%"'; } $list['used'] = $db->where($where)->order_by('id desc')->limit_page($num); } else { $list['used'] = $exts ? \Phpcmf\Service::M()->table('attachment_data')->where('uid', $this->uid)->where_in('fileext', explode(',', $exts))->order_by('id desc')->limit_page($num)[0] : \Phpcmf\Service::M()->table('attachment_data')->order_by('id desc')->limit_page($num)[0]; } \Phpcmf\Service::V()->admin(); \Phpcmf\Service::V()->assign([ 'form' => dr_form_hidden(), 'list' => $list, 'sfield' => $sfield, 'mypages' => \Phpcmf\Service::L('input')->table_page($search_url, $total, $config, $num), 'param' => [ 'name' => $name, 'value' => $value, ], 'page' => intval($_GET['page']), 'search_url' => $search_url, ]); \Phpcmf\Service::V()->display('api_upload_list.html');exit; }
我這樣改改不知道合適不合適,反正是附件可以分頁(yè)了,改了框架的內(nèi)容,找不到更好的方法了
反正是這樣目前正常,弊端未知
弊端就升級(jí)后會(huì)被覆蓋
我的方法是 復(fù)制dayrui/Core/Views/api_upload_list.html到 dayrui/My/View/api_upload_list.html
查詢:
<div class="files"> {loop $list.used $i $t} {php $url = dr_get_file_url($t, 50, 50);} <div class="template-download yl_files_row files_row"> <label class="mt-table mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline"> <input type="checkbox" class="checkboxes" name="ids1[]" value="{$t.id}" /> <span></span> </label> <label class="files_row_preview preview">{dr_file_preview_html($url, 1)}</label> <label class="label label-sm label-success" style="margin-right: 10px;"> {dr_format_file_size($t.filesize)} </label> <label class="label label-sm label-default" title="{$t.filename}">{dr_strcut($t.filename, 10)}</label> </div> {/loop} </div>
改成
<?php $rule = '/index.php?is_ajax=1&s=api&c=file&m=input_file_list&p='.\Phpcmf\Service::L('input')->get('p') .'&fid='.\Phpcmf\Service::L('input')->get('fid').'&ct='.\Phpcmf\Service::L('input')->get('ct').'&page=1&pp=[page]'; $_GET['page'] = $_GET['pp']; $sfield = [ 'id' => dr_lang('附件ID'), 'filename' => dr_lang('附件名稱'), ]; $name = \Phpcmf\Service::L('input')->get('name'); $value = dr_safe_replace(\Phpcmf\Service::L('input')->get('value')); $where = []; $exts && $where[] = "fileext in (".$exts.")"; if ($name && isset($sfield[$name]) && $value) { $this->member['is_admin'] && $where[] = 'uid = '.$this->uid; if ($name == 'id') { $where[] = 'id='.intval($value); } else { $where[]= $name.' LIKE "%'.$value.'%"'; } } $where = urlencode(implode(' AND ', $where)); ?> {table table=attachment_data where=$where page=1 pagesize=10 urlrule=$rule} {php $url = dr_get_file_url($t, 50, 50);} <div class="template-download yl_files_row files_row"> <label class="mt-table mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline"> <input type="checkbox" class="checkboxes" name="ids1[]" value="{$t.id}" /> <span></span> </label> <label class="files_row_preview preview">{dr_file_preview_html($url, 1)}</label> <label class="label label-sm label-success" style="margin-right: 10px;"> {dr_format_file_size($t.filesize)} </label> <label class="label label-sm label-default" title="{$t.filename}">{dr_strcut($t.filename, 10)}</label> </div> {/loop} 分頁(yè) {$pages}
老哥牛皮,改成你的了
學(xué)習(xí)哥真大神,出神入化了
回復(fù)@海水正藍(lán)
誰(shuí)是學(xué)習(xí)哥
老哥,你那個(gè)修改方法分頁(yè)沒問題了,如果開啟了附件歸檔,未使用的附件選擇確定時(shí)會(huì)提示 至少要選擇一個(gè)文件 ,這個(gè)怎么搞?
學(xué)習(xí)哥很牛
啊,長(zhǎng)知識(shí)了。
回復(fù)@風(fēng)之傳奇
學(xué)習(xí)哥牛P
不支持的,只顯示最多30個(gè),可以按ID來(lái)搜索
回復(fù)迅睿框架創(chuàng)始人
問題是ID是啥都不知道
名字有可能是亂七八糟的字母
這就很尷尬
不會(huì)是讓在附件管理看下ID好,然后搜吧
回復(fù)迅??蚣軇?chuàng)始人
這樣的控制器能進(jìn)行重寫嗎?
不能,記住core,fcms都不能修改,會(huì)影響升級(jí),其他地方可以隨便改
回復(fù)@張益達(dá)
回復(fù)@易學(xué)習(xí)
我知道核心的東西不能修改,我的意思是能不能通過和重寫 My/Model 一樣重寫這個(gè)
我記得應(yīng)用市場(chǎng)有一個(gè)組件可以
回復(fù)@開黑嗎我玩輔助
找了一下貌似沒找到
在模板里面寫標(biāo)簽實(shí)現(xiàn)分頁(yè)啊,不難的
回復(fù)@眼鏡
我看這個(gè)貌似不行啊
通過標(biāo)簽?zāi)軐?shí)現(xiàn)嗎?
我這樣改改不知道合適不合適,反正是附件可以分頁(yè)了,改了框架的內(nèi)容,找不到更好的方法了
反正是這樣目前正常,弊端未知
弊端就升級(jí)后會(huì)被覆蓋
我的方法是 復(fù)制dayrui/Core/Views/api_upload_list.html到 dayrui/My/View/api_upload_list.html
查詢:
改成
回復(fù)@易學(xué)習(xí)
老哥牛皮,改成你的了
學(xué)習(xí)哥真大神,出神入化了
回復(fù)@海水正藍(lán)
誰(shuí)是學(xué)習(xí)哥
回復(fù)@易學(xué)習(xí)
老哥,你那個(gè)修改方法分頁(yè)沒問題了,如果開啟了附件歸檔,未使用的附件選擇確定時(shí)會(huì)提示 至少要選擇一個(gè)文件 ,這個(gè)怎么搞?
學(xué)習(xí)哥很牛
啊,長(zhǎng)知識(shí)了。
回復(fù)@風(fēng)之傳奇
學(xué)習(xí)哥牛P