What's the bigger sin?

Marcus

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 :)
 
Neither are ideal.

What specifically do you need to do. There's surely a better way.
 
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.
 
To solve this problem I could set a cookie value to be MVC compliant but I guess it's even a bigger sin :D
 
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.
 
You could try and extend XenForo_ControllerPublic_Thread. Capture the response from actionUnread() and add an additional parameter like (see the array('page') part):

Code:
                        return $this->responseRedirect(
                                XenForo_ControllerResponse_Redirect::RESOURCE_CANONICAL,
                                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.
 
Back
Top Bottom