appStatus = $cloudAppService->getCloudAppStatus('storage'); } public function common(){ global $_G; if (!$this->appStatus) { return false; } if(CURMODULE == 'post' && CURSCRIPT == 'forum' && $_G['uid']){ $_G['config']['output']['iecompatible'] = '7'; } return true; } public function global_footer(){ if (!$this->appStatus) { return false; } include template('xf_storage:css'); return $return; } public function _output($aid, $sha, $filename) { include_once libfile('function/attachment'); $storageService = Cloud::loadClass('Service_Storage'); $qqdlUrl = $storageService->makeQQdlUrl($sha, $filename); $aidencode = packaids(array('aid' => $aid)); include template('xf_storage:link'); return $return; } public function _jsOutput($aid, $return) { $spanId = 'attach_' . $aid; $return = str_replace(array("\r\n", '\'', '
', '
', "\n"), array('', '\\\''), $return); include template('xf_storage:jscode'); return $jscode; } } class plugin_xf_storage_forum extends plugin_xf_storage { public function post_attach_btn_extra() { global $_G; if (!$this->appStatus) { return false; } include template('xf_storage:editor'); return $return; } public function post_attach_tab_extra() { global $_G; if (!$this->appStatus) { return false; } $editorid = 'e'; include template('xf_storage:ftnupload'); return $return; } public function viewthread_attach_extra_output() { global $postlist, $_G; $return = array(); foreach ($postlist as $pid => $post) { foreach ($post['attachments'] as $aid => $attachment) { if (strpos($attachment['attachment'], 'storage:') !== false) { $sha1 = substr($attachment['attachment'], -40); $return[$aid] = $this->_output($aid, $sha1, $attachment['filename']); if (in_array($aid, $_G['forum_attachtags'][$pid])) { $postlist[$pid]['message'] .= $this->_jsOutput($aid, $return[$aid]); unset($return[$aid]); } if ($attachment['isimage']) { unset($return[$aid]); } } } } return $return; } }