1 (edited by littlebigfred 2010-08-05 12:30)

Topic: [Panels] Customize homepage?

Hello

(I already asked in the relevant thread, but didn't get a reply, and since my question is partly general, I figured I might get a reply by asking again, in a more active part of the forum)

1. With PunBB installed in /punbb/, I'd like the homepage to display articles from an admin-restricted part of the forum, so that I can use PunBB both as a forum and as a blog to publish articles on the homepage.

However, I'd like to simplify the homepage, and only keep the bare minimum, while the forum page should remain as-is with all the bells and whistles:

http://img228.imageshack.us/img228/6003/punbbportal.jpg

Incidently, this is how the PunBB Resource homepage works.

Can this be achieved entirely by tweaking Administration » Start » Panels, or must I edit some templates somewhere? Is it possible to display some panels in some pages and no others?

2. This is a Daris Portal-specific question: Since Panels are part of PunBB, I'm not sure I understand why Administration » Settings » Portal contains "Panels on all pages". What does this do?


Thank you.

-----------

Edit:

3. To avoid reading the same articles from MySQL again and again each time a user requests the homepage, I'd like the whole homepage to be regenerated as a static file every time an admin publishes a new article in the News section of the forum.

Re: [Panels] Customize homepage?

For those also wanting to use PunBB to 1) publish on the homepage all the posts in a given forum and 2) simplify the homepage so that it looks like a blog instead of a forum... I found a simple way to tell whether we're in the homepage or elsewhere in the site: Just edit header.php thusly:

if("index.php" == $_SERVER["REQUEST_URI"] || "/" == $_SERVER["REQUEST_URI"]) {
    define('IS_HOMEPAGE', True);
} else {
    define('IS_HOMEPAGE', False);
}

// START SUBST OF COMMON ELEMENTS
[...]
// Main Navigation
// Don't display in homepage
if (!IS_HOMEPAGE) {
        $gen_elements['<!-- forum_navlinks -->'] = '<ul>'."\n\t\t".generate_navlinks()."\n\t".'<$
}

[...]

// START SUBST VISIT ELEMENTS
// Don't display in homepage
if (!IS_HOMEPAGE) {
        if ($forum_user['is_guest'])
                $visit_elements['<!-- forum_welcome -->'] = '<p id="welcome"><span>'.$lang_commo$
        else
                $visit_elements['<!-- forum_welcome -->'] = '<p id="welcome"><span>'.sprintf($la$

        if ($forum_user['g_read_board'] == '1' && $forum_user['g_search'] == '1')
        {
                $visit_links = array();

                if (!$forum_user['is_guest'])
                        $visit_links['newposts'] = '<span id="visit-new"'.(empty($visit_links) ?$

                $visit_links['recent'] = '<span id="visit-recent"'.(empty($visit_links) ? ' clas$
                $visit_links['unanswered'] = '<span id="visit-unanswered"'.(empty($visit_links) $
        }
}

HTH,