An alternative to UBB.threads
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace FLocal.Common.BBCodes {
|
|
|
|
|
class UserMentionProcessor {
|
|
|
|
|
|
|
|
|
|
private static string Safe(string str) {
|
|
|
|
|
return System.Web.HttpUtility.HtmlEncode(str);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string ProcessUserMention(IPostParsingContext context, string username) {
|
|
|
|
|
var user = dataobjects.User.LoadByName(username);
|
|
|
|
|
context.OnUserMention(user);
|
|
|
|
|
var url = new URL.users.user.Info(user.id.ToString(), null);
|
|
|
|
|
return String.Format("<a class=\"separate UG_{0}\" href=\"{1}\">{2}</a>", Safe(user.userGroup.name), url.canonical, Safe(user.name));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|