Requirement:
XThreads
We will try to create a simple country list with XThreads. Maybe we can use this just for a country database/list, or discussion based on user's country.
Yeah, I know that maybe this is useless. But I just want to share it
Here is a simple way to do that:
- Forum settings:
- Default Sort By: Thread subject
- Default Sort Order: Ascending
- Template Prefix: xtcl_
- Thread Grouping: 3
- Show first post on every showthread page: Yes
- Enable XThreads' Inline Forum Search: Yes
- Override Threads Per Page: 21
- Hide Forum: Yes
We need to put this forum URL manually in our template (eg: header template).
- Don't include this forum's threads/posts in global forum statistics: Yes
- Custom WOL Text:
- Forum Display:
- New Thread: Adding a country to Country List
- New Reply:
- Show Thread:
- Custom Thread Fields Setting:
- Textbox for Capital:
- Title: Capital
- Key: xtlc_cap
- Applicable Forums: 'select our Country List forum'
- Editable by / Required Field?: Everyone (required)
- Display Format:
- Textbox for Language:
- Title: Language
- Key: xtlc_lang
- Applicable Forums: 'select our Country List forum'
- Editable by / Required Field?: Everyone (required)
- Display Order: 2
- Display Format:
- Textbox for Currency:
- Title: Currency
- Key: xtlc_cur
- Applicable Forums: 'select our Country List forum'
- Editable by / Required Field?: Everyone (required)
- Display Order: 3
- Display Format:
- Listbox for Continent:
- Title: Continent
- Key: xtlc_con
- Applicable Forums: 'select our Country List forum'
- Input Field Type: Listbox
- Field Input Height: 1
- Values List:
- Editable by / Required Field?: Everyone (required)
- Allow Filtering: Yes
- Display Order: 4
- Display Format:
- File input field type for Country Flag image:
- Title: Country Flag
- Key: xtlc_flag
- Applicable Forums: 'select our Country List forum'
- Input Field Type: File
- Valid File Extensions: jpg|jpeg|gif|png
Modify it as our needs. It is the extensions of image ext can be uploaded.
- Maximum File Size: 1048576
Modify it as our needs. It is a maximum file size (in bytes) that can be uploaded.
- Editable by / Required Field?: Everyone (required)
- Allow Filtering: Yes
- Display Order: 5
- Only Accept Image Files: Yes
- Image Thumbnail Generation: 120x90|240x180
- Display Format:
- New templates in Global Template.
Admin CP -> Templates & Style -> Templates -> Global Templates:
- xtcl_forumdisplay_group_sep
- xtcl_forumdisplay_nothreads
- xtcl_forumdisplay_searchforum_inline
- xtcl_forumdisplay_sticky_sep
Well, we need the <td> part to pass validator.
- xtcl_forumdisplay_thread
- xtcl_forumdisplay_threadlist
We put all continent filtering URL in this template. There is a img tag in each the continent filter. Modify the images URL and type as our needs.
- xtcl_forumdisplay_threads_sep
Again, we need the <td> part to pass the validator, if there is a global announcement and there is no sticky thread in this forum.
- xtcl_forumdisplay_thread_null
- xtcl_postbit_first and xtcl_postbit_first_classic
- xtlyrics_forumdisplay_sticky_sep
- xtcl_showthread
- xtcl_showthread_noreplies
Well, that is our simple Country List. Many information should be added to each country I think. But in this example, I only add Capital, Currency, Continent and Language.
Please tell me if I had made a mistake in the code above. I'm still learning
Screenshot:
Showthread:
Threadlist:
Live Demo:
http://www.14.mynie.co.cc/forumdisplay.php?fid=47