[PHP] core.viewforum_get_topic_data

These requests for events in core phpBB have been merged into 3.1/Ascraeus and will be available with the next release.
Post Reply
User avatar
MattF
Extension Customisations
Extension Customisations
Posts: 675
Joined: Mon Mar 08, 2010 9:18 am

[PHP] core.viewforum_get_topic_data

Post by MattF »

Identifer: core.viewforum_get_topic_data

Location: viewforum.php
After:

Code: Select all

$sql_array = array(
	'SELECT'	=> 't.*',
	'FROM'		=> array(
		TOPICS_TABLE		=> 't'
	),
	'LEFT_JOIN'	=> array(),
);
Parameters: $sql_array

Explanation: Allow extensions to get modify the topic data $sql_array when viewing a forum. For example, Topic Preview MOD does this, it adds the first_post_text to $sql_array using LEFT_JOIN statements.
Last edited by MattF on Fri Jul 19, 2013 4:20 am, edited 2 times in total.
Has an irascible disposition.

User avatar
MattF
Extension Customisations
Extension Customisations
Posts: 675
Joined: Mon Mar 08, 2010 9:18 am

Re: [PHP] core.topicdata_modify_sql

Post by MattF »

Bump. I edited the above request to be located better.
Has an irascible disposition.

joelk
Registered User
Posts: 7
Joined: Tue Mar 11, 2014 8:00 pm

Re: [PHP] core.viewforum_get_topic_data

Post by joelk »

I'm trying to implement this event to join on another database table to restrict the result set. The SQL being generated works fine, but it looks like that SQL in some places gets reused partially, and in other places not at all.

1) Retrieving the announcements preserves the JOIN, but omits the WHERE (ideally, both should actually be removed, or trigger another SQL event)
2) Retrieving the topics/stickies does not preserve the WHERE clause, again this should probably be yet another event
3) Retrieving the topic IDs doesn't use any of the original SQL changes
4) There needs to be another event used for retrieving the forum total posts

With those limitations, having full control over which topics are displayed on a forums listing page seems impossible.

The main core.viewforum_get_topic_data event could possibly pass in multiple SQL arrays, so they can be changed as needed.

Post Reply