Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author myCred

    (@designbymerovingi)

    The myCRED_Query_Log class is used whenever the log is queried. I am working on a tutorial that goes though this class and shows you how to add those features you are asking for.

    By itself, the myCRED_Query_Log class supports searching the log and filter results by date. But the dropdown menus and search fields we have to add ourselves.

    Thread Starter Ramon

    (@monray67)

    hi Gabriel

    not how I can help to add these new functions

    with these changes and could start the integration of mycred
    on the web
    and could remove cubepoint

    Thread Starter Ramon

    (@monray67)

    I’m working
    on this code
    <?php mycred_get_total_by_time( $from, $to, $ref, $user_id, $type ); ?>

    but does not return
    no value

    I can help

    see example page
    https://espavirtual.com/author/admin

    regards

    Thread Starter Ramon

    (@monray67)

    if I work with

    <?php echo do_shortcode(‘[mycred_history time=”thismonth”]’); ?>

    Plugin Author myCred

    (@designbymerovingi)

    Can you show me how you use the mycred_get_total_by_time function? Please use pastebin for larger code snippets.

    Thread Starter Ramon

    (@monray67)

    Hi,

    <div style="background: #EFEFEF; display: inline-block;">
    <div style="float: left; font-size: 17px; font-weight: bold; background: #E0E0E0; padding: 18px; color: #565656;">Mi Saldo</div>
    <div style="float: left; padding: 18px; font-size: 20px;"><?php echo mycred_get_users_cred( $user_id, $type ); ?> <?php echo mycred_name( $singular ); ?></div>
    </div>
    <div style="background: #EFEFEF; display: inline-block;">
    <div style="float: left; font-size: 17px; font-weight: bold; background: #E0E0E0; padding: 18px; color: #565656;">Mi Rango</div>
    <div style="float: left; padding: 18px; font-size: 20px;"><?php echo mycred_get_my_rank();?> </div>
    </div>
    <div style="clear: both;"></div>
    
    <p style="font-weight: bold;">Información sobre sus ingresos y gastos</p>
    
    <?php mycred_get_total_by_time( $from, $to, $ref, $user_id, $type ); ?>
    Thread Starter Ramon

    (@monray67)

    and this function
    not me
    returns
    prefix
    <?php echo mycred_get_users_cred( $user_id, $type ); ?>
    Only the balance

    doing
    so
    <?php echo mycred_get_users_cred( $user_id, $type ); ?> <?php echo mycred_name( $singular ); ?>
    is how I get the prefix

    Plugin Author myCred

    (@designbymerovingi)

    Hey Ramon.

    If you enable WP_DEBUG and visit this page, do you get any error messages? I assume you have defined the variables you are using?

    Also, when writing code snippets on this forum, please select your code and click on the “code” button above the textarea so they get wrapped.

    If you want to get a users points balance formated use the mycred_get_users_fcred function instead of mycred_get_users_cred.

    Thread Starter Ramon

    (@monray67)

    I get errors
    attached image

    https://espavirtual.com/error.png

    Plugin Author myCred

    (@designbymerovingi)

    Just as I expected. You have just copy and pasted code from the codex. ??
    This is not correct. You need to define all those values! PHP does not know what $user_id.

    Please visit the codex for the functions you are using and look at the examples.

    Let me give you an example:

    This code of yours is invalid:

    echo mycred_get_users_cred( $user_id, $type );

    This is because PHP does not know what $user_id or $type is. You need to define these.

    Example:

    $user_id = 1;
    echo mycred_get_users_cred( $user_id );

    In the above example I took out $type since you have no use for this.

    Plugin Author myCred

    (@designbymerovingi)

    If you want to use the function in BuddyPress to display the current profile id you can use:

    $user_id = bp_displayed_user_id();

    or if you want to show the current users id (the one who views the page):

    $user_id = get_current_user_id();
    Thread Starter Ramon

    (@monray67)

    I understand, I
    this is too
    complicated for
    my

    I will try to use the function
    <? php echo do_shortcode (‘[]’);?>

    whenever possible, that the
    variables are as defined

    Plugin Author myCred

    (@designbymerovingi)

    It is basic PHP but if you are unfamiliar with PHP I understand it can seem complicated.

    If the features you are looking for are offered in one of our shortcodes then you are much better of using the shortcodes.

    Thread Starter Ramon

    (@monray67)

    I’m trying
    and get
    results without
    error

    where I can
    see the value
    of the
    variables

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘add these options for page’ is closed to new replies.