Jump to content

Invision Community Blog


Managing successful online communities

Josh
Sign in to follow this  
 

IP.Board 3.1.0 Dev Update: Modification Development Enhancements

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.
Sign in to follow this  

Comments

Recommended Comments

These improvements seem nice but what is the cost/performance?

For each template, you store all local variables until the end of execution/printing? This will not use too lot of memory and is against the Garbage Collector of PHP?

Share this comment


Link to comment
Share on other sites

[quote name='m4rtin' date='20 January 2010 - 03:52 PM']
A small tiny request regarding application independency.
Report plugins still have to go into the reportPlugins folder in the core application. Might want to move those to the applications as well :)


Report plugins will be made app specific and placed in extensions/reportPlugins of the app

Share this comment


Link to comment
Share on other sites

Nice :-) Loving the changes & additions. Great work.

[quote name='m4rtin' date='20 January 2010 - 03:52 PM']
A small tiny request regarding application independency.
Report plugins still have to go into the reportPlugins folder in the core application. Might want to move those to the applications as well :)

The report center plugin and user profile tabs ( /apps/members/sources/tabs/* ) would allow IP.Links to be shipped confined to its own little folder if they were moved to its application directory :wub:

[edit] Oh and the app icon from /skin_cp/_newimages too

Share this comment


Link to comment
Share on other sites

[quote name='Brandon D' date='21 January 2010 - 03:37 AM']
Nice :-) Loving the changes & additions. Great work.


The report center plugin and user profile tabs ( /apps/members/sources/tabs/* ) would allow IP.Links to be shipped confined to its own little folder if they were moved to its application directory :wub:

[edit] Oh and the app icon from /skin_cp/_newimages too

They changed that to /appdir/skin_cp/appIcon.png in one of the early public betas :P

Share this comment


Link to comment
Share on other sites

[quote name='Fabien' date='20 January 2010 - 09:17 PM']
These improvements seem nice but what is the cost/performance?

For each template, you store all local variables until the end of execution/printing? This will not use too lot of memory and is against the Garbage Collector of PHP?


Template bit data is only stored if a hook needs to modify the template. It won't store all data regardless.

Share this comment


Link to comment
Share on other sites

i've got to admit i was wondering why profile tabs were where they were... so its nice to move it to application directory as it makes more sense. Aside from that i was hoping for quite a bit more, so i'm really hoping you lot are holding back ALOT.

Share this comment


Link to comment
Share on other sites

[quote name='Jaggi' date='21 January 2010 - 07:10 AM']
i've got to admit i was wondering why profile tabs were where they were... so its nice to move it to application directory as it makes more sense. Aside from that i was hoping for quite a bit more, so i'm really hoping you lot are holding back ALOT.


If you have specific suggestions about what you are hoping to see, you should post them :)

Share this comment


Link to comment
Share on other sites

[quote name='Michael John' date='21 January 2010 - 02:27 AM']Sounds great, the onGroupChange change should make the auto welcome mod edit free.
Yeah, it will help also a couple of my mods as well (that's why I requested it to be changed along with several other things, josh might kill me if I suggest new things at this point lol :whistle: )

Share this comment


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...