10-24-2010, 06:18 AM
Requirement: XThreads
Just for XThreads users who want to achieve this with XThreads.
File field type for Image Upload.
Create a new custom thread fields with this settings:
It should be enough as a basic settings. If we want to enhance it a bit, try to play with the Blank Replacement Value, Viewable by Usergroups and Unviewable Value settings.
Now, open up our forumdisplay_thread template. Find:
1.4:
Just for XThreads users who want to achieve this with XThreads.
File field type for Image Upload.
Create a new custom thread fields with this settings:
- Title : Thread Image
- Key : timg
- Description: Max file size: 10 KB. Max image size: 200x200. Min Image Size: 75x75. Image allowed: GIF, JPEG, PNG.
Modify it as our needs. Depends on some settings bellow. - Applicable Forums : Select forum(s) where this will be applied
- Input Field Type : File
- Valid File Extensions : gif|png|jpeg|jpg
- Maximum File Size : 1280
Modify it as our needs. This is the maximum file size for image can be uploaded. ( in bytes). Related to the Description setting. - Editable by / Required Field? : Select which usergroup can use this feature. If more than one usergroups allowed to use this feature, but not for all usergroups, select Custom (specify usergroup). This will bring the additional setting:
- Editable by Usergroups : Select which usergroup can use this feature
- Editable by Usergroups : Select which usergroup can use this feature
- Only Accept Image Files : Yes
- Minimum Image Dimensions : 75x75
Modify it as our needs. It is the smallest image dimension can be uploaded. Related to the Description setting. - Maximum Image Dimensions : 200x200
Modify it as our needs. It is the largest image dimension can be uploaded. Related to the Description setting. - Image Thumbnail Generation : 75x75
Modify it as our needs. It is the thumbnail size that will be displayed in threadlist. Related to Display Format setting bellow. - Display Format :
HTML Code<a href="{URL}" target="_blank"><img src="{URL}/thumb75x75" alt="{FILENAME}" title="Click to view this thread image in full size - {$GLOBALS['threadfields']['timg']['dims']['w']} x {$GLOBALS['threadfields']['timg']['dims']['h']}" style="margin: 3px; float: left;" /></a>
If we modify the Image Thumbnail Generation setting with different thumbnail size, change this part of the code above:
Code:75x75
It should be enough as a basic settings. If we want to enhance it a bit, try to play with the Blank Replacement Value, Viewable by Usergroups and Unviewable Value settings.
Now, open up our forumdisplay_thread template. Find:
1.4:
HTML Code
|
1.6:
HTML Code
|
Add this variable at the beginning of the code above:
Code:
|
That template edit should be enough as a basic. If we want to enhance it a bit, try to play more with the forumdisplay_thread template, and maybe (additional) forumdisplay_threadlist template, and combine it with our custom thread fields settings.