Recent content by iHateQuesting

  1. I

    XF 2.0 Programatically creating a thread with a specified date

    Here's how I achieved this for now until I find out if it's the recommended way. //.. after $creator->save(); $creator->getThread()->set('post_date', $date_unix); $creator->getThread()->save();
  2. I

    XF 2.0 Programatically creating a thread with custom fields

    I have now realised that the code above works. However the visibility of the custom thread field was set to Admin only. I assume doing asVisitor() means that the account I post from would need Admin privs. This thread can be closed. Hope the above is useful to anyone else in future.
  3. I

    XF 2.0 Programatically creating a thread with a specified date

    Is it possible, when using the following code, to set the date for the post? I see no methods for this on the reflection class. $user = \XF::em()->find('XF:User', $data['user_id']); $forum = \XF::em()->find('XF:Forum', $data['forum_id']); \XF::asVisitor($user, function() use ($forum, $data) {...
  4. I

    XF 2.0 Programatically creating a thread with custom fields

    Hi there, I looked around and searched a lot to find information on this, but was unable to deduct how the XF:Thread\Creator ->setcustomFields(array) works exactly I've tried the following... $user = \XF::em()->find('XF:User', $data['user_id']); $forum = \XF::em()->find('XF:Forum'...
Back
Top Bottom