1

Topic: 10 last forum posts on index

Hi all, I just installed the punBB forum into my website and it works perfectly! What I want now is the last 10 or so forum entries to show up on the index of my site. I now this is possible because I saw it on a site that uses vld personals.

Does anyone know if there is a mod for this? Can anyone help me with this?

Regards Rob

2

Re: 10 last forum posts on index

It is probably a punBB mod. I know phpbb has such a mod where you can lists the posts on a html (tpl) page. I don't use punBB, but check the mods on their site to see if they have it.

3

Re: 10 last forum posts on index

in template folder create latestforum.php

<?php
$latest=file_get_contents("http://your_site/extern.php?action=new&show=10"; // or extern.php only
echo $latest;
?>

in homepage
<!-- INCLUDE latestforum.php -->

Also you may try to customise extern.php if need for the design

Last edited by Firesgame (2009-10-29 19:54:07)

4

Re: 10 last forum posts on index

great idea Firesgame, You're great !!! thx ! I've been wrestling with RSS feeders, but this is my solution

5

Re: 10 last forum posts on index

something for Phpbb3 ? I woultd like show last 10 topics on homepage or sidebar !

6

Re: 10 last forum posts on index

maybee something you can use .

This must be placed at the top of your header.tpl page.

<?
    define('IN_PHPBB', true);
    $phpbb_root_path = './forum/'; // Path to phpbb folder
    $phpEx = substr(strrchr(__FILE__, '.'), 1);
    include($phpbb_root_path . 'common.' . $phpEx);
    include($phpbb_root_path . 'includes/functions_display.' . $phpEx);

    // Start session management
    $user->session_begin();
    $auth->acl($user->data);

    // Grab user preferences
    $user->setup();
?>

Place this in header.tpl where you want the topic links to appear there you have your sidebar code.

<?  
    //Show last x topics
    define('TOPICS_LIMIT',10);

    // Create arrays
    $topics = array();
    
    // Get forums that current user has read rights to.
    $forums = array_unique(array_keys($auth->acl_getf('f_read', true)));
    
    // Get active topics.
    $sql="SELECT *
    FROM " . TOPICS_TABLE . "
    WHERE topic_approved = '1' AND " . $db->sql_in_set('forum_id', $forums) . "
    ORDER BY topic_last_post_time DESC";
    $result = $db->sql_query_limit($sql,TOPICS_LIMIT);
    while ($r = $db->sql_fetchrow($result))
    {
        $topics[] = $r;
    }
   $db->sql_freeresult($result);
?>
<div>
<?
        
    foreach($topics as $t)
    {
        // Get folder img, topic status/type related information
        $topic_tracking_info = get_complete_topic_tracking($t['forum_id'], $t['topic_id']);
        $unread_topic = (isset($topic_tracking_info[$t['topic_id']]) && $t['topic_last_post_time'] > $topic_tracking_info[$t['topic_id']]) ? true : false;
        $folder_img = $folder_alt = $topic_type = '';
        topic_status($t, $t['topic_replies'], $unread_topic, $folder_img, $folder_alt, $topic_type);
        
        // output the link
        ?>
            <img style="vertical-align: text-bottom" src="<?=$user->img($folder_img, $folder_alt, false, '', 'src');?>" title="<?=$user->lang[$folder_alt];?>" alt="<?=$user->lang[$folder_alt];?>" />
            <a href="<?=$phpbb_root_path . 'viewtopic.php?f=' . $t['forum_id'] . '&amp;t=' . $t['topic_id'] . '&amp;p=' . $t['topic_last_post_id'] . '#p' . $t['topic_last_post_id'];?>"><?=html_entity_decode($t['topic_title']);?></a><br />
    <?
    }
    ?>
</div>

Last edited by gugu (2009-11-01 17:39:06)

Give the world the best you have, and the best will come to you.
Tutorials and Mods for VldPersonals  Add CometChat to your vldPersonals site

7

Re: 10 last forum posts on index

Thank you Gugu ! it looks nice.

If I want show last 10 topics titles in sidebar, where exactly should I insert these 2 parts of codes please ?

8

Re: 10 last forum posts on index

I should try this on my testsite and then I share it here ...

Last edited by gugu (2009-11-02 12:45:59)

Give the world the best you have, and the best will come to you.
Tutorials and Mods for VldPersonals  Add CometChat to your vldPersonals site

9

Re: 10 last forum posts on index

Nice, i wait so test results

10

Re: 10 last forum posts on index

it is possible to combine the header of vldpersonal with phpbb3 header so that you can see your user navbar and maybe that you have private messages or friends requests?

11

Re: 10 last forum posts on index

I think so ... but not sure .. but it is the same database so I think it should be possible ...

Give the world the best you have, and the best will come to you.
Tutorials and Mods for VldPersonals  Add CometChat to your vldPersonals site

12

Re: 10 last forum posts on index

Isnt there a code like : {news:limit=3,cache_time=0}
only for forum? like maybe: {forum:limit=10,cache_time=0}

?

13

Re: 10 last forum posts on index

Holger i think no and maybe because it supports multiple forum types and so would need one forum extension for each type of forum

14

Re: 10 last forum posts on index

ok ... thank you ... so i have to learn how to.

15

Re: 10 last forum posts on index

Holger you must do an extension for it.
vBulletin, phpBB2, phpBB3, punBB and Vanilla
has different solution to show last 10 topics ...
and to do an extension you need knowledge in php.

Give the world the best you have, and the best will come to you.
Tutorials and Mods for VldPersonals  Add CometChat to your vldPersonals site

16

Re: 10 last forum posts on index

Ok then i have to hire one who can do this for me ,-)

I use PunBB.

Gugu ... pleeeaaaase help ;-)

17

Re: 10 last forum posts on index

I have to check how others have fixed this with PunBB.
coming back and write here when I have a solution to this.

Give the world the best you have, and the best will come to you.
Tutorials and Mods for VldPersonals  Add CometChat to your vldPersonals site

18

Re: 10 last forum posts on index

I find this maybee it can give you an idea how to do.
and this I hope maybee someone here understanding how to do.
I´m only beginner at php coding ... so I google and find it is not a easy way to do it ...
better let people who can understanding it make it the right way wink

Last edited by gugu (2010-04-01 15:32:01)

Give the world the best you have, and the best will come to you.
Tutorials and Mods for VldPersonals  Add CometChat to your vldPersonals site

19

Re: 10 last forum posts on index

Just a suggestion. Why not use RSS to post the last 10 forums posts wherever you want. Simple, easy and it works.

20

Re: 10 last forum posts on index

Dont know how to work with rss

21

Re: 10 last forum posts on index

hello all,

how to display the latest forum posts phpbb 3.7
on the homepage.
I tried without success.

Thank you for your attention.

22

Re: 10 last forum posts on index

phpbb3 the newest version has brand new coding and I don´t know.
but then I know I will tell you about it ... we need it ...

Give the world the best you have, and the best will come to you.
Tutorials and Mods for VldPersonals  Add CometChat to your vldPersonals site

23

Re: 10 last forum posts on index

you can read this 1 ...
you can read this 2 ...

Last edited by gugu (2010-10-12 15:59:22)

Give the world the best you have, and the best will come to you.
Tutorials and Mods for VldPersonals  Add CometChat to your vldPersonals site

24

Re: 10 last forum posts on index

Gugu hello, thank you.
I've watched these pages.
I get to display on a page in php but not vld.
This gives me a blank page.

25

Re: 10 last forum posts on index

try to use iframe maybe it works ...
not the best solution but you can try it ...

Give the world the best you have, and the best will come to you.
Tutorials and Mods for VldPersonals  Add CometChat to your vldPersonals site