What's the bigger sin?


Well-known member
This is worrying me. Completely overwriting a 50 line ControllerPublic action function or fetching a value from $_GET in the model?

I can do either way :)

Chris D

XenForo developer
Staff member
Neither are ideal.

What specifically do you need to do. There's surely a better way.


Well-known member
I added a &parameter=x to threads in thread_list. I have to access them on thread_view. It's possible with threads links, but not with threads/unread as this function redirects before I can hook in.


Well-known member
To solve this problem I could set a cookie value to be MVC compliant but I guess it's even a bigger sin :D


Well-known member
I would have to set ("current_node_id") each time a user visits a node. Do you think it's okay to do that or it's kind of overkill? Or is using a &node_id parameter in the URL which works great now not more common?

I would have to access the simple cache or data registry also in the model. Is that okay?

I am completely open for ideas.

Isn't there already a registry where users are at the moment "Marcus A is visiting the Announcement forum"? I could fetch the node_id value from there. Is that data stored as if the user continues going to different thread pages the former node_id data has to be accessible, too.


Well-known member
You could try and extend XenForo_ControllerPublic_Thread. Capture the response from actionUnread() and add an additional parameter like (see the array('page') part):

                        return $this->responseRedirect(
                                XenForo_Link::buildPublicLink('threads', $thread, array('page' => $page)) . $hashTag
I haven't tested this yet. I just looked through the code and I thought this could be accomplished.