Пример #1
0
/**
 * 取得站点分类
 */
function mw_getCategories($args)
{
    escape($args);
    $username = $args[1];
    $password = $args[2];
    login($username, $password);
    $Sort_Model = new Sort_Model();
    $sorts = $Sort_Model->getSorts();
    unset($Sort_Model);
    $xml = '';
    foreach ($sorts as $sort) {
        $xml .= "\n\t\t\t<value>\n\t\t\t\t<struct>\n\t\t\t\t\t<member>\n\t\t\t\t\t\t<name>description</name>\n\t\t\t\t\t\t<value>{$sort['sortname']}</value>\n\t\t\t\t\t</member>\n\t\t\t\t\t<member>\n\t\t\t\t\t\t<name>title</name>\n\t\t\t\t\t\t<value>{$sort['sortname']}</value>\n\t\t\t\t\t</member>\n\t\t\t\t</struct>\n\t\t\t</value>\n\t\t";
    }
    $xml = "<array><data>{$xml}</data></array>";
    response($xml);
}
Пример #2
0
    }
    // comments
    $commentPage = isset($_GET['comment-page']) ? intval($_GET['comment-page']) : 1;
    $verifyCode = ISLOGIN == false && Option::get('comment_code') == 'y' ? "<img src=\"../include/lib/checkcode.php\" /><br /><input name=\"imgcode\" type=\"text\" />" : '';
    $comments = $Comment_Model->getComments(2, $logid, 'n', $commentPage);
    extract($comments);
    $Log_Model->updateViewCount($logid);
    include View::getView('header');
    include View::getView('single');
    include View::getView('footer');
    View::output();
}
if (ISLOGIN === true && $action == 'write') {
    $logid = isset($_GET['id']) ? intval($_GET['id']) : '';
    $Sort_Model = new Sort_Model();
    $sorts = $Sort_Model->getSorts();
    if ($logid) {
        $Log_Model = new Log_Model();
        $Tag_Model = new Tag_Model();
        $blogData = $Log_Model->getOneLogForAdmin($logid);
        extract($blogData);
        $tags = array();
        foreach ($Tag_Model->getTag($logid) as $val) {
            $tags[] = $val['tagname'];
        }
        $tagStr = implode(',', $tags);
    } else {
        $title = '';
        $sortid = -1;
        $content = '';
        $excerpt = '';