SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Addict racerman28's Avatar
    Join Date
    Oct 2004
    Location
    Los Angeles, CA
    Posts
    399
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    want to show forum topics on home page...how?

    Hello,

    I'm looking for a script or plugin to show the latest forum posts and/or topics on my Wordpress homepage.

    If anyone has any info on this I'd appreciate it.

    Thanks.

    Kenneth

  2. #2
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,426
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    It would be helpful for others to know what forum software you are using.

  3. #3
    SitePoint Addict racerman28's Avatar
    Join Date
    Oct 2004
    Location
    Los Angeles, CA
    Posts
    399
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    stymiee,

    Ah, good idea!

    I am using PHPbb Version 2.0.21 forum software.

  4. #4
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,426
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    This query will pull the latest posts:

    Code:
       SELECT t.*
            , u.username
            , u.user_id
            , u2.username as user2
            , u2.user_id as id2
            , p.post_username
            , p2.post_username AS post_username2
            , p2.post_time
            , f.forum_name
            , f.auth_view
         FROM phpbb_topics t
            , phpbb_users u
            , phpbb_posts p
            , phpbb_posts p2
            , phpbb_users u2
            , phpbb_forums f
        WHERE t.topic_poster = u.user_id
          AND p.post_id = t.topic_first_post_id
          AND p2.post_id = t.topic_last_post_id
          AND t.forum_id = f.forum_id
          AND u2.user_id = p2.poster_id
          AND f.auth_view = 0
     ORDER BY t.topic_last_post_id
         DESC
        LIMIT 5
    You can see how I used it at the bottom of my merchant account site. I have it set to 5 posts but it can get more if you'd like.

  5. #5
    SitePoint Addict racerman28's Avatar
    Join Date
    Oct 2004
    Location
    Los Angeles, CA
    Posts
    399
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    stymiee,

    I have a feeling there is more than just pasting this code in. I tried and it didn't work. Do you have any experience with Wordpress?

  6. #6
    SitePoint Wizard bronze trophy bigalreturns's Avatar
    Join Date
    Mar 2006
    Location
    The Wirral, England
    Posts
    1,294
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by racerman28
    stymiee,

    I have a feeling there is more than just pasting this code in. I tried and it didn't work. Do you have any experience with Wordpress?
    A couple of ideas,
    1) Did you just paste the code, or did you then use (for example) PHP to output what data has been retrieved? Eg below would echo each thread title on a new line.

    PHP Code:
    $query=//stymiees post;
     
    $result=mysql_query($query);
     WHILE (
    $row=mysql_fetch_assoc($result)) {
     echo (
    $row['posttitle'] . "<br />"); //not sure what posttitle should be as I'm not familiar with phpbb database structure
     

    2) Is your phpbb database separate to your wordpress one? If so then you need to select the correct database first. Eg.

    PHP Code:
    mysql_select_db ("yourphpbbdatabasename"); 
    "The proper function of man is to live - not to exist."
    Get a Free TomTom


  7. #7
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,426
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by racerman28
    stymiee,

    I have a feeling there is more than just pasting this code in. I tried and it didn't work. Do you have any experience with Wordpress?
    That was just a database query for getting the data from the phpbb database. The code from bigalreturns should give you an idea of how to implement it.

  8. #8
    SitePoint Zealot nikola8's Avatar
    Join Date
    Jun 2006
    Posts
    133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try this:
    http://www.afsvlaanderen.be/topics_a...e/download.php

    i'm using it few months and works fine


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •