This example will show you how to set up a gallery using XThreads, similar to the
gallery example here.
This should also give you a general idea of how most of XThreads works.
UPDATE: I've also added some additional comments in
gray to explain the reasoning behind some parts.
You may also want to see
RateU's category modification
- After activating XThreads, add a new forum which will be used as the gallery forum. Use the following XThreads options when adding this forum:
Template Prefix: gal_ [this will allow us to pull different templates for this forum]
Thread Grouping: 3 [we'll have 3 images per row in the forumdisplay]
Show first post on every showthread page: yes
Enable XThreads' Inline Forum Search: yes
Override Threads Per Page: 15 [a multiple of 3; will mean up to 5 rows every page]
Allow Blank Post Message: yes
Don't include this forum's threads/posts in global forum statistics: yes
Custom WOL Text:
- Forum Display: Viewing Gallery
- New Reply: Commenting on Gallery image <a href="{1}">{2}</a>
- Show Thread: Viewing Gallery image <a href="{1}">{2}</a> {3}
- Visit AdminCP -> Configuration -> Custom Thread Fields and add the following thread field (note, some of these may reveal themselves after selecting some values, so just set them in the order listed here):
Title: Image
Key: gal_img
Applicable Forums: select the gallery forum you just added in the step above
Input Field Type: File
Valid File Extensions: gif|png|jpg|jpeg|jpe
Maximum File Size: 2097152 [2MB; change if desired]
Editable by / Required Field?: Everyone (required)
Only accept uploaded images: yes
Image Thumbnail Generation: 160x120|320x240 [if you wish to change this, don't forget to update stuff in the templates below; you may also need to rebuild thumbnails]
- Go to AdminCP -> Templates & Style -> Templates -> Global Templates and add the following templates (title with code):
gal_forumdisplay_thread
gal_forumdisplay_group_sep [row separator]
gal_forumdisplay_threadlist
gal_forumdisplay_thread_null [this is used to fill remaining spots in a thread group, if any]
gal_postbit_first and gal_postbit_first_classic (use the same code for both templates)
gal_showthread
gal_search_results_threads_thread
- Go to your gallery forum and check that everything works correctly.
If you did get this working, congratulations
I admit, the templates that I put up there aren't the best, but I'm not really a designer, so perhaps you template gurus can make something more interesting (and I hope you are willing to share it with everyone!)