Any way to make custom macros?

Go down

Any way to make custom macros?

Post by SheepEffect on August 21st 2012, 9:52 pm

I'd like to make my own "shortcode". What I'm most interested in is a quick way to post a link to a specific user.

Ideally, I could write {u1234} and have it replaced by their name as a hyperlink to their profile, preferably in the same font style as it is normally displayed. For example, if I wrote a post that said
Just send a message to {u79071}. He should be able to help.
It would come out as
Just send a message to SheepEffect. He should be able to help.

Any idea if such a modification to my forum is possible with jQuery? If not, do you think it's worth suggesting to Forumotion?

New Member

Posts : 10
Reputation : 2
Language : English

Back to top Go down

Re: Any way to make custom macros?

Post by LGforum on August 22nd 2012, 12:04 am

You could create a close effect, but it would be differcult to get the username to appear.

You could turn it into a link easily though.

  $('.post').each(function() {
      this.innerHTML = this.innerHTML.replace(/\b\{u(\d+)\}\b/g, '<a href="/u$1">User $1</a>');

Male Posts : 2263
Reputation : 260
Language : English
Location : UK

Back to top Go down

Back to top

Permissions in this forum:
You cannot reply to topics in this forum