function amr_users_give_credit()
{
    // check if the web owner is okay to give credit on  a public list
    global $amain;
    //		'no_credit' => true,
    //	'givecreditmessage' =>
    if (empty($amain['no_credit']) or $amain['no_credit'] == 'give_credit') {
        if (empty($amain['givecreditmessage'])) {
            $message = amr_users_random_message();
        } else {
            $message = $amain['givecreditmessage'];
        }
        return '<a class="credits" style="font-weight: lighter;
			font-style: italic; font-size:0.7em; line-height:0.8em; float:right;" ' . 'href="http://wpusersplugin.com" title="' . $message . ' - amr-users from wpusersplugin.com' . '">' . __('credits', 'amr-users') . '</a>';
    } else {
        return '';
    }
}
function amrmeta_validate_mainoptions()
{
    global $amain;
    global $aopt;
    $amain['no_credit'] = 'no_credit';
    if (isset($_POST['no_credit'])) {
        if ($_POST['no_credit'] == 'give_credit') {
            $amain['no_credit'] = 'give_credit';
            $amain['givecreditmessage'] = amr_users_random_message();
        }
    }
    if (!empty($_POST["use_wp_query"])) {
        $amain['use_wp_query'] = true;
    } else {
        $amain['use_wp_query'] = false;
    }
    if (isset($_POST["do_not_use_css"])) {
        $amain['do_not_use_css'] = true;
    } else {
        $amain['do_not_use_css'] = false;
    }
    if (isset($_POST['use_css_on_pages'])) {
        $check = explode(',', $_POST['use_css_on_pages']);
        foreach ($check as $i => $value) {
            $check[$i] = intval($value);
        }
        $amain['use_css_on_pages'] = implode(',', $check);
    } else {
        $amain['use_css_on_pages'] = '';
    }
    if (isset($_POST['csv_text'])) {
        $return = amrmeta_validate_text('csv_text');
        if (is_wp_error($return)) {
            echo $return->get_error_message();
        }
    }
    if (isset($_POST['refresh_text'])) {
        $return = amrmeta_validate_text('refresh_text');
        if (is_wp_error($return)) {
            echo $return->get_error_message();
        }
    }
    if (isset($_POST["rows_per_page"])) {
        $return = amrmeta_validate_rows_per_page();
        if (is_wp_error($return)) {
            echo '<h2>' . $return->get_error_message() . '</h2>';
        }
    }
    if (isset($_POST["avatar_size"])) {
        $return = amrmeta_validate_avatar_size();
        if (is_wp_error($return)) {
            echo '<h2>' . $return->get_error_message() . '</h2>';
        }
    }
    $amain['version'] = AUSERS_VERSION;
    if (isset($_POST)) {
        ausers_update_option('amr-users-main', $amain);
        //ausers_update_option ('amr-users', $aopt);
    }
    return;
}