Beispiel #1
0
 public static function getAlbumImagePic($value)
 {
     loadcache('albumcategory');
     require_once DISCUZ_ROOT . './source/function/function_home.php';
     if ($value['friend'] != 4 && ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
         $value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
     } elseif ($value['picnum']) {
         $value['pic'] = STATICURL . 'image/common/nopublish.gif';
     } else {
         $value['pic'] = '';
     }
     return $value['pic'];
 }
Beispiel #2
0
function getblockhtml($blockname, $parameters = array())
{
    global $_G, $space;
    $parameters = empty($parameters) ? array() : $parameters;
    $list = array();
    $sql = $title = $html = $wheresql = $ordersql = $titlemore = $do = $view = $contentclassname = '';
    $contenttagname = 'div';
    $shownum = 6;
    $uid = intval($space['uid']);
    $shownum = empty($parameters['shownum']) ? $shownum : intval($parameters['shownum']);
    switch ($blockname) {
        case 'profile':
            $do = $blockname;
            $managehtml = '';
            $avatar = empty($parameters['banavatar']) ? 'middle' : $parameters['banavatar'];
            $html .= "<div class=\"hm\"><p><a href=\"home.php?mod=space&uid={$uid}\" target=\"__blank\">" . avatar($uid, $avatar) . '</a></p>';
            $html .= "<h2><a href=\"home.php?mod=space&uid={$uid}\" target=\"__blank\">" . $space['username'] . "</a></h2>";
            $html .= '</div><ul class="xl xl2 cl ul_list">';
            $magicinfo = $showmagicgift = false;
            if ($_G['setting']['magicstatus'] && $_G['setting']['magics']['gift']) {
                $showmagicgift = true;
                $magicinfo = !empty($space['magicgift']) ? unserialize($space['magicgift']) : array();
            }
            if ($space['self']) {
                $html .= '<li class="ul_diy"><a href="home.php?mod=space&diy=yes">' . lang('space', 'block_profile_diy') . '</a></li>';
                $html .= '<li class="ul_msg"><a href="home.php?mod=space&uid=' . $uid . '&do=wall">' . lang('space', 'block_profile_wall') . '</a></li>';
                $html .= '<li class="ul_avt"><a href="home.php?mod=spacecp&ac=avatar">' . lang('space', 'block_profile_avatar') . '</a></li>';
                $html .= '<li class="ul_profile"><a href="home.php?mod=spacecp&ac=profile">' . lang('space', 'block_profile_update') . '</a></li>';
                if ($showmagicgift) {
                    $html .= '<li class="ul_magicgift"><div style="' . 'background: url(' . STATICURL . 'image/magic/gift.small.gif) no-repeat 0 50%;' . '">';
                    if ($magicinfo) {
                        $html .= '<a onclick="showWindow(\'magicgift\', this.href, \'get\', 0)" href="home.php?mod=spacecp&ac=magic&op=retiregift">' . lang('magic/gift', 'gift_gc') . '</a>';
                    } else {
                        $html .= '<a onclick="showWindow(\'magicgift\', this.href, \'get\', 0)" href="home.php?mod=magic&mid=gift">' . lang('magic/gift', 'gift_use') . '</a>';
                    }
                    $html .= '</div></li>';
                }
            } else {
                require_once libfile('function/friend');
                $isfriend = friend_check($uid);
                if (!$isfriend) {
                    $html .= "<li class='ul_add'><a href=\"home.php?mod=spacecp&ac=friend&op=add&uid={$space['uid']}&handlekey=addfriendhk_{$space[uid]}\" id=\"a_friend_li_{$space[uid]}\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'block_profile_friend_add') . "</a></li>";
                } else {
                    $html .= "<li class='ul_ignore'><a href=\"home.php?mod=spacecp&ac=friend&op=ignore&uid={$space['uid']}&handlekey=ignorefriendhk_{$space[uid]}\" id=\"a_ignore_{$space[uid]}\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'block_profile_friend_ignore') . "</a></li>";
                }
                $html .= "<li class='ul_msg'><a href=\"home.php?mod=space&uid={$space['uid']}&do=wall\">" . lang('space', 'block_profile_wall_to_me') . "</a></li>";
                $html .= "<li class='ul_poke'><a href=\"home.php?mod=spacecp&ac=poke&op=send&uid={$space['uid']}&handlekey=propokehk_{$space[uid]}\" id=\"a_poke_{$space[uid]}\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'block_profile_poke') . "</a></li>";
                $html .= "<li class='ul_pm'><a href=\"home.php?mod=spacecp&ac=pm&op=showmsg&handlekey=showmsg_{$space['uid']}&touid={$space['uid']}&pmid=0&daterange=2\" id=\"a_sendpm_{$space['uid']}\" onclick=\"showWindow('showMsgBox', this.href, 'get', 0)\">" . lang('space', 'block_profile_sendmessage') . "</a></li>";
            }
            $html .= '</ul>';
            $encodeusername = rawurlencode($space['username']);
            if (checkperm('allowbanuser')) {
                $managehtml .= '<li><a href="' . ($_G['adminid'] == 1 ? "admin.php?action=members&operation=ban&username={$encodeusername}&frames=yes" : "forum.php?mod=modcp&action=member&op=ban&uid={$space['uid']}") . '" id="usermanageli" onmouseover="showMenu(this.id)" class="showmenu" target="_blank">' . lang('home/template', 'member_manage') . '</a></li>';
            } elseif (checkperm('allowedituser')) {
                $managehtml .= '<li><a href="' . ($_G['adminid'] == 1 ? "admin.php?action=members&operation=search&username={$encodeusername}&submit=yes&frames=yes" : "forum.php?mod=modcp&action=member&op=edit&uid={$space['uid']}") . '" id="usermanageli" onmouseover="showMenu(this.id)" class="showmenu" target="_blank">' . lang('home/template', 'member_manage') . '</a></li>';
            }
            if ($_G['adminid'] == 1) {
                $managehtml .= "<li><a href=\"forum.php?mod=modcp&action=thread&op=post&do=search&searchsubmit=1&users={$encodeusername}\" id=\"umanageli\" onmouseover=\"showMenu(this.id)\" class=\"showmenu\">" . lang('home/template', 'content_manage') . "</a></li>";
            }
            if (!empty($managehtml)) {
                $html .= '<hr class="da mtn m0" /><ul class="ptn xl xl2 cl">' . $managehtml . '</ul><ul id="usermanageli_menu" class="p_pop" style="width: 80px; display:none;">';
                if (checkperm('allowbanuser')) {
                    $html .= '<li><a href="' . ($_G['adminid'] == 1 ? "admin.php?action=members&operation=ban&username={$encodeusername}&frames=yes" : "forum.php?mod=modcp&action=member&op=ban&uid={$space['uid']}") . '" target="_blank">' . lang('home/template', 'user_ban') . '</a></li>';
                }
                if (checkperm('allowedituser')) {
                    $html .= '<li><a href="' . ($_G['adminid'] == 1 ? "admin.php?action=members&operation=search&username={$encodeusername}&submit=yes&frames=yes" : "forum.php?mod=modcp&action=member&op=edit&uid={$space['uid']}") . '" target="_blank">' . lang('home/template', 'user_edit') . '</a></li>';
                }
                $html .= '</ul>';
                if ($_G['adminid'] == 1) {
                    $html .= '<ul id="umanageli_menu" class="p_pop" style="width: 80px; display:none;">';
                    $html .= '<li><a href="admin.php?action=threads&users=' . $encodeusername . '" target="_blank">' . lang('space', 'manage_post') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=doing&searchsubmit=1&users=' . $encodeusername . '" target="_blank">' . lang('space', 'manage_doing') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=blog&searchsubmit=1&uid=' . $uid . '" target="_blank">' . lang('space', 'manage_blog') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=feed&searchsubmit=1&uid=' . $uid . '" target="_blank">' . lang('space', 'manage_feed') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=album&searchsubmit=1&uid=' . $uid . '" target="_blank">' . lang('space', 'manage_album') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=pic&searchsubmit=1&users=' . $encodeusername . '" target="_blank">' . lang('space', 'manage_pic') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=comment&searchsubmit=1&authorid=' . $uid . '" target="_blank">' . lang('space', 'manage_comment') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=share&searchsubmit=1&uid=' . $uid . '" target="_blank">' . lang('space', 'manage_share') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=threads&operation=group&users=' . $encodeusername . '" target="_blank">' . lang('space', 'manage_group_threads') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=prune&searchsubmit=1&operation=group&users=' . $encodeusername . '" target="_blank">' . lang('space', 'manage_group_prune') . '</a></li>';
                    $html .= '</ul>';
                }
            }
            if ($_G['setting']['magicstatus'] && $_G['setting']['magics']['gift']) {
                $info = !empty($space['magicgift']) ? unserialize($space['magicgift']) : array();
                if ($space['self']) {
                } elseif ($info) {
                    if ($info['left'] && !in_array($_G['uid'], (array) $info['receiver'])) {
                        $percredit = min($info['percredit'], $info['left']);
                        if ($info['credittype'] == 'credits') {
                            $credittype = lang('core', 'title_credit');
                        } else {
                            $extcredits = str_replace('extcredits', '', $info['credittype']);
                            $credittype = $_G['setting']['extcredits'][$extcredits]['title'];
                        }
                        $html .= '<div id="magicreceivegift">';
                        $html .= '<a onclick="showWindow(\'magicgift\', this.href, \'get\', 0)" href="home.php?mod=spacecp&ac=magic&op=receivegift&uid=' . $uid . '" title="' . lang('magic/gift', 'gift_receive_gift', array('percredit' => $percredit, 'credittype' => $credittype)) . '">';
                        $html .= '<img src="' . STATICURL . 'image/magic/gift.gif" alt="gift" />';
                        $html .= '</a>';
                        $html .= '</div>';
                    }
                }
            }
            $html = '<div id="pcd">' . $html . '</div>';
            break;
        case 'statistic':
            space_merge($space, 'count');
            $html .= '<p class="mbm xw1">';
            if (empty($parameters['banviews'])) {
                $html .= lang('space', 'space_views', array('views' => $space['views'] ? $space['views'] : '--'));
            }
            $html .= '</p><ul class="xl xl2 cl">';
            if (empty($parameters['bancredits'])) {
                $html .= "<li>" . lang('space', 'credits') . ': <a href="home.php?mod=spacecp&ac=credit">' . ($space['credits'] ? $space['credits'] : '--') . "</a></li>";
                foreach ($_G['setting']['extcredits'] as $extcreditid => $extcredit) {
                    $html .= "<li>" . $extcredit['img'] . $extcredit['title'] . ': <a href="home.php?mod=spacecp&ac=credit">' . ($space['extcredits' . $extcreditid] ? $space['extcredits' . $extcreditid] : '--') . '</a>';
                }
            }
            if (empty($parameters['banfriends'])) {
                $html .= "<li>" . lang('space', 'friends') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=friend&view=me&from=space">' . ($space['friends'] ? $space['friends'] : '--') . "</a></li>";
            }
            if (empty($parameters['banthreads']) && $_G['setting']['allowviewuserthread'] !== false || $_G['adminid'] == 1) {
                $html .= "<li>" . lang('space', 'threads') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=thread&view=me&from=space">' . ($space['threads'] ? $space['threads'] : '--') . "</a></li>";
            }
            if (empty($parameters['banblogs'])) {
                $html .= "<li>" . lang('space', 'blogs') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=blog&view=me&from=space">' . ($space['blogs'] ? $space['blogs'] : '--') . "</a></li>";
            }
            if (empty($parameters['banalbums'])) {
                $html .= "<li>" . lang('space', 'albums') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=album&view=me&from=space">' . ($space['albums'] ? $space['albums'] : '--') . "</a></li>";
            }
            if (empty($parameters['bansharings'])) {
                $html .= "<li>" . lang('space', 'sharings') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=share&view=me&from=space">' . ($space['sharings'] ? $space['sharings'] : '--') . "</a></li>";
            }
            $html .= '</ul>';
            $html = '<div id="pcd">' . $html . '</div>';
            break;
        case 'doing':
            $do = $blockname;
            if (ckprivacy('doing', 'view')) {
                $dolist = array();
                $sql = "SELECT * FROM " . DB::table('home_doing') . " WHERE uid='{$uid}' ORDER BY dateline DESC LIMIT 0,{$shownum}";
                $query = DB::query($sql);
                while ($value = DB::fetch($query)) {
                    if ($value['status'] == 0 || $value['uid'] == $_G['uid']) {
                        $dolist[] = $value;
                    }
                }
                if ($dolist) {
                    foreach ($dolist as $dv) {
                        $doid = $dv['doid'];
                        $_G[gp_key] = $key = random(8);
                        $html .= "<li class=\"pbn bbda\">";
                        $html .= $dv['message'];
                        $html .= "&nbsp;<a href=\"home.php?mod=space&uid={$dv['uid']}&do=doing&view=me&from=space&doid={$dv['doid']}\" target=\"_blank\" class=\"xg1\">" . lang('space', 'block_doing_reply') . "</a>";
                        $html .= "</li>";
                    }
                } else {
                    $html .= "<p class=\"emp\">" . lang('space', 'block_doing_no_content') . "</p>";
                }
            } else {
                $html .= "<p class=\"emp\">" . lang('space', 'block_view_noperm') . "</p>";
            }
            $html = '<ul class="xl">' . $html . '</ul>';
            break;
        case 'blog':
            $do = $blockname;
            $query = DB::query("SELECT bf.*, b.* FROM " . DB::table('home_blog') . " b\r\n\t\t\t\tLEFT JOIN " . DB::table('home_blogfield') . " bf ON bf.blogid=b.blogid\r\n\t\t\t\tWHERE b.uid='{$uid}'\r\n\t\t\t\tORDER BY b.dateline DESC LIMIT 0,{$shownum}");
            while ($value = DB::fetch($query)) {
                if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
                    if ($value['pic']) {
                        $value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
                    }
                    $value['message'] = $value['friend'] == 4 ? '' : getstr($value['message'], 150, 0, 0, 0, -1);
                    $html .= lang('space', 'blog_li', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'subject' => $value['subject'], 'date' => dgmdate($value['dateline'], 'Y-m-d')));
                    if (!isset($parameters['showmessage'])) {
                        $parameters['showmessage'] = true;
                    }
                    if ($parameters['showmessage']) {
                        if ($value['pic']) {
                            $html .= lang('space', 'blog_li_img', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'src' => $value['pic']));
                        }
                        $html .= "<dd>{$value['message']}</dd>";
                    }
                    $html .= lang('space', 'blog_li_ext', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'viewnum' => $value['viewnum'], 'replynum' => $value['replynum']));
                    $html .= "</dl>";
                } else {
                    $html .= '<p>' . lang('space', 'block_view_noperm') . '</p>';
                }
            }
            $more = $html ? '<p class="ptm" style="text-align: right;"><a href="home.php?mod=space&uid=' . $uid . '&do=blog&view=me&from=space">' . lang('space', 'viewmore') . '</a></p>' : '';
            $contentclassname = ' xld';
            $html = $html . $more;
            break;
        case 'album':
            $do = $blockname;
            if (ckprivacy('album', 'view')) {
                $query = DB::query("SELECT * FROM " . DB::table('home_album') . " WHERE uid='{$uid}' ORDER BY updatetime DESC LIMIT 0,{$shownum}");
                while ($value = DB::fetch($query)) {
                    if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
                        $value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
                        $html .= lang('space', 'album_li', array('albumid' => $value['albumid'], 'src' => $value['pic'], 'albumname' => $value['albumname'], 'uid' => $value['uid'], 'picnum' => $value['picnum'], 'date' => dgmdate($value['updatetime'], 'n-j')));
                    }
                }
            } else {
                $html .= '<li>' . lang('space', 'block_view_noperm') . '</li>';
            }
            $html = '<ul class="ml mla cl">' . $html . '</ul>';
            break;
        case 'feed':
            $do = $blockname;
            if (!IS_ROBOT && ckprivacy('feed', 'view')) {
                require_once libfile('function/feed');
                $query = DB::query("SELECT * FROM " . DB::table('home_feed') . " WHERE uid='{$uid}' ORDER BY dateline DESC LIMIT 0,{$shownum}");
                while ($value = DB::fetch($query)) {
                    if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
                        $html .= mkfeedhtml(mkfeed($value));
                    }
                }
            }
            $contenttagname = 'ul';
            $contentclassname = ' el';
            $html = empty($html) ? '' : $html;
            break;
        case 'thread':
            $do = $blockname;
            if ($_G['setting']['allowviewuserthread'] !== false) {
                $fidsql = empty($_G['setting']['allowviewuserthread']) ? '' : " AND fid IN({$_G[setting][allowviewuserthread]}) ";
                $query = DB::query("SELECT * FROM " . DB::table('forum_thread') . " WHERE authorid='{$uid}' {$fidsql} AND displayorder>='0' ORDER BY tid DESC LIMIT 0,{$shownum}");
                while ($thread = DB::fetch($query)) {
                    if ($thread['author']) {
                        $html .= "<li><a href=\"forum.php?mod=viewthread&tid={$thread['tid']}\" target=\"_blank\">{$thread['subject']}</a></li>";
                    }
                }
            }
            $html = empty($html) ? '' : '<ul class="xl">' . $html . '</ul>';
            break;
        case 'friend':
            $do = $blockname;
            require_once libfile('function/friend');
            $friendlist = array();
            $friendlist = friend_list($uid, $shownum);
            $fuids = array_keys($friendlist);
            getonlinemember($fuids);
            foreach ($friendlist as $key => $value) {
                $classname = $_G['ols'][$value['fuid']] ? 'gol' : '';
                $html .= '<li><a href="home.php?mod=space&uid=' . $value['fuid'] . '" target="_blank"><em class="' . $classname . '"></em>' . avatar($value['fuid'], 'small') . '</a><p><a href="home.php?mod=space&uid=' . $value[fuid] . '" target="_blank">' . $value['fusername'] . '</a></p></li>';
            }
            $html = '<ul class="ml mls cl">' . $html . '</ul>';
            break;
        case 'visitor':
            $do = 'friend';
            $view = 'visitor';
            $query = DB::query("SELECT * FROM " . DB::table('home_visitor') . " WHERE uid='{$uid}' ORDER BY dateline DESC LIMIT 0,{$shownum}");
            $list = $fuids = array();
            while ($value = DB::fetch($query)) {
                $list[] = $value;
                $fuids[] = $value['vuid'];
            }
            getonlinemember($fuids);
            foreach ($list as $value) {
                $html .= "<li>";
                if ($value['vusername'] == '') {
                    $html .= lang('space', 'visitor_anonymity');
                } else {
                    $html .= lang('space', 'visitor_list', array('uid' => $value['vuid'], 'username' => $value['vusername'], 'class' => $_G['ols'][$value['vuid']] ? 'gol' : '', 'avatar' => avatar($value['vuid'], 'small')));
                }
                $html .= "<span class=\"xg2\">" . dgmdate($value['dateline'], 'u', '9999', 'Y-m-d') . "</span>";
                $html .= "</li>";
            }
            $html = '<ul class="ml mls cl">' . $html . '</ul>';
            break;
        case 'share':
            $do = $blockname;
            if (!IS_ROBOT && ckprivacy('share', 'view')) {
                require_once libfile('function/share');
                $query = DB::query("SELECT * FROM " . DB::table('home_share') . " WHERE uid='{$uid}' ORDER BY dateline DESC LIMIT 0,{$shownum}");
                while ($value = DB::fetch($query)) {
                    $value = mkshare($value);
                    $html .= '<li><em><a href="home.php?mod=space&uid=' . $value['uid'] . '&do=share&id=' . $value['sid'] . '">' . $value['title_template'] . '</a>(' . dgmdate($value['dateline'], 'u') . ')</em><div class="ec cl">';
                    if ($value['image']) {
                        $html .= '<a href="' . $value['image_link'] . '" target="_blank"><img src="' . $value['image'] . '" class="tn" alt="" /></a>';
                    }
                    $html .= '<div class="d">' . $value['body_template'] . '</div>';
                    if ($value['type'] == 'video') {
                        if (!empty($value['body_data']['imgurl'])) {
                            $html .= '<table class="mtm" title="' . lang('space', 'click_play') . '" onclick="javascript:showFlash(\'' . $value['body_data']['host'] . '\', \'' . $value['body_data']['flashvar'] . '\', this, \'' . $value['sid'] . '\');"><tr><td class="vdtn hm" style="background: url(' . $value['body_data']['imgurl'] . ') no-repeat"><img src="' . STATICURL . '/image/common/vds.png" alt="' . lang('space', 'click_play') . '" /></td></tr></table>';
                        } else {
                            $html .= "<img src=\"" . STATICURL . "/image/common/vd.gif\" alt=\"" . lang('space', 'click_play') . "\" onclick=\"javascript:showFlash('{$value['body_data']['host']}', '{$value['body_data']['flashvar']}', this, '{$value['sid']}');\" class=\"tn\" />";
                        }
                    } elseif ($value['type'] == 'music') {
                        $html .= "<img src=\"" . STATICURL . "/image/common/music.gif\" alt=\"" . lang('space', 'click_play') . "\" onclick=\"javascript:showFlash('music', '{$value['body_data']['musicvar']}', this, '{$value['sid']}');\" class=\"tn\" />";
                    } elseif ($value['type'] == 'flash') {
                        $html .= "<img src=\"" . STATICURL . "/image/common/flash.gif\" alt=\"" . lang('space', 'click_view') . "\" onclick=\"javascript:showFlash('flash', '{$value['body_data']['flashaddr']}', this, '{$value['sid']}');\" class=\"tn\" />";
                    }
                    if ($value['body_general']) {
                        $html .= '<div class="quote' . ($value['image'] ? 'z' : '') . "\"><blockquote>{$value['body_general']}</blockquote></div>";
                    }
                    $html .= '</div></li>';
                }
                $html = '<ul class="el">' . $html . '</ul>';
            }
            break;
        case 'wall':
            $do = $blockname;
            $walllist = array();
            if (ckprivacy('wall', 'view')) {
                $query = DB::query("SELECT * FROM " . DB::table('home_comment') . " WHERE id='{$uid}' AND idtype='uid' ORDER BY dateline DESC LIMIT 0,{$shownum}");
                while ($value = DB::fetch($query)) {
                    $value['message'] = strlen($value['message']) > 500 ? getstr($value['message'], 500, 0, 0, 0, -1) . ' ...' : $value['message'];
                    if ($value['status'] == 0 || $value['authorid'] == $_G['uid']) {
                        $walllist[] = $value;
                    }
                }
            }
            $html = '<div class="xld xlda el" id="comment_ul">';
            foreach ($walllist as $key => $value) {
                $op = '';
                if ($value['author']) {
                    $author_avatar = '<a href="home.php?mod=space&uid=' . $value['authorid'] . '" target="_blank">' . avatar($value['authorid'], 'small') . '</a>';
                    $author = '<a href="home.php?mod=space&uid=' . $value['authorid'] . '" id="author_' . $value['cid'] . '" target="_blank">' . $value['author'] . '</a>';
                } else {
                    $author_avatar = '<img src="static/image/magic/hidden.gif" alt="hidden" />';
                    $author = lang('space', 'hidden_username');
                }
                if ($value['authorid'] == $_G['uid']) {
                    $op .= lang('space', 'wall_edit', array('cid' => $value['cid']));
                }
                if ($value['authorid'] == $_G['uid'] || $space['self'] || checkperm('managecomment')) {
                    $op .= lang('space', 'wall_del', array('cid' => $value['cid']));
                }
                if ($value['authorid'] != $_G['uid'] && ($value['idtype'] != 'uid' || $space['self'])) {
                    $op .= lang('space', 'wall_reply', array('cid' => $value['cid']));
                }
                $moderate_need = $value['status'] == 1 ? lang('template', 'moderate_need') : '';
                $date = dgmdate($value['dateline'], 'u');
                $replacearr = array('author' => $author, 'author_avatar' => $author_avatar, 'moderated' => $moderate_need, 'cid' => $value['cid'], 'message' => $value['message'], 'date' => $date, 'op' => $op);
                $html .= lang('space', 'wall_li', $replacearr);
            }
            if (!empty($walllist)) {
                $html .= lang('space', 'wall_more', array('uid' => $uid));
            }
            $html .= '</div>';
            $html = lang('space', 'wall_form', array('uid' => $uid, 'FORMHASH' => FORMHASH)) . '<hr class="da mtm m0">' . $html;
            $titlemore = '<span class="y xw0"><a href="home.php?mod=space&uid=' . $uid . '&do=wall">' . lang('space', 'all') . '</a></span>';
            break;
        case 'group':
            $do = $blockname;
            $view = 'groupthread';
            require_once libfile('function/group');
            $grouplist = mygrouplist($uid, 'lastupdate', array('f.name', 'ff.icon'), $shownum);
            if (empty($grouplist)) {
                $grouplist = array();
            }
            foreach ($grouplist as $groupid => $group) {
                $group['groupid'] = $groupid;
                $html .= lang('space', 'group_li', $group);
            }
            $html = '<ul class="ml mls cl">' . $html . '</ul>';
            break;
        case 'music':
            if (!empty($parameters['mp3list'])) {
                $authcode = substr(md5($_G['authkey'] . $uid), 6, 16);
                $view = $_G['adminid'] == 1 && $_G['setting']['allowquickviewprofile'] ? '&view=admin' : '';
                $querystring = urlencode("home.php?mod=space&uid={$uid}&do=index&op=getmusiclist&hash={$authcode}{$view}&t=" . TIMESTAMP);
                $swfurl = STATICURL . 'image/common/mp3player.swf?config=' . $querystring;
                if (empty($parameters['config']['height']) && $parameters['config']['height'] !== 0) {
                    $parameters['config']['height'] = '200px';
                } else {
                    $parameters['config']['height'] .= 'px';
                }
                $html = "<script language=\"javascript\" type=\"text/javascript\">document.write(AC_FL_RunContent('id', 'mp3player', 'name', 'mp3player', 'devicefont', 'false', 'width', '100%', 'height', '" . $parameters['config']['height'] . "', 'src', '{$swfurl}', 'menu', 'false',  'allowScriptAccess', 'sameDomain', 'swLiveConnect', 'true', 'wmode', 'transparent'));</script>";
            } else {
                $html = lang('space', 'music_no_content');
            }
            $html = '<div class="ml mls cl">' . $html . '</div>';
            break;
        default:
            if ($space['self']) {
                $_G['space_group'] = $_G['group'];
            } elseif (empty($_G['space_group'])) {
                $_G['space_group'] = DB::fetch_first("SELECT * FROM " . DB::table('common_usergroup_field') . " WHERE groupid='{$space['groupid']}'");
            }
            require_once libfile('function/discuzcode');
            if ($_G['space_group']['allowspacediyimgcode']) {
                if (empty($_G['cache']['smilies']['loaded'])) {
                    loadcache(array('smilies', 'smileytypes'));
                    foreach ($_G['cache']['smilies']['replacearray'] as $skey => $smiley) {
                        $_G['cache']['smilies']['replacearray'][$skey] = '[img]' . $_G['siteurl'] . 'static/image/smiley/' . $_G['cache']['smileytypes'][$_G['cache']['smilies']['typearray'][$skey]]['directory'] . '/' . $smiley . '[/img]';
                    }
                    $_G['cache']['smilies']['loaded'] = 1;
                }
                $parameters['content'] = preg_replace($_G['cache']['smilies']['searcharray'], $_G['cache']['smilies']['replacearray'], censor(trim($parameters['content'])));
            }
            if ($_G['space_group']['allowspacediybbcode'] || $_G['space_group']['allowspacediyimgcode'] || $_G['space_group']['allowspacediyhtml']) {
                $parameters['content'] = discuzcode($parameters['content'], 1, 0, 1, 0, $_G['space_group']['allowspacediybbcode'], $_G['space_group']['allowspacediyimgcode'], $_G['space_group']['allowspacediyhtml']);
            } else {
                $parameters['content'] = dhtmlspecialchars($parameters['content']);
            }
            $parameters['content'] = nl2br($parameters['content']);
            if (empty($parameters['content'])) {
                $parameters['content'] = lang('space', $blockname);
            }
            $html .= $parameters['content'];
            break;
    }
    if ($_G['setting']['allowviewuserthread'] === false && $blockname == 'thread') {
        $html = '';
    } else {
        if (isset($parameters['title'])) {
            if (empty($parameters['title'])) {
                $title = '';
            } else {
                $view = $view === false ? '' : ($view == '' ? '&view=me' : '&view=' . $view);
                $bnamelink = $do ? '<a href="home.php?mod=space&uid=' . $uid . '&do=' . $do . $view . '">' . stripslashes($parameters['title']) . '</a>' : stripslashes($parameters['title']);
                $title = lang('space', 'block_title', array('bname' => $bnamelink, 'more' => $titlemore));
            }
        } else {
            $view = $view === false ? '' : ($view == '' ? '&view=me' : '&view=' . $view);
            $bnamelink = $do ? '<a href="home.php?mod=space&uid=' . $uid . '&do=' . $do . $view . '">' . getblockdata($blockname) . '</a>' : getblockdata($blockname);
            $title = lang('space', 'block_title', array('bname' => $bnamelink, 'more' => $titlemore));
        }
        $html = $title . '<' . $contenttagname . ' id="' . $blockname . '_content" class="content' . $contentclassname . '">' . $html . '</' . $contenttagname . '>';
    }
    return $html;
}
Beispiel #3
0
function blog_get_stick($uid, $stickblogs, $summarylen)
{
    $list = array_flip($stickblogs);
    if ($stickblogs) {
        $data_blog = C::t('home_blog')->fetch_all($stickblogs);
        $data_blogfield = C::t('home_blogfield')->fetch_all($stickblogs);
        foreach ($data_blog as $curblogid => $value) {
            $value = array_merge($value, (array) $data_blogfield[$curblogid]);
            $value['message'] = getstr($value['message'], $summarylen, 0, 0, 0, -1);
            $value['message'] = preg_replace("/&[a-z]+\\;/i", '', $value['message']);
            if ($value['pic']) {
                $value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
            }
            $value['dateline'] = dgmdate($value['dateline']);
            $value['stickflag'] = true;
            $list[$value['blogid']] = $value;
        }
    }
    return $list;
}
Beispiel #4
0
function feed_publish($id, $idtype, $add=0) {
	global $_G;
	$id = intval($id);
	if(empty($id)) {
		return;
	}
	if(!helper_access::check_module('feed')) {
		return false;
	}
	$setarr = array();
	switch ($idtype) {
		case 'blogid':
			$value = array_merge(
				C::t('home_blog')->fetch($id),
				C::t('home_blogfield')->fetch($id)
			);
			if($value) {
				if($value['friend'] != 3) {
					$setarr['icon'] = 'blog';
					$setarr['id'] = $value['blogid'];
					$setarr['idtype'] = $idtype;
					$setarr['uid'] = $value['uid'];
					$setarr['username'] = $value['username'];
					$setarr['dateline'] = $value['dateline'];
					$setarr['target_ids'] = $value['target_ids'];
					$setarr['friend'] = $value['friend'];
					$setarr['hot'] = $value['hot'];
					$status = $value['status'];

					$url = "home.php?mod=space&uid=$value[uid]&do=blog&id=$value[blogid]";
					if($value['friend'] == 4) {
						$setarr['title_template'] = 'feed_blog_password';
						$setarr['title_data'] = array('subject' => "<a href=\"$url\">$value[subject]</a>");
					} else {
						if($value['pic']) {
							$setarr['image_1'] = pic_cover_get($value['pic'], $value['picflag']);
							$setarr['image_1_link'] = $url;
						}
						$setarr['title_template'] = 'feed_blog_title';
						$setarr['body_template'] = 'feed_blog_body';
						$value['message'] = preg_replace("/&[a-z]+\;/i", '', $value['message']);
						$setarr['body_data'] = array(
							'subject' => "<a href=\"$url\">$value[subject]</a>",
							'summary' => getstr($value['message'], 150, 0, 0, 0, -1)
						);
					}
				}
			}
			break;
		case 'albumid':
			$key = 1;
			if($id > 0) {
				$query = C::t('home_pic')->fetch_all_by_sql('p.'.DB::field('albumid', $id), 'a.dateline DESC', 0, 4);
				foreach($query as $value) {
					if($value['friend'] <= 2) {
						if(empty($setarr['icon'])) {
							$setarr['icon'] = 'album';
							$setarr['id'] = $value['albumid'];
							$setarr['idtype'] = $idtype;
							$setarr['uid'] = $value['uid'];
							$setarr['username'] = $value['username'];
							$setarr['dateline'] = $value['dateline'];
							$setarr['target_ids'] = $value['target_ids'];
							$setarr['friend'] = $value['friend'];
							$status = $value['status'];
							$setarr['title_template'] = 'feed_album_title';
							$setarr['body_template'] = 'feed_album_body';
							$setarr['body_data'] = array(
								'album' => "<a href=\"home.php?mod=space&uid=$value[uid]&do=album&id=$value[albumid]\">$value[albumname]</a>",
								'picnum' => $value['picnum']
							);
						}
						$setarr['image_'.$key] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote']);
						$setarr['image_'.$key.'_link'] = "home.php?mod=space&uid=$value[uid]&do=album&picid=$value[picid]";
						$key++;
					} else {
						break;
					}
				}
			}
			break;
		case 'picid':
			$plussql = $id>0 ? 'p.'.DB::field('picid', $id) : 'p.'.DB::field('uid', $_G[uid]).' ORDER BY dateline DESC LIMIT 1';
			$query = C::t('home_pic')->fetch_all_by_sql($plussql);
			if($value = $query[0]) {
				if(empty($value['friend'])) {
					$setarr['icon'] = 'album';
					$setarr['id'] = $value['picid'];
					$setarr['idtype'] = $idtype;
					$setarr['uid'] = $value['uid'];
					$setarr['username'] = $value['username'];
					$setarr['dateline'] = $value['dateline'];
					$setarr['target_ids'] = $value['target_ids'];
					$setarr['friend'] = $value['friend'];
					$setarr['hot'] = $value['hot'];
					$status = $value['status'];
					$url = "home.php?mod=space&uid=$value[uid]&do=album&picid=$value[picid]";
					$setarr['image_1'] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote']);
					$setarr['image_1_link'] = $url;
					$setarr['title_template'] = 'feed_pic_title';
					$setarr['body_template'] = 'feed_pic_body';
					$setarr['body_data'] = array('title' => $value['title']);
				}
			}
			break;
	}

	if($setarr['icon']) {
//vot		$setarr['title_template'] = $setarr['title_template']?lang('feed', $setarr['title_template']):'';
//vot		$setarr['body_template'] = $setarr['body_template']?lang('feed', $setarr['body_template']):'';
		$setarr['body_general'] = $setarr['body_general']?lang('feed', $setarr['body_general']):'';

		$setarr['title_data']['hash_data'] = "{$idtype}{$id}";
		$setarr['title_data'] = serialize($setarr['title_data']);
		$setarr['body_data'] = serialize($setarr['body_data']);

		$feedid = 0;
		if(!$add && $setarr['id']) {
			$feedid = C::t('home_feed')->fetch($id, $idtype);
			$feedid = $feedid['feedid'];
		}
		if($status == 0) {
			if($feedid) {
				C::t('home_feed')->update('', $setarr, '', '', $feedid);
			} else {
				C::t('home_feed')->insert($setarr);
			}
		}
	}

}
Beispiel #5
0
 $sql .= $friend ? " AND a.friend = '{$friend}'" : '';
 $orderby = $orderby ? "a.{$orderby}" : 'a.updatetime';
 $ordersc = $ordersc ? "{$ordersc}" : 'DESC';
 if ($_G['adminid'] == 2 && $endtime - $starttime > 86400 * 16 || $_G['adminid'] == 3 && $endtime - $starttime > 86400 * 8) {
     $error = 'album_mod_range_illegal';
 }
 if (!$error) {
     if ($detail) {
         $_G['gp_perpage'] = intval($_G['gp_perpage']) < 1 ? 20 : intval($_G['gp_perpage']);
         $perpage = $_G['gp_pp'] ? $_G['gp_pp'] : $_G['gp_perpage'];
         $query = DB::query("SELECT * FROM " . DB::table('home_album') . " a WHERE 1 {$sql} ORDER BY {$orderby} {$ordersc} LIMIT " . ($page - 1) * $perpage . ",{$perpage}");
         $albums = '';
         include_once libfile('function/home');
         while ($album = DB::fetch($query)) {
             if ($album['friend'] != 4 && ckfriend($album['uid'], $album['friend'], $album['target_ids'])) {
                 $album['pic'] = pic_cover_get($album['pic'], $album['picflag']);
             } else {
                 $album['pic'] = STATICURL . 'image/common/nopublish.gif';
             }
             $album['updatetime'] = dgmdate($album['updatetime']);
             switch ($album['friend']) {
                 case '0':
                     $privacy_name = $lang[setting_home_privacy_alluser];
                     break;
                 case '1':
                     $privacy_name = $lang[setting_home_privacy_friend];
                     break;
                 case '2':
                     $privacy_name = $lang[setting_home_privacy_specified_friend];
                     break;
                 case '3':
     $query = DB::query("SELECT * FROM " . DB::table('home_album') . " WHERE albumid='{$id}'");
     if (!($album = DB::fetch($query))) {
         showmessage('album_does_not_exist');
     }
     if ($album['friend']) {
         showmessage('album_can_not_share');
     }
     if (isblacklist($album['uid'])) {
         showmessage('is_blacklist');
     }
     $arr['itemid'] = $id;
     $arr['fromuid'] = $album['uid'];
     $arr['title_template'] = lang('spacecp', 'share_album');
     $arr['body_template'] = '<b>{albumname}</b><br>{username}';
     $arr['body_data'] = array('albumname' => "<a href=\"home.php?mod=space&uid={$album['uid']}&do=album&id={$album['albumid']}\">{$album['albumname']}</a>", 'username' => "<a href=\"home.php?mod=space&uid={$album['uid']}\">" . $album['username'] . "</a>");
     $arr['image'] = pic_cover_get($album['pic'], $album['picflag']);
     $arr['image_link'] = "home.php?mod=space&uid={$album['uid']}&do=album&id={$album['albumid']}";
     $note_uid = $album['uid'];
     $note_message = 'share_album';
     $note_values = array('url' => "home.php?mod=space&uid={$album['uid']}&do=album&id={$album['albumid']}", 'albumname' => $album['albumname'], 'from_id' => $id, 'from_idtype' => 'albumid');
     break;
 case 'pic':
     $feed_hash_data = "picid{$id}";
     $query = DB::query("SELECT album.username, album.albumid, album.albumname, album.friend, pf.*, pic.*\r\n\t\t\t\tFROM " . DB::table('home_pic') . " pic\r\n\t\t\t\tLEFT JOIN " . DB::table('home_picfield') . " pf ON pf.picid=pic.picid\r\n\t\t\t\tLEFT JOIN " . DB::table('home_album') . " album ON album.albumid=pic.albumid\r\n\t\t\t\tWHERE pic.picid='{$id}'");
     if (!($pic = DB::fetch($query))) {
         showmessage('image_does_not_exist');
     }
     if (in_array($pic['status'], array(1, 2))) {
         showmessage('moderate_pic_not_share');
     }
     if ($pic['friend']) {
Beispiel #7
0
 			$note_uid = $arrangement['uid'];
 			$note_message = cplang('note_share_arrangement', array("space.php?uid=$arrangement[uid]&do=arrangement&id=$arrangement[arrangementid]", $arrangement['subject']));
 			
 			break;
 			*/
 case 'blog':
     $query = $_SGLOBAL['db']->query("SELECT b.*,bf.message,bf.hotuser FROM " . tname('blog') . " b\r\n\t\t\t\tLEFT JOIN " . tname('blogfield') . " bf ON bf.blogid=b.blogid\r\n\t\t\t\tWHERE b.blogid='{$id}'");
     $blog = $_SGLOBAL['db']->fetch_array($query);
     //实名
     realname_set($blog['uid'], $blog['username']);
     realname_get();
     $arr['title_template'] = cplang('share_blog');
     $arr['body_template'] = '<b>{subject}</b><br>{username}<br>{message}';
     $arr['body_data'] = array('subject' => "<a href=\"space.php?uid={$blog['uid']}&do=blog&id={$blog['blogid']}\">{$blog['subject']}</a>", 'username' => "<a href=\"space.php?uid={$blog['uid']}\">" . $_SN[$blog['uid']] . "</a>", 'message' => getstr($blog['message'], 150, 0, 1, 0, 0, -1));
     if ($blog['pic']) {
         $arr['image'] = pic_cover_get($blog['pic'], $blog['picflag']);
         $arr['image_link'] = "space.php?uid={$blog['uid']}&do=blog&id={$blog['blogid']}";
     }
     //通知
     $note_uid = $blog['uid'];
     $note_message = cplang('note_share_blog', array("space.php?uid={$blog['uid']}&do=blog&id={$blog['blogid']}", $blog['subject']));
     $hotarr = array('blogid', $blog['blogid'], $blog['hotuser']);
     break;
     /*		
     		case 'album':
     $query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('album')." WHERE albumid='$id'");
     $album = $_SGLOBAL['db']->fetch_array($query);
     //实名
     realname_set($album['uid'], $album['username']);
     realname_get();
     
Beispiel #8
0
            if ($value['pic']) {
                $value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
            }
            $value['message'] = $value['friend'] == 4 ? '' : getstr($value['message'], 150, 0, 0, 0, 0, -1);
            $bloglist[] = $value;
        }
    }
    $blognum = count($bloglist);
}
//ᅬ¢ᄇ£
$albumlist = array();
if ($_SGLOBAL['mygroupid'] == 3 || $space['albumnum'] && ckprivacy('album')) {
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('album') . " WHERE uid='{$space['uid']}' ORDER BY updatetime DESC LIMIT 0,6");
    while ($value = $_SGLOBAL['db']->fetch_array($query)) {
        if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
            $value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
            $albumlist[] = $value;
        }
    }
}
//友情链接
$flink = array();
if ($space['groupid'] == 3) {
    $fquery = $_SGLOBAL['db']->query("SELECT flink FROM " . tname('publicflink') . " WHERE uid={$space['uid']}");
    if ($fresult = $_SGLOBAL['db']->fetch_array($fquery)) {
        $flink = json_decode($fresult['flink'], true);
    }
}
//￁￴￑ᅯᄚ¥
$walllist = array();
if ($_SGLOBAL['mygroupid'] == 3 || ckprivacy('wall')) {
Beispiel #9
0
function getblockhtml($blockname, $parameters = array())
{
    global $_G, $space;
    $parameters = empty($parameters) ? array() : $parameters;
    $list = array();
    $sql = $title = $html = $wheresql = $ordersql = '';
    $shownum = 6;
    $uid = intval($space['uid']);
    $shownum = empty($parameters['shownum']) ? $shownum : intval($parameters['shownum']);
    switch ($blockname) {
        case 'profile':
            $html .= '<div class="avt avtm">' . avatar($space['uid'], 'middle');
            $html .= '<h2>' . $space['username'] . '</h2>';
            $html .= '</div><ul class="xl xl2 cl">';
            if ($space['self']) {
                $html .= '<li><a href="home.php?mod=space&diy=yes">' . lang('space', 'block_profile_diy') . '</a></li>';
                $html .= '<li><a href="home.php?mod=space&do=wall">' . lang('space', 'block_profile_wall') . '</a></li>';
                $html .= '<li><a href="home.php?mod=spacecp&ac=avatar">' . lang('space', 'block_profile_avatar') . '</a></li>';
                $html .= '<li><a href="home.php?mod=spacecp&ac=profile">' . lang('space', 'block_profile_update') . '</a></li>';
            } else {
                require_once libfile('function/friend');
                $isfriend = friend_check($space['uid']);
                if (!$isfriend) {
                    $html .= "<li><a href=\"home.php?mod=spacecp&ac=friend&op=add&uid={$space['uid']}&handlekey=addfriendhk_{$space[uid]}\" id=\"a_friend_li_{$space[uid]}\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'block_profile_friend_add') . "</a></li>";
                } else {
                    $html .= "<li><a href=\"home.php?mod=spacecp&ac=friend&op=ignore&uid={$space['uid']}&handlekey=ignorefriendhk_{$space[uid]}\" id=\"a_ignore_{$space[uid]}\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'block_profile_friend_ignore') . "</a></li>";
                }
                $html .= "<li><a href=\"home.php?mod=space&uid={$space['uid']}&do=wall\">" . lang('space', 'block_profile_wall_to_me') . "</a></li>";
                $html .= "<li><a href=\"home.php?mod=spacecp&ac=poke&op=send&uid={$space['uid']}&handlekey=propokehk_{$space[uid]}\" id=\"a_poke_{$space[uid]}\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'block_profile_poke') . "</a></li>";
                $html .= "<li><a href=\"home.php?mod=spacecp&ac=pm&op=showmsg&handlekey=showmsg_{$space['uid']}&touid={$space['uid']}&pmid=0&daterange=2\" id=\"a_sendpm_{$space['uid']}\" onclick=\"showWindow('showMsgBox', this.href, 'get', 0)\">" . lang('space', 'block_profile_sendmessage') . "</a></li>";
            }
            $html .= '</ul>';
            $html = '<div class="content"><div id="pcd">' . $html . '</div></div>';
            break;
        case 'doing':
            $dolist = array();
            $sql = "SELECT * FROM " . DB::table('home_doing') . " WHERE uid='{$uid}' ORDER BY dateline DESC LIMIT 0,{$shownum}";
            $query = DB::query($sql);
            while ($value = DB::fetch($query)) {
                $dolist[] = $value;
            }
            if ($dolist) {
                foreach ($dolist as $dv) {
                    $doid = $dv['doid'];
                    $_G[gp_key] = $key = random(8);
                    $html .= "<li class=\"pbn bbda\">";
                    $html .= $dv['message'];
                    $html .= "&nbsp;<a href=\"home.php?mod=space&uid={$dv['uid']}&do=doing&view=me&from=space&doid={$dv['doid']}\" target=\"_blank\" class=\"xg1\">" . lang('space', 'block_doing_reply') . "</a>";
                    $html .= "</li>";
                }
            } else {
                $html .= "<p class=\"emp\">" . lang('space', 'block_doing_no_content') . "</p>";
            }
            $html = '<div class="content"><ul class="xl">' . $html . '</ul></div>';
            break;
        case 'blog':
            $query = DB::query("SELECT bf.*, b.* FROM " . DB::table('home_blog') . " b\n\t\t\t\tLEFT JOIN " . DB::table('home_blogfield') . " bf ON bf.blogid=b.blogid\n\t\t\t\tWHERE b.uid='{$uid}'\n\t\t\t\tORDER BY b.dateline DESC LIMIT 0,{$shownum}");
            while ($value = DB::fetch($query)) {
                if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
                    if ($value['pic']) {
                        $value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
                    }
                    $value['message'] = $value['friend'] == 4 ? '' : getstr($value['message'], 150, 0, 0, 0, 0, -1);
                    $html .= lang('space', 'blog_li', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'subject' => $value['subject'], 'date' => dgmdate($value['dateline'], 'Y-m-d')));
                    if ($parameters['showmessage']) {
                        if ($value['pic']) {
                            $html .= lang('space', 'blog_li_img', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'src' => $value['pic']));
                        }
                        $html .= "<dd>{$value['message']}</dd>";
                    }
                    $html .= lang('space', 'blog_li_ext', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'viewnum' => $value['viewnum'], 'replynum' => $value['replynum']));
                    $html .= "</dl>";
                } else {
                    $html .= '<p>' . lang('space', 'block_view_noperm') . '</p>';
                }
            }
            $more = $html ? '<p class="ptm" style="text-align: right;"><a href="home.php?mod=space&uid=' . $space['uid'] . '&do=blog&view=me&from=space">' . lang('space', 'viewmore') . '</a></p>' : '';
            $html = '<div class="content xld">' . $html . $more . '</div>';
            break;
        case 'album':
            if (ckprivacy('album', 'view')) {
                $query = DB::query("SELECT * FROM " . DB::table('home_album') . " WHERE uid='{$uid}' ORDER BY updatetime DESC LIMIT 0,{$shownum}");
                while ($value = DB::fetch($query)) {
                    if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
                        $value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
                        $html .= lang('space', 'album_li', array('albumid' => $value['albumid'], 'src' => $value['pic'], 'albumname' => $value['albumname'], 'uid' => $value['uid'], 'picnum' => $value['picnum'], 'date' => dgmdate($value['updatetime'], 'n-j')));
                    }
                }
            } else {
                $html .= '<li>' . lang('space', 'block_view_noperm') . '</li>';
            }
            $html = '<div class="content"><ul class="ml mla cl">' . $html . '</ul></div>';
            break;
        case 'feed':
            if (ckprivacy('feed', 'view')) {
                require_once libfile('function/feed');
                $query = DB::query("SELECT * FROM " . DB::table('home_feed') . " WHERE uid='{$uid}' ORDER BY dateline DESC LIMIT 0,{$shownum}");
                while ($value = DB::fetch($query)) {
                    if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
                        $html .= mkfeedhtml(mkfeed($value));
                    }
                }
            }
            $html = empty($html) ? '' : '<ul class="content el">' . $html . '</ul>';
            break;
        case 'thread':
            if ($_G['setting']['allowviewuserthread']) {
                $fidsql = " AND fid IN({$_G[setting][allowviewuserthread]}) ";
            } else {
                $fidsql = '';
            }
            $query = DB::query("SELECT * FROM " . DB::table('forum_thread') . " WHERE authorid='{$uid}' {$fidsql} ORDER BY tid DESC LIMIT 0,{$shownum}");
            while ($thread = DB::fetch($query)) {
                if ($thread['author']) {
                    $html .= "<li><a target=\"_blank\" href=\"forum.php?mod=viewthread&tid={$thread['tid']}\">{$thread['subject']}</a></li>";
                }
            }
            $html = empty($html) ? '' : '<div class="content cl"><ul class="xl">' . $html . '</ul></div>';
            break;
        case 'friend':
            require_once libfile('function/friend');
            $friendlist = array();
            $friendlist = friend_list($uid, $shownum);
            $fuids = array_keys($friendlist);
            getonlinemember($fuids);
            foreach ($friendlist as $key => $value) {
                $classname = $_G['ols'][$value['fuid']] ? 'gol' : '';
                $html .= '<li><a href="home.php?mod=space&uid=' . $value['fuid'] . '" target="_blank"><em class="' . $classname . '"></em>' . avatar($value['fuid'], 'small') . '</a><p><a href="home.php?mod=space&uid=' . $value[fuid] . '" target="_blank">' . $value['fusername'] . '</a></p></li>';
            }
            $html = '<div class="content"><ul class="ml mls cl">' . $html . '</ul></div>';
            break;
        case 'visitor':
            $query = DB::query("SELECT * FROM " . DB::table('home_visitor') . " WHERE uid='{$uid}' ORDER BY dateline DESC LIMIT 0,{$shownum}");
            $list = $fuids = array();
            while ($value = DB::fetch($query)) {
                $list[] = $value;
                $fuids[] = $value['vuid'];
            }
            getonlinemember($fuids);
            foreach ($list as $value) {
                $html .= "<li>";
                if ($value['vusername'] == '') {
                    $html .= lang('space', 'visitor_anonymity');
                } else {
                    $html .= lang('space', 'visitor_list', array('uid' => $value['vuid'], 'username' => $value['vusername'], 'class' => $_G['ols'][$value['vuid']] ? 'gol' : '', 'avatar' => avatar($value['vuid'], 'small')));
                }
                $html .= "<span class=\"xg2\">" . dgmdate($value['dateline'], 'u') . "</span>";
                $html .= "</li>";
            }
            $html = '<div class="content"><ul class="ml mls cl">' . $html . '</ul></div>';
            break;
        case 'share':
            if (ckprivacy('share', 'view')) {
                require_once libfile('function/share');
                $query = DB::query("SELECT * FROM " . DB::table('home_share') . " WHERE uid='{$uid}' ORDER BY dateline DESC LIMIT 0,{$shownum}");
                while ($value = DB::fetch($query)) {
                    $value = mkshare($value);
                    $html .= '<li><em>' . $value['title_template'] . '(' . dgmdate($value['dateline'], 'u') . ')</em><div class="ec cl">';
                    if ($value['image']) {
                        $html .= '<a href="' . $value['image_link'] . '" target="_blank"><img src="' . $value['image'] . '" class="tn" alt="" /></a>';
                    }
                    $html .= '<div class="d">' . $value['body_template'] . '</div>';
                    if ($value['type'] == 'video') {
                        if (!empty($value['body_data']['imgurl'])) {
                            $html .= '<table class="mtm" title="' . lang('space', 'click_play') . '" onclick="javascript:showFlash(\'' . $value['body_data']['host'] . '\', \'' . $value['body_data']['flashvar'] . '\', this, \'' . $value['sid'] . '\');"><tr><td class="vdtn hm" style="background: url(' . $value['body_data']['imgurl'] . ') no-repeat"><img src="' . IMGDIR . '/vds.png" alt="' . lang('space', 'click_play') . '" /></td></tr></table>';
                        } else {
                            $html .= "<img src=\"" . IMGDIR . "/vd.gif\" alt=\"" . lang('space', 'click_play') . "\" onclick=\"javascript:showFlash('{$value['body_data']['host']}', '{$value['body_data']['flashvar']}', this, '{$value['sid']}');\" class=\"tn\" />";
                        }
                    } elseif ($value['type'] == 'music') {
                        $html .= "<img src=\"" . IMGDIR . "/music.gif\" alt=\"" . lang('space', 'click_play') . "\" onclick=\"javascript:showFlash('music', '{$value['body_data']['musicvar']}', this, '{$value['sid']}');\" class=\"tn\" />";
                    } elseif ($value['type'] == 'flash') {
                        $html .= "<img src=\"" . IMGDIR . "/flash.gif\" alt=\"" . lang('space', 'click_view') . "\" onclick=\"javascript:showFlash('flash', '{$value['body_data']['flashaddr']}', this, '{$value['sid']}');\" class=\"tn\" />";
                    }
                    if ($value['body_general']) {
                        $html .= '<div class="quote' . ($value['image'] ? 'z' : '') . "\"><blockquote>{$value['body_general']}</blockquote></div>";
                    }
                    $html .= '</div></li>';
                }
                $html = '<div class="content"><ul class="el">' . $html . '</ul></div>';
            }
            break;
        case 'wall':
            $walllist = array();
            if (ckprivacy('wall', 'view')) {
                $query = DB::query("SELECT * FROM " . DB::table('home_comment') . " WHERE id='{$uid}' AND idtype='uid' ORDER BY dateline DESC LIMIT 0,{$shownum}");
                while ($value = DB::fetch($query)) {
                    $value['message'] = strlen($value['message']) > 500 ? getstr($value['message'], 500, 0, 0, 0, 0, -1) . ' ...' : $value['message'];
                    $walllist[] = $value;
                }
            }
            $html = '<div class="xld xlda" id="comment_ul">';
            foreach ($walllist as $key => $value) {
                $op = '';
                if ($value['author']) {
                    $author_avatar = '<a href="home.php?mod=space&uid=' . $value['authorid'] . '" target="_blank">' . avatar($value['authorid'], 'small') . '</a>';
                    $author = '<a href="home.php?mod=space&uid=' . $value['authorid'] . '" id="author_' . $value['cid'] . '" target="_blank">' . $value['author'] . '</a>';
                } else {
                    $author_avatar = '<img src="static/image/magic/hidden.gif" alt="hidden" />';
                    $author = lang('space', 'hidden_username');
                }
                if ($value['authorid'] == $_G['uid']) {
                    $op .= lang('space', 'wall_edit', array('cid' => $value['cid']));
                }
                if ($value['authorid'] == $_G['uid'] || $space['self'] || checkperm('managecomment')) {
                    $op .= lang('space', 'wall_del', array('cid' => $value['cid']));
                }
                if ($value['authorid'] != $_G['uid'] && ($value['idtype'] != 'uid' || $space['self'])) {
                    $op .= lang('space', 'wall_reply', array('cid' => $value['cid']));
                }
                $date = dgmdate($value['dateline'], 'u');
                $replacearr = array('author' => $author, 'author_avatar' => $author_avatar, 'cid' => $value['cid'], 'message' => $value['message'], 'date' => $date, 'op' => $op);
                $html .= lang('space', 'wall_li', $replacearr);
            }
            $html .= '</div>';
            $html = '<div class="content">' . lang('space', 'wall_form', array('uid' => $uid, 'FORMHASH' => FORMHASH)) . $html . '</div>';
            break;
        case 'group':
            require_once libfile('function/group');
            $grouplist = mygrouplist($uid, 'lastupdate', array('f.name', 'ff.icon'), $shownum);
            if (empty($grouplist)) {
                $grouplist = array();
            }
            foreach ($grouplist as $groupid => $group) {
                $group['groupid'] = $groupid;
                $html .= lang('space', 'group_li', $group);
            }
            $html = '<div class="content"><ul class="ml mls cl">' . $html . '</ul></div>';
            break;
        case 'music':
            if (!empty($parameters['mp3list'])) {
                $authcode = substr(md5($_G['authkey'] . $uid), 6, 16);
                $querystring = urlencode("home.php?mod=space&do=index&op=getmusiclist&uid={$uid}&hash={$authcode}&t=" . TIMESTAMP);
                $swfurl = STATICURL . 'image/common/mp3player.swf?config=' . $querystring;
                $html = "<script language=\"javascript\" type=\"text/javascript\">document.write(AC_FL_RunContent('id', 'mp3player', 'name', 'mp3player', 'devicefont', 'false', 'width', '100%', 'height', '220px', 'src', '{$swfurl}', 'menu', 'false',  'allowScriptAccess', 'sameDomain', 'swLiveConnect', 'true', 'wmode', 'transparent'));</script>";
            } else {
                $html = lang('space', 'music_no_content');
            }
            $html = '<div class="content"><div class="ml mls cl">' . $html . '</div></div>';
            break;
        default:
            if ($space['self']) {
                $_G['space_group'] = $_G['group'];
            } elseif (empty($_G['space_group'])) {
                $_G['space_group'] = db::fetch_first("SELECT * FROM " . db::table('common_usergroup_field') . " WHERE groupid='{$space['groupid']}'");
            }
            require_once libfile('function/discuzcode');
            if ($_G['space_group']['allowspacediyimgcode']) {
                if (empty($_G['cache']['smilies']['loaded'])) {
                    loadcache(array('smilies', 'smileytypes'));
                    foreach ($_G['cache']['smilies']['replacearray'] as $skey => $smiley) {
                        $_G['cache']['smilies']['replacearray'][$skey] = '[img]' . $_G['siteurl'] . 'static/image/smiley/' . $_G['cache']['smileytypes'][$_G['cache']['smilies']['typearray'][$skey]]['directory'] . '/' . $smiley . '[/img]';
                    }
                    $_G['cache']['smilies']['loaded'] = 1;
                }
                $parameters['content'] = preg_replace($_G['cache']['smilies']['searcharray'], $_G['cache']['smilies']['replacearray'], censor(trim($parameters['content'])));
            }
            if ($_G['space_group']['allowspacediybbcode'] || $_G['space_group']['allowspacediyimgcode'] || $_G['space_group']['allowspacediyhtml']) {
                $parameters['content'] = discuzcode($parameters['content'], 1, 0, 1, 0, $_G['space_group']['allowspacediybbcode'], $_G['space_group']['allowspacediyimgcode'], $_G['space_group']['allowspacediyhtml'], 0, 1);
            } else {
                $parameters['content'] = dhtmlspecialchars($parameters['content']);
            }
            if (empty($parameters['content'])) {
                $parameters['content'] = lang('space', $blockname);
            }
            $html .= '<div class="content">' . $parameters['content'] . '</div>';
            break;
    }
    if (isset($parameters['title'])) {
        $title = empty($parameters['title']) ? '' : lang('space', 'block_title', array('bname' => stripslashes($parameters['title'])));
    } else {
        $title = lang('space', 'block_title', array('bname' => getblockdata($blockname)));
    }
    $html = $title . $html;
    return $html;
}
 /**
  * 家园-个人空间-相册(space_album):获取图片地址
  * @access protected
  * @param string $type 类型,可选值'album','albumpic'
  * @return string
  */
 function _album_pic_get_url($type = 'album')
 {
     global $album, $pic, $_G;
     $pic_url = '';
     if ($type == 'album') {
         require_once libfile('function/home');
         $pic_url = isset($album['pic']) & isset($album['picflag']) ? pic_cover_get($album['pic'], $album['picflag']) : '';
     } elseif ($type == 'albumpic') {
         $pic_url = isset($pic['pic']) ? (string) $pic['pic'] : '';
     }
     return 0 === strpos($pic_url, 'http') || 0 === strpos($pic_url, 'ftp') ? $pic_url : $_G['siteurl'] . $pic_url;
 }
Beispiel #11
0
function feed_publish($id, $idtype, $add = 0, $fromdevice = '')
{
    global $_SGLOBAL, $_SC;
    $setarr = array();
    switch ($idtype) {
        case 'arrangementid':
            $query = $_SGLOBAL['db']->query("SELECT * from " . tname('arrangement') . " WHERE arrangementid='{$id}'");
            if ($value = $_SGLOBAL['db']->fetch_array($query)) {
                //基本
                $setarr['icon'] = 'arrangement';
                $setarr['id'] = $value['arrangementid'];
                $setarr['idtype'] = $idtype;
                $setarr['uid'] = $value['uid'];
                //$setarr['username'] = $value['username'];
                $setarr['dateline'] = $value['dateline'];
                //$setarr['target_ids'] = $value['target_ids'];
                //$setarr['friend'] = $value['friend'];
                //$setarr['hot'] = $value['hot'];
                //详细
                $url = "space.php?uid={$value['uid']}&do=arrangement&id={$value['arrangementid']}";
                if ($value['pic']) {
                    $setarr['image_1'] = pic_cover_get($value['pic'], $value['picflag']);
                    $setarr['image_1_link'] = $url;
                }
                $setarr['title_template'] = cplang('feed_arrangement');
                $setarr['body_template'] = '<b>{subject}</b><br>{summary}';
                $setarr['body_data'] = array('subject' => "<a href=\"{$url}\">{$value['subject']}</a>", 'summary' => getstr($value['message'], 150, 1, 1, 0, 0, -1));
            }
            break;
        case 'calendar':
            $query = $_SGLOBAL['db']->query("SELECT * from " . tname('calendar') . " WHERE id='{$id}'");
            if ($value = $_SGLOBAL['db']->fetch_array($query)) {
                //基本
                $setarr['icon'] = 'calendar';
                $setarr['id'] = $value['id'];
                $setarr['idtype'] = $idtype;
                $setarr['uid'] = $value['uid'];
                $setarr['dateline'] = $value['dateline'];
                //详细
                $url = "space.php?uid={$value['uid']}&do=calendar&id={$value['id']}";
                $setarr['title_template'] = cplang('feed_calendar');
                $setarr['body_template'] = '<b>{subject}</b>';
                $setarr['body_data'] = array('subject' => "<a href=\"{$url}\">{$value['calendar_name']}</a>");
            }
            break;
        case 'blogid':
            $query = $_SGLOBAL['db']->query("SELECT b.*, bf.* FROM " . tname('blog') . " b\r\n\t\t\t\tLEFT JOIN " . tname('blogfield') . " bf ON bf.blogid=b.blogid\r\n\t\t\t\tWHERE b.blogid='{$id}'");
            if ($value = $_SGLOBAL['db']->fetch_array($query)) {
                if ($value['friend'] != 3) {
                    //基本
                    $setarr['icon'] = 'blog';
                    $setarr['icontype'] = $_POST['iswork'] ? 'work' : '';
                    $setarr['id'] = $value['blogid'];
                    $setarr['idtype'] = $idtype;
                    $setarr['uid'] = $value['uid'];
                    $setarr['username'] = $value['username'];
                    $setarr['dateline'] = $value['dateline'];
                    $setarr['target_ids'] = $value['target_ids'];
                    $setarr['friend'] = $value['friend'];
                    $setarr['hot'] = $value['hot'];
                    //详细
                    $url = "space.php?uid={$value['uid']}&do=blog&id={$value['blogid']}";
                    if ($value['friend'] == 4) {
                        //加密
                        $setarr['title_template'] = cplang('feed_blog_password');
                        $setarr['title_data'] = array('subject' => "<a href=\"{$url}\">{$value['subject']}</a>");
                    } else {
                        //非私人
                        if ($value['pic']) {
                            $setarr['image_1'] = pic_cover_get($value['pic'], $value['picflag']);
                            $setarr['image_1_link'] = $url;
                        }
                        $setarr['title_template'] = cplang('feed_blog');
                        $setarr['body_template'] = '<b>{subject}</b><br>{summary}';
                        $Message = getstr($value['message'], 150, 1, 1, 0, 0, -1);
                        $setarr['body_data'] = array('subject' => "<a href=\"{$url}\">{$value['subject']}</a>", 'summary' => $Message);
                    }
                }
            }
            break;
        case 'albumid':
            $key = 1;
            if ($id > 0) {
                $query = $_SGLOBAL['db']->query("SELECT p.*, a.username, a.albumname, a.picnum, a.friend, a.target_ids FROM " . tname('pic') . " p\r\n\t\t\t\t\tLEFT JOIN " . tname('album') . " a ON a.albumid=p.albumid\r\n\t\t\t\t\tWHERE p.albumid='{$id}' ORDER BY dateline DESC LIMIT 0,4");
                while ($value = $_SGLOBAL['db']->fetch_array($query)) {
                    if ($value['friend'] <= 2) {
                        if (empty($setarr['icon'])) {
                            //基本
                            $setarr['icon'] = 'album';
                            $setarr['id'] = $value['albumid'];
                            $setarr['idtype'] = $idtype;
                            $setarr['uid'] = $value['uid'];
                            $setarr['username'] = $value['username'];
                            $setarr['dateline'] = $value['dateline'];
                            $setarr['target_ids'] = $value['target_ids'];
                            $setarr['friend'] = $value['friend'];
                            //详细
                            $setarr['title_template'] = '{actor} ' . cplang('upload_album');
                            $setarr['body_template'] = '<b>{album}</b><br>' . cplang('the_total_picture', array('{picnum}'));
                            $setarr['body_data'] = array('album' => "<a href=\"space.php?uid={$value['uid']}&do=album&id={$value['albumid']}\">{$value['albumname']}</a>", 'picnum' => $value['picnum']);
                        }
                        $setarr['image_' . $key] = pic_get($value['filepath'], $value['thumb'], $value['remote']);
                        $setarr['image_' . $key . '_link'] = "space.php?uid={$value['uid']}&do=album&picid={$value['picid']}";
                        $key++;
                    } else {
                        break;
                    }
                }
            } else {
                //默认相册
                $picnum = $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT COUNT(*) FROM " . tname('pic') . " WHERE uid='{$_SGLOBAL['supe_uid']}' AND albumid='0'"), 0);
                if ($picnum >= 1) {
                    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('pic') . " WHERE uid='{$_SGLOBAL['supe_uid']}' AND albumid='0' ORDER BY dateline DESC LIMIT 0,4");
                    while ($value = $_SGLOBAL['db']->fetch_array($query)) {
                        if (empty($setarr['icon'])) {
                            //基本
                            $setarr['icon'] = 'album';
                            $setarr['uid'] = $value['uid'];
                            $setarr['username'] = $_SGLOBAL['supe_username'];
                            $setarr['dateline'] = $value['dateline'];
                            //详细
                            $setarr['title_template'] = '{actor} ' . cplang('upload_album');
                            $setarr['body_template'] = '<b>{album}</b><br>' . cplang('the_total_picture', array('{picnum}'));
                            $setarr['body_data'] = array('album' => "<a href=\"space.php?uid={$value['uid']}&do=album&id=-1\">" . cplang('default_albumname') . "</a>", 'picnum' => $picnum);
                        }
                        $setarr['image_' . $key] = pic_get($value['filepath'], $value['thumb'], $value['remote']);
                        $setarr['image_' . $key . '_link'] = "space.php?uid={$value['uid']}&do=album&picid={$value['picid']}";
                        $key++;
                    }
                }
            }
            break;
        case 'picid':
            $plussql = $id > 0 ? "p.picid='{$id}'" : "p.uid='{$_SGLOBAL['supe_uid']}' ORDER BY dateline DESC LIMIT 1";
            $query = $_SGLOBAL['db']->query("SELECT p.*, a.friend, a.target_ids, s.username FROM " . tname('pic') . " p\r\n\t\t\t\tLEFT JOIN " . tname('space') . " s ON s.uid=p.uid\r\n\t\t\t\tLEFT JOIN " . tname('album') . " a ON a.albumid=p.albumid WHERE {$plussql}");
            if ($value = $_SGLOBAL['db']->fetch_array($query)) {
                if (empty($value['friend'])) {
                    //隐私
                    //基本
                    $setarr['icon'] = 'album';
                    $setarr['id'] = $value['picid'];
                    $setarr['idtype'] = $idtype;
                    $setarr['uid'] = $value['uid'];
                    $setarr['username'] = $value['username'];
                    $setarr['dateline'] = $value['dateline'];
                    $setarr['target_ids'] = $value['target_ids'];
                    $setarr['friend'] = $value['friend'];
                    $setarr['hot'] = $value['hot'];
                    //详细
                    $url = "space.php?uid={$value['uid']}&do=album&picid={$value['picid']}";
                    $setarr['image_1'] = pic_get($value['filepath'], $value['thumb'], $value['remote']);
                    $setarr['image_1_link'] = $url;
                    $setarr['title_template'] = '{actor} ' . cplang('upload_a_new_picture');
                    $setarr['body_template'] = '{title}';
                    $setarr['body_data'] = array('title' => $value['title']);
                }
            }
            break;
        case 'tid':
            $query = $_SGLOBAL['db']->query("SELECT t.*, p.* FROM " . tname('thread') . " t\r\n\t\t\t\tLEFT JOIN " . tname('post') . " p ON p.tid=t.tid AND p.isthread='1'\r\n\t\t\t\tWHERE t.tid='{$id}'");
            if ($value = $_SGLOBAL['db']->fetch_array($query)) {
                //基本
                $setarr['icon'] = 'thread';
                $setarr['id'] = $value['tid'];
                $setarr['idtype'] = $idtype;
                $setarr['uid'] = $value['uid'];
                $setarr['username'] = $value['username'];
                $setarr['dateline'] = $value['dateline'];
                $setarr['hot'] = $value['hot'];
                //详细
                $url = "space.php?uid={$value['uid']}&do=thread&id={$value['tid']}";
                if ($value['eventid']) {
                    //活动
                    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname("event") . " WHERE eventid='{$value['eventid']}'");
                    $event = $_SGLOBAL['db']->fetch_array($query);
                    $setarr['title_template'] = cplang('feed_eventthread');
                    $setarr['body_template'] = '<b>{subject}</b><br>' . cplang('event') . ': {event}<br>{summary}';
                    $setarr['body_data'] = array('subject' => "<a href=\"{$url}&eventid={$value['eventid']}\">{$value['subject']}</a>", 'event' => "<a href=\"space.php?do=event&id={$value['eventid']}\">{$event['title']}</a>", 'summary' => getstr($value['message'], 150, 1, 1, 0, 0, -1));
                } else {
                    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname("mtag") . " WHERE tagid='{$value['tagid']}'");
                    $mtag = $_SGLOBAL['db']->fetch_array($query);
                    $setarr['title_template'] = cplang('feed_thread');
                    $setarr['body_template'] = '<b>{subject}</b><br>' . cplang('mtag') . ': {mtag}<br>{summary}';
                    $setarr['body_data'] = array('subject' => "<a href=\"{$url}\">{$value['subject']}</a>", 'mtag' => "<a href=\"space.php?do=mtag&tagid={$value['tagid']}\">{$mtag['tagname']}</a>", 'summary' => getstr($value['message'], 150, 1, 1, 0, 0, -1));
                }
            }
            break;
        case 'pid':
            $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('poll') . " WHERE pid='{$id}'");
            if ($value = $_SGLOBAL['db']->fetch_array($query)) {
                //基本
                $setarr['icon'] = 'poll';
                $setarr['id'] = $value['pid'];
                $setarr['idtype'] = $idtype;
                $setarr['uid'] = $value['uid'];
                $setarr['username'] = $value['username'];
                $setarr['dateline'] = $value['dateline'];
                $setarr['hot'] = $value['hot'];
                //详细
                $url = "space.php?uid={$value['uid']}&do=poll&pid={$value['pid']}";
                $setarr['title_template'] = cplang('feed_poll');
                $setarr['body_template'] = '<a href="{url}">{subject}</a>{option}';
                $optionstr = '';
                $opquery = $_SGLOBAL['db']->query("SELECT * FROM " . tname("polloption") . " WHERE pid='{$value['pid']}' LIMIT 0,2");
                while ($opt = $_SGLOBAL['db']->fetch_array($opquery)) {
                    $optionstr .= '<div><input type="' . ($value['maxchoice'] > 1 ? 'checkbox' : 'radio') . '" disabled name="poll_' . $opt['oid'] . '"/>' . $opt['option'] . '</div>';
                }
                $setarr['body_data'] = array('url' => $url, 'subject' => $value['subject'], 'option' => $optionstr);
                $setarr['body_general'] = $value['percredit'] ? cplang('reward_info', array($value['percredit'])) : '';
            }
            break;
        case 'eventid':
            $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('event') . " WHERE eventid='{$id}'");
            if ($value = $_SGLOBAL['db']->fetch_array($query)) {
                //基本
                $setarr['icon'] = 'event';
                $setarr['id'] = $value['eventid'];
                $setarr['idtype'] = $idtype;
                $setarr['uid'] = $value['uid'];
                $setarr['username'] = $value['username'];
                $setarr['dateline'] = $value['dateline'];
                $setarr['hot'] = $value['hot'];
                //详细
                $url = "space.php?do=event&id={$value['eventid']}";
                $setarr['title_template'] = cplang('event_add');
                $setarr['body_template'] = cplang('event_feed_info');
                $setarr['body_data'] = array('title' => "<a href=\"{$url}\">{$value['title']}</a>", 'province' => $value['province'], 'city' => $value['city'], 'location' => $value['location'], 'starttime' => sgmdate('m-d H:i', $value['starttime']), 'endtime' => sgmdate('m-d H:i', $value['endtime']));
                //封面
                if ($value['poster']) {
                    $setarr['image_1'] = pic_get($value['poster'], $value['thumb'], $value['remote']);
                    $setarr['image_1_link'] = $url;
                }
            }
            break;
        case 'sid':
            $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('share') . " WHERE sid='{$id}'");
            if ($value = $_SGLOBAL['db']->fetch_array($query)) {
                //基本
                $setarr['icon'] = 'share';
                $setarr['id'] = $value['sid'];
                $setarr['idtype'] = $idtype;
                $setarr['uid'] = $value['uid'];
                $setarr['username'] = $value['username'];
                $setarr['dateline'] = $value['dateline'];
                $setarr['hot'] = $value['hot'];
                //详细
                $url = "space.php?uid={$value['uid']}&do=share&id={$value['sid']}";
                $setarr['title_template'] = '{actor} ' . $value['title_template'];
                $setarr['body_template'] = $value['body_template'];
                $setarr['body_data'] = $value['body_data'];
                $setarr['body_general'] = $value['body_general'];
                $setarr['image_1'] = $value['image'];
                $setarr['image_1_link'] = $value['image_link'];
            }
            break;
        case 'videoid':
            $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('video') . " WHERE id='{$id}'");
            if ($value = $_SGLOBAL['db']->fetch_array($query)) {
                //基本
                $setarr['icon'] = 'video';
                $setarr['id'] = $id;
                $setarr['idtype'] = $idtype;
                $setarr['uid'] = $value['uid'];
                $setarr['username'] = $value['username'];
                $setarr['dateline'] = $value['dateline'];
                $setarr['hot'] = $value['hot'];
                $url = $_SC['attachurl'] . $value['filepath'];
                //$url = 'attachment/'.$value['filepath'];
                $setarr['title_template'] = cplang('upload_a_video');
                $setarr['title_data'] = array('title' => "<a href=\"plugin.php?pluginid=video&ac=view&vid={$id}\">" . $value['title'] . "</a>");
                //$setarr['body_template'] = cplang('video_info');
                $setarr['body_data'] = array('video_origin' => 'yes', 'desc' => $value['desc'], 'videourl' => $url);
            }
            break;
        case 'appsid':
            //app的基本信息
            $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('apps') . " WHERE id='{$id}' OR iauth_id='{$id}'");
            if ($value = $_SGLOBAL['db']->fetch_array($query)) {
                $value['uid'] = $_SGLOBAL['supe_uid'];
                $setarr['icon'] = 'apps';
                $setarr['id'] = $value['id'];
                $setarr['idtype'] = $idtype;
                $setarr['uid'] = $value['uid'];
                $setarr['username'] = '******';
                $setarr['dateline'] = time();
                //详细
                $url = "plugin.php?pluginid=apps&ac=detail&appsid={$value['id']}";
                $value['logo'] = $value['logo'] ? $value['logo'] : 'plugin/apps/images/app.gif';
                $setarr['image_1'] = pic_get($value['logo'], '', '');
                $setarr['image_1_link'] = $url;
                $setarr['title_template'] = '{actor} ' . cplang('use_new_app');
                $setarr['title_data'] = array('title' => "<a href=\"plugin.php?pluginid=apps&ac=detail&appsid={$value['id']}\">" . $value['name'] . "</a>");
                $setarr['body_template'] = '{title}';
                $setarr['body_data'] = array('title' => $value['name']);
            }
            break;
    }
    if ($setarr['icon']) {
        $setarr['appid'] = UC_APPID;
        //数据处理
        $setarr['title_data'] = serialize($setarr['title_data']);
        //数组转化
        if ($idtype != 'sid') {
            $setarr['body_data'] = serialize($setarr['body_data']);
            //数组转化
        }
        $setarr['hash_template'] = md5($setarr['title_template'] . "\t" . $setarr['body_template']);
        //喜好hash
        $setarr['hash_data'] = md5($setarr['title_template'] . "\t" . $setarr['title_data'] . "\t" . $setarr['body_template'] . "\t" . $setarr['body_data']);
        //合并hash
        $setarr['fromdevice'] = $fromdevice;
        $setarr = saddslashes($setarr);
        $feedid = 0;
        if (!$add && $setarr['id']) {
            $query = $_SGLOBAL['db']->query("SELECT feedid FROM " . tname('feed') . " WHERE id='{$id}' AND idtype='{$idtype}'");
            $feedid = $_SGLOBAL['db']->result($query, 0);
        }
        if ($feedid) {
            updatetable('feed', $setarr, array('feedid' => $feedid));
        } else {
            inserttable('feed', $setarr);
        }
    }
}
Beispiel #12
0
$where[] = 'uid=' . $brandresult['uid'];
$where[] = 'bid=' . $bid;
$albumcat = C::t('#sanree_brand#sanree_brand_album_category')->fetch_all_by_searchd($where, 'displayorder,dateline DESC');
$bids = array();
foreach ($albumcat as $data) {
    $bids[] = $data[catid];
}
$maxpic = $maxishomepic;
$albumlist = array();
for ($i = 0; $i < $maxpic; $i++) {
    $albumlist[$i]['pic'] = 'source/plugin/sanree_brand/tpl/good/images/nophoto.gif';
    $albumlist[$i]['thumbpic'] = 'source/plugin/sanree_brand/tpl/good/images/nophoto.gif';
    $albumlist[$i]['albumname'] = srlang('no_pic');
}
$aids = "''";
if ($bids) {
    $where = "AND catid in(" . implode($bids, ",") . ") AND ishome=1";
    $albumdata = C::t('#sanree_brand#sanree_brand_album')->fetch_all_by_searchex($where, 'ishome desc,displayorder,albumid desc', 0, $maxpic);
    include_once libfile('function/home');
    $aids = '[';
    $tmparray = array();
    foreach ($albumdata as $key => $album) {
        $album['thumbpic'] = $isalbumthumb == 1 ? sr_albumimage($album['pic'], 165, 165) : pic_cover_get($album['pic'], 1);
        $album['pic'] = pic_cover_get($album['pic'], 1);
        $albumlist[$key] = $album;
        $tmparray[] = "'{$album['albumid']}'";
    }
    $aids .= implode($tmparray, ",");
    $aids .= ']';
}
include templateEx($plugin['identifier'] . ':' . $template . '/album');
Beispiel #13
0
function blog_get_stick($uid, $stickblogs, $summarylen)
{
    $list = array_flip($stickblogs);
    $stickblogs = dimplode($stickblogs);
    if ($stickblogs) {
        $query = DB::query("SELECT bf.*, b.* FROM " . DB::table('home_blog') . " b {$f_index}\r\n\t\t\tLEFT JOIN " . DB::table('home_blogfield') . " bf ON bf.blogid=b.blogid\r\n\t\t\tWHERE b.blogid IN ({$stickblogs})");
        while ($value = DB::fetch($query)) {
            $value['message'] = getstr($value['message'], $summarylen, 0, 0, 0, -1);
            $value['message'] = preg_replace("/&[a-z]+\\;/i", '', $value['message']);
            if ($value['pic']) {
                $value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
            }
            $value['dateline'] = dgmdate($value['dateline']);
            $value['stickflag'] = true;
            $list[$value['blogid']] = $value;
        }
    }
    return $list;
}
Beispiel #14
0
function getblogbyid($blogidarray)
{
    global $_G;
    $bloglist = array();
    if (!empty($blogidarray)) {
        $query = DB::query("SELECT bf.*, b.* FROM " . DB::table('home_blog') . " b LEFT JOIN " . DB::table('home_blogfield') . " bf ON bf.blogid=b.blogid WHERE b.blogid IN (" . dimplode($blogidarray) . ") ORDER BY b.dateline DESC");
        require_once libfile('function/spacecp');
        require_once libfile('function/home');
        $classarr = array();
        while ($result = DB::fetch($query)) {
            $result['dateline'] = dgmdate($result['dateline']);
            $classarr = getclassarr($result['uid']);
            $result['classname'] = $classarr[$result[classid]]['classname'];
            if ($result['friend'] == 4) {
                $result['message'] = $result['pic'] = '';
            } else {
                $result['message'] = getstr($result['message'], $summarylen, 0, 0, 0, -1);
            }
            $result['message'] = preg_replace("/&[a-z]+\\;/i", '', $result['message']);
            if ($result['pic']) {
                $result['pic'] = pic_cover_get($result['pic'], $result['picflag']);
            }
            $bloglist[] = $result;
        }
    }
    return $bloglist;
}
Beispiel #15
0
function getblogbyid($blogidarray)
{
    global $_G;
    $bloglist = array();
    if (!empty($blogidarray)) {
        $data_blog = C::t('home_blog')->fetch_all($blogidarray, 'dateline', 'DESC');
        $data_blogfield = C::t('home_blogfield')->fetch_all($blogidarray);
        require_once libfile('function/spacecp');
        require_once libfile('function/home');
        $classarr = array();
        foreach ($data_blog as $curblogid => $result) {
            $result = array_merge($result, (array) $data_blogfield[$curblogid]);
            $result['dateline'] = dgmdate($result['dateline']);
            $classarr = getclassarr($result['uid']);
            $result['classname'] = $classarr[$result[classid]]['classname'];
            if ($result['friend'] == 4) {
                $result['message'] = $result['pic'] = '';
            } else {
                $result['message'] = getstr($result['message'], $summarylen, 0, 0, 0, -1);
            }
            $result['message'] = preg_replace("/&[a-z]+\\;/i", '', $result['message']);
            if ($result['pic']) {
                $result['pic'] = pic_cover_get($result['pic'], $result['picflag']);
            }
            $bloglist[] = $result;
        }
    }
    return $bloglist;
}
function getblockhtml($blockname, $parameters = array())
{
    global $_G, $space;
    $parameters = empty($parameters) ? array() : $parameters;
    $list = array();
    $sql = $title = $html = $wheresql = $ordersql = $titlemore = $do = $contentclassname = '';
    $view = $from = false;
    $contenttagname = 'div';
    $shownum = 6;
    $uid = intval($space['uid']);
    $shownum = empty($parameters['shownum']) ? $shownum : intval($parameters['shownum']);
    switch ($blockname) {
        case 'personalinfo':
            $do = 'profile';
            space_merge($space, 'profile');
            require_once libfile('function/friend');
            $isfriend = friend_check($space['uid']);
            require_once libfile('function/spacecp');
            loadcache('profilesetting');
            include_once libfile('function/profile');
            $profiles = array();
            $privacy = $space['privacy']['profile'] ? $space['privacy']['profile'] : array();
            foreach ($_G['cache']['profilesetting'] as $fieldid => $field) {
                if (!$field['available'] || in_array($fieldid, array('birthprovince', 'birthdist', 'birthcommunity', 'resideprovince', 'residedist', 'residecommunity'))) {
                    continue;
                }
                if ($field['available'] && $field['invisible'] != '1' && strlen($space[$fieldid]) > 0 && ($field['showinthread'] || $field['showincard'] || ($space['self'] || empty($privacy[$fieldid]) || $isfriend && $privacy[$fieldid] == 1))) {
                    $val = profile_show($fieldid, $space);
                    if ($val !== false) {
                        if ($fieldid == 'realname' && $_G['uid'] != $space['uid'] && !ckrealname(1)) {
                            continue;
                        }
                        if ($field['formtype'] == 'file' && $val) {
                            $imgurl = getglobal('setting/attachurl') . './profile/' . $val;
                            $val = '<span><a href="' . $imgurl . '" target="_blank"><img src="' . $imgurl . '"  style="max-width: 300px;" /></a></span>';
                        }
                        if ($val == '') {
                            $val = '';
                        }
                        $html .= '<li><em>' . $field['title'] . '</em>' . $val . '</li>';
                    }
                }
            }
            $html = $html ? $html : '<li>' . lang('space', 'block_view_profileinfo_noperm') . '</li>';
            $html = '<ul id="pprl" class="mbm pbm bbda cl">' . $html . $more . '</ul>';
            $more = lang('space', 'block_profile_all', array('uid' => $uid));
            $html = $html . $more;
            $titlemore = $space['self'] ? lang('space', 'block_profile_edit') : '';
            break;
        case 'profile':
            $do = $blockname;
            $managehtml = '';
            $avatar = empty($parameters['banavatar']) ? 'middle' : $parameters['banavatar'];
            $html .= "<div class=\"hm\"><p><a href=\"home.php?mod=space&uid={$uid}\" target=\"_blank\">" . avatar($uid, $avatar) . '</a></p>';
            $memberfieldforum = C::t('common_member_field_forum')->fetch($space['uid']);
            $space['medals'] = $memberfieldforum['medals'];
            unset($memberfieldforum);
            $usermedals = $medal_detial = $usermedalmenus = '';
            if ($space['medals']) {
                loadcache('medals');
                foreach ($space['medals'] = explode("\t", $space['medals']) as $key => $medalid) {
                    list($medalid, $medalexpiration) = explode("|", $medalid);
                    if (isset($_G['cache']['medals'][$medalid]) && (!$medalexpiration || $medalexpiration > TIMESTAMP)) {
                        $usermedals .= '<img src="' . STATICURL . 'image/common/' . $_G['cache']['medals'][$medalid]['image'] . '" id="md_' . $medalid . '" alt="' . $_G['cache']['medals'][$medalid]['name'] . '\'" onmouseover="showMenu({\'ctrlid\':this.id, \'menuid\':\'md_' . $medalid . '_menu\', \'pos\':\'12!\'});" />&nbsp;';
                        $usermedalmenus .= '
						<div id="md_' . $medalid . '_menu" class="tip tip_4" style="display: none;">
							<div class="tip_horn"></div>
							<div class="tip_c">
								<h4>' . $_G['cache']['medals'][$medalid]['name'] . '</h4>
								<p>' . $_G['cache']['medals'][$medalid]['description'] . '</p>
							</div>
						</div>';
                    }
                }
                if ($usermedals) {
                    $usermedals = '<p class="md_ctrl"><a href="home.php?mod=medal">' . $usermedals . '</a></p>' . $usermedalmenus;
                }
            }
            $html .= "<h2 class=\"mbn\"><a href=\"home.php?mod=space&uid={$uid}\" target=\"_blank\">" . $space['username'] . "</a></h2>{$usermedals}";
            $html .= '</div><ul class="xl xl2 cl ul_list">';
            $magicinfo = $showmagicgift = false;
            if ($_G['setting']['magicstatus'] && $_G['setting']['magics']['gift']) {
                $showmagicgift = true;
                $magicinfo = !empty($space['magicgift']) ? dunserialize($space['magicgift']) : array();
            }
            if (helper_access::check_module('follow')) {
                $html .= '<li class="ul_broadcast"><a href="home.php?mod=space&uid=' . $uid . '">' . lang('space', 'block_profile_follow') . '</a></li>';
            }
            if ($space['self']) {
                $html .= '<li class="ul_diy"><a href="home.php?mod=space&do=index&diy=yes">' . lang('space', 'block_profile_diy') . '</a></li>';
                $html .= '<li class="ul_msg"><a href="home.php?mod=space&uid=' . $uid . '&do=wall">' . lang('space', 'block_profile_wall') . '</a></li>';
                $html .= '<li class="ul_avt"><a href="home.php?mod=spacecp&ac=avatar">' . lang('space', 'block_profile_avatar') . '</a></li>';
                $html .= '<li class="ul_profile"><a href="home.php?mod=spacecp&ac=profile">' . lang('space', 'block_profile_update') . '</a></li>';
                if ($showmagicgift) {
                    $html .= '<li class="ul_magicgift"><div style="' . 'background: url(' . STATICURL . 'image/magic/gift.small.gif) no-repeat 0 50%;' . '">';
                    if ($magicinfo) {
                        $html .= '<a onclick="showWindow(\'magicgift\', this.href, \'get\', 0)" href="home.php?mod=spacecp&ac=magic&op=retiregift">' . lang('magic/gift', 'gift_gc') . '</a>';
                    } else {
                        $html .= '<a onclick="showWindow(\'magicgift\', this.href, \'get\', 0)" href="home.php?mod=magic&mid=gift">' . lang('magic/gift', 'gift_use') . '</a>';
                    }
                    $html .= '</div></li>';
                }
            } else {
                require_once libfile('function/friend');
                $isfriend = friend_check($uid);
                $follow = C::t('home_follow')->fetch_by_uid_followuid($_G['uid'], $uid);
                if ($follow) {
                    $html .= "<li class='ul_flw'><a href=\"home.php?mod=spacecp&ac=follow&op=del&fuid={$space['uid']}\" id=\"followmod\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'follow_cancle_follow') . "</a></li>";
                } else {
                    $html .= "<li class='ul_flw'><a href=\"home.php?mod=spacecp&ac=follow&op=add&hash=" . FORMHASH . "&fuid={$space['uid']}\" id=\"followmod\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'follow_follow_ta') . "</a></li>";
                }
                if (!$isfriend) {
                    $html .= "<li class='ul_add'><a href=\"home.php?mod=spacecp&ac=friend&op=add&uid={$space['uid']}&handlekey=addfriendhk_{$space[uid]}\" id=\"a_friend_li_{$space[uid]}\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'block_profile_friend_add') . "</a></li>";
                } else {
                    $html .= "<li class='ul_ignore'><a href=\"home.php?mod=spacecp&ac=friend&op=ignore&uid={$space['uid']}&handlekey=ignorefriendhk_{$space[uid]}\" id=\"a_ignore_{$space[uid]}\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'block_profile_friend_ignore') . "</a></li>";
                }
                $html .= "<li class='ul_msg'><a href=\"home.php?mod=space&uid={$space['uid']}&do=wall\">" . lang('space', 'block_profile_wall_to_me') . "</a></li>";
                $html .= "<li class='ul_poke'><a href=\"home.php?mod=spacecp&ac=poke&op=send&uid={$space['uid']}&handlekey=propokehk_{$space[uid]}\" id=\"a_poke_{$space[uid]}\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'block_profile_poke') . "</a></li>";
                $html .= "<li class='ul_pm'><a href=\"home.php?mod=spacecp&ac=pm&op=showmsg&handlekey=showmsg_{$space['uid']}&touid={$space['uid']}&pmid=0&daterange=2\" id=\"a_sendpm_{$space['uid']}\" onclick=\"showWindow('showMsgBox', this.href, 'get', 0)\">" . lang('space', 'block_profile_sendmessage') . "</a></li>";
            }
            $html .= '</ul>';
            $encodeusername = rawurlencode($space['username']);
            if (checkperm('allowbanuser')) {
                $managehtml .= '<li><a href="' . ($_G['adminid'] == 1 ? "admin.php?action=members&operation=ban&username={$encodeusername}&frames=yes" : "forum.php?mod=modcp&action=member&op=ban&uid={$space['uid']}") . '" id="usermanageli" onmouseover="showMenu(this.id)" class="showmenu" target="_blank">' . lang('home/template', 'member_manage') . '</a></li>';
            } elseif (checkperm('allowedituser')) {
                $managehtml .= '<li><a href="' . ($_G['adminid'] == 1 ? "admin.php?action=members&operation=search&username={$encodeusername}&submit=yes&frames=yes" : "forum.php?mod=modcp&action=member&op=edit&uid={$space['uid']}") . '" id="usermanageli" onmouseover="showMenu(this.id)" class="showmenu" target="_blank">' . lang('home/template', 'member_manage') . '</a></li>';
            }
            if ($_G['adminid'] == 1) {
                $managehtml .= "<li><a href=\"forum.php?mod=modcp&action=thread&op=post&do=search&searchsubmit=1&users={$encodeusername}\" id=\"umanageli\" onmouseover=\"showMenu(this.id)\" class=\"showmenu\">" . lang('home/template', 'content_manage') . "</a></li>";
            }
            if (!empty($managehtml)) {
                $html .= '<hr class="da mtn m0" /><ul class="ptn xl xl2 cl">' . $managehtml . '</ul><ul id="usermanageli_menu" class="p_pop" style="width: 80px; display:none;">';
                if (checkperm('allowbanuser')) {
                    $html .= '<li><a href="' . ($_G['adminid'] == 1 ? "admin.php?action=members&operation=ban&username={$encodeusername}&frames=yes" : "forum.php?mod=modcp&action=member&op=ban&uid={$space['uid']}") . '" target="_blank">' . lang('home/template', 'user_ban') . '</a></li>';
                }
                if (checkperm('allowedituser')) {
                    $html .= '<li><a href="' . ($_G['adminid'] == 1 ? "admin.php?action=members&operation=search&username={$encodeusername}&submit=yes&frames=yes" : "forum.php?mod=modcp&action=member&op=edit&uid={$space['uid']}") . '" target="_blank">' . lang('home/template', 'user_edit') . '</a></li>';
                }
                $html .= '</ul>';
                if ($_G['adminid'] == 1) {
                    $html .= '<ul id="umanageli_menu" class="p_pop" style="width: 80px; display:none;">';
                    $html .= '<li><a href="forum.php?mod=modcp&action=thread&op=post&searchsubmit=1&do=search&users=' . $encodeusername . '" target="_blank">' . lang('space', 'manage_post') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=doing&searchsubmit=1&detail=1&search=true&fromumanage=1&users=' . $encodeusername . '" target="_blank">' . lang('space', 'manage_doing') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=blog&searchsubmit=1&detail=1&search=true&fromumanage=1&uid=' . $uid . '" target="_blank">' . lang('space', 'manage_blog') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=feed&searchsubmit=1&detail=1&fromumanage=1&uid=' . $uid . '" target="_blank">' . lang('space', 'manage_feed') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=album&searchsubmit=1&detail=1&search=true&fromumanage=1&uid=' . $uid . '" target="_blank">' . lang('space', 'manage_album') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=pic&searchsubmit=1&detail=1&search=true&fromumanage=1&users=' . $encodeusername . '" target="_blank">' . lang('space', 'manage_pic') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=comment&searchsubmit=1&detail=1&fromumanage=1&authorid=' . $uid . '" target="_blank">' . lang('space', 'manage_comment') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=share&searchsubmit=1&detail=1&search=true&fromumanage=1&uid=' . $uid . '" target="_blank">' . lang('space', 'manage_share') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=threads&operation=group&searchsubmit=1&detail=1&search=true&fromumanage=1&users=' . $encodeusername . '" target="_blank">' . lang('space', 'manage_group_threads') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=prune&operation=group&searchsubmit=1&detail=1&fromumanage=1&users=' . $encodeusername . '" target="_blank">' . lang('space', 'manage_group_prune') . '</a></li>';
                    $html .= '</ul>';
                }
            }
            if ($_G['setting']['magicstatus'] && $_G['setting']['magics']['gift']) {
                $info = !empty($space['magicgift']) ? dunserialize($space['magicgift']) : array();
                if ($space['self']) {
                } elseif ($info) {
                    if ($info['left'] && !in_array($_G['uid'], (array) $info['receiver'])) {
                        $percredit = min($info['percredit'], $info['left']);
                        if ($info['credittype'] == 'credits') {
                            $credittype = lang('core', 'title_credit');
                        } else {
                            $extcredits = str_replace('extcredits', '', $info['credittype']);
                            $credittype = $_G['setting']['extcredits'][$extcredits]['title'];
                        }
                        $html .= '<div id="magicreceivegift">';
                        $html .= '<a onclick="showWindow(\'magicgift\', this.href, \'get\', 0)" href="home.php?mod=spacecp&ac=magic&op=receivegift&uid=' . $uid . '" title="' . lang('magic/gift', 'gift_receive_gift', array('percredit' => $percredit, 'credittype' => $credittype)) . '">';
                        $html .= '<img src="' . STATICURL . 'image/magic/gift.gif" alt="gift" />';
                        $html .= '</a>';
                        $html .= '</div>';
                    }
                }
            }
            $html = '<div>' . $html . '</div>';
            break;
        case 'statistic':
            space_merge($space, 'count');
            $html .= '<p class="mbm xw1">';
            if (empty($parameters['banviews'])) {
                $html .= lang('space', 'space_views', array('views' => $space['views'] ? $space['views'] : '--'));
            }
            $html .= '</p><ul class="xl xl2 cl">';
            if (empty($parameters['bancredits'])) {
                $html .= "<li>" . lang('space', 'credits') . ': <a href="home.php?mod=spacecp&ac=credit">' . ($space['credits'] ? $space['credits'] : '--') . "</a></li>";
                foreach ($_G['setting']['extcredits'] as $extcreditid => $extcredit) {
                    $html .= "<li>" . ($extcredit['img'] ? $extcredit['img'] . ' ' : '') . $extcredit['title'] . ': <a href="home.php?mod=spacecp&ac=credit">' . ($space['extcredits' . $extcreditid] ? $space['extcredits' . $extcreditid] : '--') . '</a>';
                }
            }
            if (empty($parameters['banfriends'])) {
                $html .= "<li>" . lang('space', 'friends') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=friend&view=me&from=space">' . ($space['friends'] ? $space['friends'] : '--') . "</a></li>";
            }
            if (empty($parameters['banthreads']) && $_G['setting']['allowviewuserthread'] !== -1 || $_G['adminid'] == 1) {
                $html .= "<li>" . lang('space', 'threads') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=thread&view=me&from=space">' . ($space['threads'] ? $space['threads'] : '--') . "</a></li>";
            }
            if (empty($parameters['banblogs'])) {
                $html .= "<li>" . lang('space', 'blogs') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=blog&view=me&from=space">' . ($space['blogs'] ? $space['blogs'] : '--') . "</a></li>";
            }
            if (empty($parameters['banalbums'])) {
                $html .= "<li>" . lang('space', 'albums') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=album&view=me&from=space">' . ($space['albums'] ? $space['albums'] : '--') . "</a></li>";
            }
            if (empty($parameters['bansharings'])) {
                $html .= "<li>" . lang('space', 'sharings') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=share&view=me&from=space">' . ($space['sharings'] ? $space['sharings'] : '--') . "</a></li>";
            }
            $html .= '</ul>';
            $html = '<div>' . $html . '</div>';
            break;
        case 'doing':
            $do = $blockname;
            $view = 'me';
            $from = 'space';
            if (ckprivacy('doing', 'view')) {
                $dolist = array();
                $query = C::t('home_doing')->fetch_all_by_uid_doid(array($uid), '', 'dateline', 0, $shownum, false, true);
                foreach ($query as $value) {
                    if ($value['status'] == 0 || $value['uid'] == $_G['uid']) {
                        $dolist[] = $value;
                    }
                }
                if ($dolist) {
                    foreach ($dolist as $dv) {
                        $doid = $dv['doid'];
                        $_GET[key] = $key = random(8);
                        $html .= "<li class=\"pbn bbda\">";
                        $html .= $dv['message'];
                        $html .= "&nbsp;<a href=\"home.php?mod=space&uid={$dv['uid']}&do=doing&view=me&from=space&doid={$dv['doid']}\" target=\"_blank\" class=\"xg1\">" . lang('space', 'block_doing_reply') . "</a>";
                        $html .= "</li>";
                    }
                } else {
                    $html .= "<p class=\"emp\">" . lang('space', 'block_doing_no_content') . ($space['self'] ? lang('space', 'block_doing_no_content_publish', $space) : '') . "</p>";
                }
            } else {
                $html .= "<p class=\"emp\">" . lang('space', 'block_view_noperm') . "</p>";
            }
            $html = '<ul class="xl">' . $html . '</ul>';
            break;
        case 'stickblog':
            space_merge($space, 'profile');
            $stickblogs = explode(',', $space['stickblogs']);
            if (!empty($stickblogs)) {
                $bids = array_slice($stickblogs, 0, $shownum);
                if (count($bids)) {
                    if (!isset($parameters['showmessage'])) {
                        $parameters['showmessage'] = 150;
                    }
                    $data_blog = C::t('home_blog')->fetch_all($bids);
                    if ($parameters['showmessage'] > 0) {
                        $data_blogfield = C::t('home_blogfield')->fetch_all($bids);
                    }
                    foreach ($data_blog as $curblogid => $value) {
                        if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
                            if ($parameters['showmessage'] > 0) {
                                $value = array_merge($value, (array) $data_blogfield[$curblogid]);
                            }
                            if ($value['pic']) {
                                $value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
                            }
                            $value['message'] = $value['friend'] == 4 ? '' : getstr($value['message'], $parameters['showmessage'], 0, 0, 0, -1);
                            $html .= lang('space', 'blog_li', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'subject' => $value['subject'], 'date' => dgmdate($value['dateline'], 'Y-m-d')));
                            if (!empty($parameters['showmessage'])) {
                                if ($value['pic']) {
                                    $html .= lang('space', 'blog_li_img', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'src' => $value['pic']));
                                }
                                $html .= "<dd>{$value['message']}</dd>";
                            }
                            $html .= lang('space', 'blog_li_ext', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'viewnum' => $value['viewnum'], 'replynum' => $value['replynum']));
                            $html .= "</dl>";
                        } else {
                            $html .= '<p>' . lang('space', 'block_view_noperm') . '</p>';
                        }
                    }
                }
            }
            $more = $html ? '<p class="ptm" style="text-align: right;"><a href="home.php?mod=space&uid=' . $uid . '&do=blog&view=me&from=space">' . lang('space', 'viewmore') . '</a></p>' : '';
            $contentclassname = ' xld';
            $html = $html . $more;
            break;
        case 'blog':
            $do = $blockname;
            $view = 'me';
            $from = 'space';
            if (!isset($parameters['showmessage'])) {
                $parameters['showmessage'] = 150;
            }
            $data_blog = C::t('home_blog')->fetch_all_by_uid($uid, 'dateline', 0, $shownum);
            $blogids = array_keys($data_blog);
            $data_blogfield = C::t('home_blogfield')->fetch_all($blogids);
            foreach ($data_blog as $curblogid => $value) {
                if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
                    $value = array_merge($value, (array) $data_blogfield[$curblogid]);
                    if ($value['pic']) {
                        $value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
                    }
                    $value['message'] = $value['friend'] == 4 ? '' : getstr($value['message'], $parameters['showmessage'], 0, 0, 0, -1);
                    $html .= lang('space', 'blog_li', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'subject' => $value['subject'], 'date' => dgmdate($value['dateline'], 'Y-m-d')));
                    if (!empty($parameters['showmessage'])) {
                        if ($value['pic']) {
                            $html .= lang('space', 'blog_li_img', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'src' => $value['pic']));
                        }
                        $html .= "<dd>{$value['message']}</dd>";
                    }
                    $html .= lang('space', 'blog_li_ext', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'viewnum' => $value['viewnum'], 'replynum' => $value['replynum']));
                    $html .= "</dl>";
                } else {
                    $html .= '<p>' . lang('space', 'block_view_noperm') . '</p>';
                }
            }
            if ($html) {
                $more = '<p class="ptm" style="text-align: right;"><a href="home.php?mod=space&uid=' . $uid . '&do=blog&view=me&from=space">' . lang('space', 'viewmore') . '</a></p>';
            } else {
                $html = '<p class="emp">' . lang('space', 'block_blog_no_content') . ($space['self'] ? lang('space', 'block_blog_no_content_publish', $space) : '') . '</p>';
                $more = '';
            }
            $contentclassname = ' xld';
            $html = $html . $more;
            break;
        case 'album':
            $do = $blockname;
            $view = 'me';
            $from = 'space';
            if (ckprivacy('album', 'view')) {
                $query = C::t('home_album')->fetch_all_by_uid($uid, 'updatetime', 0, $shownum);
                foreach ($query as $value) {
                    if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
                        $value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
                        $html .= lang('space', 'album_li', array('albumid' => $value['albumid'], 'src' => $value['pic'], 'albumname' => $value['albumname'], 'uid' => $value['uid'], 'picnum' => $value['picnum'], 'date' => dgmdate($value['updatetime'], 'n-j')));
                    }
                }
                if (!$html) {
                    $html = '<p class="emp">' . lang('space', 'block_album_no_content') . ($space['self'] ? lang('space', 'block_album_no_content_publish', $space) : '') . '</p>';
                }
            } else {
                $html .= '<li>' . lang('space', 'block_view_noperm') . '</li>';
            }
            $html = '<ul class="ml cl">' . $html . '</ul>';
            break;
        case 'feed':
            $do = 'home';
            $view = 'me';
            $from = 'space';
            if (!IS_ROBOT && ckprivacy('feed', 'view')) {
                require_once libfile('function/feed');
                $query = C::t('home_feed')->fetch_all_by_uid_dateline($uid, false, 0, $shownum);
                foreach ($query as $value) {
                    if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
                        $html .= mkfeedhtml(mkfeed($value));
                    }
                }
            }
            $contenttagname = 'ul';
            $contentclassname = ' el';
            $html = !$html ? '<p class="emp">' . lang('space', 'block_feed_no_content') . '</p>' : $html;
            break;
        case 'thread':
            $do = $blockname;
            $view = 'me';
            $from = 'space';
            if ($_G['setting']['allowviewuserthread'] !== -1) {
                $fidsql = empty($_G['setting']['allowviewuserthread']) ? '' : " AND fid IN({$_G[setting][allowviewuserthread]}) ";
                $viewfids = str_replace("'", '', $_G['setting']['allowviewuserthread']);
                if (!empty($viewfids)) {
                    $viewfids = explode(',', $viewfids);
                }
                foreach (C::t('forum_thread')->fetch_all_by_authorid_displayorder($uid, 0, '>=', null, '', 0, $shownum) as $thread) {
                    if (!empty($viewfids) && $_G['adminid'] != 1 && !in_array($thread['fid'], $viewfids)) {
                        continue;
                    }
                    if ($thread['author']) {
                        $html .= "<li><a href=\"forum.php?mod=viewthread&tid={$thread['tid']}\" target=\"_blank\">{$thread['subject']}</a></li>";
                    }
                }
            }
            $html = !$html ? '<p class="emp">' . lang('space', 'block_thread_no_content') . ($space['self'] ? lang('space', 'block_thread_no_content_publish', $space) : '') . '</p>' : '<ul class="xl">' . $html . '</ul>';
            break;
        case 'friend':
            $do = $blockname;
            $view = 'me';
            $from = 'space';
            require_once libfile('function/friend');
            $friendlist = array();
            $friendlist = friend_list($uid, $shownum);
            $fuids = array_keys($friendlist);
            getonlinemember($fuids);
            foreach ($friendlist as $key => $value) {
                $classname = $_G['ols'][$value['fuid']] ? 'gol' : '';
                $html .= '<li><a href="home.php?mod=space&uid=' . $value['fuid'] . '" target="_blank" class="avt"><em class="' . $classname . '"></em>' . avatar($value['fuid'], 'small') . '</a><p><a href="home.php?mod=space&uid=' . $value[fuid] . '" target="_blank">' . $value['fusername'] . '</a></p></li>';
            }
            $html = !$html ? '<p class="emp">' . lang('space', 'block_friend_no_content') . ($space['self'] ? lang('space', 'block_friend_no_content_publish', $space) : '') . '</p>' : '<ul class="ml mls cl">' . $html . '</ul>';
            break;
        case 'visitor':
            if ($space['self']) {
                $do = 'friend';
                $view = 'visitor';
            }
            $list = $fuids = array();
            foreach (C::t('home_visitor')->fetch_all_by_uid($uid, $shownum) as $value) {
                $list[] = $value;
                $fuids[] = $value['vuid'];
            }
            getonlinemember($fuids);
            foreach ($list as $value) {
                $html .= "<li>";
                if ($value['vusername'] == '') {
                    $html .= lang('space', 'visitor_anonymity');
                } else {
                    $html .= lang('space', 'visitor_list', array('uid' => $value['vuid'], 'username' => $value['vusername'], 'class' => $_G['ols'][$value['vuid']] ? 'gol' : '', 'avatar' => avatar($value['vuid'], 'small')));
                }
                $html .= "<span class=\"xg2\">" . dgmdate($value['dateline'], 'u', '9999', 'Y-m-d') . "</span>";
                $html .= "</li>";
            }
            $html = !$html ? '<p class="emp">' . lang('space', 'block_visitor_no_content') . ($space['self'] ? lang('space', 'block_visitor_no_content_publish', $space) : '') . '</p>' : '<ul class="ml mls cl">' . $html . '</ul>';
            break;
        case 'share':
            $do = $blockname;
            $view = 'me';
            $from = 'space';
            if (!IS_ROBOT && ckprivacy('share', 'view')) {
                require_once libfile('function/share');
                foreach (C::t('home_share')->fetch_all_by_uid($uid, 0, $shownum) as $value) {
                    $value = mkshare($value);
                    $html .= '<li><em><a href="home.php?mod=space&uid=' . $value['uid'] . '&do=share&id=' . $value['sid'] . '">' . $value['title_template'] . '</a>(' . dgmdate($value['dateline'], 'u') . ')</em><div class="ec cl">';
                    if ($value['image']) {
                        $html .= '<a href="' . $value['image_link'] . '" target="_blank"><img src="' . $value['image'] . '" class="tn" alt="" /></a>';
                    }
                    $html .= '<div class="d">' . $value['body_template'] . '</div>';
                    if ($value['type'] == 'video') {
                        if (!empty($value['body_data']['imgurl'])) {
                            $html .= '<table class="mtm" title="' . lang('space', 'click_play') . '" onclick="javascript:showFlash(\'' . $value['body_data']['host'] . '\', \'' . $value['body_data']['flashvar'] . '\', this, \'' . $value['sid'] . '\');"><tr><td class="vdtn hm" style="background: url(' . $value['body_data']['imgurl'] . ') no-repeat"><img src="' . STATICURL . '/image/common/vds.png" alt="' . lang('space', 'click_play') . '" /></td></tr></table>';
                        } else {
                            $html .= "<img src=\"" . STATICURL . "/image/common/vd.gif\" alt=\"" . lang('space', 'click_play') . "\" onclick=\"javascript:showFlash('{$value['body_data']['host']}', '{$value['body_data']['flashvar']}', this, '{$value['sid']}');\" class=\"tn\" />";
                        }
                    } elseif ($value['type'] == 'music') {
                        $html .= "<img src=\"" . STATICURL . "/image/common/music.gif\" alt=\"" . lang('space', 'click_play') . "\" onclick=\"javascript:showFlash('music', '{$value['body_data']['musicvar']}', this, '{$value['sid']}');\" class=\"tn\" />";
                    } elseif ($value['type'] == 'flash') {
                        $html .= "<img src=\"" . STATICURL . "/image/common/flash.gif\" alt=\"" . lang('space', 'click_view') . "\" onclick=\"javascript:showFlash('flash', '{$value['body_data']['flashaddr']}', this, '{$value['sid']}');\" class=\"tn\" />";
                    }
                    if ($value['body_general']) {
                        $html .= '<div class="quote' . ($value['image'] ? 'z' : '') . "\"><blockquote>{$value['body_general']}</blockquote></div>";
                    }
                    $html .= '</div></li>';
                }
                $html = !$html ? '<p class="emp">' . lang('space', 'block_share_no_content') . '</p>' : '<ul class="el">' . $html . '</ul>';
            }
            break;
        case 'wall':
            $do = $blockname;
            $walllist = array();
            if (ckprivacy('wall', 'view')) {
                $query = C::t('home_comment')->fetch_all_by_id_idtype($uid, 'uid', 0, $shownum, '', 'DESC');
                foreach ($query as $value) {
                    $value['message'] = strlen($value['message']) > 500 ? getstr($value['message'], 500, 0, 0, 0, -1) . ' ...' : $value['message'];
                    if ($value['status'] == 0 || $value['authorid'] == $_G['uid']) {
                        $walllist[] = $value;
                    }
                }
            }
            foreach ($walllist as $key => $value) {
                $op = '';
                if ($value['author']) {
                    $author_avatar = '<a href="home.php?mod=space&uid=' . $value['authorid'] . '" target="_blank">' . avatar($value['authorid'], 'small') . '</a>';
                    $author = '<a href="home.php?mod=space&uid=' . $value['authorid'] . '" id="author_' . $value['cid'] . '" target="_blank">' . $value['author'] . '</a>';
                } else {
                    $author_avatar = '<img src="static/image/magic/hidden.gif" alt="hidden" />';
                    $author = $_G['setting']['anonymoustext'];
                }
                if ($value['authorid'] == $_G['uid']) {
                    $op .= lang('space', 'wall_edit', array('cid' => $value['cid']));
                }
                if ($value['authorid'] == $_G['uid'] || $space['self'] || checkperm('managecomment')) {
                    $op .= lang('space', 'wall_del', array('cid' => $value['cid']));
                }
                if ($value['authorid'] != $_G['uid'] && ($value['idtype'] != 'uid' || $space['self'])) {
                    $op .= lang('space', 'wall_reply', array('cid' => $value['cid']));
                }
                $moderate_need = $value['status'] == 1 ? lang('template', 'moderate_need') : '';
                $date = dgmdate($value['dateline'], 'u');
                $replacearr = array('author' => $author, 'author_avatar' => $author_avatar, 'moderated' => $moderate_need, 'cid' => $value['cid'], 'message' => $value['message'], 'date' => $date, 'op' => $op);
                $html .= lang('space', 'wall_li', $replacearr);
            }
            $html = !empty($walllist) ? $html . lang('space', 'wall_more', array('uid' => $uid)) : '<p class="emp">' . lang('space', 'block_wall_no_content') . '</p>';
            $html = '<div class="xld xlda el" id="comment_ul">' . $html . '</div>';
            if (helper_access::check_module('wall')) {
                $html = lang('space', 'wall_form', array('uid' => $uid, 'FORMHASH' => FORMHASH)) . '<hr class="da mtm m0">' . $html;
            }
            $titlemore = '<span class="y xw0"><a href="home.php?mod=space&uid=' . $uid . '&do=wall">' . lang('space', 'all') . '</a></span>';
            break;
        case 'group':
            require_once libfile('function/group');
            $grouplist = mygrouplist($uid, 'lastupdate', array('f.name', 'ff.icon'), $shownum);
            if (empty($grouplist)) {
                $grouplist = array();
            }
            foreach ($grouplist as $groupid => $group) {
                $group['groupid'] = $groupid;
                $html .= lang('space', 'group_li', $group);
            }
            $html = !$html ? '<p class="emp">' . lang('space', 'block_group_no_content') . ($space['self'] ? lang('space', $_G['group']['allowbuildgroup'] ? 'block_group_no_content_publish' : 'block_group_no_content_join', $space) : '') . '</p>' : '<ul class="ml mls cl">' . $html . '</ul>';
            break;
        case 'music':
            if (!empty($parameters['mp3list'])) {
                $authcode = substr(md5($_G['authkey'] . $uid), 6, 16);
                $view = $_G['adminid'] == 1 && $_G['setting']['allowquickviewprofile'] ? '&view=admin' : '';
                $querystring = urlencode("home.php?mod=space&uid={$uid}&do=index&op=getmusiclist&hash={$authcode}{$view}&t=" . TIMESTAMP);
                $swfurl = STATICURL . 'image/common/mp3player.swf?config=' . $querystring;
                if (empty($parameters['config']['height']) && $parameters['config']['height'] !== 0) {
                    $parameters['config']['height'] = '200px';
                } else {
                    $parameters['config']['height'] .= 'px';
                }
                $html = "<script language=\"javascript\" type=\"text/javascript\">document.write(AC_FL_RunContent('id', 'mp3player', 'name', 'mp3player', 'devicefont', 'false', 'width', '100%', 'height', '" . $parameters['config']['height'] . "', 'src', '{$swfurl}', 'menu', 'false',  'allowScriptAccess', 'sameDomain', 'swLiveConnect', 'true', 'wmode', 'transparent'));</script>";
            } else {
                $html = lang('space', 'music_no_content');
            }
            $html = '<div class="ml mls cl">' . $html . '</div>';
            break;
        case 'myapp':
            $html = '';
            $listclass = 'ptm ml mls cl';
            $userapps = C::t('home_userapp')->fetch_all_by_uid_appid($uid, 0, 'menuorder', 'DESC', 0, $shownum);
            $appids = array();
            foreach ($userapps as $app) {
                $appids[$app['appid']] = $app['appid'];
            }
            if (!empty($appids)) {
                $myapps = C::t('common_myapp')->fetch_all($appids);
            }
            foreach ($userapps as $value) {
                $value['iconstatus'] = $myapps[$value['appid']]['iconstatus'];
                if (!empty($value['appname'])) {
                    $replace = array('appid' => $value['appid'], 'appname' => $value['appname']);
                    $parameters['logotype'] = !empty($parameters['logotype']) && in_array($parameters['logotype'], array('icon', 'logo')) ? $parameters['logotype'] : 'logo';
                    if ($parameters['logotype'] == 'icon') {
                        $listclass = 'xl xl1 cl';
                        $replace['icon'] = getmyappiconpath($value['appid'], $value['iconstatus']);
                    }
                    $html .= lang('space', 'myapp_li_' . $parameters['logotype'], $replace);
                }
            }
            $html = !$html ? '<p class="emp">' . lang('space', 'block_myapp_no_content') . ($space['self'] ? lang('space', 'block_myapp_no_content_publish', $space) : '') . '</p>' : '<ul class="' . $listclass . '">' . $html . '</ul>';
            break;
        case 'block1':
        case 'block2':
        case 'block3':
        case 'block4':
        case 'block5':
            if ($space['self']) {
                $_G['space_group'] = $_G['group'];
            } elseif (empty($_G['space_group'])) {
                $_G['space_group'] = C::t('common_usergroup_field')->fetch($space['groupid']);
            }
            require_once libfile('function/discuzcode');
            if ($_G['space_group']['allowspacediyimgcode']) {
                if (empty($_G['cache']['smilies']['loaded'])) {
                    loadcache(array('smilies', 'smileytypes'));
                    foreach ($_G['cache']['smilies']['replacearray'] as $skey => $smiley) {
                        $_G['cache']['smilies']['replacearray'][$skey] = '[img]' . $_G['siteurl'] . 'static/image/smiley/' . $_G['cache']['smileytypes'][$_G['cache']['smilies']['typearray'][$skey]]['directory'] . '/' . $smiley . '[/img]';
                    }
                    $_G['cache']['smilies']['loaded'] = 1;
                }
                $parameters['content'] = preg_replace($_G['cache']['smilies']['searcharray'], $_G['cache']['smilies']['replacearray'], trim($parameters['content']));
            }
            if ($_G['space_group']['allowspacediybbcode'] || $_G['space_group']['allowspacediyimgcode'] || $_G['space_group']['allowspacediyhtml']) {
                $parameters['content'] = discuzcode($parameters['content'], 1, 0, 1, 0, $_G['space_group']['allowspacediybbcode'], $_G['space_group']['allowspacediyimgcode'], $_G['space_group']['allowspacediyhtml']);
            } else {
                $parameters['content'] = dhtmlspecialchars($parameters['content']);
            }
            $parameters['content'] = nl2br($parameters['content']);
            if (empty($parameters['content'])) {
                $parameters['content'] = lang('space', $blockname);
            }
            $html .= $parameters['content'];
            break;
        default:
            return false;
    }
    if (isset($parameters['title'])) {
        if (empty($parameters['title'])) {
            $title = '';
        } else {
            $view = $view === false ? '' : '&view=' . $view;
            $from = $from === false ? '' : '&from=' . $from;
            $bnamelink = $do ? '<a href="home.php?mod=space&uid=' . $uid . '&do=' . $do . $view . $from . '">' . $parameters['title'] . '</a>' : $parameters['title'];
            $title = lang('space', 'block_title', array('bname' => $bnamelink, 'more' => $titlemore));
        }
    } else {
        $view = $view === false ? '' : '&view=' . $view;
        $from = $from === false ? '' : '&from=' . $from;
        $bnamelink = $do ? '<a href="home.php?mod=space&uid=' . $uid . '&do=' . $do . $view . $from . '">' . getblockdata($blockname) . '</a>' : getblockdata($blockname);
        $title = lang('space', 'block_title', array('bname' => $bnamelink, 'more' => $titlemore));
    }
    $html = $title . '<' . $contenttagname . ' id="' . $blockname . '_content" class="dxb_bc' . $contentclassname . '">' . $html . '</' . $contenttagname . '>';
    return $html;
}
function feed_publish($id, $idtype, $add = 0)
{
    global $_G;
    $setarr = array();
    switch ($idtype) {
        case 'blogid':
            $query = DB::query("SELECT b.*, bf.* FROM " . DB::table('home_blog') . " b\r\n\t\t\t\tLEFT JOIN " . DB::table('home_blogfield') . " bf ON bf.blogid=b.blogid\r\n\t\t\t\tWHERE b.blogid='{$id}'");
            if ($value = DB::fetch($query)) {
                if ($value['friend'] != 3) {
                    $setarr['icon'] = 'blog';
                    $setarr['id'] = $value['blogid'];
                    $setarr['idtype'] = $idtype;
                    $setarr['uid'] = $value['uid'];
                    $setarr['username'] = $value['username'];
                    $setarr['dateline'] = $value['dateline'];
                    $setarr['target_ids'] = $value['target_ids'];
                    $setarr['friend'] = $value['friend'];
                    $setarr['hot'] = $value['hot'];
                    $status = $value['status'];
                    $url = "home.php?mod=space&uid={$value['uid']}&do=blog&id={$value['blogid']}";
                    if ($value['friend'] == 4) {
                        $setarr['title_template'] = 'feed_blog_password';
                        $setarr['title_data'] = array('subject' => "<a href=\"{$url}\">{$value['subject']}</a>");
                    } else {
                        if ($value['pic']) {
                            $setarr['image_1'] = pic_cover_get($value['pic'], $value['picflag']);
                            $setarr['image_1_link'] = $url;
                        }
                        $setarr['title_template'] = 'feed_blog_title';
                        $setarr['body_template'] = 'feed_blog_body';
                        $value['message'] = preg_replace("/&[a-z]+\\;/i", '', $value['message']);
                        $setarr['body_data'] = array('subject' => "<a href=\"{$url}\">{$value['subject']}</a>", 'summary' => getstr($value['message'], 150, 1, 1, 0, -1));
                    }
                }
            }
            break;
        case 'albumid':
            $key = 1;
            if ($id > 0) {
                $query = DB::query("SELECT a.username, a.albumname, a.picnum, a.friend, a.target_ids, p.* FROM " . DB::table('home_pic') . " p\r\n\t\t\t\t\tLEFT JOIN " . DB::table('home_album') . " a ON a.albumid=p.albumid\r\n\t\t\t\t\tWHERE p.albumid='{$id}' ORDER BY dateline DESC LIMIT 0,4");
                while ($value = DB::fetch($query)) {
                    if ($value['friend'] <= 2) {
                        if (empty($setarr['icon'])) {
                            $setarr['icon'] = 'album';
                            $setarr['id'] = $value['albumid'];
                            $setarr['idtype'] = $idtype;
                            $setarr['uid'] = $value['uid'];
                            $setarr['username'] = $value['username'];
                            $setarr['dateline'] = $value['dateline'];
                            $setarr['target_ids'] = $value['target_ids'];
                            $setarr['friend'] = $value['friend'];
                            $status = $value['status'];
                            $setarr['title_template'] = 'feed_album_title';
                            $setarr['body_template'] = 'feed_album_body';
                            $setarr['body_data'] = array('album' => "<a href=\"home.php?mod=space&uid={$value['uid']}&do=album&id={$value['albumid']}\">{$value['albumname']}</a>", 'picnum' => $value['picnum']);
                        }
                        $setarr['image_' . $key] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote']);
                        $setarr['image_' . $key . '_link'] = "home.php?mod=space&uid={$value['uid']}&do=album&picid={$value['picid']}";
                        $key++;
                    } else {
                        break;
                    }
                }
            }
            break;
        case 'picid':
            $plussql = $id > 0 ? "p.picid='{$id}'" : "p.uid='{$_G['uid']}' ORDER BY dateline DESC LIMIT 1";
            $query = DB::query("SELECT p.*, a.friend, a.target_ids FROM " . DB::table('home_pic') . " p\r\n\t\t\t\tLEFT JOIN " . DB::table('home_album') . " a ON a.albumid=p.albumid WHERE {$plussql}");
            if ($value = DB::fetch($query)) {
                if (empty($value['friend'])) {
                    $setarr['icon'] = 'album';
                    $setarr['id'] = $value['picid'];
                    $setarr['idtype'] = $idtype;
                    $setarr['uid'] = $value['uid'];
                    $setarr['username'] = $value['username'];
                    $setarr['dateline'] = $value['dateline'];
                    $setarr['target_ids'] = $value['target_ids'];
                    $setarr['friend'] = $value['friend'];
                    $setarr['hot'] = $value['hot'];
                    $status = $value['status'];
                    $url = "home.php?mod=space&uid={$value['uid']}&do=album&picid={$value['picid']}";
                    $setarr['image_1'] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote']);
                    $setarr['image_1_link'] = $url;
                    $setarr['title_template'] = 'feed_pic_title';
                    $setarr['body_template'] = 'feed_pic_body';
                    $setarr['body_data'] = array('title' => $value['title']);
                }
            }
            break;
    }
    if ($setarr['icon']) {
        $setarr['title_template'] = $setarr['title_template'] ? lang('feed', $setarr['title_template']) : '';
        $setarr['body_template'] = $setarr['body_template'] ? lang('feed', $setarr['body_template']) : '';
        $setarr['body_general'] = $setarr['body_general'] ? lang('feed', $setarr['body_general']) : '';
        $setarr['title_data']['hash_data'] = "{$idtype}{$id}";
        $setarr['title_data'] = serialize($setarr['title_data']);
        $setarr['body_data'] = serialize($setarr['body_data']);
        $setarr = daddslashes($setarr);
        $feedid = 0;
        if (!$add && $setarr['id']) {
            $query = DB::query("SELECT feedid FROM " . DB::table('home_feed') . " WHERE id='{$id}' AND idtype='{$idtype}'");
            $feedid = DB::result($query, 0);
        }
        if ($status == 0) {
            if ($feedid) {
                DB::update('home_feed', $setarr, array('feedid' => $feedid));
            } else {
                DB::insert('home_feed', $setarr);
            }
        }
    }
}
Beispiel #18
0
function feed_publish($id, $idtype, $add = 0)
{
    global $_SGLOBAL;
    $setarr = array();
    switch ($idtype) {
        case 'blogid':
            $query = $_SGLOBAL['db']->query("SELECT b.*, bf.* FROM " . tname('blog') . " b\r\n\t\t\t\tLEFT JOIN " . tname('blogfield') . " bf ON bf.blogid=b.blogid\r\n\t\t\t\tWHERE b.blogid='{$id}'");
            if ($value = $_SGLOBAL['db']->fetch_array($query)) {
                if ($value['friend'] != 3) {
                    //
                    $setarr['icon'] = 'blog';
                    $setarr['id'] = $value['blogid'];
                    $setarr['idtype'] = $idtype;
                    $setarr['uid'] = $value['uid'];
                    $setarr['username'] = $value['username'];
                    $setarr['dateline'] = $value['dateline'];
                    $setarr['target_ids'] = $value['target_ids'];
                    $setarr['friend'] = $value['friend'];
                    $setarr['hot'] = $value['hot'];
                    //ϸ
                    $url = "space.php?uid={$value['uid']}&do=blog&id={$value['blogid']}";
                    if ($value['friend'] == 4) {
                        //
                        $setarr['title_template'] = cplang('feed_blog_password');
                        $setarr['title_data'] = array('subject' => "<a href=\"{$url}\">{$value['subject']}</a>");
                    } else {
                        //˽
                        if ($value['pic']) {
                            $setarr['image_1'] = pic_cover_get($value['pic'], $value['picflag']);
                            $setarr['image_1_link'] = $url;
                        }
                        $setarr['title_template'] = cplang('feed_blog');
                        $setarr['body_template'] = '<b>{subject}</b><br>{summary}';
                        $setarr['body_data'] = array('subject' => "<a href=\"{$url}\">{$value['subject']}</a>", 'summary' => getstr($value['message'], 150, 1, 1, 0, 0, -1));
                    }
                }
            }
            break;
        case 'albumid':
            $key = 1;
            if ($id > 0) {
                $query = $_SGLOBAL['db']->query("SELECT p.*, a.username, a.albumname, a.picnum, a.friend, a.target_ids FROM " . tname('pic') . " p\r\n\t\t\t\t\tLEFT JOIN " . tname('album') . " a ON a.albumid=p.albumid\r\n\t\t\t\t\tWHERE p.albumid='{$id}' ORDER BY dateline DESC LIMIT 0,4");
                while ($value = $_SGLOBAL['db']->fetch_array($query)) {
                    if ($value['friend'] <= 2) {
                        if (empty($setarr['icon'])) {
                            //
                            $setarr['icon'] = 'album';
                            $setarr['id'] = $value['albumid'];
                            $setarr['idtype'] = $idtype;
                            $setarr['uid'] = $value['uid'];
                            $setarr['username'] = $value['username'];
                            $setarr['dateline'] = $value['dateline'];
                            $setarr['target_ids'] = $value['target_ids'];
                            $setarr['friend'] = $value['friend'];
                            //ϸ
                            $setarr['title_template'] = '{actor} ' . cplang('upload_album');
                            $setarr['body_template'] = '<b>{album}</b><br>' . cplang('the_total_picture', array('{picnum}'));
                            $setarr['body_data'] = array('album' => "<a href=\"space.php?uid={$value['uid']}&do=album&id={$value['albumid']}\">{$value['albumname']}</a>", 'picnum' => $value['picnum']);
                        }
                        $setarr['image_' . $key] = pic_get($value['filepath'], $value['thumb'], $value['remote']);
                        $setarr['image_' . $key . '_link'] = "space.php?uid={$value['uid']}&do=album&picid={$value['picid']}";
                        $key++;
                    } else {
                        break;
                    }
                }
            } else {
                //Ĭ album
                $picnum = $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT COUNT(*) FROM " . tname('pic') . " WHERE uid='{$_SGLOBAL['supe_uid']}' AND albumid='0'"), 0);
                if ($picnum >= 1) {
                    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('pic') . " WHERE uid='{$_SGLOBAL['supe_uid']}' AND albumid='0' ORDER BY dateline DESC LIMIT 0,4");
                    while ($value = $_SGLOBAL['db']->fetch_array($query)) {
                        if (empty($setarr['icon'])) {
                            //
                            $setarr['icon'] = 'album';
                            $setarr['uid'] = $value['uid'];
                            $setarr['username'] = $_SGLOBAL['supe_username'];
                            $setarr['dateline'] = $value['dateline'];
                            //ϸ
                            $setarr['title_template'] = '{actor} ' . cplang('upload_album');
                            $setarr['body_template'] = '<b>{album}</b><br>' . cplang('the_total_picture', array('{picnum}'));
                            $setarr['body_data'] = array('album' => "<a href=\"space.php?uid={$value['uid']}&do=album&id=-1\">" . cplang('default_albumname') . "</a>", 'picnum' => $picnum);
                        }
                        $setarr['image_' . $key] = pic_get($value['filepath'], $value['thumb'], $value['remote']);
                        $setarr['image_' . $key . '_link'] = "space.php?uid={$value['uid']}&do=album&picid={$value['picid']}";
                        $key++;
                    }
                }
            }
            break;
        case 'picid':
            $plussql = $id > 0 ? "p.picid='{$id}'" : "p.uid='{$_SGLOBAL['supe_uid']}' ORDER BY dateline DESC LIMIT 1";
            $query = $_SGLOBAL['db']->query("SELECT p.*, a.friend, a.target_ids, s.username FROM " . tname('pic') . " p\r\n\t\t\t\tLEFT JOIN " . tname('space') . " s ON s.uid=p.uid\r\n\t\t\t\tLEFT JOIN " . tname('album') . " a ON a.albumid=p.albumid WHERE {$plussql}");
            if ($value = $_SGLOBAL['db']->fetch_array($query)) {
                if (empty($value['friend'])) {
                    // privacy
                    //
                    $setarr['icon'] = 'album';
                    $setarr['id'] = $value['picid'];
                    $setarr['idtype'] = $idtype;
                    $setarr['uid'] = $value['uid'];
                    $setarr['username'] = $value['username'];
                    $setarr['dateline'] = $value['dateline'];
                    $setarr['target_ids'] = $value['target_ids'];
                    $setarr['friend'] = $value['friend'];
                    $setarr['hot'] = $value['hot'];
                    //ϸ
                    $url = "space.php?uid={$value['uid']}&do=album&picid={$value['picid']}";
                    $setarr['image_1'] = pic_get($value['filepath'], $value['thumb'], $value['remote']);
                    $setarr['image_1_link'] = $url;
                    $setarr['title_template'] = '{actor} ' . cplang('upload_a_new_picture');
                    $setarr['body_template'] = '{title}';
                    $setarr['body_data'] = array('title' => $value['title']);
                }
            }
            break;
        case 'tid':
            $query = $_SGLOBAL['db']->query("SELECT t.*, p.* FROM " . tname('thread') . " t\r\n\t\t\t\tLEFT JOIN " . tname('post') . " p ON p.tid=t.tid AND p.isthread='1'\r\n\t\t\t\tWHERE t.tid='{$id}'");
            if ($value = $_SGLOBAL['db']->fetch_array($query)) {
                //
                $setarr['icon'] = 'thread';
                $setarr['id'] = $value['tid'];
                $setarr['idtype'] = $idtype;
                $setarr['uid'] = $value['uid'];
                $setarr['username'] = $value['username'];
                $setarr['dateline'] = $value['dateline'];
                $setarr['hot'] = $value['hot'];
                //ϸ
                $url = "space.php?uid={$value['uid']}&do=thread&id={$value['tid']}";
                if ($value['eventid']) {
                    // event
                    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname("event") . " WHERE eventid='{$value['eventid']}'");
                    $event = $_SGLOBAL['db']->fetch_array($query);
                    $setarr['title_template'] = cplang('feed_eventthread');
                    $setarr['body_template'] = '<b>{subject}</b><br>' . cplang('event') . ': {event}<br>{summary}';
                    $setarr['body_data'] = array('subject' => "<a href=\"{$url}&eventid={$value['eventid']}\">{$value['subject']}</a>", 'event' => "<a href=\"space.php?do=event&id={$value['eventid']}\">{$event['title']}</a>", 'summary' => getstr($value['message'], 150, 1, 1, 0, 0, -1));
                } else {
                    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname("mtag") . " WHERE tagid='{$value['tagid']}'");
                    $mtag = $_SGLOBAL['db']->fetch_array($query);
                    $setarr['title_template'] = cplang('feed_thread');
                    $setarr['body_template'] = '<b>{subject}</b><br>' . cplang('mtag') . ': {mtag}<br>{summary}';
                    $setarr['body_data'] = array('subject' => "<a href=\"{$url}\">{$value['subject']}</a>", 'mtag' => "<a href=\"space.php?do=mtag&tagid={$value['tagid']}\">{$mtag['tagname']}</a>", 'summary' => getstr($value['message'], 150, 1, 1, 0, 0, -1));
                }
            }
            break;
        case 'pid':
            $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('poll') . " WHERE pid='{$id}'");
            if ($value = $_SGLOBAL['db']->fetch_array($query)) {
                //
                $setarr['icon'] = 'poll';
                $setarr['id'] = $value['pid'];
                $setarr['idtype'] = $idtype;
                $setarr['uid'] = $value['uid'];
                $setarr['username'] = $value['username'];
                $setarr['dateline'] = $value['dateline'];
                $setarr['hot'] = $value['hot'];
                //ϸ
                $url = "space.php?uid={$value['uid']}&do=poll&pid={$value['pid']}";
                $setarr['title_template'] = cplang('feed_poll');
                $setarr['body_template'] = '<a href="{url}"><strong>{subject}</strong></a>{option}';
                $optionstr = '';
                $opquery = $_SGLOBAL['db']->query("SELECT * FROM " . tname("polloption") . " WHERE pid='{$value['pid']}' LIMIT 0,2");
                while ($opt = $_SGLOBAL['db']->fetch_array($opquery)) {
                    $optionstr .= '<br><input type="' . ($value['maxchoice'] > 1 ? 'checkbox' : 'radio') . '" disabled name="poll_' . $opt['oid'] . '"/>' . $opt['option'];
                }
                $setarr['body_data'] = array('url' => $url, 'subject' => $value['subject'], 'option' => $optionstr);
                $setarr['body_general'] = $value['percredit'] ? cplang('reward_info', array($value['percredit'])) : '';
            }
            break;
        case 'eventid':
            $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('event') . " WHERE eventid='{$id}'");
            if ($value = $_SGLOBAL['db']->fetch_array($query)) {
                //
                $setarr['icon'] = 'event';
                $setarr['id'] = $value['eventid'];
                $setarr['idtype'] = $idtype;
                $setarr['uid'] = $value['uid'];
                $setarr['username'] = $value['username'];
                $setarr['dateline'] = $value['dateline'];
                $setarr['hot'] = $value['hot'];
                //ϸ
                $url = "space.php?do=event&id={$value['eventid']}";
                $setarr['title_template'] = cplang('event_add');
                $setarr['body_template'] = cplang('event_feed_info');
                $setarr['body_data'] = array('title' => "<a href=\"{$url}\">{$value['title']}</a>", 'country' => $value['country'], 'province' => $value['province'], 'city' => $value['city'], 'location' => $value['location'], 'starttime' => sgmdate('m-d H:i', $value['starttime']), 'endtime' => sgmdate('m-d H:i', $value['endtime']));
                //
                if ($value['poster']) {
                    $setarr['image_1'] = pic_get($value['poster'], $value['thumb'], $value['remote']);
                    $setarr['image_1_link'] = $url;
                }
            }
            break;
        case 'sid':
            $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('share') . " WHERE sid='{$id}'");
            if ($value = $_SGLOBAL['db']->fetch_array($query)) {
                //
                $setarr['icon'] = 'share';
                $setarr['id'] = $value['sid'];
                $setarr['idtype'] = $idtype;
                $setarr['uid'] = $value['uid'];
                $setarr['username'] = $value['username'];
                $setarr['dateline'] = $value['dateline'];
                $setarr['hot'] = $value['hot'];
                //ϸ
                $url = "space.php?uid={$value['uid']}&do=share&id={$value['sid']}";
                $setarr['title_template'] = '{actor} ' . $value['title_template'];
                $setarr['body_template'] = $value['body_template'];
                $setarr['body_data'] = $value['body_data'];
                $setarr['body_general'] = $value['body_general'];
                $setarr['image_1'] = $value['image'];
                $setarr['image_1_link'] = $value['image_link'];
            }
            break;
    }
    if ($setarr['icon']) {
        $setarr['appid'] = UC_APPID;
        //ݴ
        $setarr['title_data'] = serialize($setarr['title_data']);
        // groups ת
        if ($idtype != 'sid') {
            $setarr['body_data'] = serialize($setarr['body_data']);
            // groups ת
        }
        $setarr['hash_template'] = md5($setarr['title_template'] . "\t" . $setarr['body_template']);
        //ϲhash
        $setarr['hash_data'] = md5($setarr['title_template'] . "\t" . $setarr['title_data'] . "\t" . $setarr['body_template'] . "\t" . $setarr['body_data']);
        //ϲhash
        $setarr = saddslashes($setarr);
        $feedid = 0;
        if (!$add && $setarr['id']) {
            $query = $_SGLOBAL['db']->query("SELECT feedid FROM " . tname('feed') . " WHERE id='{$id}' AND idtype='{$idtype}'");
            $feedid = $_SGLOBAL['db']->result($query, 0);
        }
        if ($feedid) {
            updatetable('feed', $setarr, array('feedid' => $feedid));
        } else {
            inserttable('feed', $setarr);
        }
    }
}
Beispiel #19
0
 function _convertAlbum($albumInfo)
 {
     $siteUrl = $this->_getUchomeUrl();
     if ($albumInfo && is_array($albumInfo)) {
         $convAlbum = array();
         $convAlbum['aId'] = $albumInfo['albumid'];
         $convAlbum['name'] = $albumInfo['albumname'];
         $convAlbum['created'] = $albumInfo['dateline'];
         $convAlbum['updated'] = $albumInfo['updatetime'];
         $convAlbum['privacy'] = $this->_convertPrivacy($albumInfo['friend'], true);
         $convAlbum['passwd'] = $albumInfo['passwd'];
         $convAlbum['friendIds'] = $albumInfo['target_ids'] ? explode(',', $albumInfo['target_ids']) : '';
         if ($albumInfo['pic']) {
             $convAlbum['cover'] = pic_cover_get($albumInfo['pic'], $albumInfo['picflag']);
             if (!preg_match("/^(http\\:\\/\\/|\\/)/i", $convAlbum['cover'])) {
                 $convAlbum['cover'] = $siteUrl . $struct['url'];
             }
         } else {
             $convAlbum['cover'] = '';
         }
         $convAlbum['url'] = $siteUrl . 'space.php?uid=' . $albumInfo['uid'] . '&do=album&id=' . $albumInfo['albumid'];
     } else {
         $convAlbum = false;
     }
     return $convAlbum;
 }
$navigation = '<em>&raquo;</em><a href="' . $brandresult['url'] . '">' . $brandresult['name'] . '</a><em>&raquo;</em>' . srlang('myalbum');
$navtitle = srlang('myalbum') . '-' . $brandresult['name'] . ' - ' . $config['title'];
$where = array();
$where[] = 'uid=' . $brandresult['uid'];
$where[] = 'bid=' . $bid;
$albumcatelist = array();
include_once libfile('function/home');
$picshowtipformat = srlang('picshowtip');
foreach (C::t('#sanree_brand#sanree_brand_album_category')->fetch_all_by_searchd($where, 'displayorder,dateline DESC') as $data) {
    if ($config['isbird']) {
        $data['pic'] = empty($data['pic']) ? 'static/image/common/nophoto.gif' : pic_cover_get($data['pic'], 1);
    } else {
        if ($isalbumthumb == 1) {
            $data['pic'] = sr_albumimage($data['pic'], 120, 120);
        } else {
            $data['pic'] = empty($data['pic']) ? 'static/image/common/nophoto.gif' : pic_cover_get($data['pic'], 1);
        }
    }
    $data['url'] = getalbumitemurl($data[catid]);
    $wherealbumsub = array();
    $wherealbumsub[] = 'catid = ' . $data[catid];
    $data['num'] = C::t('#sanree_brand#sanree_brand_album')->count_by_wherec($wherealbumsub);
    $data['picshowtip'] = str_replace("{picnum}", $data['num'], $picshowtipformat);
    $albumcatelist[] = $data;
}
if (!$config['isbird']) {
    require_once libfile('class/' . $plugin['identifier'] . '_menu', 'plugin/' . $plugin['identifier']);
    $menuclass = new sanree_brand_menu($plugin['identifier']);
    $menuclass->getmenu($brandresult, 'myalbum');
    $brand_header = $menuclass->_brand_header;
    $brand_header_one = $menuclass->_brand_header_one;