Forum Index > glFusion > glFusion Support New Topic Post Reply
 Forum in center block?
 |  Printable Version
By: dlassen (offline) on November 03 2009 11:46 AM (Read 279 times)  
dlassen

Hi guys,

Quick forum question: how can I get the more detailed topic listing into the center block on the front page.

Right now I'm able to show a not very detailed listing of latest posts for all forums (no user name, date, number of replies etc.).

Could I get the more detailed view (I can live with doing this for one forum only, but ideally it would be nice to see the last X posts from any forum).

Thanks in advance,

Dennis



Forum Junior
Junior

Group Comfort
Level:
: 0

Status: offline

Registered: 10/30/09
Posts: 19

Profile Email   PM
  Quote
By: Geiss (offline) on November 03 2009 11:52 AM  
Geiss

Just to make sure you're aware, if you hover over any of the Topic or Latest Post entries in the Forum Centerblock, it provides a lot of that info already ( user name, date, number of replies etc.)

Thx!

Eric



Forum Admin
Admin

Group Comfort
Level:
: +48

Status: offline

Registered: 02/15/07
Posts: 1828
Boise, Idaho

Profile Email Website PM
  Quote
By: dlassen (offline) on November 03 2009 12:11 PM  
dlassen

Thanks Geiss - I am aware of that, but it's just that the more detailed view would be useful in my situation.


Forum Junior
Junior

Group Comfort
Level:
: 0

Status: offline

Registered: 10/30/09
Posts: 19

Profile Email   PM
  Quote
By: Geiss (offline) on November 03 2009 12:21 PM  
Geiss

No worries. I'm going for the low hanging fruit first! Big Grin

The function that creates the centerblock lives in private/plugins/forum/functions.inc, and starts on line 1022:

PHP Formatted Code
function plugin_centerblock_forum ($where = 1, $page = 1, $topic = '')
...



In the function, you'll see all the template tags that you can use in the .thtml file, for example:

PHP Formatted Code
        $block->set_var ('phpself', $_CONF['site_url'] .'/index.php');
        $block->set_var ('startblock', COM_startBlock($LANG_GF02['msg170']));
        $block->set_var ('endblock', COM_endBlock());
        $block->set_var ('site_url', $_CONF['site_url']);
        $block->set_var ('layout_url', $_CONF['layout_url']);
        $block->set_var ('LANG_title', $LANG_GF02['msg170']);
        $block->set_var ('LANG_FORUM', $LANG_GF01['FORUM']);
        $block->set_var ('LANG_TOPIC', $LANG_GF01['TOPIC']);
        $block->set_var ('LANG_LASTPOST', $LANG_GF01['LASTPOST']);
        $block->set_var ('LANG_viewlastpost', $LANG_GF02['msg160']);
        $block->set_var ('LANG_forumjump', $LANG_GF02['msg195']);



and then further down towards the end of the function:

PHP Formatted Code
            $block->set_var ('lastpostinfo', $lastpostinfo);
            $block->set_var ('lastpostid', $lastid);
            $block->set_var ('topicinfo', $topicinfo);
            $block->set_var ('cssid', $cssid);
            $block->set_var ('forum_id', $A['forum']);
            $block->set_var ('forum_name', $A['forum_name']);
            $block->set_var ('topic_id', $A['id']);
            $block->set_var ('topic_subject', $A['subject']);
            $block->set_var ('fullsubject', $fullsubject);
            $block->set_var ('views', $A['views']);
            $block->set_var ('replies', $A['replies']);
            $block->set_var ('date',$lastdate );
            $block->set_var ('lastpostby',$A['name']);
            $block->parse ('block_records', 'record',true);



You can use those tags in the private/plugins/forum/templates/blocks/ templates and edit them to your liking Specifically for the centerblock, you'll want to change centerblock.thtml and centerblock_displayline.thtml.

Make sure to copy whatever .thtml file you modify into the /custom folder in the same directory, that way you won't lose your changes on an upgrade.

Thx!

Eric



Forum Admin
Admin

Group Comfort
Level:
: +48

Status: offline

Registered: 02/15/07
Posts: 1828
Boise, Idaho

Profile Email Website PM
  Quote
By: dlassen (offline) on November 03 2009 12:47 PM  
dlassen

Thanks for your quick and detailed response - I'll have a go at it!

Dennis


Forum Junior
Junior

Group Comfort
Level:
: 0

Status: offline

Registered: 10/30/09
Posts: 19

Profile Email   PM
  Quote
Content generated in: 1.73 seconds
New Topic Post Reply



 All times are CDT. The time is now 09:41 AM.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to Post 
HTML Allowed 
Censored Content