AndyB
Well-known member
I'm updating my History add-on from XF1. What I would like to do is be able to click a link called History and rather then showing "Your threads" as seen here:
I would like to show threads most recently viewed by the member.
I have successfully extended the FindThreads class and I can view the same page using my function.
I have created a table called xf_history, these are the fields:
The code I think I will need to use is this:
I assume this will work and all the finder needs is the thread_id's. So if this is all correct, my assumption is I need to create an entity for History. How do I create a History entity? I know how to extend an entity for example when I add a column to an existing table, is it basically the same procedure?
I would like to show threads most recently viewed by the member.
I have successfully extended the FindThreads class and I can view the same page using my function.
I have created a table called xf_history, these are the fields:
The code I think I will need to use is this:
PHP:
$finder = \XF::finder('XF:History')
->where('user_id', '=', $userId);
$threadFinder = $finder->fetch();
I assume this will work and all the finder needs is the thread_id's. So if this is all correct, my assumption is I need to create an entity for History. How do I create a History entity? I know how to extend an entity for example when I add a column to an existing table, is it basically the same procedure?