后台模型已经设置了允许评论,viewcomment.php文件中的
$query = $_SGLOBAL['db']->query('SELECT * FROM '.tname('spaceitems').' WHERE itemid=\''.$itemid.'\' AND allowreply=\'1\'');
也已经改成
$type_query = $_SGLOBAL['db']->query('SELECT type FROM '.tname('channels').' WHERE nameid=\''.$type.'\''); $type_channel = $_SGLOBAL['db']->fetch_array($type_query); $table_name = $type_channel['type'] == 'model'? $type.'items': 'spaceitems'; $query = $_SGLOBAL['db']->query('SELECT * FROM '.tname($table_name).' WHERE itemid=\''.$itemid.'\' AND allowreply=\'1\'');