Announcement

Collapse
No announcement yet.

Mark Channels Read Fix question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mark Channels Read Fix question

    I've implemented the code posted by Mark.B on Admin Ammo to mark channels read in a new tab I created called 'New Posts' which displays all the threads that have new activity over the last 24 hours.

    And - it works! (Update: Well, sort of - it appears to mark all posts everywhere as read rather than the ones displayed, which isn't really what was requested)

    There is only one problem - after using the new menu item you end up on the forum home page rather than staying on the same page. I'm sure it's something very simple! Any ideas/
    Last edited by imager; Tue 23 Jun '20, 7:51am.

  • #2
    Mark.B

    Usually you have to get help on customizations on the site that provides the customization. Hopefully Mark chimes in. I have no idea what you're talking about.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API - Full / Mobile
    Vote for your favorite feature requests and the bugs you want to see fixed.

    Comment


    • #3
      All this does is put back the Mark Channels Read link in to the navbar. It will mark the whole site read, and it will redirect you to the forum homepage, which is exactly what the original used to do.

      I don’t know how you would make it more nuanced or specific than what it is.

      The original was removed because it only did anything at all if you were on a channel page, yet it showed up everywhere.
      MARK.B | vBULLETIN SUPPORT

      TalkNewsUK - My vBulletin 5.6.2 Demo
      AdminAmmo - My Cloud Demo

      Comment


      • #4
        You can probably change the value in this line but I haven't tried it:

        Code:
        location.href = pageData.baseurl; //redirect to homepage
        You can try changing it to

        Code:
        location.reload
        I'm not where I can test this at the moment.

        Comment


        • imager
          imager commented
          Editing a comment
          Many thanks for the suggestion - it goes to /forum/function reload() {%20%20%20 [native code]} with the error: Invalid Page URL. If this is an error and the page should exist, please contact the system administrator and tell them how you got this message.

      • #5
        You can try something like:

        location.href = pageData.baseurl + "/node/" + pageData.nodeid;
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API - Full / Mobile
        Vote for your favorite feature requests and the bugs you want to see fixed.

        Comment


        • #6
          Personally, if it were my site...

          I would create a custom template with the contents of:

          <a href="#' class="js-markread">Mark Channel Read</a>

          Then attach it to a more prominent template hook if the link at the bottom of every channel page doesn't work for you. Adding to non-channel pages isn't really going to benefit anyone. Topics are marked read when you view them. Channels are marked read when all topics are viewed or you click the "mark channel read" link. The link has absolutely no affect on topics.
          Translations provided by Google.

          Wayne Luke
          The Rabid Badger - a vBulletin Cloud demonstration site.
          vBulletin 5 API - Full / Mobile
          Vote for your favorite feature requests and the bugs you want to see fixed.

          Comment


          • #7
            Originally posted by Wayne Luke View Post
            You can try something like:

            location.href = pageData.baseurl + "/node/" + pageData.nodeid;
            How do I identify the node value?

            Comment


            • #8
              Copy the line exactly as it is written.
              Translations provided by Google.

              Wayne Luke
              The Rabid Badger - a vBulletin Cloud demonstration site.
              vBulletin 5 API - Full / Mobile
              Vote for your favorite feature requests and the bugs you want to see fixed.

              Comment


              • #9
                Originally posted by Wayne Luke View Post
                Copy the line exactly as it is written.
                That takes you to this url: /forum/node/0 and an invalid url error.

                Comment


                • #10
                  Then something in the custom Javascript is preventing the pageData information from being used. You will have to discuss it with the original author if you can.
                  Translations provided by Google.

                  Wayne Luke
                  The Rabid Badger - a vBulletin Cloud demonstration site.
                  vBulletin 5 API - Full / Mobile
                  Vote for your favorite feature requests and the bugs you want to see fixed.

                  Comment


                • #11
                  The original script was Glenn's but sadly there's been no sign of him anywhere for a long while now.
                  MARK.B | vBULLETIN SUPPORT

                  TalkNewsUK - My vBulletin 5.6.2 Demo
                  AdminAmmo - My Cloud Demo

                  Comment


                  • imager
                    imager commented
                    Editing a comment
                    Ah, OK - I have been in touch with him on and off at his site.

                • #12
                  There are a couple of usual ways of going about redirecting jquery to the same page but I'm not willing or able to test them.

                  One is window.location.href;

                  Another is location.href;

                  Obviously, you don't want to redirect to the baseurl if you're trying to redirect to the same URL ...

                  I usually avoid this stuff like a plague because it's never as simple as you think it should be.

                  Glenn was on his own site two days ago but he's been very busy since his job promotion. I don't think he has much free time these days.

                  Comment

                  Related Topics

                  Collapse

                  Working...
                  X