$tribe_id = $_POST['tribe_id'];
            $page = intval($_POST['page']);
            $num_start = $page * 10;
            $sql_tribe = "SELECT * FROM " . $core->prefix . "tribe WHERE tribe_id='" . $tribe_id . "'";
            if ($tribe_id == "") {
                $sql_tribe = generate_SQL(0, 10, array(), array(), null, "week", true);
                // popular
            }
            $rs = $core->con->select($sql_tribe);
            if ($rs->count() > 0) {
                $tribe_icon = getTribeIcon($rs->f('tribe_id'), $rs->f('tribe_name'), $rs->f('tribe_icon'));
                $tribe = array("title" => $rs->f('tribe_name'), "id" => $rs->f('tribe_id'), "icon" => $tribe_icon, "page" => $page);
                $core->tpl->setVar('tribe', $tribe);
                $sql_posts = generate_tribe_SQL($tribe_id, $num_start);
                $rs_posts = $core->con->select($sql_posts);
                $tpl = showTribe($core->tpl, $rs_posts);
            }
            print $tpl->render('portal.block');
            break;
            ##########################################################
            # DEFAULT RETURN
            ##########################################################
        ##########################################################
        # DEFAULT RETURN
        ##########################################################
        default:
            print '<div class="flash_error">' . T_('User bad call') . '</div>';
            break;
    }
} else {
    print 'forbidden';
Beispiel #2
0
$rs = $core->con->select($sql_tribes);
$align = 'right';
while ($rs->fetch()) {
    $align = $align == 'right' ? 'left' : 'right';
    $tribe_icon = getTribeIcon($rs->tribe_id, $rs->tribe_name, $rs->tribe_icon);
    $tribe = array("title" => $rs->tribe_name, "id" => $rs->tribe_id, "icon" => $tribe_icon, "align" => $align, "page" => 0);
    $core->tpl->setVar('tribe', $tribe);
    // Generating the SQL request
    $sql_posts = generate_tribe_SQL($rs->tribe_id);
    $rs_posts = $core->con->select($sql_posts);
    if ($rs_posts->count() > 0) {
        $core->tpl = showTribe($core->tpl, $rs_posts);
        $core->tpl->render('portal.block');
    }
    // For each tribe I'll have to generate a list of 10 posts with their title and permalink
}
$align = $align == 'right' ? 'left' : 'right';
$tribe = array("title" => T_('Popular posts'), "id" => 'popular', "icon" => '', "align" => $align);
$core->tpl->setVar('tribe', $tribe);
$popular_sql = generate_SQL(0, 10, array(), array(), null, "week", true);
// popular
$rs_posts = $core->con->select($popular_sql);
if ($rs_posts->count() > 0) {
    $core->tpl = showTribe($core->tpl, $rs_posts, true);
    $core->tpl->render('portal.block');
}
$core->tpl->render("content.portal");
# Show result
$analytics_code = getAnalyticsCode();
$core->tpl->setVar('analytics_html', $analytics_code);
$core->renderTemplate();