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

extending Xen_Foro_Model_Avatar

Discussion in 'XenForo Development Discussions' started by Helmut2509, Nov 26, 2013.

  1. Helmut2509

    Helmut2509 Member

    I want to override XenForo_Model_Avatar::gravatarExists
    which invokes XenForo_Helper_Http::getClient.
    There I have to add parameters for Zend Proxy. All is done in a new add on.
    I have written a listener with load_class_model, but infortunately extending XenForo_Model_Avatar
    does not work this way. I guess that's because 'gravatarExists' is a static method and therefore
    XenForo_Model_Avatar is not instantiated.
    Any suggestions how to solve this problem?
  2. Jon W

    Jon W Well-Known Member

    You will probably have to extend whatever it is that calls the static method -- i.e., the Account/Register controllers. Not a particularly elegant way of doing it though.
  3. Helmut2509

    Helmut2509 Member

    There are three places where XenForo_Model_Avatar::gravatarExists is being called, hence a lot of work...whereas the only real change is _one_ additional line in XenForo_Helper_Http::getClient.
  4. xf_phantom

    xf_phantom Well-Known Member

    But wouldn't you need the proxy connection for ALL usages of XenForo_Helper_Http::getClient and not only for the connection to gravatar?
  5. Helmut2509

    Helmut2509 Member

    I got the request to use the proxy only for gravatar connection.

Share This Page