Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+5 votes
1.4k views
in Plugins by

This tips is conversation in ASKIVE. Because I think that there are many users in hope of the same (like) things, I will share it here.

Original question:

How to make default avatar on Gravatar at registration?

My (selected) answer:

Try tiny plugin below.

1. Create new plugin (e.g. qa-plugin/default-gravatar)

2. Upload qa-plugin.php under qa-plugin/default-gravatar/

<?php
if (!defined('QA_VERSION')) {
    header('Location: ../../');
    exit;
}
qa_register_plugin_overrides('qa-default-gravatar.php')

3. Upload qa-default-gravatar.php under qa-plugin/default-gravatar/

<?php
if (!defined('QA_VERSION')) {
  header('Location: ../../');
  exit;
}
function qa_create_new_user($email, $password, $handle, $level=QA_USER_LEVEL_BASIC, $confirmed=false) {
    $userid = qa_create_new_user_base($email, $password, $handle, $level, $confirmed);
    if (qa_opt('avatar_allow_gravatar'))
        qa_db_user_set_flag($userid, QA_USER_FLAGS_SHOW_GRAVATAR, true);
    return $userid;
}

This code is very simple, but you may be able to change default specifications to be related to user registeration without core hack.

Thanks Lucas.

Q2A version: 1.6.3
by
Thanks for the valuable information
by
very helpful... thanks
by
amiyasahu.com pointed me to this post which is helpful to address my question too"http://question2answer.org/qa/39697/where-to-modify-to-pick-random-avatars-at-registration". Thank you for sharing it sama
by
Hi, What should be added in ('Location: ../../') ?
by
Hi, is it also possible to store a few avatars (jpeg files) and prompt the user to chose from the list upon registration? How can this be done?

Please log in or register to answer this question.

...