Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.
Help keep Vanilla free:Posted: Monday, 16 July 2007 at 9:54AM
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);
}
1 to 8 of 8