I would like to insert in boardlistLastPost the image of the user who responds to last in a given discussion. How can I do? I was able to insert the image but you can see the avatar of your profile, because I copied the code of the user panel. Is there a code or something to make what I want? Thank you.
Dieses Projekt wird in seiner aktuellen Form die Tore bald schließen.
Hier mehr erfahren: Unsere Zukunft innerhalb des WoltLab-Ökosystems
Hier mehr erfahren: Unsere Zukunft innerhalb des WoltLab-Ökosystems
-
-
Not in the standard feature list. You would have to read out the avatar of the user giving the last answer to the thread with an event listener. So you need to use PHP to get this information in order to use it in your templates.
-
And how can I do? I can not think of anything.
-
Without any knowledge of programming inside of Community Framework you won't get any solution...
-
And how can I learn?
-
Hey
you can learn with the api and docs.
For example:
http://www.woltlab.com/downloads/manual/wcfdoc_en.pdf
http://www.woltlab.com/downloads/api/tempest/ -
I was able to understand what the code is not needed and has become so
PHP<a href="index.php?page=User&userID={@$lastPosts.$boardID->lastPosterID}{@SID_ARG_2ND}">hello</a>
Now instead of "hello" should go the code that allows me to see the avatar of the person who gave the ultimate answer to that question.
Some help? I can not find these classes, even if you have to hand the api...
-
You have to create an instance of the \wcf\lib\data\user\UserProfile-class an use its getAvatar()-method.
I recommend to create an eventlistener which catches all "lastPosterIDs", then fetches all User-objects limited by the "lasterPosterIDs" from database and after that constructing the UserProfile-class with the given database-rows. The constructed instances should be stored within in an array like that:
Finally you have to assign the array to the template. With a little modification of the template (see below) you can fetch and display the users avatar.