Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Downloads Permissions
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #1
Downloads Permissions
So, two years later and I am back with a question about downloading files.

add option to expire attachment links and/or tie them to IP address ranges; enable in cache/xthreads.php (requested by Sama34)

(04-09-2012 01:56 PM)leefish Wrote:  Zinga - sorry to reask the question: but these dynamic urls will only affect images links where I link directly to the "real" image url rather than a specified thumbnail? Will it still show the thumbnails?

Example: {$GLOBALS['threadfields']['pfapic2']['value']}  <- That image would not be affected? pfapic is my threadfield key.

(04-09-2012 03:25 PM)ZiNgA BuRgA Wrote:  Yes, if you reference the image through an XThreads function/variable, it will always work.

I was considering doing this with my sims downloads (making the url variable) because I am having problems with hotlinking. However, I am still worried about my images. My users often put a big picture in their posts and am I right in thinking that if I was to implement this then all the images in posts (using mybb code) would break?  Is there any way to make this function not change the url to an image file?


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 05-29-2014 02:22 PM by leefish.)
05-29-2014 12:37 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Online
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: Downloads Permissions
I'm not sure whether using an image bbCode tag is the correct way to go about it.  For example, if the image is changed in any way, the URL gets changed too, so, not really ideal.
MyBB's solution to use something like [attachment=id] makes a bit more sense.
Would likely require at least some conditionals to perform replacements and existing posts would need to be manually ported across...

Though if all you care about is preventing hotlinking, it makes more sense to configure the webserver to perform the block rather than do something with PHP.

My Blog
05-30-2014 12:18 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #3
RE: Downloads Permissions
Well, i would like to solve it. I have a lot of posts, the only place where I really use the actual image url is in the shadowbox and the posts. I must admit I never realised that just by knowing the attachment url my files could be linked to from outside my site. How can I prevent that server side? Is it htaccess?


[Image: leelink.gif]
MYBB1.6 & XThreads
05-30-2014 02:16 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Online
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #4
RE: Downloads Permissions
For Apache, yes.
Quick web search: http://altlab.com/htaccess_tutorial.html

For the above example, you'll need to change the RewriteRule (last line) to cover the XThreads attachment script, which depends on how the URL is structured, eg

Code:
RewriteRule ^/path_to_forum/xthreads_attach\.php http://i.imgur.com/qX4w7.gif [L]


My Blog
05-30-2014 04:45 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #5
RE: Downloads Permissions
Thank you; I have added that to my site and I will see how it goes.


[Image: leelink.gif]
MYBB1.6 & XThreads
06-02-2014 03:02 AM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: