1
ericktot
Re: Yogurt and Smartprofile
  • 2008/7/29 16:46

  • ericktot

  • Just popping in

  • Posts: 6

  • Since: 2003/2/21


thanks to all, thanks Shiva, thanks demian with your explanation work fine now

Quote:

demian wrote:
I got this working with XOOPS 2.0181, Yogurt 3.2rc and smartprofile 1.0 (0fficial)

this is what i do based on shiva's instruction


1. Open yogurt/index.php

find this at the end on the file

le="color: #000000"><?php /** * Closing the page */ include("../../footer.php"); ?>


Before that line Add the following code

le="color: #000000"><?php $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','smartprofile')->getVisibleFields($groups, $thisUsergroups); $profile_handler =& xoops_getmodulehandler('profile','smartprofile'); $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('fieldid'), $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 smartprofile/class/field.php and go to somewhere in line 341

replace this
le="color: #000000"><?php function getUserVars() { return xoops_getmodulehandler('profile')->getUserVars(); } }

with this one
le="color: #000000"><?php function getUserVars() { return xoops_getmodulehandler('profile','smartprofile')->getUserVars(); } }


3. Now you can refer to smartprofile variables in your yogurt social networking 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 smartprofile module
* clear templates_c and cache
* don't forget to change the link for the register.php in the login block to modules/smartprofile/register.php, and also redirect the yogurt/edituser.php or root/edituser.php to smartprofile/edituser.php
you can do this manually or by using htaccess
* also edit root/userinfo.php to make the yogurt userpage as the main userpage of your site:

Open userinfo.php in the root of your site, search at the very beggining of the file for
le="color: #000000"><?php $uid = intval($_GET['uid']); if ($uid <= 0) { redirect_header('index.php', 3, _US_SELECTNG); exit(); }

Add after this the following lines:
le="color: #000000"><?php header("Location:".XOOPS_URL."/modules/yogurt/index.php?uid=".$uid); exit();


thank you shiva......



2
ericktot
Re: Yogurt and Smartprofile
  • 2008/7/26 18:13

  • ericktot

  • Just popping in

  • Posts: 6

  • Since: 2003/2/21


No work for me, I'm doing something wrong, missing some code?

Thank you!

xoops 2.0.16
Smartprofile 1.03
Yogurt 3.2
Php5



3
ericktot
Re: username as uid ? (Yogurt Social Network)
  • 2008/5/17 1:08

  • ericktot

  • Just popping in

  • Posts: 6

  • Since: 2003/2/21


I found the code, sarahmx try...


create username.php in XOOPS root

Quote:

<?php

require_once "mainfile.php";

unset($uname);
if (isset($_GET['uname'])) $uname = $_GET['uname'];

if (isset($uname)) {
$member_handler =& xoops_gethandler('member');
$criteria = new Criteria("uname", $uname);
if ($member_handler->getUserCount($criteria) == 1) {
$user_list =& $member_handler->getUsers($criteria);
list($user) = $user_list;
header('Location: '.XOOPS_URL.'/modules/yogurt/index.php?uid=' . $user->uid()); exit ();
} else {
header('Location: '.XOOPS_URL.'/user.php'); exit ();
}

}

?>



In .htaccess in XOOPS root

Quote:

RewriteEngine On
RewriteRule ^([A-Za-z_0-9-]+)((/)|())?$ http://yourdomain.com/username.php?uname=$1


working for me =)



4
ericktot
Re: Yogurt Social Network 2.9 BETA
  • 2008/5/16 18:38

  • ericktot

  • Just popping in

  • Posts: 6

  • Since: 2003/2/21


Hi!! thank you suico for yogurt!! excellent module!

Need help, how add the date format to messages of the scrapsbook?

thank you!!



5
ericktot
Re: PHPBB converter?
  • 2007/11/23 4:03

  • ericktot

  • Just popping in

  • Posts: 6

  • Since: 2003/2/21





6
ericktot
Re: News on firstpage.
  • 2004/9/6 8:31

  • ericktot

  • Just popping in

  • Posts: 6

  • Since: 2003/2/21


Spotlight v.2.0

http://www.garbo.cc/clientes/cremita/spotlight.v2.0.rar

I have used it from the last year and works fine, I hope that she serves to you. I have installed your module LeagueStats and has a good beginning, we hope you can finish to excuses by my english to it... I speak Spanish

to greetings friend, if you have problems with the download you warn to me.

ericktot
Guatemala c.a.

Thanx for LeagueStats




TopTop