Support Forum

Req. for code change: sp_UserAvatar

BO BOZ
BOZ
Member

Keeping it simple.

Currently tagClass is used for both the div output and img src resulting in the inability of the elements being addressed independently.

Please add an imgClass element to separate the two elements.

Original code:

# now display the avatar
        $width = ($avatarData->size > 0) ? ” width=’$avatarData->size'” : “”;
        $avatar = sp_build_avatar_display($avatarData->userId, “<img src='”.esc_url($avatarData->url).”‘ class=’$tagClass’$width alt=” />”, $link);

        $avatar = “<div class=’$tagClass’>$avatar</div>n”;

 

Replacement code:

# now display the avatar
        $width = ($avatarData->size > 0) ? ” width=’$avatarData->size'” : “”;
        $avatar = sp_build_avatar_display($avatarData->userId, “<img src='”.esc_url($avatarData->url).”‘ class=’$imgClass’$width alt=” />”, $link);

        $avatar = “<div class=’$tagClass’>$avatar</div>n”;

 

PS. How did you place the code in a container on the forum yesterday, which editor or tags, please

8 Answers

New Answer

MP Mr Papa
Mr Papa
Member

the code sytnax highlighter is only available in the tinymce rich text editor…  paste the code, select the code, then hit the code button – looks like ${}

I will take a look at this… should be doable…

where were you in the alpha when we went through all this??? wink

BO BOZ
BOZ
Member

Heh, sorry like I said I was late to the game, glad I found you, not trying to bust your chops.

MP Mr Papa
Mr Papa
Member

no, we actually like this… would have be nice of course during alpha rather than just before RC, but good all the same… wink

MP Mr Papa
Mr Papa
Member

does req mean requested or required???? winkcool

changes to separate avatar container class and image class have been committed to svn…

oh… and Boz, we could always use another coder on the simple:press team! laugh

BO BOZ
BOZ
Member

Mr Papa said

does req mean requested or required???? winkcool

changes to separate avatar container class and image class have been committed to svn…

oh… and Boz, we could always use another coder on the simple:press team! laugh

Hmm well, lets see it was meant as REQuest, but would REQuired mean I get my way? wink

As to the jumping in as a coder, yeah I think Im twinkling my toes in the waters, We ll see where it goes laugh

 

Definitely easier to get these commits this way, so far, than using all my space and overhead for my rapidly growing spfunction file, GRIN 

MP Mr Papa
Mr Papa
Member

lol. understand. are you running out of svn? you could always just submit a patch…

BO BOZ
BOZ
Member

Mr Papa said

lol. understand. are you running out of svn? you could always just submit a patch…

Have to get up to speed on SVN, I understand the concepts and subversion control would have certainly pulled my bacon out of the fire on more than one occasion, but Ive been working in a local LAMP to remote LAMP environment with a SAMBA share as a manual commit wall between the two for over a decade now so old habits die hard. I grabbed tortoise and Ill see about generating some diff patches on future ideas or bugs that I can help with.

MP Mr Papa
Mr Papa
Member

yeah, tortoise svn is great… real easy to generate a patch file.. just svn checkout trunk… then make your changes and then in the right click menu, select create (generate?) patch…