![]() |
Replacing text in a message with an HMTL snippet
I want to make certain words in messages on my forum be surrounded by HTML. For example, if a member types "magic" in to their message, that will be surrounded by (parsing) h2 tags automatically. Is this possible?
|
write a plugin to do a str_replace in the message. Do a search on that in these forums - the plugin has been posted before.
|
In postbit_display_complete:
Code:
$post['message'] = str_replace('magic', '<h2 class="emphasis">magic</h2>', $post['message']); Any idea how to make an h2 tag not start a new line? :p |
h2 tags are block display tags by definition. They will start a new line unless you change their definition in your css.
|
I was mostly joking. Is that possible? If so, how?
|
You modify the display property in your css for your h2 tags - http://www.w3schools.com/css/pr_class_display.asp
|
That did it. Thanks a bunch. :) And removing the automatic bolding added to h2 tags?
|
Same thing, modify the CSS.
|
Got it.
|
Quote:
Please tell me where and how to find postbit_display_complete? Can't find it in templates... I understand it's some hook but it's not clear for me how to work with it. |
All times are GMT. The time now is 11:32 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|