2020-05-04, 02:02 AM
Hi again, I feel like I've read so much about how templates work in MyBB and yet I am unable to wrap my head around it for some reason.
I have had success with working with templates in custom pages I have coded. But as for working with templates through hooks I must say I feel pretty beat. After trying many possible options I feel more and more retarded, and can't say that this is good for my well-being either. Over the course of a week I have tried to study how scopes are affected by hooks, and there seems to be some delicate issues and my head is unable to wrap around it.
Here comes a case where I'm beat, I'm hooking a function into the hook 'postbit'. And in the postbit template I have added
And in the function hooked to postbit I have something like this
Which is getting it from another template.
Tbh this is one of many many attempts at doing this, and I think I've gotten so deep into it that all the tries I've made has been faulty in logic so many times I kind of have given up. Spent a week looking at this, and templates have been ups and downs for me.
I appreciate all and any help, I have also tried other hooks but to no avail.
Feelings: Huge Sigh
I have had success with working with templates in custom pages I have coded. But as for working with templates through hooks I must say I feel pretty beat. After trying many possible options I feel more and more retarded, and can't say that this is good for my well-being either. Over the course of a week I have tried to study how scopes are affected by hooks, and there seems to be some delicate issues and my head is unable to wrap around it.
Here comes a case where I'm beat, I'm hooking a function into the hook 'postbit'. And in the postbit template I have added
{$atv_votebuttons}
And in the function hooked to postbit I have something like this
eval("\$atv_votebuttons = \"".$templates->get("atv_votebuttons")."\";");
Which is getting it from another template.
Tbh this is one of many many attempts at doing this, and I think I've gotten so deep into it that all the tries I've made has been faulty in logic so many times I kind of have given up. Spent a week looking at this, and templates have been ups and downs for me.
I appreciate all and any help, I have also tried other hooks but to no avail.
Feelings: Huge Sigh