Forums / Cotonti / General / Moar questions ;)

<<<123>>>

Kingsley
#16 2012-01-17 17:36

Oops, was demo1.. corrected it, pass now is demo :)

<img src="{USERS_DETAILS_AVATAR}" width="xx" height="xx" /> this would not work to begin with coz output in html would have been

<img src=" <<AVATARIMAGE>> width="xx" height="xx" />

so no, never use this combo

It was, however, when I used that other tag I mentioned {PHP.urr.user_avatar} but that was before you told me that that one only works for the durrent logged in user..

lukgoh
#17 2012-01-17 17:55

oh, are you not using Siena? As {USERS_DETAILS_AVATAR} should put out: "datas/avatars/file.jpg" so yeah <img src="{USERS_DETAILS_AVATAR}" width="xx" height="xx" /> that would work. 

Anyway after logging in and looking at your html code it is setting the width and hight in your html. You need to remove the width and height from the image tag.

Added 1 minute later:

<img src="datas/defaultav/blank.png" alt="Avatar" width="75px" height="75px">

Added 1 minute later:

If the tag is producing HTML (Which it shouldn't) then you will need to edit the tag in it's php file (very minor core hack). 

uznik73
#18 2012-01-17 17:59

On my test site with siena work like this:

<img id="avatar" src="{PHP.usr.profile.user_avatar}" />

and in css file use "#avatar {width:75px}" it works....

Добавлено 19 минут спустя:

No i dont see it after logout but if it need

<img id="avatar" src="
				<!-- IF {PHP.usr.profile.user_avatar} -->
				{PHP.usr.profile.user_avatar}
				<!-- ELSE -->
				themes/{PHP.theme}/img/blank.png
				<!-- ENDIF -->
				" alt="{PHP.L.Avatar}"  />

If user have avatar he see it, if not hel see img blank. And guests see blank avatar.. 

sorry for my English

Sorry for my poor English
This post was edited by uznik73 (2012-01-17 18:19, 12 years ago)
lukgoh
#19 2012-01-17 18:26

Yeah that makes sense. The only problem he is having is he cant resize the avatar but that is because as I said before the width and hight values are being set in the html...

Added 18 hours later:

I have to apologise Kingsley, I was looking at the wrong part like an idiot... 

Ok having a look at your css and html I can see you are setting the dimensions for the box the avatar image is inside but I can't see where you are setting the dimensions for the avatar image itself. As I set an avatar of 100 x 100px I can see that it pushes itself well out of the box set to 45 x 45px. 

#userava
    {
    float: left; 
    padding: 3px; 
    border: 1px solid #d2d2d2; 
    margin-bottom: 4px;
    }
    
.useravabox
    {
    width: 45px;
    height: 45px;
    }

So where can I find the css for the classes userimg and avatar? As one of these should have the dimensions you wish to set the image for...

Added 5 minutes later:

Okay, I found this:

#avatar{
  width:35px;
  height:35px;
}

This needs to be a class so swap # with .

Added 11 minutes later:

Or perhaps that is for something else altogether, I cannot tell... 

This post was edited by lukgoh (2012-01-18 13:02, 12 years ago)
Kingsley
#20 2012-01-18 13:19
#avatar{
  width:35px;
  height:35px;
}

You found this in my css files? Cute, coz i cant find it..


Have changed it so that the avatar now has a div of it's own, but it's still not taking the dimensions I give it.
have to admit that I have nver succeeded with adapting the ava on user details on previous skins.

Will just remove it from there, and give it an place where it can has it's set dimensions.

lukgoh
#21 2012-01-18 13:39

Yeah I can't remember which of your css files I found it in. I think it was default.css or styles.css, something like that...

If you are giving it it's own div then you should try the method I gave you before, so if its like this: <div id="divname"><img src="imge"></div> then in your css you would need to put it like this: #divname img {width: xxpx; height: xxpx;} at the very least you can see if any other styles in your css are conflicting, causing it to ignor your new style...

Added 1 minute later:

But also check the core files to make sure that what ever tag you are using is not putting out html, just to make sure, it doesn't look like it is... 

Kingsley
#22 2012-01-18 13:46

You were very close Mr. Skywalker.. but the winner is:

the avatar img css with only the tag, so not the img scr part..

As you can see, now it works!

Thx for thinking along :) it's appriciated!!
 

Added 3 minutes later:

It's always nice when annoying little things that take way to much time are getting solved.. dunno, but it makes me smile and feel satisfied..
Now continuing work on teh theme!!
 

lukgoh
#23 2012-01-18 14:09

So just so I understand you properly, the tag you are using is putting out html otherwise it wouldn't work? 

Kingsley
#24 2012-01-18 14:17

think the output isn't html at all, seeing you don't need to add <img scr"..."/>. and that's were I went wrong.

You telling me it should be an id, in stead of a class made me thinking and adjusting it, with a working result.

lukgoh
#25 2012-01-18 14:20

Thats what I mean though, if you dont have to put <img src="..." /> in your tpl file and you are only using a tag to display the avatar then the tag must output the html for it to work. would you mind just pasting the line of code for the avatar please?

Kingsley
#26 2012-01-18 16:00

Lé HTML

<div id="userid">

<div id="useravabox">
    <div id="useravatar">{USERS_DETAILS_AVATAR}</div>
</div>
<div id="usernamebox">
    <p style="font-size: 20px; margin-bottom:-18px; font-weight:bold;">{PHP.urr.user_name}</p><br />
    <p class="small" style="vertical-align:middle;">{USERS_DETAILS_COUNTRYFLAG} {USERS_DETAILS_COUNTRY} &nbsp;|&nbsp; {USERS_DETAILS_GENDER}</p>
</div>
<div>
    <hr class="userhr" />
    <p class="small" style="vertical-align:middle; text-indent: 5px;"><strong>Last seen:</strong> {PHP.urr.user_lastlog|cot_date('l, F d, Y', $this)} <strong>time:</strong> {PHP.urr.user_lastlog|cot_date('H:i', $this)}</p>
</div>

</div>

Lé CSS

#userid
    {
    line-height: 15px;
    padding: 15px;
    }
    
.userhr
    {
    border-top: 1px solid #d2d2d2; border-bottom: 1px solid #efefef; border-left:0px; border-right:0px; height: 1px; border-collapse: collapse;
    }
    
#useravabox
    {
    width: 45px; 
    float: left; 
    padding: 3px; 
    border: 1px solid #d2d2d2; 
    margin-bottom: 4px;
    }
    
#useravatar img
    {
    width: 45px;
    height: 45px;    
    }
    
#usernamebox
    {
    width: 655px; 
    float: right; 
    line-height: 23px; 
    border: 0px solid #000;
    }

Added 27 seconds later:

Replaced the code just now, cleaned it up a bit for you.

lukgoh
#27 2012-01-18 16:30

Yeah, as I said for this to work:

<div id="useravatar">{USERS_DETAILS_AVATAR}</div>

The tag would have to output the image tags as well. I am guessing you are not using Siena because as far as I know tags do not output any html. 

Also I noticed you used this tag: {PHP.urr.user_name} I thought that would only load the username for who ever is logged in for some reason, but I checked and it doesn't on your site, which is also interesting. I guess I do not understand Cotonti as well as I thought. 

Well everyday is a school day, thanks for taking the time to paste this dude. 

Added 5 minutes later:

Also I noticed in your profile pages, example: user/demo if you have not selected a country or sex, etc it displays: 00 ---  |  you can tidy this up with the IF statments ;)

This post was edited by lukgoh (2012-01-18 16:35, 12 years ago)
Kingsley
#28 2012-01-18 16:37

again, it is Siena. The mistake I made was class instead of id.

 

lukgoh
#29 2012-01-18 16:42

I think it was looking in the core files, I saw how Cot builds its tags. 

$t->assign(cot_generate_usertags($urr, 'USERS_DETAILS_', '', true));

Without looking at it again I thought $urr carried stuff over to other parts. Anyways if in the database a users avatar is stored as a link to the image, so "datas/avatars/imagename.jpg" then the tag should only put out "datas/avatars/imagename.jpg" so I don't understand where it is getting the "<img src="" /> part from, to be able to just use the tag in your tpl file to display the image? It's a little confusing... 

Kingsley
#30 2012-01-18 16:44

Maybe they've set the img scr part as default for that particular tag? As long as I can remember the output is given that way (eversince seditio, cant remember if LDU had the same)

<<<123>>>