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.
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...
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')
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...
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...
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...
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!
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() {...
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...
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?
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.
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...