Jump to content






* * * * * 1 votes

IP.Board 3.1.0 Dev Update: Modification Development Enhancements

Posted by Josh, in 3.1.0 20 January 2010 · 2,548 views

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.




Sounds Awesome! :)
GJ!

      if( $pos )

      {

              echo 'Product needs improvement';

   

      }

Nice to see yet another update. ^_^
hmmmm, sounds interesting now, this may reduce at least a few old hooks + file edits from my applications.

Thanks IPS, keep up the job
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 :)
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?

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
I don't understand anything, but I'm happy anyway.
    • likes this
Sounds great, the onGroupChange change should make the auto welcome mod edit free.
Nice :-) Loving the changes & additions. Great work.

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

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
Sounds good for developers, making mods easier to produce can allow developers make better mods or more or get them out quicker and update them quicker which is all good for IPB users.
    • likes this
I guess nobody caught my joke >_<

I guess nobody caught my joke Posted Image


That wasn't a joke! Posted Image

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.
Brett, I got it.

if Piece of S**T.....
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.
Looks good! :rolleyes:
it is probably ok for all you coders ... but means abolutely zilch to me

May 2013

S M T W T F S
   1234
567891011
12131415161718
1920 21 22232425
262728293031 

Recent Entries

Recent Comments

Search My Blog