diff --git a/lang/chs/lang_index.php b/lang/chs/lang_index.php index c0ce3bd3..f1109feb 100644 --- a/lang/chs/lang_index.php +++ b/lang/chs/lang_index.php @@ -105,6 +105,8 @@ $lang_index = array 'top_uploader_toggle_time_range_tab' => '点击切换时间范围', 'top_uploader_toggle_time_range_recently' => '最近 30 天', 'top_uploader_toggle_time_range_all' => '全部时间', + 'clear_shout_box' => '清空群聊区', + 'sure_to_clear_shout_box' => '确定要清空群聊区吗?', ); diff --git a/lang/cht/lang_index.php b/lang/cht/lang_index.php index 593a43ba..2d80f9f1 100644 --- a/lang/cht/lang_index.php +++ b/lang/cht/lang_index.php @@ -104,6 +104,8 @@ $lang_index = array 'top_uploader_toggle_time_range_tab' => '點擊切換時間範圍', 'top_uploader_toggle_time_range_recently' => '最近 30 天', 'top_uploader_toggle_time_range_all' => '全部時間', + 'clear_shout_box' => '清空群聊區', + 'sure_to_clear_shout_box' => '確定要清空群聊區嗎?', ); ?> diff --git a/lang/en/lang_index.php b/lang/en/lang_index.php index 93a190db..d4dede07 100644 --- a/lang/en/lang_index.php +++ b/lang/en/lang_index.php @@ -104,6 +104,8 @@ $lang_index = array 'top_uploader_toggle_time_range_tab' => 'Click to toggle the time range', 'top_uploader_toggle_time_range_recently' => 'Last 30 days', 'top_uploader_toggle_time_range_all' => 'All time', + 'clear_shout_box' => 'Clear shout box', + 'sure_to_clear_shout_box' => 'Are you sure you want to clear the shout box?', ); ?> diff --git a/public/ajax.php b/public/ajax.php index 97115177..8fe245a5 100644 --- a/public/ajax.php +++ b/public/ajax.php @@ -123,3 +123,11 @@ function consumeBenefit($params) $rep = new \App\Repositories\UserRepository(); return $rep->consumeBenefit($CURUSER['id'], $params); } + +function clearShoutBox($params) +{ + global $CURUSER; + user_can('sbmanage', true); + \Nexus\Database\NexusDB::table('shoutbox')->delete(); + return true; +} diff --git a/public/index.php b/public/index.php index 46130b2f..5f1626d6 100644 --- a/public/index.php +++ b/public/index.php @@ -137,10 +137,33 @@ if ($showfunbox_main == "yes" && (!isset($CURUSER) || $CURUSER['showfb'] == "yes // ------------- start: shoutbox ------------------// if ($showshoutbox_main == "yes") { ?> -

-

+

+ - + + ['.$lang_index['clear_shout_box'].']'; + $clearShoutBoxJs = << +

\n"); - print("

\n"); + print("

\n"); print("
\n"); print('
'); print(" ");