Keyword

User Extended Fields Problems

  • Carlos Morales
  • Carlos Morales's Avatar Topic Author
  • Offline
  • New Member
More
9 years 2 months ago #136485 by Carlos Morales
User Extended Fields Problems was created by Carlos Morales
I'm new with PHP and I'm developing a website with joomla 3. I have a module which is k2 users where I show all k2 users, well, I want to add to this module some fields from the User Extended Fields Plugin and I don't know how to do it. What I have tried it's this:

<?php


// no direct access
defined('_JEXEC') or die;
$params = K2HelperUtilities::getParams('com_k2');
$limitstart = JRequest::getInt('limitstart');
?>

<div id="k2ModuleBox<?php echo $module->id; ?>" class="k2UsersBlock<?php if($params->get('moduleclass_sfx')) echo ' '.$params->get('moduleclass_sfx'); ?>">
<table id="tUsuarios">
<thead>
<tr>
<th>Avatar</th>
<th>Nombre</th>
<th>Descripción</th>
<th>Correo</th>
</tr>
</thead>
<tbody>
<?php foreach($users as $key=>$user):

$dispatcher = JDispatcher::getInstance();
JPluginHelper::importPlugin('k2');
$results = $dispatcher->trigger('onK2UserDisplay', array(&$user->profile, &$params, $limitstart));
echo $user->youtube;
?>
<tr class="<?php echo ($key%2) ? "odd" : "even"; if(count($users)==$key+1) echo ' lastItem'; ?>">
<td>
<?php if($userAvatar && !empty($user->avatar)): ?>
<a class="k2Avatar ubUserAvatar" rel="author" href="<?php echo $user->link; ?>" title="<?php echo K2HelperUtilities::cleanHtml($user->name); ?>">
<img src="<?php echo $user->avatar; ?>" alt="<?php echo K2HelperUtilities::cleanHtml($user->name); ?>" style="width:<?php echo $avatarWidth; ?>px;height:auto;" />
</a>
<?php endif; ?>
</td>
<td>
<?php if($userName): ?>
<a class="ubUserName" rel="author" href="<?php echo $user->link; ?>" title="<?php echo K2HelperUtilities::cleanHtml($user->name); ?>">
<?php echo $user->name; ?>
</a>
<?php endif; ?>
</td>
<td>
<?php if($userDescription && $user->description): ?>
<div class="ubUserDescription">
<?php if($userDescriptionWordLimit): ?>
<?php echo K2HelperUtilities::wordLimit($user->description, $userDescriptionWordLimit) ?>
<?php else: ?>
<?php echo $user->description; ?>
<?php endif; ?>
</div>

<?php endif; ?>
</td>
<td>
<?php if($userFeed || ($userURL && $user->url) || $userEmail): ?>
<div class="ubUserAdditionalInfo">

<?php if($userFeed): ?>
<!-- RSS feed icon -->
<a class="ubUserFeedIcon" href="<?php echo $user->feed; ?>" title="<?php echo JText::_('K2_SUBSCRIBE_TO_THIS_USERS_RSS_FEED'); ?>">
<span><?php echo JText::_('K2_SUBSCRIBE_TO_THIS_USERS_RSS_FEED'); ?></span>
</a>
<?php endif; ?>

<?php if($userURL && $user->url): ?>
<a class="ubUserURL" rel="me" href="<?php echo $user->url; ?>" title="<?php echo JText::_('K2_WEBSITE'); ?>" target="_blank">
<span><?php echo JText::_('K2_WEBSITE'); ?></span>
</a>
<?php endif; ?>

<?php if($userEmail): ?>
<span class="ubUserEmail" title="<?php echo JText::_('K2_EMAIL'); ?>">
<?php echo JHTML::_('Email.cloak', $user->email); ?>
</span>
<?php endif; ?>
</div>
<?php endif; ?>
</td>
<td>
<?php if($userItemCount && count($user->items)): ?>
<h3><?php echo JText::_('K2_RECENT_ITEMS'); ?></h3>
<ul class="ubUserItems">
<?php foreach ($user->items as $item): ?>
<li>
<a href="<?php echo $item->link; ?>" title="<?php echo K2HelperUtilities::cleanHtml($item->title); ?>">
<?php echo $item->title; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</td>
<div class="clr"></div>
</li>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>

How can I do it?, Thanks a lot in advance.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 2 months ago #136522 by Krikor Boghossian
Replied by Krikor Boghossian on topic User Extended Fields Problems
What does echo $user->youtube; produce?

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum