1 (edited by bingiman 2008-01-12 18:12)

Topic: I am a bit consufed with the Moved feature in punBB

I am trying to figure out exactly how this works. If I move a post why is it I don't see the text moved next to it. The only time I see it is in the mod_active_topics that I use on my index. I even tried a fresh install of pun and I still don't see it. In my case I use images for all so if I can see an image for $icon_type = 'icon inew';
then why I can I see one for: $icon_type = 'icon imoved';? Maybe someone can shed some light on this for me. This is extremely confusing.

update: The only way I can see the icon is if I checge this:

if ($cur_topic['moved_to'] != 0)

to:

if ($cur_topic['moved_to'] != 1)

Thanks
Bingiman.

Re: I am a bit consufed with the Moved feature in punBB

Moved: is for redirect topics.

Re: I am a bit consufed with the Moved feature in punBB

Ok, so by that what do you mean exactly? Isn't it the same as if I moved a topic from Forum #1 to Forum #2? I don't see the difference in what I posted and your response.

Re: I am a bit consufed with the Moved feature in punBB

When you move a topic, there is a checkbox. It says "Leave redirect topic(s)." If you keep that box checked, not only is the original topic moved from Forum 1 to Forum 2 but a new topic is created in Forum 1 that redirects to the topic in its new location. It is called a redirect topic.

5 (edited by bingiman 2008-01-12 19:22)

Re: I am a bit consufed with the Moved feature in punBB

Ok, I understand that, but if I do not check it shouldn't it still show as a moved topics with the text Moved: Also, why in my case it does not display an icon?

Isn't this correct:

tr.imoved div.icon {
background-image:url(../../img/ShowcaseII/moved.png);
background-repeat:no-repeat;
}

Also, why does it only show Moved: in the mod_active_topics I am using on the front page. How else would I have seen the Moved: if I weren't using this mod? I don't see it in viewforum.

Re: I am a bit consufed with the Moved feature in punBB

In the original version of my viewforum I had the following codE:

        // Without "the dot"
    $sql = 'SELECT t.id, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to, question, rating, labels, icon_topic, p.poster_id AS last_poster_id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON (p.id=t.last_post_id) WHERE forum_id='.$id.' ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'];

but then I had help from Smartys to modify it to view the user profile as a link and this is the new query.

        // Without "the dot"
        $sql = 'SELECT id, poster, subject, posted, last_post, last_post_id, last_poster, num_views, num_replies, closed, sticky, moved_to, question, rating, icon_topic, labels FROM '.$db->prefix.'topics WHERE forum_id='.$id.' ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'];

Now, the problem I am having is that I can no longer see the Moved topics on the viewform. If however I use the old query then it works as it should. How can I modify it so that I can see the Moved topics?

Thank for the help.
Bingiman

Re: I am a bit consufed with the Moved feature in punBB

I can't imagine I ripped out all of that code from the SQL, are you sure I helped you? wink

$sql = 'SELECT t.id, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to, t.question, t.rating, t.icon_topic, t.labels, p.poster_id AS last_poster_id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON (p.id=t.last_post_id) WHERE forum_id='.$id.' ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'];

Try this, I just merged the two queries.

8 (edited by bingiman 2008-01-13 03:23)

Re: I am a bit consufed with the Moved feature in punBB

I am pretty sure it was you. I don't recall anyone else helping me with it. Anyway, I tried that but it still doesn't display the Moved topic.

This is the one I am using now:

    $sql = 'SELECT t.id, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to, question, rating, labels, icon_topic, p.poster_id AS last_poster_id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON (p.id=t.last_post_id) WHERE forum_id='.$id.' ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'];

Re: I am a bit consufed with the Moved feature in punBB

bingiman wrote:

Ok, I understand that, but if I do not check it shouldn't it still show as a moved topics with the text Moved:

No. The topic remains as is if it's not a redirect topic. Does that answer your question?

You might also have edited the code in viewforum.php that deals with redirect topics. Check that.

Re: I am a bit consufed with the Moved feature in punBB

Well, Once I copy the code shown in post #6 it displays the Moved to: but once I use the one in post #6 (bottom) it doesn't work. So the problem has to be in that sql area.

Re: I am a bit consufed with the Moved feature in punBB

Aha. Change the inner join to a left join.

However, neither of the two queries you posted are standard PunBB queries. Just so you know.

12 (edited by bingiman 2008-01-13 03:51)

Re: I am a bit consufed with the Moved feature in punBB

Wow! That did it...

Thank you very much Smartys. You always save the day. smile

Update: I know that they aren't standard queries. That's why I mentioned that you helped me to modify it.