Support

  1. zuotoski
  2. Features Request
  3. Tuesday, June 24 2014, 04:59 AM
Hi!

It would be nice to have an Articles User Info Plugin. This would work this way:

At the end or at the bottom of each article, it would have an area with information about the Author (user who wrote or published the article), like Name, avatar, links to his/her social networks (with social network icons to make the layout more interesting), a short description, e-mail or any other relevant information.

This is very useful for sites that have more than one author to write articles, giving a more professional approach.

I know how to display these info using the Plugin Content, but I don't know how to make it appear on every article automatically without the need of the user's interaction.

There is a plugin that does it already, but it collects information from different places and the user plugin (provided by Auythor Info Box) makes redundant information in the user profile. You can have a look here: http://extensions.joomla.org/extensions/news-display/content-infos/authors/20830

Regards.
Accepted Answer
admin Accepted Answer
Admin
Hi,
sorry for late reply, it was night for us.

Try this solution (I think is the best).

add this function to our author plugin:
public function onContentAfterDisplay( $context, &$article ) {
if(isset($article->created_by) && isset($article->author) && $article->created_by && !is_object($article->author)){
require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php');
$user=JsnHelper::getUser($article->created_by);
$html=array();
$html[]='<div style="border-radius:4px;color: #71767A; background-color: #F7F7D1; border-color: #E4E999; padding: 10px;">';
$html[]='<div style="float: left; margin-right: 10px;">'.$user->getField('avatar_mini').'</div>';
$html[]='<div style="font-weight:bold">'.$user->getField('name').'</div>';
$html[]='<div style="clear:both"></div></div>';
return implode('',$html);
}

}


see here for docs https://www.easy-profile.com/docs/38-jsnuser-object.html

In this example I have load the avatar and name, you can load all fields you want (like gender,about,etc...)
for link to user profile page you can use this link
JRoute::_('index.php?option=com_jsn&view=profile&id='.$article->created_by)


This function add the author info in article page and in category page, if you want to use different layout you can use this code:
if(JRequest::getVar('view')=='article'){
//you code for article page (maybe avatar, name,about, gender ...)
}
else{
//your code for author info in category page (maybe only avatar and name)
}


We do not develop this because the standard fields are only avatar and name, and this not fit all customer. But if you have any problem, we can help you.;)
Attachments (1)
  1. more than a month ago
  2. Features Request
  3. # Permalink
zuotoski Accepted Answer
Hello,

I tried to edit the above post, but there is no Edit option anymore....

I would like to add that I actually don't know how to display the user information using Plugin Content, once it doesn't know which user to dipslay based only on the actual article. So, there would be more stuff to do.

Regards.
  1. more than a month ago
  2. Features Request
  3. # 1
zuotoski Accepted Answer
Hi!
Thanks for the fast reply and solution. I have one doubt: You said "add this function to our author plugin:", but you don't have an Author Plugin, so you mean that I should add this to the "Author Info Box Plugin" or to the "Plugin content"?

I'll wait for your answer.

Regards.
  1. more than a month ago
  2. Features Request
  3. # 2
admin Accepted Answer
Admin
Hi,
Sorry for late reply.
Yes we have author plugin. You can enable from plugin management. You can see it in previous screenshot at right bottom of title of article.

You can edit this file: /plugins/content/jsn_author/jsn_author.php
  1. more than a month ago
  2. Features Request
  3. # 3
zuotoski Accepted Answer
Content Protected
  1. more than a month ago
  2. Features Request
  3. # 4
admin Accepted Answer
Admin
The problem of COM_USERS_PROFILE_VALUE_... is a bug, we will resolve in next release, anyway the patch is here: https://www.easy-profile.com/support/removing-the-no-information-entered-on-profile.html#reply-2768

For social icon you add something like this:
if(!empty($user->facebook_link_aliasfield)) $html[]='<a target="_blank" href="'.$user->facebook_link_aliasfield.'"><img src="/facebookicon" /></a>';
if(!empty($user->twitter_link_aliasfield)) $html[]='<a target="_blank" href="'.$user->twitter_link_aliasfield.'"><img src="/twittericon" /></a>';
.......


UPDATE FOR SOCIALNETWORK: we will add navigation by key arrow on gallery. this is very simple and I decided to add it immediately. Some day to new release.;)
  1. more than a month ago
  2. Features Request
  3. # 5
zuotoski Accepted Answer
Hi!
Thanks for the feedback and "rookie tutorial". Great news about the key arrow navigation, that's brilliant!
About the "if (!empty....", as I said, I tried already. The problem is that I have the icons inside two divs, so I can not test the content of each field because they are already inside a main div - like this:

					$html[]='
<div class="bw-rs">
<div id="bw-id-rs"><a title="Facebook" href="'.$user->getField('facebook').'" target="_blank"><img class="bw-id-rs-bottom" src="/images/zpeed/redes_facebook_overlay.jpg" alt="redes facebook" width="24" height="24" /><img class="bw-id-rs-top" src="/images/zpeed/redes_facebook.jpg" alt="redes facebook" width="24" height="24" /></a></div>
<div id="bw-id-rs"><a title="Twitter" href="'.$user->getField('twitter').'" target="_blank"><img class="bw-id-rs-bottom" src="/images/zpeed/redes_twitter_overlay.jpg" alt="redes facebook" width="24" height="24" /><img class="bw-id-rs-top" src="/images/zpeed/redes_twitter.jpg" alt="redes facebook" width="24" height="24" /></a> </div>
<div id="bw-id-rs"><a title="Youtube" href="'.$user->getField('canal_do_youtube').'" target="_blank"><img class="bw-id-rs-bottom" src="/images/zpeed/redes_youtube_overlay.jpg" alt="redes facebook" width="24" height="24" /><img class="bw-id-rs-top" src="/images/zpeed/redes_youtube.jpg" alt="redes facebook" width="24" height="24" /></a></div>
<div id="bw-id-rs"><a title="Google+" href="'.$user->getField('google').'" target="_blank"><img class="bw-id-rs-bottom" src="/images/zpeed/redes_google_plus_overlay.jpg" alt="redes google+" width="24" height="24" /><img class="bw-id-rs-top" src="/images/zpeed/redes_google_plus.jpg" alt="redes google+" width="24" height="24" /></a> </div>
</div>';


If I put the "if" before any of these icon links, it will display the test in the screen instead of execute it.

Thank you very much!
  1. more than a month ago
  2. Features Request
  3. # 6
admin Accepted Answer
Admin
Hi alex you can do something like this:
$html[]='<div class="bw-rs">'
if(!empty($user->facebook_link_aliasfield)) $html[]='<div id="bw-id-rs"><a title="Facebook" href="'.$user->getField('facebook').'" target="_blank"><img class="bw-id-rs-bottom" src="/images/zpeed/redes_facebook_overlay.jpg" alt="redes facebook" width="24" height="24" /><img class="bw-id-rs-top" src="/images/zpeed/redes_facebook.jpg" alt="redes facebook" width="24" height="24" /></a></div>';
if(!empty($user->twitter_link_aliasfield)) $html[]='<div id="bw-id-rs"><a title="Twitter" href="'.$user->getField('twitter').'" target="_blank"><img class="bw-id-rs-bottom" src="/images/zpeed/redes_twitter_overlay.jpg" alt="redes facebook" width="24" height="24" /><img class="bw-id-rs-top" src="/images/zpeed/redes_twitter.jpg" alt="redes facebook" width="24" height="24" /></a> </div>';
if(!empty($user->youtube_link_aliasfield)) $html[]='<div id="bw-id-rs"><a title="Youtube" href="'.$user->getField('canal_do_youtube').'" target="_blank"><img class="bw-id-rs-bottom" src="/images/zpeed/redes_youtube_overlay.jpg" alt="redes facebook" width="24" height="24" /><img class="bw-id-rs-top" src="/images/zpeed/redes_youtube.jpg" alt="redes facebook" width="24" height="24" /></a></div>';
if(!empty($user->google_link_aliasfield)) $html[]='<div id="bw-id-rs"><a title="Google+" href="'.$user->getField('google').'" target="_blank"><img class="bw-id-rs-bottom" src="/images/zpeed/redes_google_plus_overlay.jpg" alt="redes google+" width="24" height="24" /><img class="bw-id-rs-top" src="/images/zpeed/redes_google_plus.jpg" alt="redes google+" width="24" height="24" /></a> </div>';
$html[]='</div>';
  1. more than a month ago
  2. Features Request
  3. # 7
zuotoski Accepted Answer
Hello!
Now it is great! Thanks a lot, you are brilliant.

Best Regards.
  1. more than a month ago
  2. Features Request
  3. # 8
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.
Sorry, the discussion is currently locked. You will not be able to post a reply at the moment.

Request Support

Support is currently Offline

Support Availability

Working days: Monday to Friday. The support staff is not available on weekends; in the most of cases tickets will not be answered during that time.

Reply time: Depending on the complexity of your support issue it's usually between a few minutes and 24 hours for paid members and about one week for free members. When we expect longer delays we will notify you.

Guidelines

Before you post: read the documentation and search the forums for an answer to your question.

When you post: include Site Details if you request a support (you can use the form below the reply in Site Details tab).

Auto Solved Question: If after a week the author of the post does not reply to a request by moderator, the question will be marked as resolved.

Language: only English

Search Users

Easy Profile® is not affiliated with or endorsed by Open Source Matters or the Joomla Project. Joomla is Free Software released under the GNU/GPL License.