tr.im are meant to be open sourcing their code at some point. What you'll need to do though is this:
Form with box for URL, custom name, password.
Generate a unique short code if there's not a custom one specified.
Insert the URL, short code/custom name and password.
When visited, query for the short term, select the URL.
Record any stats you want to do.
If it's password protected redirect them to a page to enter password then if it's correct redirect them to the full URL.
If it's not password protected redirect them to the full URL.
I can't imagine that'd need more than a few hundred lines of code, depending on how many other features you add. The reason I haven't made one myself is it's not going to be able to compete with the other big players in URL shorteners and I wouldn't be able to take it far enough to make it worth bothering with.
Form with box for URL, custom name, password.
Generate a unique short code if there's not a custom one specified.
Insert the URL, short code/custom name and password.
When visited, query for the short term, select the URL.
Record any stats you want to do.
If it's password protected redirect them to a page to enter password then if it's correct redirect them to the full URL.
If it's not password protected redirect them to the full URL.
I can't imagine that'd need more than a few hundred lines of code, depending on how many other features you add. The reason I haven't made one myself is it's not going to be able to compete with the other big players in URL shorteners and I wouldn't be able to take it far enough to make it worth bothering with.
MyBB Support Team Lead