Forums / Cotonti / General / Moar questions ;)

123>>>

Kingsley
#1 2012-01-14 17:21

I want to use an x amount of images for one (page) category. I want it to select the next image in line when a new page is added to a given category.

So when on my index and having 3 of the same category news items, they'll all show a different cat icon..

No clue on how I can achieve this, and how it's called ( <-this usally is my biggest problem).. so does anyone feel up to learning this dude some new stuff??

 

thx..

Trustmaster
#2 2012-01-14 18:40

So you want something like "image roulette" for categories in the news. Each new page "shoots" next image from its category.

Kinda tricky. If you have as many images as pages in the cat, then using PageAvatar for each page is a better idea. But if you really want a roulette which turns another round if there are more pages than icons, then you need a plugin that would:

  • store comma separated URLs to images in configs for each category (like page module stores configs for each category with BEGIN_COT_EXT_CONFIG_STRUCTURE here);
  • hook into news (or pagetags), and for each page fetch an image from config and increase the roulette counter for its category;
  • whenever counter passes the number of images in its category, it starts again with 0.
May the Source be with you!
Kingsley
#3 2012-01-16 02:28

well, actually, I've managed to fix this with html, css, a tag and the pageavatar plugin. Result will be shown shortly :)

It's a pretty nifty solution, if I say so myself. You will probably go: "Could've told ya that, dumbass!" but nevertheless.. xD


Dit bericht is bewerkt door Kingsley (2012-01-16 02:39, 12 jaren ago)
pieter
#4 2012-01-16 07:46

Maybe you can write a tutorial how you did it. Like I did for a gallery with PAGEAVATAR.

Put it here: http://www.cotonti.com/docs/plugin/

... can we help you ...
Kingsley
#5 2012-01-16 09:29

@ Pieter
 

will do that after ze theme is finished.

Added 1 hour later:

another question:

When logged out, the (user) avatar doesn't show on their profile page. Logged in, everything is fine. Any idea howcome?

Added 21 minutes later:

Oh, and I want a specific block only to appear when a user visits it's own profile page (for new p.m. amount and new profile message/new friend request
 

I guess I can achieve that with if/endif.. but dunno what kind of if/endif, clou plz.. ;)


Dit bericht is bewerkt door Kingsley (2012-01-16 11:32, 12 jaren ago)
lukgoh
#6 2012-01-16 14:50

You coul try something like: <-- IF {USERS_DETAILS_ID} == {PHP.user_id} (not sure if that's right.) --> custom block <-- ENDIF --> as for your avatar problem are you using the correct tag? Luke.

Added 2 minutes later:

Infact look at the Symisun03 theme. I am pretty sure it uses the if statements to show content if the logged in user is looking at their own profile...


Dit bericht is bewerkt door lukgoh (2012-01-16 17:24, 12 jaren ago)
Kingsley
#7 2012-01-16 15:22

well, the problem is that the avatar doesn't show when a guest is visiting the profile page. Then the word avatar is displayed. Moment of logging in, it shows again.

Am using the tag: {PHP.usr.profile.user_avatar} because of the fact that I now can adjust the height and with of the avatar on the details page..

lukgoh
#8 2012-01-16 17:19

Yeah I think you need to use {USERS_DETAILS_AVATAR} as I think {PHP.usr.profile.user_avatar} shows the avatar of the user that is logged in. If you want to adjust the height and width of the avatar you can place the tag inside a div and then using css to do something like: #divname img {height: XXpx; width: xxpx;} - I think that might be the best way to do it...

Luke.

Kingsley
#9 2012-01-16 19:40

thx luke..

lukgoh
#10 2012-01-16 19:48

Your welcome.

Kingsley
#11 2012-01-17 00:44

:( nope... avatar stays original size..

lukgoh
#12 2012-01-17 09:58

Can you pastebin your code?

Added 3 hours later:

Should be something like:

<div id="divname">{USERS_DETAILS_AVATAR}</div> then in your css: #divname img {width: xxpx; height xxpx;} 

or you could try:

<div id="divname" class="classname">{USER_DETAILS_AVATAR}</div> then in your css: .classname img {width: xxpx; height: xxpx;}

I am not sure why this wouldn't change the height and width of the avatar...


Dit bericht is bewerkt door lukgoh (2012-01-17 13:17, 12 jaren ago)
Kingsley
#13 2012-01-17 16:02

Did it exactly like you said..

see for yourself..

www.killbox1alpha.nl

user: demo pass: demo

uznik73
#14 2012-01-17 17:19

Kingsley, try:

index.css

#user2 img {
height: 100px;
width: 100px;
}
Sorry for my poor English
lukgoh
#15 2012-01-17 17:19

Sorry Kingsley, I couldn't log in with those details but I noticed for the default avatar the size is being set in its HTML, perhaps this is also happening with all avatars? 

Added 3 minutes later:

Is the avatar image like this in the tpl file: <img src="{USERS_DETAILS_AVATAR}" width="xx" height="xx" /> because you would need to remove the width and hight values 

The only other thing I can think of is moving the id from your opening table tag  to the td tag just before the image tag...

123>>>