Пример #1
0
function recommendtopic()
{
    $arrTopics = aac('group')->findAll('group_topic', array('isaudit' => 0, 'isrecommend' => 1), 'uptime desc', null, 10);
    foreach ($arrTopics as $key => $item) {
        $arrTopic[$key] = $item;
        $arrTopic[$key]['title'] = tsTitle($item['title']);
        // 标题过滤
        $arrTopic[$key]['desc'] = tsCutContent(strip_tags($item['content']), 50);
        // 简介
        $arrTopic[$key]['user'] = aac('user')->getOneUser($item['userid']);
        // 用户信息
        $arrTopic[$key]['group'] = aac('group')->getOneGroup($item['groupid']);
        // 群组信息
        /* 匹配标题图片 */
        $pattern = "/<[img|IMG].*?src=[\\'|\"](.*?(?:[\\.gif|\\.jpg|\\.png]))[\\'|\"].*?[\\/]?>/";
        preg_match($pattern, tsDecode($item['content']), $match);
        if (!$match[1]) {
            // 内容里面没有图片
            $match[0] = '<img src="/plugins/home/recommendtopic/images/default.png" />';
            $match[1] = '/plugins/home/recommendtopic/images/default.png';
        }
        $arrTopic[$key]['thumb'] = $match;
    }
    include template('recommendtopic', 'recommendtopic');
}
Пример #2
0
    $groupUser = $new['group']->findAll('group_user', array('groupid' => $groupid), 'addtime desc', null, 8);
    if (is_array($groupUser)) {
        foreach ($groupUser as $item) {
            $strUser = aac('user')->getOneUser($item['userid']);
            if ($strUser) {
                $arrGroupUser[] = $strUser;
            } else {
                $new['group']->delete('group_user', array('userid' => $item['userid'], 'groupid' => $groupid));
            }
        }
    }
    //标签
    $strGroup['tags'] = aac('tag')->getObjTagByObjid('group', 'groupid', $strGroup['groupid']);
    if ($page > 1) {
        $title = $strGroup['groupname'] . ' - 第' . $page . '页';
    }
    //把标签作为关键词
    if ($strGroup['tags']) {
        foreach ($strGroup['tags'] as $key => $item) {
            $arrTag[] = $item['tagname'];
        }
        $sitekey = $strGroup['groupname'] . ',' . arr2str($arrTag);
    } else {
        $sitekey = $strGroup['groupname'];
    }
    $sitedesc = tsCutContent($strGroup['groupdesc'], 50);
    if ($TS_CF['mobile']) {
        $sitemb = tsUrl('moblie', 'group', array('ts' => 'show', 'groupid' => $strGroup['groupid']));
    }
    include template("show");
}
Пример #3
0
$arrFeeds = $new['user']->findAll('feed', array('userid' => $strUser['userid']), 'addtime desc', null, '15');
foreach ($arrFeeds as $key => $item) {
    $data = json_decode($item['data'], true);
    if (is_array($data)) {
        foreach ($data as $key => $itemTmp) {
            $tmpkey = '{' . $key . '}';
            $tmpdata[$tmpkey] = tsTitle(urldecode($itemTmp));
        }
    }
}
$arrFeeds = aac('group')->findAll('group_topic', array('userid' => $strUser['userid']), 'addtime desc', null, 25);
foreach ($arrFeeds as $key => $item) {
    $arrFeed[$key] = $item;
    $arrFeed[$key]['title'] = tsTitle($item['title']);
    // 标题过滤
    $arrFeed[$key]['desc'] = tsCutContent(strip_tags($item['content']), 90);
    // 简介
    $arrFeed[$key]['user'] = aac('user')->getOneUser($item['userid']);
    // 用户信息
    $arrFeed[$key]['group'] = aac('group')->getOneGroup($item['groupid']);
    // 群组信息
    /* 匹配标题图片 */
    $pattern = "/<[img|IMG].*?src=[\\'|\"](.*?(?:[\\.gif|\\.jpg|\\.png]))[\\'|\"].*?[\\/]?>/";
    preg_match($pattern, tsDecode($item['content']), $match);
    if (!$match[1]) {
        // 内容里面没有图片
        $match[0] = '<img src="/plugins/home/newtopics/images/default.png" />';
        $match[1] = '/plugins/home/newtopics/images/default.png';
    }
    $arrFeed[$key]['thumb'] = $match;
}
<h3><span>[小组] </span>&nbsp;<a  href="<?php 
    echo tsurl('group', 'show', array('id' => $item['groupid']));
    ?>
"><?php 
    echo tsTitle($item['groupname']);
    ?>
</a></h3>
<div class="info">创建于 <?php 
    echo date('Y-m-d', $item['addtime']);
    ?>
 &nbsp; <a href="#"><?php 
    echo $item['count_user'];
    ?>
 人</a></div>
<p><?php 
    echo tsCutContent($item['groupdesc']);
    ?>
</p>
</div>
</div>
<?php 
}
?>

<div class="page"><?php 
echo $pageUrl;
?>
</div>
</div>
</div>