Requirement:
XThreads
Last Updated:
04 November 2012
XThreads already has Images Gallery and Video Gallery. Now, we will try to create Music Gallery
Here is a simple example (based on MyBB 1.4):
Custom Thread Fields Setting:
- Textbox for Artist:
Create a Custom Thread Fields with this settings:
- Title: Name
- Key: mscartist
- Applicable Forums: 'select a forum that we will apply for our Music Gallery'
- Editable by / Required Field?: Everyone (required)
Variable in template for displaying this field is: {$GLOBALS['threadfields']['mscartist']}.
- Textbox for Writer:
Create a Custom Thread Fields with this settings:
- Title: Writer
- Key: mscwriter
- Applicable Forums: 'select a forum above'
- Editable by / Required Field?: Everyone (required)
- Display Order: 2
Variable in template for displaying this field is: {$GLOBALS['threadfields']['mscwriter']}.
- Textbox for Arranged:
Create a Custom Thread Fields with this settings:
- Title: Arranged
- Key: mscarranged
- Applicable Forums: 'select a forum above'
- Editable by / Required Field?: Everyone (required)
- Display Order: 3
Variable in template for displaying this field is: {$GLOBALS['threadfields']['mscarranged']}.
- Listbox for Genre:
Create a Custom Thread Fields with this settings:
- Title: Genre
- Key: mscgenre
- Applicable Forums: 'select the forum above'
- Input Field Type: Listbox
- Field Input Height: 1
- Values List:
Modify it as our needs.
- Editable by / Required Field?: Everyone (required)
- Display Order: 4
- Allow Filtering: Yes
We will put the filtering URL manually in template.
- Listbox for Duration:
Create a Custom Thread Fields with this settings:
- Title: Duration
- Key: mscduration
- Applicable Forums: 'select the forum above'
- Input Field Type: Listbox
- Field Input Height: 1
- Values List:
Modify it as our needs.
- Editable by / Required Field?: Everyone
- Display Order: 5
- Allow Filtering: Yes
We put the filtering URL manually in template. We will try to "combine" it with Genre filtering URL and MyBB sorting thread in forumdisplay_threadlist template, using the $filters_set XThreads feature.
- Textbox for Music URL:
It's a bit hard for me to decide what player should be used for this. Finally, I've decided to use 1pixelout music player. So, this sample using 1pixelout music player. We need to download the player from 1pixelout.net. We will receive 2 file, 1 js file and 1 swf file. Pack it into one folder, call it player, and upload the folder to our forum root directory.
We will include the player in this field, With this way we can set which user group can play the music, via the Viewable by Usergroups feature.
In this sample, we need to upload the mp3 file to another file hosting which is allowing us to hotlink the file from their site. There are some free file hosting like this. The reason is, because I use free hosting, and most of free web hosting or shared hosting not allowing us to stream multimedia file directly from their web host, so, we need to host the file to another file hosting. That's why we don't use File input field type here.
Create a Custom Thread Fields with this settings:
- File Input for Artist Photo / Album Cover:
Create a Custom Thread Fields with this settings:
- Title: Artist Photo / Album Cover
- Key: mscpic
- Applicable Forums: 'select a forum above'
- Input Field Type: File
- Valid File Extensions: gif|png|jpg|jpeg
Modify it as our needs. It is the extensions of image that can be uploaded.
- Maximum File Size: 1048576
Modify it as our needs. It is a maximum file size (in bytes) that can be uploaded. In this example, 1 Mb.
- Editable by / Required Field?: Everyone (required)
- Display Order: 7
- Only accept uploaded images: Yes
- Image Thumbnail Generation: 120x90|160x120|280x210
We will put the image manually in template
- Multiline Textbox for Lyrics:
Create a Custom Thread Fields with this settings:
Edit the selected forum with this XThreads Options settings:
- Template Prefix: msc_
- Show first post on every showthread page: Yes
- Enable XThreads' Inline Forum Search: Yes
- Settings Overrides:
- Setting: Showthread Options -> Post Layout
Value: horizontal
- Hide Forum: Yes
We need to put this forum url manually in our templates (e.g: header template).
- Custom WOL Text:
- Forum Display: Viewing Music Gallery
- New Thread: Submitting A New Song
- New Reply: Commenting <a href="{1}">{2}</a> Song
- Show Thread: Listening <a href="{1}">{2}</a> Song
Now, we need to create new templates in Global Template.
Admin CP -> Templates & Style -> Templates -> Global Templates:
- Template Name: msc_forumdisplay_nothreads
- Template Name: msc_forumdisplay_searchforum_inline
- Template Name: msc_forumdisplay_sticky_sep
- Template Name: msc_forumdisplay_thread
- Template Name: msc_forumdisplay_threadlist
- Template Name: msc_forumdisplay_threadlist_rating
- Template Name: msc_forumdisplay_threads_sep
- Template Name: msc_forumdisplay_thread_modbit
- Template Name: msc_forumdisplay_thread_rating
- Template Name: msc_newthread
- Template Name: msc_postbit
- Template Name: msc_postbit_first
- Template Name: msc_showthread
- Template Name: msc_showthread_noreplies
- Template Name: msc_showthread_ratethread
Change Logs: 23 October 2011 -
7 October 2012
Screenshots:
1. Thread list. We have a simple "category level" here.
2. Showthread. In this page the player displayed.
Live Demo:
http://www.14.mynie.co.cc/forumdisplay.php?fid=34