HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Avatars In Personal Stats Block

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#27161 (In Topic #6265)
Joe
Avatar

Honoured member

You know how in many CMS's when a member logs in, their avatar is displayed in the side welcome block?

What I want to know is: How would I place the members avatar in the

Code

side_personal_stats
block? i.e. what files would I need to edit, what variables would be needed to use, etc.

Back to the top
 
Posted
Rating:
#27163
Avatar

You'd have to add something like the following to BLOCK_SIDE_PERSONAL_STATS.tpl:

Code

{+START,IF_NON_EMPTY,{AVATAR}}

            <div class="ocf_member_column ocf_member_column_a">

               <img class="blend" alt="{!AVATAR}" src="{AVATAR*}" />

            </div>

         {+END}

And then make the AVATAR template parameter available to the template by adding it to the /sources/blocks/side_personal_stats.php file.

Back to the top
 
Posted
Rating:
#27243
Joe
Avatar

Honoured member

Could you please be a bit more specific? I'm far from even being close to a programmer :P


Back to the top
 
Posted
Rating:
#27244
Avatar

You aren't registered, so it would be unfair of me to provide you with any more detailed support.

Back to the top
 
Posted
Rating:
#27245
Joe
Avatar

Honoured member

Unfair? You provide support to everyone, and now all of a sudden you're not able to provide me with any details?

Back to the top
 
Posted
Rating:
#27248
Avatar

Writing actual new code for free for anyone who asks is crossing the line of what we can sanely do I'm afraid. Answering questions is normally okay, but we're not guaranteeing that support, and it's very awkward when ocProducts staff are asked directly to do something for free that we don't have the time to do.
Fortunately I was responsible for recently adding a new Tempcode symbol which Philip isn't yet aware of, and the following should work in the BLOCK_SIDE_PERSONAL_STATS template, without any additional code being required:

Code

{+START,IF_NON_EMPTY,{$AVATAR}}

            <div class="ocf_member_column ocf_member_column_a">

               <img class="blend" alt="{!AVATAR}" src="{$AVATAR*}" />

            </div>

         {+END}


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#27697
Joe
Avatar

Honoured member

Ok then, maybe someone can tell me where a file is that I'm looking for.

Looking at the forum, the 'Member information' menu at the top, is this a block? Can the information in this block be found in sources/blocks ?

I was thinking if I could find the code for the avatar display, I could add it to the side_personal_stats block. I looked in the forum/pages/modules directory, but unfortunately did not find what I was looking for.

Back to the top
 
Posted
Rating:
#27702
Avatar

That's not a block, but I gave the instructions you need in my last post: just add the Tempcode/HTML I posted into the BLOCK_SIDE_PERSONAL_STATS template :).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#27705
Joe
Avatar

Honoured member

That's what I did - but it did nothing.

Back to the top
 
Posted
Rating:
#27706
Avatar

Clear your block cache :).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: