Uutiset:

Wondering if this will always be free?  See why free is better.

Main Menu
Advertisement:

How to remove #new from 'latest topics' links?

Aloittaja Armada, kesäkuu 12, 2013, 10:41:21 AP

« edellinen - seuraava »

Armada

Hiya,

I'm using SSI.php to create a list of latest topics.

When I click on a new topic it takes me right to the end posting of that topic because the link has the #new at the end.

How do I get rid of that?

Thanks,
Armada
--- SMF Rocks even more than YabbSE---

Kindred

it doesn't take you to the end posting...  it takes you to the first post in the thread which is not marked as "read by you"
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Colin

"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Ricky.

you must be fetching latest post but not latest topics, if you fetch latest topics function then it should take you to latest topic only but not the latest post on that topic.

You should use :
ssi_boardNews($board = null, $limit = null, $start = null, $length = null, $output_method = 'echo')

Kindred

boardnews?  no, I don't think so.  That fetches the entire post

ssi_recentTopics();

However...   recentTopics AND recentPosts both include the #new
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Ricky.

Guess, you are right,  wanted to mention recentTopics(), however from recent topic, if he takes it as array, then can create url without #new thing.

Armada

--- SMF Rocks even more than YabbSE---

emanuele

Maybe knowing how you are using it would help quite a bit...
BTW I would do:
require_once('SSI.php');
$topics = ssi_recentTopics(WHATEVERYOUWANT, null, null, 'return');

foreach ($topics as $topic)
    echo '<a href="' . $scripturl . '?topic=' . $topic['topic'] . '.0'">' . $topic['subject'] . '</a>';


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Armada

Thanks for the help.

In the end, it was pretty easy.

I opened SSI.php and looked for the function ssi_recentTopics();

I then searched for ;topicseen#new and removed it.

Et voila!  :)
--- SMF Rocks even more than YabbSE---

Arantor

#new takes you to the first unread post in the topic... surely that's a good thing?
Holder of controversial views, all of which my own.


Armada

Yes, that's a brilliant thing if you want all users to jump to the very latest and last message of every post. I can see that's really useful for a list of latest replies,

I was asking how to remove this behaviour, because we're using it for a slightly different purpose - a list of latest active topics.

I prefer it so that users are taken to the top of the page to read some of the messages above it so that they could get the context of the latest reply. It saves having to scroll up each time.  :)

So, in reality it does become a list of "recent active Topics" rather than "recent replies". It also stops multiple replies on the same topic appearing on the list.

I suppose we all have our own preferences, and that makes things interesting.
--- SMF Rocks even more than YabbSE---

Arantor

Lainaus käyttäjältä: Armada - lokakuu 14, 2013, 09:34:37 AP
Yes, that's a brilliant thing if you want all users to jump to the very latest and last message of every post. I can see that's really useful for a list of latest replies,

Except if you read my post, that IS NOT WHAT IT DOES.

The whole point of #new is to go to the first post in a topic you have not yet read. That may be the last post in the topic. It frequently isn't, though.

If you haven't read the last two messages in a topic, you don't get pushed to the last one, you get pushed to the last one you haven't seen yet.

In fact there is still a 1/15 chance it still won't do what you want either ;)
Holder of controversial views, all of which my own.


Armada

#12
Yes, I did read your post, unfortunately it did not answer the question, it just explained what the behaviour of the #new was or what it did, and your reply was after I'd posted the solution myself, just in case it would help somebody.

It's not a critisism of the '#new' thing, chill, it's just I don't want it for the way we integrate the forum with our own pages.

Now we have a wonderful list that does the following:

1) It lists all the topics that have been most recently contributed to.
2) It does not duplicate the topics that has more than one reply.

When they click on a topic:
1) It takes people to the last page of the topic if there are multiple topics.
2) It takes people to the top of the page.

Perfect for us, 100%. :) It does exactly what I want now, thank you for your concern, it works like a charm.  :)
--- SMF Rocks even more than YabbSE---

Arantor

LainaaWhen they click on a topic:
1) It takes people to the last page of the topic if there are multiple topics.
2) It takes people to the top of the page.

Except it doesn't necessarily do that, which is the point. If the link has a .new in it as well, it will go to whichever page the last unread will be on, which could just as easily be the previous page in a multipage topic.
Holder of controversial views, all of which my own.


Armada

#14
Nope. To coin your own phrase, "If you'd read my last post" you would have seen:

Perfect for us, 100%. :) It does exactly what I want now, thank you for your concern, it works like a charm.  :)

Perfecto
--- SMF Rocks even more than YabbSE---

Advertisement: