<?php defined('IN_DESTOON') or exit('Access Denied'); $gid = $catid; $GRP = get_group($gid); if (!$GRP || $GRP['status'] != 3) { include load('404.inc'); } if ($GRP['list_type'] && !is_fans($GRP)) { $action = 'list'; $head_title = lang('message->without_permission'); exit(include template('nofans', $module)); } $CAT = get_cat($GRP['catid']); $GRP['managers'] = $GRP['manager'] ? explode('|', $GRP['manager']) : array(); $admin = is_admin($GRP); $typeid = isset($typeid) ? intval($typeid) : 0; isset($TYPE[$typeid]) or $typeid = 0; $condition = 'status=3 AND gid=' . $catid; if ($typeid) { switch ($typeid) { case 1: $MOD['order'] = 'addtime DESC'; break; case 2: $MOD['order'] = 'replytime DESC'; break; case 3: $condition .= " AND level>0"; break; case 4:
$item = $db->get_one("SELECT * FROM {$table} WHERE itemid={$itemid}"); if ($item && $item['status'] > 2) { if ($MOD['show_html'] && is_file(DT_ROOT . '/' . $MOD['moduledir'] . '/' . $item['linkurl'])) { d301($MOD['linkurl'] . $item['linkurl']); } extract($item); } else { include load('404.inc'); } $CAT = get_cat($catid); if (!check_group($_groupid, $CAT['group_show'])) { include load('403.inc'); } $GRP = get_group($gid); $GRP['managers'] = $GRP['manager'] ? explode('|', $GRP['manager']) : array(); if ($GRP['show_type'] && !is_fans($GRP)) { $action = 'show'; $head_title = lang('message->without_permission'); exit(include template('nofans', $module)); } $content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data); $t = $db->get_one("SELECT content FROM {$content_table} WHERE itemid={$itemid}"); $content = $t['content']; if ($lazy) { $content = img_lazy($content); } if ($MOD['keylink']) { $content = keylink($content, $moduleid); } $CP = $MOD['cat_property'] && $CAT['property']; if ($CP) {
$limit_free = $MG['club_reply_limit'] > $limit_used ? $MG['club_reply_limit'] - $limit_used : 0; } switch ($action) { case 'add': check_group($_groupid, $MOD['group_reply']) or dalert(lang('message->without_permission_and_upgrade'), 'goback'); $tid = isset($tid) ? intval($tid) : 0; $tid or dalert($L['my_choose_post'], $MOD['linkurl']); $T = $db->get_one("SELECT * FROM {$table} WHERE itemid={$tid}"); $T && $T['status'] == 3 or dalert($L['my_not_post']); $gid = $T['gid']; $GRP = get_group($gid); $GRP && $GRP['status'] == 3 or dalert($L['my_not_group']); if ($MG['club_reply_limit'] && $limit_used >= $MG['club_reply_limit']) { dalert(lang($L['day_limit'], array($MG['club_reply_limit'], $limit_used)), $MODULE[2]['linkurl'] . $DT['file_my'] . '?mid=' . $mid . '&job=' . $job); } if ($GRP['reply_type'] && !is_fans($GRP)) { $action = 'reply'; $head_title = lang('message->without_permission'); exit(include template('nofans', $module)); } $rid = isset($rid) ? intval($rid) : 0; $R = array(); if ($rid) { $R = $db->get_one("SELECT * FROM {$table}_reply WHERE itemid={$rid}"); $R && $R['status'] == 3 && $R['tid'] == $tid or dalert($L['my_not_reply']); $str = $R['content']; if (strpos($str, '<hr class="club_break" />') !== false) { $str = substr($str, strpos($str, '<hr class="club_break" />')); } else { if (strpos($str, '<hr class="club_break">') !== false) { $str = substr($str, strpos($str, '<hr class="club_break">'));
$do->add($post); exit($post['status'] == 3 ? 'ok' : 'check'); } exit('ko'); } $head_title = $L['reply_title'] . $DT['seo_delimiter'] . $head_title; $foot = ''; include template('club_reply', 'mobile'); if (DT_CHARSET != 'UTF-8') { toutf8(); } break; case 'post': $gid or dheader(mobileurl($moduleid)); $MG['club_limit'] > -1 or mobile_msg($L['post_no_rights']); if ($GRP['post_type'] && !is_fans($GRP)) { mobile_msg($L['msg_not_fans'], 'club.php?action=fans&gid=' . $gid); } $sql = $_userid ? "username='******'" : "ip='{$DT_IP}'"; $limit_used = $limit_free = $need_password = $need_captcha = $need_question = $fee_add = 0; $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE {$sql} AND status>1"); $limit_used = $r['num']; $limit_free = $MG['club_limit'] > $limit_used ? $MG['club_limit'] - $limit_used : 0; if ($MG['club_limit'] && $limit_used >= $MG['club_limit']) { mobile_msg($L['post_too_many']); } if ($MG['day_limit']) { $today = $today_endtime - 86400; $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE {$sql} AND addtime>{$today}"); if ($r && $r['num'] >= $MG['day_limit']) { mobile_msg($L['post_too_many_today']);