HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Is there a way to automatically embed links on the recent discussion page?
nicholaszen
New
Via the https://vanillaforums.org/addon/example-plugin, I can show excerpts at the discussion board and with a small adjustment in the plugin (credits to @clethrill) even HTML code works. But is there a way that YT and other links also automatically changes in the excerpts like in the real post.
Hope you understand, what I try to explain.
Thank you.
Tagged:
0
Comments
You probably want to pass the text thru
Gdn_Format::html()
before outputting it.Thank you @Linc, I found it because the direction you pointed me to.
I changed class.example.plugin.php line 192
echo wrap(sliceString(strip_tags($Sender->EventArguments['Discussion']->Body),$TrimSize), 'div', array(
to
echo wrap(sliceString(Gdn_Format::html($Sender->EventArguments['Discussion']->Body,$TrimSize->Discussion->Format)), 'div', array(
Can someone please point to me, how I can do the EXACT thing but in the categories?
If you click now on the category page, you will see the list of discussions of that certain category. But without the excerpts. I tried to change the example plugin above, but don't know which controller I need. I assume, it's something in the following part.
Thank you!
public function CategoriesController_afterDiscussionTitle_handler($Sender) {
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
or maybe
public function CategoryController_afterDiscussionTitle_handler($Sender) {
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
@vrijvlinder thank you very much!!! It's the first one:
Edit: uploading to the addons section
Notice: This plugin is not written by me, I just throw it in all together and trying not to mess up. It is based on the example plugin of the Vanilla staff and with help from @clethrill , @Linc & @vrijvlinder
You need to upload those into the add ons section... because they need to follow the guidelines...
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
Oh ic.. Shall I delete my previous post than?
Just delete the zip files by hitting the x upon edit post on the files. then go to the addons section and upload the new plugins
https://vanillaforums.org/addon/add
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
@vrijvlinder what does this mean?
/class.Categoryexcerpt.plugin.php: The addon's key is not the same as its folder name.
Here is example of how it must be, name of plugin must be the same as folder name of plugin.
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌