Possible applications:
If you have a single selection profile field with predefined options that tell you something about the user then you can display images in the postbit based on the value the user has selected for that field. This is done using a template conditional.
Go to your:
Admin CP -> Styles & Templates -> Style Manager -> « » -> Postbit Templates -> postbit or postbit_legacy (depending on the layout you use)
Use code like this:
Where fieldX is the field number for the profile field as indicated in the:
Admin CP -> User Profile Fields -> User Profile Field Manager
Using fruits as an example, let's say the user selects banana from the profile field in their User CP. The above code would be activated because the user selected a value for that profile field, which would then display the img tag that ends up calling images/fruit/banana.gif.
Notice how the img src uses the value of the profile field to call the appropriate image. As long as the menu options are "one word" options (no spaces) this method should work fine.
The above example assumes you have uploaded the fruit images to the images/fruit directory.
- Display a logo for a user's favorite baseball team in their posts.
- User's religion.
- ...sex.
- ...favorite food.
- etc.
If you have a single selection profile field with predefined options that tell you something about the user then you can display images in the postbit based on the value the user has selected for that field. This is done using a template conditional.
Go to your:
Admin CP -> Styles & Templates -> Style Manager -> « » -> Postbit Templates -> postbit or postbit_legacy (depending on the layout you use)
Use code like this:
Code:
<if condition="$post['[color=red]fieldX[/color]']"> <img src="images/fruit/$post[[color=red]fieldX[/color]].gif" alt="$post[[color=red]fieldX[/color]]" border="0" /> </if>
Admin CP -> User Profile Fields -> User Profile Field Manager
Using fruits as an example, let's say the user selects banana from the profile field in their User CP. The above code would be activated because the user selected a value for that profile field, which would then display the img tag that ends up calling images/fruit/banana.gif.
Notice how the img src uses the value of the profile field to call the appropriate image. As long as the menu options are "one word" options (no spaces) this method should work fine.
The above example assumes you have uploaded the fruit images to the images/fruit directory.