更改头像中的图片 ߞ带有所需电子邮件地址的网址

发布于 2024-10-07 01:04:44 字数 160 浏览 3 评论 0原文

我想将其放在用户个人资料上的“更改图片”操作网址下。为了限制可能出现的错误,我想提供个人资料中使用的电子邮件用户(因此在图片网址中使用),这样他们在注册 Gravatar 服务时就不必这样做。

我想知道是否有一种方法可以使用已提供的电子邮件生成更改/注册 Gravatar 图片的 URL。

I want to put this under "change picture" action url on the user profile. To limit possible mistakes, I would like to provide an email user used in the profile (thus used in the picture url) so they wouldn't have to while registering to Gravatar service.

I wonder if there is a way to generate an URL to a change/register Gravatar picture with email already provided.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

悲欢浪云 2024-10-14 01:04:44

由于这里没有提供更好的答案,我的解决方法是:

<form action="http://pl.gravatar.com/accounts/signup" method="post">
  <input type="hidden" name="email" value="[email protected]">
  <input type="hidden" name="commit" value="Get Your Gravatar">
  <button type="submit">Change avatar</button>
</form> 

Since no better answer was provided here my workaround:

<form action="http://pl.gravatar.com/accounts/signup" method="post">
  <input type="hidden" name="email" value="[email protected]">
  <input type="hidden" name="commit" value="Get Your Gravatar">
  <button type="submit">Change avatar</button>
</form> 
故事和酒 2024-10-14 01:04:44

这是我的解决方案,因为此链接通常位于另一种形式中:

  def gravatar_create_url(user)
     user_email = u user.email.downcase
     "https://signup.wordpress.com/signup/?ref=oauth2&user_email=#{user_email}&oauth2_redirect=bf551c93d83b96478db51481a9cbe97e%40https%3A%2F%2Fpublic-api.wordpress.com%2Foauth2%2Fauthorize%2F%3Fclient_id%3D1854%26response_type%3Dcode%26blog_id%3D0%26state%3D331f9ecba5fcab15e2168e1231f7be2a4b1b8cd24dd6f90b3672fb5159d7b590%26redirect_uri%3Dhttps%253A%252F%252Fen.gravatar.com%252Fconnect%252F%253Faction%253Drequest_access_token%26jetpack-code%26jetpack-user-id%3D0%26action%3Doauth2-login&wpcom_connect=1"
  end

请注意查询字符串中的 user_email 变量。我不确定所有其他重定向参数,因为随着时间的推移,这些参数可能会随着 WordPress 接管 Gravatar 的方式而发生变化,但希望这能让您朝着正确的方向前进。

Here is my solution, since this link is often inside another form:

  def gravatar_create_url(user)
     user_email = u user.email.downcase
     "https://signup.wordpress.com/signup/?ref=oauth2&user_email=#{user_email}&oauth2_redirect=bf551c93d83b96478db51481a9cbe97e%40https%3A%2F%2Fpublic-api.wordpress.com%2Foauth2%2Fauthorize%2F%3Fclient_id%3D1854%26response_type%3Dcode%26blog_id%3D0%26state%3D331f9ecba5fcab15e2168e1231f7be2a4b1b8cd24dd6f90b3672fb5159d7b590%26redirect_uri%3Dhttps%253A%252F%252Fen.gravatar.com%252Fconnect%252F%253Faction%253Drequest_access_token%26jetpack-code%26jetpack-user-id%3D0%26action%3Doauth2-login&wpcom_connect=1"
  end

Notice the user_email variable in the query string. I'm not sure about all those other redirect params, as those may change over time with how Wordpress has taken over Gravatar, but hopefully this gets you in the right direction.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文