Example #1
0
<?php

$num = 10;
$sysmsgApi = new KSysmsg_Api();
$msglist = $sysmsgApi->getIndexList('0_0', $num, $next, $next_boundary);
$page = compact('num', 'next', 'next_boundary');
$render = new KRender_www();
$render->oSetTemplate('www/index.html')->oSetData('msglist', $msglist)->oSetData('page', $page)->oSend();
Example #2
0
    $userinfo = Ko_Tool_Adapter::VConv($uid, array('user_baseinfo', array('logo80')));
    $prevlist = $nextlist = array();
    $curinfo = $photoinfo;
    while (!empty($curinfo = $photoApi->getPrevPhotoInfo($curinfo))) {
        $curinfo['image'] = $storageApi->sGetUrl($curinfo['image'], 'imageView2/1/w/60');
        array_unshift($prevlist, $curinfo);
        if (count($prevlist) >= 4) {
            break;
        }
    }
    $curinfo = $photoinfo;
    while (!empty($curinfo = $photoApi->getNextPhotoInfo($curinfo))) {
        $curinfo['image'] = $storageApi->sGetUrl($curinfo['image'], 'imageView2/1/w/60');
        array_push($nextlist, $curinfo);
        if (count($nextlist) >= 15 - count($prevlist)) {
            break;
        }
    }
    if (!empty($prevlist) && count($prevlist) + count($nextlist) < 15) {
        $curinfo = $prevlist[0];
        while (!empty($curinfo = $photoApi->getPrevPhotoInfo($curinfo))) {
            $curinfo['image'] = $storageApi->sGetUrl($curinfo['image'], 'imageView2/1/w/60');
            array_unshift($prevlist, $curinfo);
            if (count($prevlist) >= 15 - count($nextlist)) {
                break;
            }
        }
    }
    $render = new KRender_www();
    $render->oSetTemplate('www/photo/item.html')->oSetData('userinfo', $userinfo)->oSetData('albuminfo', $albuminfo)->oSetData('photoinfo', $photoinfo)->oSetData('prevlist', $prevlist)->oSetData('nextlist', $nextlist)->oSend();
});
Example #3
0
        $bloginfo = array();
        $htmlrender->oSetData(KContent_Api::DRAFT_CONTENT, $uid);
        $htmlrender->oSetData(KContent_Api::DRAFT_TITLE, $uid);
    }
    $render = new KRender_www();
    $render->oSetTemplate('www/blog/post.html')->oSetData('userinfo', $userinfo)->oSetData('bloginfo', $bloginfo)->oSetData('blogcontent', $htmlrender)->oSetData('taginfos', $taginfos)->oSend();
});
Ko_Web_Route::VGet('item', function () {
    $uid = Ko_Web_Request::IGet('uid');
    $blogid = Ko_Web_Request::IGet('blogid');
    $tag = Ko_Web_Request::SGet('tag');
    $userinfo = Ko_Tool_Adapter::VConv($uid, array('user_baseinfo', array('logo80')));
    $blogApi = new KBlog_Api();
    $taginfos = $blogApi->aGetAllTaginfo($uid);
    $bloginfo = $blogApi->aGet($uid, $blogid);
    if (empty($bloginfo) || in_array('回收站', $bloginfo['tags'])) {
        Ko_Web_Response::VSetRedirect('user?uid=' . $uid);
        Ko_Web_Response::VSend();
        exit;
    }
    if (0 == strlen($tag)) {
        $tag = $blogApi->sGetPriorTag($bloginfo['tags']);
    }
    $prevnextInfo = $blogApi->aGetPrevNextTitle($uid, $blogid, $tag);
    $contentApi = new KContent_Api();
    $htmlrender = new Ko_View_Render_HTML($contentApi);
    $htmlrender->oSetData(KContent_Api::BLOG_TITLE, $blogid);
    $htmlrender->oSetData(KContent_Api::BLOG_CONTENT, $blogid);
    $render = new KRender_www();
    $render->oSetTemplate('www/blog/item.html')->oSetData('tag', $tag)->oSetData('prevnext', $prevnextInfo)->oSetData('userinfo', $userinfo)->oSetData('bloginfo', $bloginfo)->oSetData('blogcontent', $htmlrender)->oSetData('taginfos', $taginfos)->oSend();
});