Requirement:
XThreads
Last Updated:
23 October 2011
With XThreads, we can create a download system. Here is a simple example to do that:
1. First, we will create a file upload for our download system:
Create a Custom Thread Fields with this settings:
- Title: File Upload
- Key: fupload
- Description: Upload a file. You can choose uploading form your computer or from URL.
- Applicable Forums: 'select a forum that we will apply the download system'
- Input Field Type: File
- Valid File Extensions: rar|zip
Modify it as our needs.
- Maximum File Size: 1048576
Modify it as our needs. Like the title says, it is a maximum file size (in bytes) that can be uploaded.
- Editable by / Required Field?: Everyone (Required)
This Display Format will be replaced by Unviewable Value for not selected usergroup(s) in Viewable by Usergroups setting (new features in the newest version).
- Display Format:
To display the Display Format, later, we need put {$GLOBALS['threadfields']['fupload']['value']} variable into our template.
With these additional settings, we can set which usergroup(s) can view the download link. And then we can set what will be displayed for the usergroup(s) which is not allowed to view the download link. Very very useful features. Thank you very much, Yumi
Skip this settings if we didn't want to add the permission for the file:
- Viewable by Usergroups: 'Select usergroup(s) which is allowed to view the download link. CTRL + left click to select more than one usergroup'
- Unviewable Value:
This setting will be displayed if at least one usergroup selected in Viewable by Usergroups setting above.
The text above will replace the download link (in this example, we put it in Display Format) for usergroup(s) which is not selected in the Viewable by Usergroups setting.
2. Now, we will create a description for our download system:
Create a Custom Thread Fields with this settings:
- Title: Description
- Key: fdesc
- Description: Give a short description about the file.
- Applicable Forums: 'select the forum in point 1'
- Input Field Type: Multiline Textbox
- Maximum Text Length: 200
Modify it as our needs. It is a maximum characters for the description.
- Editable by / Required Field?: Everyone (Required)
- Display Order: 2
To display the Description, later, we need put {$GLOBALS['threadfields']['fdesc']} variable into our template.
3. Then, we will create a screenshot for our download system:
Create a Custom Thread Fields with this settings:
- Title: Screenshot
- Key: fscr
- Description: Upload a screenshot
- Applicable Forums: 'select the forum in point 1 or 2'
- Input Field Type: File
- Valid File Extensions: gif|png|jpg|jpeg
Modify it as our needs.
- Maximum File Size: 1048576
Modify it as our needs. Like the title says, it is a maximum image file size (in bytes) that can be uploaded.
- Editable by / Required Field?: Everyone (Required)
- Display Order: 3
- Only accept uploaded images: Yes
- Image Thumbnail Generation: 320x240|640x480
4. Now, we will create categories for our download system:
Create a Custom Thread Fields with this settings:
5. Now, XThreads Options in Forum settings (the forum in the settings 1, 2, 3 and 4 above):
- Template Prefix: dld_
- Enable XThreads' Inline Forum Search: Yes
- Override Threads Per Page: 5
Modify it as our needs.
6. Create new templates in Global Template:
- Template Name: dld_forumdisplay_threadlist
- Template Content:
- Template Name: dld_forumdisplay_threadlist_rating
- Template Content:
- Template Name: dld_forumdisplay_thread_rating
- Template Content:
- Template Name: dld_forumdisplay_thread
- Template Content:
- Template Name: dld_forumdisplay_threads_sep
- Template Content:
- Template Name: dld_forumdisplay_sticky_sep
- Template Content:
Screenshots:
There is no change for the screenshots. All the EDIT above will get the same layout.
1. User create a download thread:
2. User view the post:
3. Thread List:
I'm sorry for my English