YAFLogo

Harlequin
  • Harlequin
  • 60.4% (Friendly)
  • YAF Lover Topic Starter
11 years ago
Is it possible to pull a DNN users avatar image from YAF and have it display in another module by editing the template of that other module? If so what code in the template do I need to add? Thanks for any help!
Sponsor
Harlequin
  • Harlequin
  • 60.4% (Friendly)
  • YAF Lover Topic Starter
11 years ago
Any dev? I'd love to know if this is possible.
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
11 years ago

Is it possible to pull a DNN users avatar image from YAF and have it display in another module by editing the template of that other module? If so what code in the template do I need to add? Thanks for any help!

Originally Posted by: Harlequin 

It depends in which module you want to add it and how.

By default if the Profile Synchronizer in the DNN YAF Module is enabled, the avatar of the yaf user is synced to the dnn user photo. So all you need is use the Dnn Photo.

In Dnn there are various Tokens which you can use. But i dont know which Modules support them. For example if you turn on the Token Replacement Feature in the html Module you can do...

<img alt="avatar" src="http://yourdomain.com[Profile:Photo]" />

To show the avatar of the current user. Or do you want to show the avatar of a specific user and not the current one? That would be only possible if you know the user id.

Harlequin
  • Harlequin
  • 60.4% (Friendly)
  • YAF Lover Topic Starter
11 years ago
I am using DigArticle for my front page news, it has the option to display the users DNN profile avatar when they post a comment or submit a article next to their display name. I would rather it pull the users YAF avatar instead, and was hoping that would be possible. From what you are saying however if I set it to pull the DNN profile avatar it should still pull the YAF avatar?

The YAF Profile Synchronizer is automatically installed and started or is there something I need to do to get it to run?

Harlequin
  • Harlequin
  • 60.4% (Friendly)
  • YAF Lover Topic Starter
11 years ago
I talked to the dev of digarticle, I explained to him what I am trying to do, this is what he posted in reply about his module pulling the the YAF avatar info:

" If you get the "linking" information, where the avatar data is stored in the db. I can put something so you can do something like [author:yafid] "

Looks like he wants to add a token to his module template to his module to link to your avatar. If you could post what he is asking for I'll relay it to him, thanks!

Harlequin
  • Harlequin
  • 60.4% (Friendly)
  • YAF Lover Topic Starter
11 years ago
Watcha, just wanted to bump this so you can see it. I am not sure what he is asking for.
Harlequin
  • Harlequin
  • 60.4% (Friendly)
  • YAF Lover Topic Starter
11 years ago
daveburke
11 years ago
Harlequin,

We did this in the Sueetie Community platform where we feature YetAnotherForum.NET and use a site-wide avatar originating from the user's YAF Avatar.

http://sueetie.com 

In a nutshell, we added our own logic to YAF's avatar upload and storage, supporting full YAF usage as well as usage outside of YAF. You would do that in the YAF Profile Avatar Edit page, then you can do anything with the image you want. We saved a separate image for our purposes which we use in a Sueetie UserAvatar Control that we can drop anywhere we wish, but your logic can be anything that works for you. Just hang your logic on the YAF Profile Avatar Edit page so whenever someone adds an avatar or modifies their avatar you capture it at that one location.

This wiki document explains the UserAvatar Control a bit.

http://sueetie.com/wiki/PatternsUserAvatarControl.ashx 

The UserAvatar Control and the modifications we made to the YAF Profile Avatar Edit page is available in the Sueetie Source.

-Dave

Harlequin
  • Harlequin
  • 60.4% (Friendly)
  • YAF Lover Topic Starter
11 years ago
Thank you for the reply, but without editing the YAF source code, there isn't a simple slice of code one can put into the module to pull the YAF avatar?