ENXF NET
Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
- Joined
- Nov 13, 2018
- Messages
- 27,142
- Points
- 823
Reputation:
When posting a news article on my site's CMS, I create a new thread for that article, with the userid of that user that was posting the news item.
The code to do this is this:
Code:
Read more
Continue reading...
The code to do this is this:
Code:
Code:
$forum = \XF::em()->find('XF:Forum', $forumid);
$user = \XF::em()->find('XF:User', $userid);
$thread = \XF::asVisitor($user, function() use ($forum, $title, $message)
{
$creator = \XF::service('XF:Thread\Creator', $forum)...
Read more
Continue reading...