11-24-2010, 05:28 AM
This is a simple way how to create a custom style for thread.
Similar to http://mybbhacks.zingaburga.com/forumdisplay.php?fid=25
Create custom thread fields:
Example full forumdisplay_thread template, based on the default 1.4 and 1.6 forumdisplay_thread template:
1.4:
Similar to http://mybbhacks.zingaburga.com/forumdisplay.php?fid=25
Create custom thread fields:
- Textbox for Thread background Color:
- Title: Background Color
- Key: xtcstyle_btc
- Description: Color name (eg red) or hexadecimal representation (eg #FF0000)
- Applicable Forums: Select forum where this application will be applied
- Input Field Type: Textbox
- Maximum Text Length: 7
- Field Input Width: 9
- Editable by / Required Field?: Everyone
Modify it as our needs. If only some usergroups allowed to use it, select Custom (specify usergroups), and select those usergroups in Editable by Usergroups setting. - Display Format:
Code:
background-color: {VALUE};
- Text Mask Filter: Color Value
- Textbox for Thread Title Color:
- Title: Title Color
- Key: xtcstyle_tc
- Description: Color name (eg red) or hexadecimal representation (eg #FF0000)
- Applicable Forums: Select the forum above
- Input Field Type: Textbox
- Maximum Text Length: 7
- Field Input Width: 9
- Editable by / Required Field?: Everyone
Modify it as our needs. If only some usergroups allowed to use it, select Custom (specify usergroups), and select those usergroups in Editable by Usergroups setting. - Display Order: 2
- Display Format:
Code:
color: {VALUE};
- Text Mask Filter: Color Value
- Edit forumdisplay_thread template. For each td tags there, insert this code:
Code:style="{$GLOBALS['threadfields']['xtcstyle_btc']}"
And insert this code for the Thread Link tag:
Code:style="{$GLOBALS['threadfields']['xtcstyle_tc']}"
- Edit forumdisplay_thread_rating template. Insert this code to the td tag there:
Code:style="{$GLOBALS['threadfields']['xtcstyle_btc']}"
Example full forumdisplay_thread template, based on the default 1.4 and 1.6 forumdisplay_thread template:
1.4:
HTML Code
|
1.6:
HTML Code
|
Example full forumdisplay_thread_rating template, based on the default 1.4 and 1.6 forumdisplay_thread_rating template:
1.4:
HTML Code
|
1.6:
HTML Code
|
That is the simple example. We can add more style properties for the thread if we want. Just modify it.