Announcement

Collapse
No announcement yet.

Thread Titles

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

  • Thread Titles

    As part of working on a new release of gbThreads that is more compatible with the new forums, I'm saving threads as a local file but have run into forum thread URLs that are giving me trouble. For example this forum link ... ...

    Code:
    https://forum.powerbasic.com/forum/user-to-user-discussions/powerbasic-for-windows/10253-word-excel-com-||-ddt-sdk-designer
    ... this title has the | symbol in it, which I cannot use in a PC file name.

    I'd like the local file name to be usable as the URL that I could put in a browser to call up the forum thread but it's now obvious how that would work for URLs with invalid PC filename characters.

    I could create a fake URL name to use for the file, then keep a table that then translates the file names to the true URL name, but would like to avoid that table if possible.

  • #2
    By experimentation, this URL ...

    Code:
    https://forum.powerbasic.com/forum/user-to-user-discussions/powerbasic-for-windows/10253-word-excel-com-||-ddt-sdk-designer
    ... can be accessed by using this URL ...

    Code:
    https://forum.powerbasic.com/forum/user-to-user-discussions/powerbasic-for-windows/10253
    It seems that the 10253 is all that is needed for the forum to display the URL, as though the longer URL name was entered.

    In the old forum, threads were literally numbered 1 to n. That made it easy to get a full set of threads.

    But in the new forum, that sequential numbering scheme is not used. But, it does seem that threads have a number (as the 10253 above), just not sequential numbers.

    Comment


    • #3
      It also appears that the new forum thread "10253" is the same thread of that name in the old forum. The old forum had about 50K threads and corresponding thread numbers of the same size.

      But the new forum thread numbers are sometimes much larger, such as "763585".

      I don't know the logic of the new forum thread number assignment, but it does introduce some gaps between old forum thread numbers and new forum thread numbers.

      Making it worse, the new forum doesn't seem to have simply a new starting thread number. Rather, it seems that the new forum new thread numbers can jump around - are not continuous from a new starting point.

      Comment


      • #4
        My guess is that the thread IDs are in (global) chronological order. Your three postings here are 782691, 782692, 782693.

        As for the invald charaters (for file names) in thread titles, there's a standard for this which might help you circumvent this: HTML charatcer encoding.

        Comment


        • #5
          Good morning, Knuth!

          Thanks for the link!

          One of the threads that I found was started by me and it had one of the invalid characters in the title. I"m certain I would not have done that.

          I've also seen thread titles with | and TAB characters in them, which I also find it hard to believe posters would have used.

          It leads me to believe that the forum software is a culprit, somehow, in adding the invalid characters, but I don't see why they would do that. There's some mystery afoot here!

          If it works reliably, then using the 782691-like numbers for downloading threads and setting the local file name will be the simpler approach, but having the thread title in the thread would be useful too. That means I'll have to do some character translation to get the thread titles into Windows-acceptable filename strings.

          Comment


          • #6
            You mean something like URL encoding?
            You can edit strOK to include other legal file name characters)

            Code:
            #COMPILE EXE
            #DIM ALL
            FUNCTION PBMAIN () AS LONG
            LOCAL strPlain AS STRING
                strPlain ="user-to-user-discussions/powerbasic-for-windows/10253-word-excel-com-||-ddt-sdk-designer"
                ?  URLENCODE(strPlain)
            END FUNCTION
            
            FUNCTION URLENcode(strIn AS STRING) AS STRING
                LOCAL strOut AS STRING
                LOCAL strChar AS STRING
                LOCAL strOK AS STRING
                LOCAL strTest AS STRING
                LOCAL i AS LONG
                strOK = "_ -. ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
                FOR i = 1 TO LEN(strIn)
                    strChar = MID$(strIn,i,1)
                    IF INSTR(strOK,strChar) THEN
                        strOut += strChar
                    ELSE
                        strOut += "%" & HEX$(ASC(strChar),2)
                    END IF
                NEXT
                FUNCTION = strOut
             END FUNCTION
            Returns:
            user-to-user-discussions%2Fpowerbasic-for-windows%2F10253-word-excel-com-%7C%7C-ddt-sdk-designer
            which is a valid file name and can be easily decoded back to the original string.

            Comment


            • #7
              Hi Stuart!

              No, I'm getting a list of thread URLs from Adam. Many of those thread names have the characters I mention above.

              I need to save the URL so that gbThreads can go to the URL. I had thought to save the threads using the URL name, but cannot do that because the URL has characters that cannot be used in a file name. I can remove the characters without any trouble, but then the file name would no longer serve as the URL to use in opening the thread.

              I was surprised that any of the thread URLs had the above-mentioned characters. I don't know why vBulletin does that, plus, I'm not sure that the original poster used those characters.

              Comment


              • #8
                Originally posted by Gary Beene View Post
                In the old forum, threads were literally numbered 1 to n. That made it easy to get a full set of threads.

                But in the new forum, that sequential numbering scheme is not used. But, it does seem that threads have a number (as the 10253 above), just not sequential numbers.
                Every post gets a unique and sequential number. The thread number is just the post number for its first post.
                Dan

                Comment


                • #9
                  Hi Dan!
                  Yep, it appears that what you say is true, just not sequential numbers. Knuth noted that successive threads do seem to get sequential thread numbers, at least starting with the new 6 digit new forum thread numbers.. I'll look to see if all new forum threads do that and will look to find the starting thread number for the new forum.

                  I also haven't checked to see if the old forum thread number was carried over to the new forum. Adam does say that I can use the old number to access the same thread in the new forum. I just haven't yet compared the list he gave me to see if that is the only thread number used by the new forum, or if the forum has a new number and also carries the old one.

                  I'll try to spend some time on this to check out all the connections as I'm working on the new gbThreads.

                  Comment


                  • #10
                    Originally posted by Gary Beene View Post
                    Knuth noted that successive threads do seem to get sequential thread numbers, at least starting with the new 6 digit new forum thread numbers.
                    My bad. I meant to say, as Dan Soper pointed out above, that each posting gets a global successive number, where the first posting of a (new) thread = the thread number.

                    Comment


                    • #11
                      I'm pretty sure that the forum uses a URL rewriting schema to add thread titles to the page URL, but the only important data point for the forum to understand the URL is the id number. For example, this thread has the URL:

                      https://forum.powerbasic.com/forum/u...-thread-titles

                      but if you put this in your address bar:

                      https://forum.powerbasic.com/forum/u...1-some-garbage

                      It still renders the page (and rewrites the URL). For gbThread purposes, I think you can just exclude/strip any bad characters without worry.
                      Bernard Ertl
                      InterPlan Systems

                      Comment

                      Working...
                      X