<?php

if(!defined('IN_DISCUZ')) {

    exit('Access Denied');

}

require_once libfile('function/forumlist');



odz_loadforum();

$tmp = array_keys($_G['forum']['threadsorts']['types']);

$sortid = isset($tmp[0])?$tmp[0]:'';



$thread = array('readperm' => '', 'pricedisplay' => '', 'hiddenreplies' => '');

$threadtypes = array();

    $threadtypes['sortid'] = $sortid;

    if($_G['forum']['ismoderator'] || empty($_G['forum']['threadtypes']['moderators'][$thread['typeid']])) {

        $arr = $_G['forum']['threadtypes'];

        $threadtypes['required'] = $arr['required'];

        foreach($arr['types'] as $key => $value) {

            $threadtypes['types'][] = array('id'=>$key, 'name'=>strip_tags($value));

        }

    }

odz_result(array('threadtypes'=>$threadtypes));