By Avi on Thursday, 20 February 2020
Replies 12
Likes 0
Views 4.9K
Votes 0
Dear Team,
which files/DB tables i should modified in order to allow creation of new post type and allow HTML tags inside it.
I've created API to automatic post, posts under a specific user on the site.

What I'm trying to achieve now, is to allow HTML tags inside such posts. I've notice that blog post type, allow HTML code inside it.
so I want to create new post type, called dog_updates. it will be used by my API, and I want to allow HTML tags inside it.

How I can achieve that?
Hi Avi,

Sorry, I do not quite get you here, may I know which component that you referring this to?
I believe you are referring to EasyDiscuss yes?
Perhaps, you can use another editor(eg: codemirror) in order to use html tags inside the composer https://www.screencast.com/t/lcI5UgalUPEQ
·
Friday, 21 February 2020 11:07
·
0 Likes
·
0 Votes
·
0 Comments
·
I'm talking about EasySocial -

Again - I will explain what I'm trying to do.

I have built an API to automatically post a post, under a user profile(timeline) of EasySocial.
When I'm trying to post HTML code under a user timeline, it will present like this <p style="font-size:16px;">This is a demo</p>
here is a demo screenshot - demo

However - I've noticed there is a post type function, for example, image, link, text... when post type is "blog" - EasySocial will post HTML tags inside a post under the user timeline - for example, achievement post - demo

What I want to understand is - where I can create new post type, and how I can allow HTML tags inside it, so when I use my API, it will be presented as HTML tags.
Avi
·
Friday, 21 February 2020 16:55
·
0 Likes
·
0 Votes
·
0 Comments
·
Ah, I see, sorry for my misunderstanding.
Perhaps, you can use BB code instead of html code? Because by default it will convert the bbcode in the story items. Thus you no need to customize inside core file, that can be overridden once you update EasySocial
For example:

[b ]testing[/ b]

*remove the space
·
Friday, 21 February 2020 18:43
·
0 Likes
·
0 Votes
·
0 Comments
·
I understand, but I will have no choice but to modify the core as I need the flexibility to post HTML tags inside the post.....
but I still don't want users to post HTML code, so this is why I wanted to create new post type and to allow just for this post type to allow posting of HTML code.
Avi
·
Friday, 21 February 2020 18:48
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Avi,

You can customize in the file:
.../administrator/components/com_easysocial/includes/stream/item.php
In the formatContent function
·
Monday, 24 February 2020 13:32
·
0 Likes
·
0 Votes
·
0 Comments
·
Dear team, thank you for your support.
I've changed that function to allow HTML tag under a new post type called specialUpdate. However when I change post type to use that, it is no longer appear under the user timeline.

I also tried to check it in this way -
Logged into my account
Post a normal story
Go to db and change story type to specialUpdate
Refresh page

Post does not longer appears under my timeline.

Which file/function should I modify in order to allow it ?
Avi
·
Thursday, 27 February 2020 15:29
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi, I'm still waiting for an answer about this
Avi
·
Monday, 02 March 2020 14:36
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Avi,

Sorry for the late reply on this.
I also tried to check it in this way -
Logged into my account
Post a normal story
Go to db and change story type to specialUpdate
Refresh page

I am did not quite get you here, can you screenshot which part you change on database?

By the way, I have moved this ticket under tutorials category.
·
Monday, 02 March 2020 15:26
·
0 Likes
·
0 Votes
·
0 Comments
·
here is a screenshot of what I'm trying to do screen
Avi
·
Monday, 02 March 2020 15:50
·
0 Likes
·
0 Votes
·
0 Comments
·
This was changed I applied to the core file -

/public_html/administrator/components/com_easysocial/includes/stream/item.php

line 915

$content = $this->formatMentions($content, $currentView);

instead to

if($this->type != 'dogupdates')
$content = $this->formatMentions($content, $currentView);
Avi
·
Monday, 02 March 2020 17:44
·
0 Likes
·
0 Votes
·
0 Comments
·
Guys, any updates about this issue?
Avi
·
Tuesday, 03 March 2020 15:31
·
0 Likes
·
0 Votes
·
0 Comments
·
I see, basically you want to create a new stream preview.
You can take a look file: media/com_easysocial/apps/user/story/story.php onPrepareStream function
·
Wednesday, 04 March 2020 15:10
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post