• Resolved mele03

    (@mele03)


    Hello Birds Author Box team,
    Just installled your plugin and check that all requirments are set.

    I’m getting this error: “Uncaught ReferenceError: tb_show is not defined” while trying to upload avatar from the user profile.

    Do you famiiar with the issue?

    Update:
    I will add another request/question. Is there anyway to ask the plugin to the “autor” image(avatar) from the user’s BuddyPress profile?

    $content.= ‘<img class=”birds_box_avatar” src=”‘ . get_the_author_meta(‘image’, get_query_var(‘author’)) . ====>> bp_core_fetch_avatar

    Make any sense?

    Thanks in advance

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Frederic Serva

    (@fredserva)

    What’s your version of WordPress?

    Thread Starter mele03

    (@mele03)

    4.1.1

    Plugin Author Frederic Serva

    (@fredserva)

    “Uncaught ReferenceError: tb_show is not defined” means Thickbox script is not loaded in admin, which is strange.
    Try to open birds-author-box.php (Plugins > Editor), find lines 89 to 90

    public function register_admin_scripts() {
    }

    and add
    add_thickbox();
    between this two lines.

    Let me know if it works!

    About BuddyPress:
    I will not (for now) make the plugin BP compatible.

    Thread Starter mele03

    (@mele03)

    Works. Plugin looks perfect by the way.

    Thanks a lot.

    Thread Starter mele03

    (@mele03)

    Hi guys,

    If it will help anyone in the future I managed to sync Buddypress profile avatar to this plugin by replacing this code:

    if (get_the_author_meta('image', get_query_var('author')))
                {
                    $content.= '<img class="birds_box_avatar" src="' . get_the_author_meta('image', get_query_var('author')) . '">';
                }
                else
                {
                    $blank = plugin_dir_url(__FILE__) . 'img/blank.png';
                    $content.= '<img class="birds_box_avatar" src="' . $blank . '">';
                }

    With this code:

    $avatar_args = array(
       'item_id' =>  get_the_author_meta('ID', get_query_var('author')),
       'type' => 'thumb',
       'html' => false
    );
    
    $content.= '<img class="birds_box_avatar" src="' . bp_core_fetch_avatar( $avatar_args ) . '">';

    Works perfect for me

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Uncaught ReferenceError: tb_show is not defined’ is closed to new replies.