Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Vanilla 2.1: How to remove the "#latest" from the end of discussion URLs?

When logged in, from the home page (discussions list) or the categories each discussion title if clicked takes you to the topic but it adds a "#latest" to the end of the URL. I know what its for, how do you remove it.

I would like the recent discussions links to never have "#latest" at the end.

Thanks,

Answers

  • 422422 Developer MVP
    edited February 2013

    wont that annoy users who partake in really long discussions ?

    There was an error rendering this rich post.

    KasperbusinessdadUnderDog
  • Any of these?

    grep -r "#latest" .
    ./applications/conversations/views/messages/popin.php:   <li class="Item" rel="<?php echo Url("/messages/{$Row['ConversationID']}#latest"); ?>">
    ./applications/conversations/views/messages/popin.php:         <b class="Subject"><?php echo Anchor($Subject, "/messages/{$Row['ConversationID']}#latest"); ?></b>
    ./applications/vanilla/views/discussion/embed.php:      $DiscussionUrl = DiscussionUrl($Discussion).'#latest';
    ./applications/vanilla/views/discussions/popin.php:            <b class="Subject"><?php echo Anchor($Row->Name, $Row->Url.'#latest'); ?></b>
    ./applications/vanilla/views/discussions/table.php:      $DiscussionUrl .= '#latest';
    ./applications/vanilla/views/discussions/table.php:   $LastPageUrl = DiscussionUrl($Discussion, FALSE).'#latest';
    ./applications/vanilla/views/discussions/helper_functions.php:      $DiscussionUrl .= '#latest';
    ./applications/vanilla/models/class.categorymodel.php:            $Row['LastUrl'] = DiscussionUrl($Discussion, FALSE, '//').'#latest';
    ./applications/vanilla/models/class.categorymodel.php:            SetValue('LastUrl', $Category, DiscussionUrl($LastDiscussion, FALSE, '//').'#latest');
    ./applications/vanilla/models/class.categorymodel.php:            SetValue('LastUrl', $Category, DiscussionUrl($LastDiscussion, FALSE, '//').'#latest');
    ./applications/vanilla/models/class.commentmodel.php:                   'LastUrl'           => DiscussionUrl($Discussion).'#latest'
    
  • hydnhydn New
    edited February 2013

    NVM. Found it in:

    /applications/vanilla/views/discussions/table.php

    So now the title goes to post #1 and if a reader wants the recent they simply click under where it says most recent post and that still links fo #latest.

  • 422422 Developer MVP

    In future you are on your own, as far as I am concerned dude.

    There was an error rendering this rich post.

    hydnfr3em1ndUnderDog
  • lol

    Kasper
  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    @hydn said:
    On forums you need to learn to answer the "question".

    If people were paid to answer questions maybe they would make more effort, specially for obscure questions that no other person has thought about because they may not use the forums in that way. Or the one asking the question is lacking in basic experience they need to learn the basics before asking questions that answers won't help them because they don't know how to implement them to begin with.

    It does get irritating when someone asks something so basic and that searching on the net gives them the answers they need. Why must we do the all research?

    It is not fair that someone gets angry because they are told they need to learn a bunch of stuff before they can get a useful answer. Those asking the question need to be prepared as well.

    People here are Willing Volunteers Users like you. Nobody is required to answer anything from anyone. If they do it is because they want to help. People here are not expected to know everything, even though most know quite a lot and kindly offer their knowledge and experience as best they can, because they want to not because they have to.

    This after all, is a Self-Help Forum. For Free Open Source Software .

    422UnderDog
  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    That says more than your rant.

    I don't see where it says more than my rant, lmao , and this one was a shorty ;)

    I guess self help works after all !

  • 422422 Developer MVP
    edited February 2013

    @vrijvlinder I agree

    Q. What's for dinner mum ?

    A. ( multi choice keeping in spirit )

    1. fish and chips
    2. have you done your home work
    3. you cannot be hungry, you only just had tea !
    4. why are you asking me you are 32 years old, and more than capable.

    Not every question, demands the obvious answer.

    All of the above are valid answers for the respondant, only one is valid to the enquirer

    There was an error rendering this rich post.

    UnderDog
  • jrgrandejrgrande New
    edited April 2016

    @hydn said:
    Any of these?

    grep -r "#latest" .
    ./applications/conversations/views/messages/popin.php:   <li class="Item" rel="<?php echo Url("/messages/{$Row['ConversationID']}#latest"); ?>">
    ./applications/conversations/views/messages/popin.php:         <b class="Subject"><?php echo Anchor($Subject, "/messages/{$Row['ConversationID']}#latest"); ?></b>
    ./applications/vanilla/views/discussion/embed.php:      $DiscussionUrl = DiscussionUrl($Discussion).'#latest';
    ./applications/vanilla/views/discussions/popin.php:            <b class="Subject"><?php echo Anchor($Row->Name, $Row->Url.'#latest'); ?></b>
    ./applications/vanilla/views/discussions/table.php:      $DiscussionUrl .= '#latest';
    ./applications/vanilla/views/discussions/table.php:   $LastPageUrl = DiscussionUrl($Discussion, FALSE).'#latest';
    ./applications/vanilla/views/discussions/helper_functions.php:      $DiscussionUrl .= '#latest';
    ./applications/vanilla/models/class.categorymodel.php:            $Row['LastUrl'] = DiscussionUrl($Discussion, FALSE, '//').'#latest';
    ./applications/vanilla/models/class.categorymodel.php:            SetValue('LastUrl', $Category, DiscussionUrl($LastDiscussion, FALSE, '//').'#latest');
    ./applications/vanilla/models/class.categorymodel.php:            SetValue('LastUrl', $Category, DiscussionUrl($LastDiscussion, FALSE, '//').'#latest');
    ./applications/vanilla/models/class.commentmodel.php:                   'LastUrl'           => DiscussionUrl($Discussion).'#latest'
    

    I remove #latest from this documents and update in my server but nothing happend. #latest appear again.
    What do you thing i did bad? Thank you

  • Other question realated.
    How can i change the discussions route in url?
    I changed the title of a discussion but the route in url is the same....

    Thnak you! :p

  • hgtonighthgtonight ∞ · New Moderator

    @jrgrande You can disable the automatic offset via a config setting now. No core hacking required: https://vanillaforums.org/discussion/comment/227053/#Comment_227053

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • jrgrandejrgrande New
    edited April 2016

    Thank you hgtonight

    I added $Configuration['Vanilla']['Comments']['AutoOffset'] = FALSE; to my config.php but Not work for me.
    "latest" appear yet

    Some idea How can i change the discussions route in url?

    Thank you!

  • R_JR_J Ex-Fanboy Munich Admin

    @jrgrande said:
    Some idea How can i change the discussions route in url?

    Maybe this is helpful for you: https://vanillaforums.org/discussion/31488/how-to-make-short-discussion-urls-for-vanilla

  • R_JR_J Ex-Fanboy Munich Admin
    edited April 2016

    O.o doublepost o.O

  • BleistivtBleistivt Moderator

    Why do you want to remove the "#latest" hash? It is not part of the canonical URL and doesn't have a SEO impact either way.

    Also, if you've done what was recommended above (February 2013) I recommend you revert your changes or reinstall vanilla. Don't change core files.

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP
    edited April 2016

    Gesundheit!

    R_J
  • jrgrandejrgrande New
    edited April 2016

    @Bleistivt said:
    Why do you want to remove the "#latest" hash? It is not part of the canonical URL and doesn't have a SEO impact either way.

    I want to start the reading of the discussion in the beginning B)

    Why if i change the title of the discussion the url of it not change too? ** [Sorry its ok. Cache problem]**

    I would like to remove the "#latest" url end... I changed it from all .php files in core, but still appearing :(

  • BleistivtBleistivt Moderator

    @jrgrande Then the AutoOffset = false setting should work.
    However it has been reported not working: https://github.com/vanilla/vanilla/issues/2469

    Note that #latest will jump to the latest unread post. Users (and guests) who haven't read the discussion will always start from the beginning.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited April 2016

    Note that #latest will jump to the latest unread post. Users (and guests) who haven't read the discussion will always start from the beginning.

    Maybe people are required to re-read the comments from the start. This might be handy for instructional discussions where people still ask the same questions over and over, however if they re-read the comments over and over, the number of uninformed would drop substantially ;)

    There may be room for a plugin that forces people to read and re-read from the start every time no matter what …. >:)

    K17
Sign In or Register to comment.