Jump to content

Recommended Posts

Posted

There are a lot of enhancements being made to the application/hook system in IPB 3.1, many of which were discussed in a previous blog post. While that post focused on the hooks system, there have been many other changes made throughout IPB 3.1, and we'd like to highlight a few of those in this blog post. We hope that our modification community will find these changes helpful and can't wait to see what they do with this new version! As always, if there are any suggestions or comments, we would love to hear them.

Template Hooks: Replace Output

A new optional function has been added for template hooks called replaceOutput(), which receives the entire content of the page and replaces it with what is returned from your hook. This allows your hook to replace tags with whatever content you need, here's an example that adds the pid of a post next to the multiquote button:


public function replaceOutput( $output, $key )

{

	$tag		= '<!--hook.'.$key.'-->';

	$lastFound	  = 0;


	foreach( $this->registry->output->getTemplate('topic')->functionData['topicViewTemplate']['post_data'] as $pid => $post )

	{

		$pos = strpos( $output, $tag, $lastFound );

		$strToInsert = 'PID: ' . $pid;


		if( $pos )

		{

			$output = substr_replace( $output, $strToInsert . $tag, $pos, strlen( $tag ) );

			$lastFound = $pos + strlen( $tag . $strToInsert );


		}

	}


	return $output;

}



memberSync Changes

We've made a few changes to memberSync, in order to make a few of the functions a little more useful.

  • onGroupChange: The old member group is now passed into this function
  • onLogin: The plain text password is now passed into this function
  • onCreateAccount: The plain text password is now passed into this function


Extensible Forms

One of the new features we introduced with IPB3 was the ability for applications to extend the member and group edit forms in the ACP. We've now expanded that functionality to include the forum edit form as well. This works in the same way as the group edit form, by allowing your application to add a tab to the edit forum form. We've also updated the member form extender to determine tab ids automatically, exactly as the group form extender does in the 3.0. So you'll no longer have to worry about your member form conflicting with another applications member_form.

Attachment Plugins and Profile Tabs

Our goal with applications is to make them as independent of each other as possible, toward that end we've moved the attachment and profile tab plugins into the application extension directory of each application. Profile tabs will now be placed in YOUR_APPLICATION/extensions/profileTabs and attachment plugins will now be placed in YOUR_APPLICATION/extensions/attachments. The file and class names have remained the same, the only difference is their location within the file structure.

New Setting Type: Autocomplete Member Name

This new setting type will allow you to create fields that will then be turned into member name autocomplete fields by IPB.

View full blog entry

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...