1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Add-on Conversation after user upgrade

Discussion in 'Resource and Add-on Requests' started by Allan, Nov 9, 2014.

  1. Allan

    Allan Well-Known Member

  2. Aayush

    Aayush Well-Known Member

    I haven't seen something like this before but it is pretty easy to implement. I once did some custom work for a client and implementing this requires only 10-20 lines of code.
     
  3. Allan

    Allan Well-Known Member

    Ha cool, you don't want to share here?
     
  4. Aayush

    Aayush Well-Known Member

    If I have time next week, I'll write one up and upload here! :)
     
    TheComputerGuy, Allan and Insy like this.
  5. Allan

    Allan Well-Known Member

    Thank you :)
     
  6. Allan

    Allan Well-Known Member

    Do you have news ?
    :)
     
  7. Aayush

    Aayush Well-Known Member

    I'll do it on Friday most probably.
     
    TheComputerGuy and Allan like this.
  8. TheComputerGuy

    TheComputerGuy Active Member

    Please keep me posted, I will donate!
     
  9. Aayush

    Aayush Well-Known Member

    I'll be coding it today, if anyone has some suggestions, please post them in the thread. Thanks!
     
  10. Aayush

    Aayush Well-Known Member

    I've made the options page. Let me know if you guys want me to add anything else. Screen Shot 2014-11-14 at 6.36.39 PM.png
     
  11. Xon

    Xon Well-Known Member

    @Aayush Will it support replacables used for most other places (warning PMs, notices, etc)? ie; {name}, {user_id}, etc.
     
  12. Allan

    Allan Well-Known Member

    Hi @Aayush :)

    Html enable in message ?
     
  13. Aayush

    Aayush Well-Known Member

    I'll add support for HTML, but will not be able to add support for BBCode.

    Not sure about this, had thought about this initially, but I am not sure if I'll be able to parse this sort of stuff. Maybe I'll add a list of variables that can be used in the message and title, for which I'll have to create a custom parser.
    If you have any idea how I could parse this kind of stuff using XF built in parser or something, please let me know.
     
  14. Xon

    Xon Well-Known Member

    I would have thought it would have to be bbcode in conversations?

    XF just does straight string replacements, nothing that fancy.

    For example, XenForo_ViewRenderer_HtmlPublic has the following code:
    Code:
    				$noticeTokens = array(
    					'{name}' => $user['username'] !== '' ? $user['username'] : new XenForo_Phrase('guest'),
    					'{user_id}' => $user['user_id'],
    				);
    
    				XenForo_CodeEvent::fire('notices_prepare', array(&$noticeList, &$noticeTokens, $template, $containerData));
    
    				foreach ($noticeList AS $noticeId => $notice)
    				{
    					$notices[$noticeId] = array(
    ...
    						'message' => str_replace(array_keys($noticeTokens), $noticeTokens, $notice['message']),
    ...
    					);
    				}
    
     
  15. Aayush

    Aayush Well-Known Member

    Probably BBCode, IDK, it wouldn't be possible to add support for both, I'll still have to look into that part later.

    Thats how I originally imagined I would be parsing stuff. I was looking for a function which I could invoke from the model directly.
     
  16. Aayush

    Aayush Well-Known Member

  17. Allan

    Allan Well-Known Member

    Thank you :)
     
    Aayush likes this.

Share This Page