This topic has 2 replies, 1 voice, and was last updated 10 years by tydd.

  • Author
  • #19499
     tydd
    Participant

    Hi, in the script below which i found in the source of the webpage where i crop avatar.

    There are 2 lines

    var fw = 150;
    var fh = 150;

    Which should be

    var fw = 580;
    var fh = 580;

    Now please tell what file to modify so it turn back to 150.

    COPY CODE
    <script type="text/javascript">
    		jQuery(window).load( function(){
    			jQuery('#avatar-to-crop').Jcrop({
    				onChange: showPreview,
    				onSelect: showPreview,
    				onSelect: updateCoords,
    				aspectRatio: 1,
    				setSelect: [ 113, 113, 337, 337 ]
    			});
    			updateCoords({x: 113, y: 113, w: 337, h: 337});
    		});
    
    		function updateCoords(c) {
    			jQuery('#x').val(c.x);
    			jQuery('#y').val(c.y);
    			jQuery('#w').val(c.w);
    			jQuery('#h').val(c.h);
    		}
    
    		function showPreview(coords) {
    			if ( parseInt(coords.w) > 0 ) {
    				var fw = 150;
    				var fh = 150;
    				var rx = fw / coords.w;
    				var ry = fh / coords.h;
    
    				jQuery( '#avatar-crop-preview' ).css({
    					width: Math.round(rx * 450) + 'px',
    					height: Math.round(ry * 450) + 'px',
    					marginLeft: '-' + Math.round(rx * coords.x) + 'px',
    					marginTop: '-' + Math.round(ry * coords.y) + 'px'
    				});
    			}
    		}
    	</script>
    
    #19500
     tydd
    Participant

    Mistakes:

    Now please tell me what file to modify so it turn back to 150 580.

    #19503
     tydd
    Participant

    I resolve it by fix /home1/bantraic/public_html/wp-content/plugins/buddypress/bp-core/bp-core-avatars.php

    COPY CODE
    if ( !defined( 'BP_AVATAR_FULL_WIDTH' ) )
    		define( 'BP_AVATAR_FULL_WIDTH', 580 );
    
    if ( !defined( 'BP_AVATAR_FULL_HEIGHT' ) )
    		define( 'BP_AVATAR_FULL_HEIGHT', 580 );
Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Avatar Cropping’ is closed to new replies.

Log in with your credentials

Forgot your details?