phpBB

Development Discussion Board

phpBB's testing ground of bleeding edge code
Advanced search

[RFC|Implemented] Topicrow Hook

These requests for events in core phpBB have been merged into 3.1/Ascraeus and will be available with the next release.

[RFC|Implemented] Topicrow Hook

Postby Sam » Thu Aug 19, 2010 4:08 pm

Name: hook_topicrow
Rationale: This hook will allow for people to modify the topicrow before it is sent to the $template->assign_block_vars.
Placement: viewforum.php
Input arguments: &$topicrow (single parameter passed by reference)
Output format: void
Output semantics: $topicrow is passed by reference and acts as the Output.
Infrastructure: In viewforum.php, a new array should be created, $topicrow, that contains the full array to be sent to $template->assign_block_vars. This array will be passed by reference to the hook function before send to the template.

Example: (just pseudo code)
Code: Select all
// Hook function to rewrite pretty urls
function creat_pretty_urls_topicrow($topicrow)
{
    // ./my-topic-name-t123.html
    $topicrow['U_VIEW_TOPIC']    = $phpbb_root_path . url_slug($topicrow['TOPIC_TITLE']) . '-t' .$topicrow['TOPIC_ID'] . '.html';
}
User avatar
Sam
Website Team
Website Team
 
Posts: 31
Joined: Fri Jan 23, 2009 10:24 pm

Re: [RFC] Topicrow Hook

Postby MichaelC » Thu Mar 15, 2012 9:08 pm

Implemented
Unknown Bliss
psoTFX wrote:I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"

No unsolicited PMs please except for quotes.
User avatar
MichaelC
Website Team
Website Team
 
Posts: 797
Joined: Thu Jan 28, 2010 6:29 pm

Re: [RFC] Topicrow Hook

Postby Dragosvr92 » Thu Mar 15, 2012 11:43 pm

There will be pretty/seo urls in 3.1 !? o-O :?:
Previous username: TheKiller
Avatar on Memberlist 1.0.3
User avatar
Dragosvr92
Registered User
 
Posts: 358
Joined: Tue May 31, 2011 12:08 pm
Location: Romania

Re: [RFC] Topicrow Hook

Postby DavidIQ » Thu Mar 15, 2012 11:50 pm

TheKiller wrote:There will be pretty/seo urls in 3.1 !? o-O :?:

It's an Example of what the hook can be used for, not some implementation of it. :roll:
Image
User avatar
DavidIQ
MOD Team Leader
MOD Team Leader
 
Posts: 760
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth


Return to [3.1/Ascraeus] Merged Event Requests

Who is online

Users browsing this forum: No registered users and 1 guest