Announcement

Collapse
No announcement yet.

Full URL of attachements at their location

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

  • Full URL of attachements at their location

    Where do I go to make it so attachments are linked to and displayed within the posts to have their full URL instead of being /images/attachments/IMAGE.jpg ? (Or whatever it really is.)

    Reason I ask is because depending on the directory they are displayed within on my site, I need the vB to be looking at them with the full URL of h ttp :// mysite . com /vbforums/yadda yadda yadda

    Just like how we can do it with Smilies by adding http: // site.com infront of the images/smilies/ that each smilie has by default.

    Get what I'm asking?

  • #2
    I think i get a bit of what you want.

    First question would be where are you storing your attachments? In the database or the filesystem?

    If it is filesystem they are all stored under the directory you have assigned for attachments. Under this directory, sub directories will be created based on the userid of the member that uploads the files. If your attachment directory is "files" for example, then aatachments stored for a member with userid "1234" would go into:
    ..../files/1/2/3/4/

    The attachments themself are named <attachementid>.attach. (ie 543.attach).

    Hope this answers your question.

    So there is actually no "full url" to the attachments, they are generated at run time by attachment.php
    Want to take your board beyond the standard vBulletin features?
    Visit the official Member to Member support site for vBulletin Modifications: www.vbulletin.org

    Comment


    • #3
      Someday I'll be a big boy and be able to ask big boy questions like all the other big boys.

      Okay, let me try this again and I appreciate your effort in helping my crap question.

      For example, a page at site.com/vb/page.php will show the image attachments just fine on a post.

      A page at site.com/page.php will display corrupted images because I'm guessing attachment.php only builds the file attachment's urls to be /files/1234/ as you stated above. So being that this image is being asked to display on site.com/ I need to make it so that all attached file urls are site.com/vb/ as their prefix so when they are called, they will be called as site.com/vb/files/1234/

      Similar thing takes place with the PostIcons and Smilies. But there they have an easy EDIT button in the AdminCP and I just tell vB that all Post Icons or Smilies are located at http://www.site.com/vb/images/smilies instead of their default value of just /images/smilies.

      That make a little more sense what I'm trying to do? If not I'll try again after your response.

      Comment


      • #4
        You still not answered the first question: Stored in Database or Filesystem?

        But i guess you are looking for something like:
        Code:
        echo "<img class=\"attach\" src=\"attachment.php?$session[sessionurl]attachmentid=10&amp;stc=1\" border=\"0\" alt=\"\" />";
        Where you ofcourse need to put the correct attachmentid.
        Want to take your board beyond the standard vBulletin features?
        Visit the official Member to Member support site for vBulletin Modifications: www.vbulletin.org

        Comment


        • #5
          Filesystem

          Originally posted by MarcoH64
          You still not answered the first question: Stored in Database or Filesystem?

          But i guess you are looking for something like:
          Code:
          echo "<img class=\"attach\" src=\"attachment.php?$session[sessionurl]attachmentid=10&amp;stc=1\" border=\"0\" alt=\"\" />";
          Where you ofcourse need to put the correct attachmentid.
          Sorry, filesystem.

          And I need that src=\" to read src=\"http://www.site.com/forums/attachement........

          Comment

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