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.

Username delegate

edited December 2007 in Vanilla 1.0 Help
I am creating an extension that requires that the way that 'Usernames' are displayed is changed (I want to add an image after each user name).

I have been able to do this by using the Discussion and Comment delegates but was wondering if there is a delegate linked to the display of the user name. At the moment I have to search through the discussion or comment for user names and replace them where necessary.

Hope this makes sense!

Comments

  • Hi, user names appear at several different places. Which one do you need to change?
  • It would be good to be able to change them all.
    I don't want to be able to change the user name just to be able to 'attach' an image.
  • Since the user related strings are not encapsulated, there's no centralized place to change this. However what could be interesting is to change the reference to the comment and discussion classes, and override some function like FormatPropertiesForSafeDisplay() to add some html here (quite dirty, but that's all I have for the moment).
    Here is what I did for my 'like a tree' extension, where ThreadedCommentGrid extends CommentGrid:
    if ( ! class_exists( 'CommentGrid' )) include( $Context->Configuration['LIBRARY_PATH'] . 'Vanilla/Vanilla.Control.CommentGrid.php' ); if ( ! class_exists( 'ThreadedCommentGrid' )) include('inc/ThreadedCommentGrid.class.php'); $Context->ObjectFactory->SetReference( 'CommentGrid', 'ThreadedCommentGrid' );
This discussion has been closed.