Skip to:
Content
Pages
Categories
Search
Top
Bottom

where is the problem? forum on wp page

  • @kikko088

    Member

    <table id=”latest”>

    <tr>

    <th>Forum</th>

    <th>Discussioni</th>

    <th>Messaggi</th>

    </tr>

    <?php

    global $wpdb;

    $query=”SELECT * FROM bb_forums WHERE topics!=0 ORDER BY forum_order ASC LIMIT 10″;

    $results=$wpdb->get_results($query);

    foreach ($results as $result) {

    echo “<tr><td>forum_id.”‘>”.$result->forum_name.”</td>”;

    echo “<td class=’num’>”.$result->forum_topics.”</td>”;

    echo “<td class=’num’>”.$result->forum_posts.”</td></tr>”;

    }

    ?>

    </table>

    why this code don’t display the number of discussions and posts?

    kikko088

Viewing 3 replies - 1 through 3 (of 3 total)
  • @mr_pelle

    Participant

    I suppose the first echo should read:

    echo "<tr><td>". $forum_id." > ".$result->forum_name."</td>";

    By the way, I suggest you to use double quotes for html tags (like you would do normally) and single quotes for php commands, unless you include vars in them. Like this: echo '<td class="num">';

    More details here.

    @kikko088

    Member

    thank you for the answer, I change the quotes but the problem persist :(

    kikko088

    @kikko088

    Member

    ps. the first line echo is

    echo “<tr><td> link of (bbpress/forum.php?id=”.$result->forum_id.”‘>”.$result->forum_name.”)</td>”;

    I SOLVED put $result->posts. instead $result->forum_posts.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar