Jump to content

Recommended Posts

Posted

hi!

Can someone replace the code from punbb to smf but it make the same job please?

<?php
            // Get all topics
            $query = array(
             'SELECT' => 't.id, subject, t.last_post, forum_id',
             'FROM'  => 'topics AS t',
             'JOINS'  => array(
                    array(
               'INNER JOIN' => 'forums AS f',
               'ON'  => 'f.id = t.forum_id'
                    )
                ),
             'ORDER BY' => 't.posted DESC',
             'LIMIT'  => '0,10'
            );

            $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
            if (!$forum_user['is_guest'])
            $tracked_topics = get_tracked_topics();


            while ($cur_topic = $forum_db->fetch_assoc($result))
            {
                echo '<li>';

                if (!$forum_user['is_guest'] && $cur_topic['last_post'] > $forum_user['last_visit']
                    && (!isset($tracked_topics['topics'][$cur_topic['id']]) || $tracked_topics['topics'][$cur_topic['id']] < $cur_topic['last_post'])
                    && (!isset($tracked_topics['forums'][ $cur_topic['forum_id'] ]) || $tracked_topics['forums'][ $cur_topic['forum_id'] ] < $cur_topic['last_post']))
                echo ' ';
                else
                echo ' ';
                echo '<a href="'.forum_link($forum_url['topic'], array($cur_topic['id'], sef_friendly($cur_topic['subject']))).'">', $cur_topic['subject'], '</a>';

                echo '</li>';
            }

            ?>

 

Thanks in advance!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...