Announcement

Collapse
No announcement yet.

hrefing to a particular post in a thread

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

  • hrefing to a particular post in a thread

    sorry for the cross post (from Templates) but this might end up requiring some PHP sleuthing I suspect, and its more likely (I hope ) to be read here.


    When I create a new post, I would like to be able to refer to some existing post (elsewhere, perhaps in a different thread), so the URL I will need to provide in my referring post is something like:


    http://www.yada.com/forum/showthread.php?threadid=999#post222

    Since this is hardly user-friendly to find out or type in, I want to modify my templates so the user can get that href info quickly. For example, I could put a little anchor around every posts $post[foldericon] (default is to the left of the date/time posted info)

    That way - at least in IE - a user can hover over the icon, right click, "copy shortcut" and paste the link into the referring post. E-Z.

    In order to do that, I have to modify the postbits template around the foldericon. Something like this:

    PHP Code:
    ...<a href="showthread.php?threadid=$threadid#post$post[postid]">$post[foldericon]</a$post[postdate]... 
    My problem is that the $threadid variable seems to be empty during postbits construction, so I get

    http://www.yada.com/forum/showthread.php?threadid=#post222

    Notice the missing threadid value ("999").

    1. what am I doing wrong or is there a workaround ?
    2. am I completely braindead and there is already another way of referencing another post directly (with #relative href) from within a new post ?

    Thanks !
    Robert
    Last edited by rseidl; Sat 6 Sep '03, 5:52pm.
    Canoma - software for creating realistic 3D models from photographs - forum - examples

  • #2
    I was told about something like this before. And all i can remeber was that not all variables are parsed in all templates. But im not to sure on the matter.

    Comment


    • #3
      If your using vB3, you could use the [post] bbcode

      Or for your solution to work, again with vB3 (i dont know if it will work with 2, but i think it will), Just use

      showthread.php?p=<postid>#p<postid>

      Maybe you could use $post[threadid]

      Comment


      • #4
        Try $thread[threadid]

        Comment


        • #5
          Freddie -
          if you mean

          PHP Code:
          ...<a href="showthread.php?threadid=$thread[threadid]#post$post[postid]">$post[foldericon]</a$post[postdate]... 
          That i tried and still gives me an empty:

          http://www.yada.com/forum/showthread.php?threadid=#post222

          I like the solution for vb3 though - is there anything that WON'T be in 3 ?

          Love it !

          Thanks - Robert

          BTW (off topic): Just saw in the demoforums. Some guy hijacked the thread display to redirect to another site. Interesting how that was done...embedding a refresh meta tag in the signature ? Seems like vb allows arbitrary HTML codes in sigs ? (Means one spoiler could mess up reading for everyone...)


          Canoma - software for creating realistic 3D models from photographs - forum - examples

          Comment


          • #6
            Originally posted by rseidl
            BTW (off topic): Just saw in the demoforums. Some guy hijacked the thread display to redirect to another site. Interesting how that was done...embedding a refresh meta tag in the signature ? Seems like vb allows arbitrary HTML codes in sigs ? (Means one spoiler could mess up reading for everyone...)
            Demo forums? HTML can be enabled or disabled in signatures, it is an option that the admin chooses.

            As for $thread[threadid], did you try $post[postid] ?

            Comment


            • #7
              I was referring to vB3...

              threadid should be available to you in the postbit template from $post[threadid]

              Comment


              • #8
                Doh, postid, threadid...

                $post[threadid]

                Comment


                • #9
                  vb3 is the way...

                  Thanks, guys.
                  Looks like vb3 is definetly the way to go. I am just getting into it and all the new stuff already makes me drool - it's a monster !

                  I know this is as annoying as your new mother in law asking whether your wife is pregnant yet, but is there an estimated "ship" date for a 3.0 final ?
                  Canoma - software for creating realistic 3D models from photographs - forum - examples

                  Comment


                  • #10
                    Originally posted by rseidl
                    Thanks, guys.
                    Looks like vb3 is definetly the way to go. I am just getting into it and all the new stuff already makes me drool - it's a monster !

                    I know this is as annoying as your new mother in law asking whether your wife is pregnant yet, but is there an estimated "ship" date for a 3.0 final ?
                    Dont think so, Beta 6 on Monday though

                    Comment

                    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                    Working...
                    X