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

How I can extend XenForo_Template_Helper_Core class and override protected function?

Discussion in 'XenForo Development Discussions' started by infis, Jan 13, 2012.

  1. infis

    infis Well-Known Member

    I need to change one method in this class which is protected.
    What candidate solutions of this task are?
     
  2. digitalpoint

    digitalpoint Well-Known Member

    You can't... at least not without editing XF's stock PHP files.
     
  3. infis

    infis Well-Known Member

    Thread must be close. It's impossible. Thank you, digitalpoint. XenForo is not provide easy access for addons developpers for add little functions such as 'avatar from url'...
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Avatars are served from the "data" directory. There is a configurable setting for this. Add this code to your library/config.php file:

    Code:
    $config['externalDataUrl'] = 'data';
    
     
  5. ragtek

    ragtek Guest

    You could also change the avatar callback method in $helperCallbacks on init_dependencies run
    PHP:
      XenForo_Template_Helper_Core::$helperCallbacks['avatar'] = array('Ragtek_XXXX''helperNewAvatarUrl');
    to change the avatar url
    BUT ATTENTION: this works only for 1 add-on.
    All other addons will overwrite the previous change;)
     
  6. infis

    infis Well-Known Member

    No. User want use url for avatar such as gravatar (clear url, not email). And I can't change logic of work gravatar functions from check data in input gravatars field to generation right code in final html code.
    Thank for your answers!
     

Share This Page