Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Making names in posts link to profiles?
I'm curious about having nicknames mentioned in a post link to their relevant profile.
Does anything like this exist? If not, anyone interested in making it or getting me on my way> I'm comfortable with PHP but the Vanilla extension system confuses me.. no idea where to start.
Could use a tag i'm presuming, to save every word of every post having to be parsed to see if it's a nick.. maybe putting something on either side of it like BBcode works, or just #nick# or something.
Then again ideally it should do it automatically so that even if people don't know or use the tags and type someones nickname, it still links.
0
This discussion has been closed.
Comments
Your extension would basically be a Formatter. Have a look at this page and especially this one.
Nope, I'm sure I've used it in the past though.
Posted: Monday, 16 July 2007 at 9:54AM
I tried pulling this out to make it work just as a "/ me" replace to get started but it won't work.. ? My plan is to get this working as a standalone "/ me" replacer, without the link parser etc that was in this extension, and then add in from there some code to work for "/nickname"..
if (in_array($Context->SelfUrl, array("comments.php", "post.php"))) { // An implementation of the string filter interface for plain text strings class ProfileLinker extends StringFormatter { function Parse ($String, $Object, $FormatPurpose) { $sReturn = $String; // Only format plain text strings if they are being displayed (save in database as is) if ($FormatPurpose == FORMAT_STRING_FOR_DISPLAY) { $sReturn = preg_replace("/\/\bme\b/", $this->GetAccountLink($Object), $sReturn); } return $sReturn; } function GetAccountLink($Object) { if (isset($Object->AuthUserID) && $Object->AuthUserID != "" && isset($Object->AuthUsername) && $Object->AuthUsername != "") { return '<a href="'.GetUrl($Object->Context->Configuration, 'account.php', '', 'u', $Object->AuthUserID).'">'.$Object->AuthUsername.'</a>'; } else { return '/ me'; //space in source so it doesn't parse on lussomo forums } } } $ProfileLinker = $Context->ObjectFactory->NewObject($Context, "ProfileLinker"); $Context->StringManipulator->Formatters[$Configuration["DEFAULT_FORMAT_TYPE"]]->AddChildFormatter($ProfileLinker); }