Main Menu
collapse

Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

User Info

Welcome Guest.
Please log in.

Who's Online

  • Dot Guests: 834
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]


NEED HELP? If you're looking for support with Simple Portal, look no further than the Support Board!

One recent post per topic in "recent posts"

Started by MarkoKg, May 02, 2013, 08:35:36 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MarkoKg

Hello there again :)

I know I'm a bit boring, but I have to ask as i didn't manage to deal with this myself, sorry.

So I'd like to have just one recent post per topic in "recent posts" block at portal. I tried to edit default SMFs' recent posts, and it works like i wanted. I did following changes:
./Sources/Subs-Recent.php
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
after that added:

LEFT JOIN {db_prefix}messages AS m2 ON (m.id_topic = m2.id_topic AND m.poster_time<m2.poster_time)


and after this:
ORDER BY m.id_msg DESC
I added this:

AND m2.id_msg IS NULL


That helped for recent posts in SMF but SP is using SSI function for recent posts block, and that one i can't manage to change.

Basically, If there's few posts in the same topic - only one should be listed in recent posts block if possible. Any suggestions?

[SiNaN]

Instead of Posts use Topics for Display option of the block. Recent topic is not a list of recently created topics but a list of recently updated topics. So it's exactly what you are looking for.
And slowly, you come to realize... It's all as it should be...

MarkoKg

Thanks for your answer Sinan.

I was looking for a way to have recent posts actually, but just to exclude multiple posts to be shwon in a row. So recent topics would not be the exact solution though.

[SiNaN]

Have you actually tried it? I'm pretty sure that's what you want. Can you try it and see what part of Recent Topics block does not behave as you want it to?
And slowly, you come to realize... It's all as it should be...

MarkoKg

Yes i tried that actually. I would like recet posts as i said, but just not to be more posts in a row when it's written in same topic. So i want current recent posts function with just exluded multiple posts from the same topic. As it could be done easely for forum recent posts (the one that is at the end of forum in stats) i guess that it's possible for this as well.

Thanks for trying to help man, i appreciate it.

[SiNaN]

Apply the following change to SSI.php and try Recent Topics block again:

Code (Find) Select
ms.id_msg = t.id_first_msg

Code (Replace) Select
ms.id_msg = t.id_last_msg
And slowly, you come to realize... It's all as it should be...

MarkoKg

Thank you once again Sinan! :)

I managed to do this after all. I'm not really sure what exactly i did, so i attached ssi.php file if anyone would need the similar change.

Mainly I do what you said in your last reply + changes from my first post. Actually second change is not possible as there is not
ORDER BY m.id_msg DESC in my ssi.php file, so i was looking to find just "m.id_msg" and then I put AND m2.id_msg IS NULL after that at few logical places though...

Now it's working somehow, so i'm more than happy.

Thank you once again Sinan for providing such a great support and for developing such a great software :)

[SiNaN]

And slowly, you come to realize... It's all as it should be...