21
eventspeak
Re: Xoops 2.3 User Profile & Yogurt 3.3
  • 2008/10/5 19:34

  • eventspeak

  • Just popping in

  • Posts: 66

  • Since: 2006/3/20


I second this. I tried to implament the hack but it does not work. It is still taking the user to the old profiles profile.

Any one suggest.. ??
James Trivlis
james(@)Eventspeak.com
http://www.eventspeak.com

22
sarahmx
Re: Xoops 2.3 User Profile & Yogurt 3.3
  • 2008/10/9 5:32

  • sarahmx

  • Quite a regular

  • Posts: 381

  • Since: 2007/10/28


::( didn't work anymore...

help

23
demian
Re: Xoops 2.3 User Profile & Yogurt 3.3
  • 2008/10/16 14:10

  • demian

  • Quite a regular

  • Posts: 225

  • Since: 2008/4/29


bump again..

help...us...


24
jimmyx
Re: Xoops 2.3 User Profile & Yogurt 3.3
  • 2008/11/15 0:40

  • jimmyx

  • Quite a regular

  • Posts: 338

  • Since: 2007/7/18


anyone ?

is this somehow related

Xoops 2.3.1 - How to get addition field of users in Extended Profiles

my coding skill is not good enough

25
noo-b
Re: Xoops 2.3 User Profile & Yogurt 3.3
  • 2008/11/23 3:45

  • noo-b

  • Just can't stay away

  • Posts: 456

  • Since: 2007/10/23


Quote:

sarahmx wrote:
I solved this myself...

1. Open yogurt/index.php

find this at the end on the file

/**
 * Closing the page
 */ 
include("../../footer.php");
?>


Before that line Add the following code

$gperm_handler = & xoops_gethandler'groupperm' );
$groups is_object($xoopsUser) ? $thisUser->getGroups() : array(XOOPS_GROUP_ANONYMOUS);

// Dynamic User Profiles
$thisUsergroups =& $thisUser->getGroups();
$fieldids xoops_getmodulehandler('visibility','profile')->getVisibleFields($groups$thisUsergroups);

$profile_handler =& xoops_getmodulehandler('profile','profile');
$fields =& $profile_handler->loadFields();

$profile $profile_handler->get($thisUser->getVar('uid'));
// Add dynamic fields
foreach (array_keys($fields) as $i) {
    
//If field should be shown
    
if (in_array($fields[$i]->getVar('field_id'), $fieldids)) {
        
//echo "VAL0:".$value."<P>";
        
$value $fields[$i]->getOutputValue($thisUser$profile);
        if (
is_array($value)) {
            
$value implode('<br />'array_values($value));
        }
        if(
$value){
        
$fieldattr=array('title' => $fields[$i]->getVar('field_title'), 'value' => $value);
        
$fieldname=$fields[$i]->getVar('field_name');
        
$xoopsTpl->assign($fieldname$fieldattr);    
        }
    }
}



2. open modules/profile/class/field.php and replace this
function getUserVars() {
        return 
xoops_getmodulehandler('profile')->getUserVars();
    }
}

with this one
function getUserVars() {
        return 
xoops_getmodulehandler('profile','profile')->getUserVars();
}
    }


3. Now you can refer to XOOPS user profile 2.3rc2 variables in your yogurt social networking 3.3 index template:

(modules/yogurt/templates/yogurt_index.html)

example if you created a field named age

put this in the yogurt index template

Age: <{$age.value}>

* make sure to set the permission for the field you created in profile module
* clear xoops_data cache


credit to shiva and demian


anyone know how to fix this to work with XOOPS 2.31 final ?????
I Love Xoops

26
sarahmx
Re: Xoops 2.3 User Profile & Yogurt 3.3
  • 2008/12/8 8:24

  • sarahmx

  • Quite a regular

  • Posts: 381

  • Since: 2007/10/28


still waiting for this to working again..anyone have any luck ???



i want an early christmas present !!!!!

27
pablo103
Re: Xoops 2.3 User Profile & Yogurt 3.3
  • 2008/12/9 23:22

  • pablo103

  • Not too shy to talk

  • Posts: 181

  • Since: 2008/2/3 1


Not really, i am just experimenting but no luck...

28
blueteen
Re: Xoops 2.3 User Profile & Yogurt 3.3
  • 2008/12/12 14:39

  • blueteen

  • Quite a regular

  • Posts: 379

  • Since: 2004/7/16


Thanks to Ghia's post and jimmyx's post above, i can suggest you a solution.
In french here.

And the translation :

So, I suggest a first test with the addition of a field (date_birthday) in the 'profile' module, and displaying this date into 'yogurt' module.

I first created a field (date format) in the module 'profile' (under XOOPS 2.3.x, profil 1.51 and yogurt 3.3).
The label is 'Date of birth', and the name of the field in the database will be 'date_birthday'.

Resized Image

Resized Image

Resized Image

Then I edit my profile in module 'profile', and I set a date of birth.
I found this date in my profile.

Resized Image

edit /modules/yogurt/index.php
And juste before the line :
include("../../footer.php");

Add :
$profile_handler =& xoops_getmodulehandler('profile','profile');
$profile $profile_handler->get($xoopsUser->getVar('uid'));
$date_birthday date('d/m/Y'$profile->getVar('date_birthday'));
$xoopsTpl->assign('date_birthday',$date_birthday);

As this date is stored as an integer, I use the php function 'date' to change the format.

I can now use the smarty variable :
<{$date_birthday}>


That's what I do with the file /modules/yogurt/templates/yogurt/index.html, changing the line 105:
<class="odd"><img src="images/username.gif" /><span class="yogurt-profileinfo-label"><{$lang_uname}>:</span><span class="yogurt-profileinfo-value"><{$user_uname}></span></p>

With :
<class="odd"><img src="images/username.gif" /><span class="yogurt-profileinfo-label"><{$lang_uname}>:</span><span class="yogurt-profileinfo-value"><{$user_uname}> - <{$date_birthday}></span></p>

Wich displays :

Resized Image

I can use this variable everywhere in the template.

In case of text variable, you can use this simple code :
$my_variable $profile->getVar('my_text_variable');
$xoopsTpl->assign('my_text_variable',$my_variable);

Instead of :
$date_birthday date('d/m/Y'$profile->getVar('date_birthday'));
$xoopsTpl->assign('date_birthday',$date_birthday);


I can the display this variable where I want with
<{$my_text_variable}>

29
ghia
Re: Xoops 2.3 User Profile & Yogurt 3.3
  • 2008/12/12 14:51

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


InQuote:
With :

<class="odd"><img src="images/username.gif" /><span class="yogurt-profileinfo-label"><{$lang_uname}>:</span><span class="yogurt-profileinfo-value"><{$user_uname}> - <{$date_naissance}></span></p>
date_naissance has to be date_birthday.

30
blueteen
Re: Xoops 2.3 User Profile & Yogurt 3.3
  • 2008/12/12 14:55

  • blueteen

  • Quite a regular

  • Posts: 379

  • Since: 2004/7/16


Thank you, updated

Login

Who's Online

185 user(s) are online (130 user(s) are browsing Support Forums)


Members: 0


Guests: 185


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits