2020-03-21, 08:56 PM
Hello, so I'm trying to play around with hooks to get a good idea of how it works, and at my first attempt I'm already meeting a bit of a hazzle.
The plugin contains the default setup and then this code:
I'm trying to intervene before the showthread page is output, to write text besides the 'new reply' button, and the proposition is pretty much just saying "If user can post and thread is closed", so that only I can see it.
My skills at PHP is decaying day for day, and I'm not sure how to go about this, is my logic in how PHP functions wrong? xD
I'd be really glad for any help, thanks a lot.
The plugin contains the default setup and then this code:
$plugins->add_hook("tcd_evaluate", "showthread_end");
(...)
function tcd_evaluate()
{
if ($forumpermissions['canpostreplys'] != 0 && $thread['closed'] == 1) {
eval("\$newreply = \""."Text Here?".$templates->get("showthread_newreply")."\";");
}
}
I'm trying to intervene before the showthread page is output, to write text besides the 'new reply' button, and the proposition is pretty much just saying "If user can post and thread is closed", so that only I can see it.
My skills at PHP is decaying day for day, and I'm not sure how to go about this, is my logic in how PHP functions wrong? xD
I'd be really glad for any help, thanks a lot.