MyBB Hacks

Full Version: Downloads Permissions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
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.
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?
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]

Thank you; I have added that to my site and I will see how it goes.
Reference URL's