コード例 #1
0
ファイル: index.php プロジェクト: severnaya99/Sg-2010
        if (!isset($xt)) {
            $xt = new AmsTopic($xoopsDB->prefix('ams_topics'));
        }
        $xt->getTopic($xoopsOption['storytopic']);
        $pagetitle .= ' - ' . $xt->topic_title();
        $xoopsTpl->assign('breadcrumb', $xt->getTopicPath(true));
    } else {
        $xoopsTpl->assign('breadcrumb', '');
    }
} else {
    include_once XOOPS_ROOT_PATH . "/class/tree.php";
    $xt = new AmsTopic($xoopsDB->prefix("ams_topics"));
    $allTopics = $xt->getAllTopics($xoopsModuleConfig['restrictindex']);
    $topic_obj_tree = new XoopsObjectTree($allTopics, 'topic_id', 'topic_pid');
    $alltopics = $topic_obj_tree->getFirstChild(0);
    $article_counts = AmsStory::countPublishedOrderedByTopic();
    $smarty_topics = array();
    foreach (array_keys($alltopics) as $i) {
        $allstories[$i] = AmsStory::getAllPublished($xoopsOption['storynum'], 0, false, $i, 0);
        if (count($allstories[$i]) > 0) {
            foreach ($allstories[$i] as $thisstory) {
                $uids[$thisstory->uid()] = $thisstory->uid();
            }
        }
        if (!isset($article_counts[$i])) {
            $article_counts[$i] = 0;
        }
    }
    if (count($uids) > 0) {
        $member_handler =& xoops_gethandler('member');
        $user_arr = $member_handler->getUsers(new Criteria('uid', "(" . implode(',', array_keys($uids)) . ")", 'IN'), true);