MyBB Hacks

Full Version: XThreads
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
It is right now, dunno what the problem was, it just get fixed by itself, maybe not.
Do you plan to add group permissions check in attachment downloads file?
(03-10-2012 02:09 PM)Sama34 Wrote: [ -> ]Do you plan to add group permissions check in attachment downloads file?
No.
Is there any reason why you need this?
I know your opinion about privatizing files for guests and so, but that doesn´t seen that good for example, when sharing private stuff in private forums.

I know once the users has downloaded the file, they can redistribute it again as much as they want, but, even so I wouldn´t like knowing anybody can download private files without restriction.
Fair enough.
Would randomising URLs every so often work for you?
(03-12-2012 09:59 AM)ZiNgA BuRgA Wrote: [ -> ]Fair enough.
Would randomising URLs every so often work for you?

That sounds better that nothing, to be honest Tongue
Well, you can try applying changes from this commit.
https://github.com/zingaburga/XThreads-M...https://github.com/zingaburga/XThreads-MyBB-Plugin/commit/d6a092b6aa1a4843c37feec973baa8

After that, edit cache/xthreads.php, and add to the bottom:

PHP Code:
/**
 * Expire attachment links after a certain period of time.  This may be useful if you wish to prevent users distributing direct links to attachments.
 * If non-zero, attachment links will change every n seconds (where n is the value below).  Note that actual link expiry will range from n to n*2 seconds.
 * Setting this value too low will cause links to be broken frequently.  You should also take into consideration download pausing, which may break if the download is resumed after the link expires.  A recommended number would be 43200 (12 hours)
 *  - if set to 43200, this means that links will expire 12-24 hours after the user sees it
 */
define('XTHREADS_EXPIRE_ATTACH_LINK', 43200);


/**
 * Tie download links to IP networks.
 * If non-zero, download links will vary depending on the IP address used to access the link.
 * The IP will be masked by the number of host bits you specify below.  For example, a value of 8 would mean that all 224.0.0.0/8 would get the same download link, which would be different to the link accessible from 225.0.0.0/8
 * A recommended number would be 16.  Do NOT set a value above 32.
 */
define('XTHREADS_ATTACH_LINK_IPMASK', 16);

It is working very nicely. Thanks one more time.
I don't quite undestand how the *postbit_first template works.

For example, doing this:
>Create/edit a forum
>Use some prefix (news_ for this example)
>Force postbit classic visual style for that forum
>Edit templates, add "news_postbit_first" and "news_postbit_classic". Leave "news_postbit_first" empty.

Now, in showthread, {$first_post} will show the first post, and {$posts} the rest. But both will use the news_postbit_classic" template, not the "news_postbit_first" and when you delete the "news_postbit_first" template, {$first_post} stop working and {4posts} will be used for all posts instead.

Maybe I don't understand how it works, but adding the ability to use "news_postbit_classic_first (and news_postbit_classic_*)" may help.
Are you using a conflicting plugin?

You just replace "postbit_" with "postbit_first_", so it's "news_postbit_first_classic", not the other way around.
Reference URL's