$lang[username] $searchlang[message_message] $searchlang[message_tid] $searchlang[message_pid]
SEARCH; showformheader($pluginurl); showtableheader(lang('plugin/'.$plugin['identifier'], 'message_list'). '['.lang('plugin/'.$plugin['identifier'], 'recycle_clean').']'); showsubtitle(array('', 'username', lang('plugin/'.$plugin['identifier'], 'message_message'), lang('plugin/'.$plugin['identifier'], 'message_createtime'), 'ip', '')); $count = C::t('#'.$plugin['identifier'].'#'.$plugin['identifier'].'_message')->count_by_search_where($wherearr); $list = C::t('#'.$plugin['identifier'].'#'.$plugin['identifier'].'_message')->fetch_all_by_search_where($wherearr,'order by createtime desc', $start, $perpage); foreach ($list as $value) { $value['message'] = replyfloor_discuzcode($value['message']); if($setconfig['show_br']) { $value['message'] = nl2br($value['message']); } $attachhtml = ''; if($value['attachment']) { $attachhtml = '
'; $attachlist = explode("\t", $value['attachment']); foreach ($attachlist as $attach) { $attachhtml .= '
'; } $attachhtml .= '
'; } $value['createtime'] = dgmdate($value['createtime'], 'Y-n-j H:i'); showtablerow('', array('class="td25"', 'class="td24"', '', 'class="td24"', 'class="td24"', 'class="td32"'), array( "", $value['username'], '
'.$value['message'].'
'.($attachhtml ? $attachhtml : ''), $value['createtime'], $value['postip'], "".$lang['edit']." ". "".lang('plugin/'.$plugin['identifier'], 'message_viewpost')."", )); } $multipage = multi($count, $perpage, $page, $mpurl); showsubmit('savesubmit', 'submit', '  ', '', $multipage, false); showtablefooter(); showformfooter(); } else { if(is_array($_GET['ids'])) { if($_GET['optype'] == 'restore') { if($setconfig['get_credit']) { require_once libfile('function/post'); require_once libfile('function_forum', 'function'); $list = C::t('#'.$plugin['identifier'].'#'.$plugin['identifier'].'_message')->fetch_all_by_id($_GET['ids']); foreach ($list as $value) { $thread = get_thread_by_tid($value['tid']); updatepostcredits('+', $value['uid'], 'reply', $thread['fid']); } } C::t('#'.$plugin['identifier'].'#'.$plugin['identifier'].'_message')->restore_by_id($_GET['ids']); }else{ replyfloor_deletemessage($_GET['ids'], 'id', 0); } }else{ cpmsg(lang('plugin/'.$plugin['identifier'], 'operate_not_check'), '', 'error'); } cpmsg(lang('plugin/'.$plugin['identifier'], 'message_updatesucceed'), "action=$pluginurl", 'succeed'); } } elseif($op == 'edit' && $_GET['id']) { $item = C::t('#'.$plugin['identifier'].'#'.$plugin['identifier'].'_message')->fetch_by_id($_GET['id']); if(!$item) { cpmsg(lang('plugin/'.$plugin['identifier'], 'message_nonexistence'), '', 'error'); } if(!submitcheck('savesubmit')) { showformheader("$pluginurl&op=edit&id=".$_GET['id'],'enctype'); showtableheader(lang('plugin/'.$plugin['identifier'], 'message_edit')); showsetting(lang('plugin/'.$plugin['identifier'], 'message_message'), 'message', $item['message'], 'textarea', '', 0, lang('plugin/'.$plugin['identifier'], 'message_message_comment')); showtablerow('', array('class="" colspan="2"'), array(''.lang('plugin/'.$plugin['identifier'], 'message_upload_image').'')); $attachhtml = '
'; $attachlist = C::t('#'.$plugin['identifier'].'#'.$plugin['identifier'].'_attachment')->fetch_all_by_msgid(array($item['id']), 'order by displayorder asc,dateline asc'); foreach ($attachlist as $attach) { $attach['attachment'] = ($attach['remote'] ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']) . 'replyfloor/'. $attach['attachment']; $attachhtml .= '
'.$attach['filename'].'
'; } $attachhtml .= '
'; showtablerow('', array('class="" colspan="2"'), array($attachhtml)); showsubmit('savesubmit', 'submit'); showtablefooter(); showformfooter(); require_once libfile('function/upload'); $swfconfig = getuploadconfig($_G['uid']); $verhash = random(5); echo << .replyfloor_content_upload {background-color:#fff;border:1px solid #dbdbdb;color: #222;height: 32px;line-height: 32px;text-align: center;font-size: 14px;display: inline-block;width:120px;cursor:pointer;} .replyfloor_upimage {overflow: hidden;} .replyfloor_upimage_li {float:left;position:relative;margin:5px 5px 0 0;width:50px;height:50px;} .replyfloor_upimage_img {width:50px;height:50px;} .replyfloor_upimage_img img {display:block;width:50px;height:50px;object-fit:cover;} .replyfloor_upimage_del {position:absolute;top:-3px;right:-3px;} .replyfloor_upimage_del a {display:block;width:13px;height:11px;background: url("source/plugin/replyfloor/static/image/icon_close.png");} EOT; } else { $attach = isset($_GET['attach']) ? $_GET['attach'] : array(); $attachment = $usedattach = $queryattach = array(); if($attach){ $queryattach = C::t('#'.$plugin['identifier'].'#'.$plugin['identifier'].'_attachment_unused')->fetch_all_by_id($attach); } foreach($queryattach as $value){ $attachdata = array( 'id' => $value['id'], 'tid' => $item['tid'], 'pid' => $item['pid'], 'msgid' => $item['id'], 'uid' => $value['uid'], 'username' => $value['username'], 'filename' => $value['filename'], 'filesize' => $value['filesize'], 'fileext' => $value['fileext'], 'attachment' => $value['attachment'], 'remote' => $value['remote'], 'width' => $value['width'], 'height' => $value['height'], 'dateline' => $value['dateline'], ); C::t('#'.$plugin['identifier'].'#'.$plugin['identifier'].'_attachment')->insert($attachdata, true); C::t('#'.$plugin['identifier'].'#'.$plugin['identifier'].'_attachment_unused')->delete_by_id($value['id']); } $i = 1; if($attach){ $queryattach = C::t('#'.$plugin['identifier'].'#'.$plugin['identifier'].'_attachment')->fetch_all_by_id($attach); foreach($attach as $aid){ if($queryattach[$aid] && in_array($queryattach[$aid]['fileext'], array('jpg', 'jpeg', 'gif', 'png', 'bmp', 'webp'))){ C::t('#'.$plugin['identifier'].'#'.$plugin['identifier'].'_attachment')->update_by_id($aid, array('displayorder' => $i)); $i++; $attachment[] = ($queryattach[$aid]['remote'] ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']) . 'replyfloor/'. $queryattach[$aid]['attachment']; } } } $data = array( 'message' => $_GET['message'], 'attachment' => implode("\t", $attachment), ); if(!$data['message'] && !$data['attachment']) { cpmsg(lang('plugin/'.$plugin['identifier'], 'message_message_empty'), '', 'error'); } C::t('#'.$plugin['identifier'].'#'.$plugin['identifier'].'_message')->update_by_id($_GET['id'], $data); cpmsg(lang('plugin/'.$plugin['identifier'], 'message_updatesucceed'), "action=$pluginurl", 'succeed'); } } elseif($op == 'clean') { if(!submitcheck('rbsubmit', 1)) { showformheader("$pluginurl&op=clean",'enctype'); showtableheader(lang('plugin/'.$plugin['identifier'], 'recycle_clean_title')); showsetting(lang('plugin/'.$plugin['identifier'], 'recycle_clean_days'), 'days', '30', 'text', '', 0, lang('plugin/'.$plugin['identifier'], 'recycle_clean_days_comment')); showsubmit('rbsubmit', 'submit'); showtablefooter(); showformfooter(); } else { $deleteids = array(); $pernum = 500; $linksdel = intval($_GET['linksdel']); $days = intval($_GET['days']); $wherearr = array(); $wherearr[] = "status = '1'"; if($days){ $wherearr[] = "createtime < '".(TIMESTAMP - ($days * 86400))."'"; } $list = C::t('#'.$plugin['identifier'].'#'.$plugin['identifier'].'_message')->fetch_all_by_search_where($wherearr,'order by createtime asc', 0, $pernum); foreach($list as $value) { $deleteids[] = $value['id']; } if($deleteids) { replyfloor_deletemessage($deleteids, 'id', 0); $linksdel += count($deleteids); //$startlimit += $pernum; cpmsg(lang('plugin/'.$plugin['identifier'], 'recycle_clean_next'), 'action='.$pluginurl.'&op=clean&rbsubmit=1&linksdel='.$linksdel.'&days='.$days, 'succeed', array('linksdel' => $linksdel)); } else { cpmsg(lang('plugin/'.$plugin['identifier'], 'recycle_clean_succeed'), 'action='.$pluginurl.'&op=clean', 'succeed', array('linksdel' => $linksdel)); } } } ?>