![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
![[community profile]](https://www.dreamwidth.org/img/silk/identity/community.png)
I've been reading S2 documentation like crazy, and I'm pretty sure the answer is 'no' but I'm going to throw out the question anyway:
Is there any possible way to call functions from a different view than the one you're currently on? For example, the EntryPage class has a function print_comments. But what if I want to print the subjects of the 5 latest comments on the Recent view (maybe in the sidebar)? The RecentPage class doesn't include that function, so I'm assuming there's no way to call it unless the core was rewritten to add it into RecentPage and allow it to take parameters so it knows which comments to pull back. Am I correct in that assumption?
I'll gladly take the question elsewhere if this isn't the right place. Any direction would be so much appreciated.
Is there any possible way to call functions from a different view than the one you're currently on? For example, the EntryPage class has a function print_comments. But what if I want to print the subjects of the 5 latest comments on the Recent view (maybe in the sidebar)? The RecentPage class doesn't include that function, so I'm assuming there's no way to call it unless the core was rewritten to add it into RecentPage and allow it to take parameters so it knows which comments to pull back. Am I correct in that assumption?
I'll gladly take the question elsewhere if this isn't the right place. Any direction would be so much appreciated.
no subject
Date: 2009-05-06 04:06 pm (UTC)no subject
Date: 2009-05-06 04:44 pm (UTC)Looking at a community like ask_me_anything, they must use an external service and the API to update their sidebar stats (for example, "Popular Posts"). I guess I'll look in that direction next.
no subject
Date: 2009-05-06 05:49 pm (UTC)However, that only shows the number of comments made on the entry, not the time the last comment was made, or the actual comment metadata/text.
If my guess is correct, and they're doing it with pure s2, then the more accurate description of the information is "most popular posts on the front page/from the first 20 entries", though "of the past hour" probably works given the popularity of the community.
no subject
Date: 2009-05-06 06:50 pm (UTC)The reason I think they're using an external service is because the comment count in the sidebar sometimes lags behind the actual comment count. Also, not all of the popular posts appear on the front page. That makes me think they're scraping the content intermittently somehow and then auto-updating the sidebar.
No idea at this point how that works. Once all the S2 and API documentation is done, will it be clear to me? ;)
no subject
Date: 2009-05-06 06:52 pm (UTC)no subject
Date: 2009-05-07 09:26 pm (UTC)no subject
Date: 2009-05-07 02:28 am (UTC)no subject
Date: 2009-05-07 02:37 am (UTC)(though you can make a new class that extends an existing class).
But I'm afraid I don't see the connection with my comment, and I'm worried that I'm giving the wrong impression of what is/is not possible, somehow.
no subject
Date: 2009-05-07 02:48 am (UTC)no subject
Date: 2009-05-07 02:58 am (UTC)no subject
Date: 2009-05-07 03:05 am (UTC)no subject
Date: 2009-05-07 03:09 am (UTC)no subject
Date: 2009-05-07 03:13 am (UTC)