Requirement: XThreads
This is just a very simple example for creating a Computer Specs section on our forum, based on the other XThreads example applications.
There are many fields that can be added to the Computer Specs. In this example applications, we use the basic specs only. So, modify it as our needs.
Create/edit a forum:
AdminCP -> Forums & Posts -> Forum Management:
- Template Prefix: compspecs_
- Language File Prefix: compspecs_
- Show first post on every showthread page: Yes
- Enable XThreads' Inline Forum Search: Yes
- Allow Blank Post Message: Yes
Create a Custom Thread Fields:
AdminCP -> Configuration -> Custom Thread Fields
- Listbox for Type
- Listbox for Processor
- Textbox for Processor Series
- Title: Processor Series
- Key: compspecs_procseries
- Applicable Forums: select our Computer Specs forum
- Input Field Type: Textbox
- Editable by / Required Field?: Everyone (required)
- Display Order: 3
- Hide Input Field: Yes
- Textbox for Processor Frequency
- Title: Frequency
- Key: compspecs_procfreq
- Applicable Forums: select our Computer Specs forum
- Input Field Type: Textbox
- Maximum Text Length: 5
- Field Input Width: 5
- Editable by / Required Field?: Everyone (required)
- Display Order: 4
- Underlying Data Type: Float
- Text Mask Filter: Number (real)
- Hide Input Field: Yes
- Listbox for Chipsets
- Textbox for Chipsets Series
- Title: Chipsets Series
- Key: compspecs_chipsetsseries
- Applicable Forums: select our Computer Specs forum
- Input Field Type: Textbox
- Editable by / Required Field?: Everyone (required)
- Display Order: 6
- Hide Input Field: Yes
- Textbox for Memory Size
- Title: Memory Size
- Key: compspecs_memsize
- Applicable Forums: select our Computer Specs forum
- Input Field Type: Textbox
- Maximum Text Length: 3
- Maximum Text Length: 3
- Editable by / Required Field?: Everyone (required)
- Display Order: 7
- Underlying Data Type: Integer (unsigned)
- Text Mask Filter: Digits
- Hide Input Field: Yes
- Textbox for Memory Frequency
- Title: Memory Frequency
- Key: compspecs_memfreq
- Applicable Forums: select our Computer Specs forum
- Input Field Type: Textbox
- Maximum Text Length: 10
- Maximum Text Length: 10
- Editable by / Required Field?: Everyone (required)
- Display Order: 8
- Display Format:
- Underlying Data Type: Integer (unsigned)
- Text Mask Filter: Digits
- Hide Input Field: Yes
- Listbox for Memory Type
- Listbox for Graphics
- Textbox for Graphics Series
- Title: Graphics Series
- Key: compspecs_graphicsseries
- Applicable Forums: select our Computer Specs forum
- Input Field Type: Textbox
- Editable by / Required Field?: Everyone (required)
- Display Order: 11
- Hide Input Field: Yes
- Textbox for Graphics Memory
- Title: Graphics Memory
- Key: compspecs_graphicsmemory
- Applicable Forums: select our Computer Specs forum
- Input Field Type: Textbox
- Maximum Text Length: 10
- Maximum Text Length: 10
- Editable by / Required Field?: Everyone (required)
- Display Order: 12
- Display Format:
- Underlying Data Type: Integer (unsigned)
- Text Mask Filter: Digits
- Hide Input Field: Yes
- Textbox for Hard Drives
- Title: Hard Drives
- Key: compspecs_hd
- Applicable Forums: select our Computer Specs forum
- Input Field Type: Textbox
- Maximum Text Length: 10
- Maximum Text Length: 10
- Editable by / Required Field?: Everyone (required)
- Display Order: 13
- Display Format:
- Underlying Data Type: Integer (unsigned)
- Text Mask Filter: Digits
- Hide Input Field: Yes
- Textbox for RPM
- Title: RPM
- Key: compspecs_hdrpm
- Applicable Forums: select our Computer Specs forum
- Input Field Type: Textbox
- Maximum Text Length: 10
- Maximum Text Length: 10
- Editable by / Required Field?: Everyone (required)
- Display Order: 14
- Display Format:
- Underlying Data Type: Integer (unsigned)
- Text Mask Filter: Digits
- Hide Input Field: Yes
- File for Computer Picture
- Title: Picture
- Key: compspecs_picture
- Applicable Forums: select our Computer Specs forum
- Input Field Type: File
- Valid File Extensions: jpg|jpeg|gif|png
- Maximum File Size: 204800
Modify it as our needs.
- Editable by / Required Field?: Everyone
Modify it as our needs. Select Everyone (required) if we want to force user to upload an image.
- Display Order: 15
- Only Accept Image Files: Yes
- Image Thumbnail Generation: 120x90|160x120
- Blank Replacement Value:
- Display Format:
Now, we need to create new templates in Global Template.
Admin CP -> Templates & Style -> Templates -> Global Templates:
- compspecs_postbit_first
- compspecs_newthread
- compspecs_forumdisplay_threadlist
- compspecs_forumdisplay_thread
- compspecs_editpost_first
- compspecs_forumdisplay_searchforum_inline
- compspecs_postbit_first_classic
Additional Info:
- We use language prefix for this (attached). Upload it to our inc/languages/english folder.
- The templates above based on MyBB 1.6.8 templates.
That's the basic. Just modify it as our needs.
Please tell me if there is something wrong with the code above. I'm still learning.
Screenshots:
1. Newthread / Editpost:
2. Thread List:
3. Showthread: