JoniJnm wrote:
Hi,
You can add it manually. For example, if you want add a field which show the user's country:
{Kunena}/JoniJnm_plugins/plugins/jomosocial/jomsocial.xml
add:
<param type="text" name="country" default="0" title="Country" />
{Kunena}/JoniJnm_plugins/plugins/jomosocial/helper.php
add (in the integration function, in "foreach"):
elseif ($dato->field_id == $plugin->getParam("country", 0)) {
$userinfo->country = $dato->value;
}
Later, in the file {template}/message.php, search:
if (isset($msg_birthdate)) {
echo $msg_birthdate;
}
and add later:
if (isset($userinfo->country)) {
echo $userinfo->country;
}
Thank you for amazing work! I was waiting for something like that! Tryin first to migrate to phpBB3 but you stopped me! Thanks.
And my question about above modification - can't add dditionaal info. For example I would like to add 2 fields - home town and city. In JS those fields are named
Miasto w PL - for hometown Miasto w UK - for city
and... doesn't show enything. I mean only DOB and gender is showin. And I've tryied in Kunena Configuration assing different value to gender and DOB than default and it change nothing.
My code for
jomsocial.xml
<param type="text" name="gender" default="2" title="K_JOMSOCIAL_GENDER" />
<param type="text" name="hometown" default="4" title="Miasto w PL" />
<param type="text" name="city" default="11" title="Miasto w UK" />
<param type="text" name="signature" default="0" title="K_JOMSOCIAL_SIGNATURE" />
<param type="text" name="country" default="0" title="Country" />
helper.php
elseif ($dato->field_id == $plugin->getParam("birthdate", 3)) {
$userinfo->birthdate = explode(" ",$dato->value);
$userinfo->birthdate = $userinfo->birthdate[0];
}
elseif ($dato->field_id == $plugin->getParam("country", 0)) {
$userinfo->country = $dato->value;
}
elseif ($dato->field_id == $plugin->getParam("gender", 2)) {
$userinfo->gender = "";
$kunena_db->setQuery("SELECT options FROM #__community_fields WHERE id=".$dato->field_id);
$options = explode("\n", $kunena_db->loadResult());
$i=0;
while (!$userinfo->gender && $i<count($options)) {
if ($options[$i] == $dato->value) {
$userinfo->gender = $i+1;
}
$i++;
}
}
elseif ($dato->field_id == $plugin->getParam("hometown", 4)) {
$userinfo->country = $dato->value;
}
elseif ($dato->field_id == $plugin->getParam("city", 11)) {
$userinfo->country = $dato->value;
}
elseif ($dato->field_id == $plugin->getParam("signature", 0)) {
$userinfo->signature = $dato->value;
}
message.php
<?php
if (isset($msg_birthdate)) {
echo $msg_birthdate;
}
if (isset($userinfo->hometown)) {
echo $userinfo->hometown;
}
if (isset($userinfo->city)) {
echo $userinfo->city;
}
}
?>
Thanks in advance for your reply!
:*