The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.

Create a free forum like this one.

Any way to make custom macros?

Go down

Any way to make custom macros?

Post by SheepEffect on Tue 21 Aug 2012 - 21:52

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 Wed 22 Aug 2012 - 0:04

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 : 2262
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