The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Any way to make custom macros?

2 posters

Go down

Any way to make custom macros? Empty Any way to make custom macros?

Post by SheepEffect 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?
avatar
SheepEffect
New Member

Posts : 10
Reputation : 2
Language : English

http://begonebrotherhood.forumotion.com/

Back to top Go down

Any way to make custom macros? Empty Re: Any way to make custom macros?

Post by LGforum 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>');
  });
});
LGforum
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

Back to top

- Similar topics

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