$url))); $responsehook = WeChatHook::getResponse(); if($_GET['subscribe'] == 'custom') { $response['subscribeback'] = $responsehook['receiveEvent::subscribe']; $updatedata = array('receiveEvent::subscribe' => array('plugin' => 'wechat', 'include' => 'response.class.php', 'class' => 'WSQResponse', 'method' => 'custom')); $responsehook = WeChatHook::updateResponse($updatedata); savecache('wechat_response', $response); cpmsg(lang('plugin/wechat', 'response_subscribe_custom'), 'action=plugins&operation=config&do='.$pluginid.'&identifier=wechat&pmod=response_setting', 'succeed'); } elseif($_GET['subscribe'] == 'restore') { $response['subscribeback'] = $response['subscribeback'] ? $response['subscribeback'] : array('plugin' => 'wechat', 'include' => 'response.class.php', 'class' => 'WSQResponse', 'method' => 'subscribe'); $updatedata = array('receiveEvent::subscribe' => $response['subscribeback']); $responsehook = WeChatHook::updateResponse($updatedata); savecache('wechat_response', $response); cpmsg(lang('plugin/wechat', 'response_subscribe_plugin'), 'action=plugins&operation=config&do='.$pluginid.'&identifier=wechat&pmod=response_setting', 'succeed'); } if($_GET['text'] == 'custom') { $response['textback'] = $responsehook['receiveMsg::text']; $updatedata = array('receiveMsg::text' => array('plugin' => 'wechat', 'include' => 'response.class.php', 'class' => 'WSQResponse', 'method' => 'text')); $responsehook = WeChatHook::updateResponse($updatedata); savecache('wechat_response', $response); cpmsg(lang('plugin/wechat', 'response_message_custom'), 'action=plugins&operation=config&do='.$pluginid.'&identifier=wechat&pmod=response_setting', 'succeed'); } elseif($_GET['text'] == 'restore') { $response['textback'] = $response['textback'] ? $response['textback'] : array('plugin' => 'wechat', 'include' => 'response.class.php', 'class' => 'WSQResponse', 'method' => 'text'); $updatedata = array('receiveMsg::text' => $response['textback']); $responsehook = WeChatHook::updateResponse($updatedata); savecache('wechat_response', $response); cpmsg(lang('plugin/wechat', 'response_message_plugin'), 'action=plugins&operation=config&do='.$pluginid.'&identifier=wechat&pmod=response_setting', 'succeed'); } WeChatSetting::showResource(); showformheader('plugins&operation=config&do='.$pluginid.'&identifier=wechat&pmod=response_setting'); showtableheader(); echo '
".lang('plugin/wechat', 'response_custom')." ".($response['subscribeback'] ? "[".lang('plugin/wechat', 'response_switch_plugin_mode', array('plugin' => $response['subscribeback']['plugin']))."]
" : '') )); showtablerow('', array('', 'class="td23 td28"', '', 'class="td29"'), array( "", "".lang('plugin/wechat', 'subscribe')."", "" ."".lang('plugin/wechat', 'response_plugin_mode', array('plugin' => $responsehook['receiveEvent::subscribe']['plugin']))." [".lang('plugin/wechat', 'response_switch_custom_mode')."]
" )); } showtablerow('class="header"', array('', 'class="td23 td28"', '', 'class="td29"'), array( "", lang('plugin/wechat', 'response_access'), "".lang('plugin/wechat', 'response_access_comment')
));
showtablerow('', array('', 'class="td23 td28"', '', 'class="td29"'), array(
"",
"".lang('plugin/wechat', 'access')."",
""
."
".lang('plugin/wechat', 'resource_select').""
));
showtablerow('class="header"', array('', 'class="td23 td28"', '', 'class="td29"'), array(
"",
lang('plugin/wechat', 'response_scan'),
"
".lang('plugin/wechat', 'response_scan_comment')
));
showtablerow('', array('', 'class="td23 td28"', '', 'class="td29"'), array(
"",
"".lang('plugin/wechat', 'scan')."",
""
."
".lang('plugin/wechat', 'resource_select').""
));
if($responsehook['receiveMsg::text']['plugin'] == 'wechat' &&
$responsehook['receiveMsg::text']['class'] == 'WSQResponse' &&
$responsehook['receiveMsg::text']['method'] == 'text') {
showtablerow('class="header"', array('', 'class="td23 td28"', '', 'class="td29"'), array(
"",
lang('plugin/wechat', 'response_message'),
"
".lang('plugin/wechat', 'response_custom')." ".($response['textback'] ? "[".lang('plugin/wechat', 'response_switch_plugin_mode', array('plugin' => $response['textback']['plugin']))."]
" : '') )); foreach($response['text'] as $k => $text) { showtablerow('', array('', 'class="td23 td28"', 'class="td29"'), array( "", "", "" ."".lang('plugin/wechat', 'response_plugin_mode', array('plugin' => $responsehook['receiveMsg::text']['plugin']))." [".lang('plugin/wechat', 'response_switch_custom_mode')."]
" )); } showsubmit('menusubmit', 'submit', 'del'); showtablefooter(); showformfooter(); } else { if(!empty($_GET['newresponse'])) { foreach($_GET['newresponse']['keyword'] as $k => $keyword) { $item = array( 'keyword' => $keyword, 'response' => $_GET['newresponse']['response'][$k], ); $response['text'][] = $item; } } foreach($_GET['response']['text'] as $k => $value) { if($value['delete']) { unset($response['text'][$k]); continue; } $response['text'][$k] = $value; } $response['subscribe'] = $_GET['response']['subscribe']; $response['access'] = $_GET['response']['access']; $response['scan'] = $_GET['response']['scan']; $query = array( 'subscribe' => $response['subscribe'], 'text' => array(), ); foreach($response['text'] as $value) { $query['text'][$value['keyword']] = $value['response']; } $response['query'] = $query; savecache('wechat_response', $response); cpmsg('setting_update_succeed', 'action=plugins&operation=config&do='.$pluginid.'&identifier=wechat&pmod=response_setting', 'succeed'); } ?>