Piorun Posted July 3, 2014 Share Posted July 3, 2014 Hi Today i have problem with: function getEmailGravatar(email) local email = md5(string.lower(email)) fetchRemote("http://www.gravatar.com/avatar/"..email.."?s=50", function(data, errno) if errno == 0 then return data else return errno end end ) end fetchRemote doesnt work. I mean everytime return is equals to nil. email is correctly, resource is in admin group in ACL. What im doing wrong? Link to comment
MTA Team botder Posted July 3, 2014 MTA Team Share Posted July 3, 2014 Clientside or Serverside? Link to comment
MTA Team botder Posted July 3, 2014 MTA Team Share Posted July 3, 2014 The callback function from fetchRemote can't pass any "return" value to your getEmailGravatar this way. The function fetchRemote loads the data from gravatar.com probably asynchronous. That means you can't "wait" for the response from the page inside your function. Link to comment
Piorun Posted July 3, 2014 Author Share Posted July 3, 2014 Hmm i think that i understand what you want to say so thanks . I come back if i fix it. Link to comment
Piorun Posted July 3, 2014 Author Share Posted July 3, 2014 Ok i know what i done wrong. Your adv helped me so thanks a lot. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now