luca90
Total posts: 65
05 Апр 2015 16:59

Hi,

i have the community integration with JSN PROFILE.

i have the image of user profile in the user's homepage section. I want to insert in this page another field of jsn profile.

In the file default_user_block i have this line to load the user avatar.

<img src="/<?php echo CCommunityHelper::getAvatar(JFactory::getApplication()->input->getInt('user_id'), $params->get('personal.user_avatar_w', 100), $params->get('personal.user_avatar_h', 100));?>" />

How can i load another field of JSN PROFILE such us another image field etc?

Thanks

Последние изменения: 29 Апр 2015


asmuz
Total posts: 102
06 Апр 2015 10:00

Read EasyProfile documentation. Click here to link...


luca90
Total posts: 65
07 Апр 2015 17:56

Hi,

thanks for the link. But how can insert $user->field_alias into community php file of Cobalt?


Sergey
Total posts: 13,748
20 Апр 2015 11:34

Somethign like this in Cobalt template

$user = JsnHelper::getUser($item->user_id);
echo $user->field_alias;

luca90
Total posts: 65
23 Апр 2015 21:26

Hi,

i have insert

$user = JsnHelper::getUser($item->user_id); echo $user->field_alias;

into default_user_block cobalt file (file override) but i have two errors:

  • Warning: mysql_result() expects parameter 1 to be resource, boolean given in MY MODIFIED FILE
  • Fatal error: Class 'JsnHelper' not found in MY MODIFIED FILE.

How can i resolve?


Jeff VIP
Total posts: 745
24 Апр 2015 01:58

Did you insert require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php'); before your code?

Did you replace field_alias with the alias of the field you want to use?


luca90
Total posts: 65
24 Апр 2015 19:03

Hi, thanks works!!


luca90
Total posts: 65
24 Апр 2015 21:37

Hi,

another question about the user id and jsn field.

In index.php file template i have added this:

$utente = $_GET["user_id"];

to determinate the user id of Cobalt User Homepage.

It works if i disabled SEF and the page read the user id (it is displayed in the url. es: com_cobalt&view=records&section_id=1:alias-ialis&user_id=830). When i active SEF it doesn't work.

How can i do the same of $_GET with SEF enabled?

Thanks


Sergey
Total posts: 13,748
27 Апр 2015 05:07
$id = JFactory::getApplication()->input->getInt('user_id', 0);

luca90
Total posts: 65
29 Апр 2015 07:23

Hi, thanks. Works!

Работает на Cobalt