Recent content by grantus

  1. grantus

    XF 2.2 Style errors but only with Firefox

    So far it's only happened in Firefox. I'm disabling addons but it's hard to tell since it's so random. Sometimes it happens a few times in one day, then not for another few days.
  2. grantus

    XF 2.2 Style errors but only with Firefox

    Everything has been fine until recently (I didn't make any changes recently) when I get this console error in Firefox: Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. The resource at...
  3. grantus

    XF 2.2 Using the editor in my own template

    I completely forgot about quick-reply! I've never seen _xfWithData before. I just looked it up and for example in Thread.php there's if ($this->filter('_xfWithData', 'bool')
  4. grantus

    XF 2.2 Using the editor in my own template

    Ok, thanks. So far I'm on track, I'm able to insert no problem, but in the editor when I post, the message stays in the editor (I eventually want the same functionality as here in the thread view). Is there something in the editor template syntax that should be added, or is it just a matter of...
  5. grantus

    XF 2.2 Using the editor in my own template

    I put $battle->save(); in the actionBattleComment function and so far my post is saving.
  6. grantus

    XF 2.2 Using the editor in my own template

    I tried that but I don't see an EditorPlugin, but there's an Editor file so I did this: $editorPlugin = $this->plugin(\XF\ControllerPlugin\Editor::class); $message = $editorPlugin->fromInput('message'); $form = $this->formAction(); $form->setup(function () use ($battle...
  7. grantus

    XF 2.2 Using the editor in my own template

    I'm wondering what is the correct way to use Xenforo's editor in my own template. I have this so far in my template: <xf:form action="{{ link('battle/comment', $battle) }}" class="block" ajax="1"> <div class="block-container"> <div...
  8. grantus

    XF 2.2 Custom widget help

    Ah, ok I get it. I just added it as a widget definition instead and it works fine. There was an error about and admin template so I created that and the error went away. Thanks for the tip!
  9. grantus

    XF 2.2 Custom widget help

    Yes, I'm doing a php callback. What would be the difference?
  10. grantus

    XF 2.2 Custom widget help

    I created my widget definition called "test_widget". I created a template called "test_widget_tpl". Here's my code: namespace Test\ILL\Widgets; use XF\Widget\AbstractWidget; class TestWidget extends AbstractWidget { protected $defaultOptions = []; public function render() {...
  11. grantus

    XF 2.2 Issue with deleting a row

    D'oh! Don't know why I did that lol. So obvious. Thanks, it works.
  12. grantus

    XF 2.2 Issue with deleting a row

    I'm trying to delete a row: private static function deletePending($table, $upload_id) { $db = \XF::db(); $rowsDeleted = $db->delete($table, [ 'upload_id' => $upload_id ]); } And I'm calling it in another method like this...
  13. grantus

    XF 2.2 How can I calculate this inside a template?

    Inside my template I need to calculate a time from my db table (in UNIX format) then divide a value, minus the current time, and then format it. For example: ({$item.end_date} / 60) - {$xf.time} Is $xf.time already in UNIX format?
  14. grantus

    XF 2.1 Cron entry title

    The more I look at it, I think processing the finished battles all at once is the best approach since it's less strain on the server. This way there's only one cron job.
  15. grantus

    XF 2.1 Cron entry title

    It's a battle system I have set up, so right now it's basically User1 challenges User2. If User2 accepts, a cron job is created with a battle start and end time. At the end time the cron job will trigger the code that calculates the results. So I have everything in a separate table, it's just...
Back
Top Bottom