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 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
Code:
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?

SheepEffect
New Member

Posts : 10
Reputation : 2
Language : English

http://begonebrotherhood.forumotion.com/

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.
Code:

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

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

http://www.avacweb.com/

Back to top Go down

Back to top


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