MyBB Community Forums

Full Version: Randomly selected text display
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I had removed
$plugins->add_hook('admin_load', 'randomplot_admin');
from the inc/plugins file.

And I commented out the randomplot_admin function line (including the opening and closing curly braces). So that when the file was called it should have just started running checks as if the function were called.

So, by rights, it should just start executing when the page gets loaded. I've tried adding an echo line just to see if the conditions are being met, but for some reason it still blanks out.

Though I've discovered that if I go to:
admin/index.php?module=forum-randomplot&action=randomplot

Then it does rendered the table correctly. (The add, edit and delete pages don't render properly yet... but one thing at a time.)

EDIT - Everything for normal use appears to be functioning properly now (adding new, editing existing, deleting unnecessary, etc...).

I've got a few more tests to run (installing, uninstalling etc...) with it first before I make it available though. (I hope those functions work smoothly, but if not I'll be back with more questions...)
But either way... thanks for all your help Dragonexpert, I appreciate it.
Update:

Nearly everything seems to be working... Except the ability to edit. Which seems to have gone awol on me (right when I uploaded it to testing on my live server).
I'm not sure why either since it was working before and appears to have just stopped. I hadn't made any changes to prompt it. But whenever I try to edit it just throws an error and states a field is required. (The field is there and should be getting updated properly...)

The code is this.

For a bit more info... If I remove:
|| $mybb->input['theplot'] == ''

from the error checking part of the edit code then it'll let me submit but nothing will get inserted. (The field will simply be blanked out, regardless of what should actually be submitted.) So it's likely something messing with actual insertion of theplot. (If I remove the others then the error still trips so it has to be due to theplot coding.)

Update 2:
After looking at the code after a break, I figured out why it wasn't working. (I had the field name for "theplot" under the do_editplot wrong. I had it working under a different variable/field name but I'd forgotten that I'd renamed it and hadn't tested that part again until when I originally posted this message.)
So the plugin is fixed and working properly.
Pages: 1 2