31
maxxy
Re: Xoops 2.3.1 - How to get addition field of users in Extended Profiles
  • 2009/12/29 18:23

  • maxxy

  • Quite a regular

  • Posts: 286

  • Since: 2007/6/11


Solved..here's how i did it based on the fix for yogurt+profile integration by blueteen

$profile_handler =& xoops_getmodulehandler('profile','profile');
$uid intval($_GET['uid']); //get uid from url
if ($uid <= 0) { 
 if (
is_object($xoopsUser))  {//if member
        
$profile $profile_handler->get($xoopsUser->getVar('uid'));} //get uid for the connected member
        
else {
             
header('location: ' XOOPS_URL); //back to homepage - redirect wherever you want
             
exit();
             }
 }
else 
{
//$profile = $profile_handler->get($xoopsUser->getVar('uid'));  
$profile $profile_handler->get($uid);
}

//if a correct uid passed to url - eg. : index.php?uid=12
//get uid passed to url to take right data from profile

$gender $profile->getVar('gender');
$xoopsTpl->assign('gender',$gender);



32
maxxy
Re: XOOPS 2.42 - Profile Module Registration Captcha ?
  • 2009/12/29 17:46

  • maxxy

  • Quite a regular

  • Posts: 286

  • Since: 2007/6/11


yes now its working..register.php with text captcha..


thank you alfred

why is image captcha not working..can someone explain to me

do i have any missing files ? where should i check ?



33
maxxy
Re: Xoops 2.3.1 - How to get addition field of users in Extended Profiles
  • 2009/12/29 16:50

  • maxxy

  • Quite a regular

  • Posts: 286

  • Since: 2007/6/11


The field and value is visible but its same for all profile



34
maxxy
Re: Xoops 2.3.1 - How to get addition field of users in Extended Profiles
  • 2009/12/29 16:25

  • maxxy

  • Quite a regular

  • Posts: 286

  • Since: 2007/6/11


Can someone help me

I'm using XOOPS 2.42

I'm trying to customize my user info template

i want to display a custom field manually in my user info template (gender)

here's what i did

1. in modules/profile/userinfo.php

i add this line near the footer
$profile_handler =& xoops_getmodulehandler('profile','profile');
$profile $profile_handler->get($xoopsUser->getVar('uid')); 
$gender $profile->getVar('gender');
$xoopsTpl->assign('gender',$gender);


2. and in modules/profiles/templates/profile_userinfo.html

i use
<{$gender}>


to display the value...
i viewed my profile

and it showed the value of the gender

but when i view other user profile its showed the same value of gender like in my profile


can someone correct my code?

i found this fix for yogurt+profile
https://xoops.org/modules/newbb/viewtopic.php?post_id=302702#forumpost302702

how to fix this if i'm not using yogurt

please help

TQ



35
maxxy
Re: XOOPS 2.42 - Profile Module Registration Captcha ?
  • 2009/12/29 16:15

  • maxxy

  • Quite a regular

  • Posts: 286

  • Since: 2007/6/11


i have frameworks shipped with XOOPS 2.42..downloaded here in xoops.org

there is only 2 folder in the frameworks folder

Frameworks/art
frameworks/compat


i can't see any captcha folder



36
maxxy
Re: Poster's status
  • 2009/12/29 15:32

  • maxxy

  • Quite a regular

  • Posts: 286

  • Since: 2007/6/11


..its a little bit confusing reading the instruction in this thread


For my and all xoopser future reference and info.........here's what i did in XOOPS 2.42 profile to show online/offline status in user profile


1. open root/header.php..put code below before the closing tag ?>

$online_handler =& xoops_gethandler('online');
    
mt_srand((double)microtime()*1000000);
    
// set gc probabillity to 10% for now..
    
if (mt_rand(1100) < 11) {
        
$online_handler->gc(300);
    }
    if (
is_object($xoopsUser)) {
        
$uid $xoopsUser->getVar('uid');
        
$uname $xoopsUser->getVar('uname');
    } else {
        
$uid 0;
        
$uname '';
    }
    if (
is_object($xoopsModule)) {
        
$online_handler->write($uid$unametime(), $xoopsModule->getVar('mid'), $_SERVER['REMOTE_ADDR']);
    } else {
        
$online_handler->write($uid$unametime(), 0$_SERVER['REMOTE_ADDR']);
    }


2. Open modules/profile/userinfo.php

add this code
$user_online = new XoopsUser($thisUser->getVar('uid'));
if (
$user_online->isOnline())
{
    
$xoopsTpl->assign('user_online'true);
}

before

//User info
$xoopsTpl->assign('uname'$thisUser->getVar('uname'));


3. Open modules/profiles/templates/profile_userinfo.html
add the code below where you want to show it in user profile

<br /><bOnline Status:b> <{if $user_online == true}>
                <
span style='color:#ee0000;'>Onlinespan><br />
<{else}>
                <
span style='color:#000000;'>Offlinespan><br />
<{/if}>


4. Clear Cache..Voila




37
maxxy
Re: XOOPS 2.42 - Profile Module Registration Captcha ?
  • 2009/12/29 15:09

  • maxxy

  • Quite a regular

  • Posts: 286

  • Since: 2007/6/11


i set the activate automatically ..thats what i want in the first place

but right now i want captcha for registration but currently there is none




sorry my site is still in localhost mode


in config.php i have this
Quote:

'disabled' => false, // Disable CAPTCHA


any other suggestion ?



38
maxxy
Re: XOOPS 2.42 - Profile Module Registration Captcha ?
  • 2009/12/29 13:29

  • maxxy

  • Quite a regular

  • Posts: 286

  • Since: 2007/6/11


i'm using XOOPS 2.42 - profile module..

right now i have a single page registration - deleted the complimentary step


click submit..and user is activated automatically



Quote:

you can config the captcha in file /class/captcha/config.php



what should i change ?

Quote:

defined('XOOPS_ROOT_PATH') or die('Restricted access');

/**
* This keeping config in files has really got to stop. If we can't actually put these into
* the actual XOOPS config then we should do this.
*/
return $config = array(
'disabled' => false, // Disable CAPTCHA
'mode' => 'image', // default mode
'name' => 'xoopscaptcha', // captcha name
'skipmember' => true, // Skip CAPTCHA check for members
'maxattempt' => 10, // Maximum attempts for each session
'num_chars' => 4, // Maximum characters
'rule_text' => _CAPTCHA_RULE_TEXT,
'maxattempt_text' => _CAPTCHA_MAXATTEMPTS);

?>



39
maxxy
Re: Profile Module - Website Row is displayed even value is empty
  • 2009/12/29 13:13

  • maxxy

  • Quite a regular

  • Posts: 286

  • Since: 2007/6/11


i'm using profile module - modules/profiles
that does not fix it

any other suggestion ?




40
maxxy
Re: XOOPS 2.42 - Profile Module Registration Captcha ?
  • 2009/12/29 13:11

  • maxxy

  • Quite a regular

  • Posts: 286

  • Since: 2007/6/11


i have only 1 page for registration - basic

is it in the complimetary section ? i have deleted the complimentary

how do i bring back the captcha or put the capthca in the first step ?

no preference/setting to enable/disable that i can found in the module

is this a bug ?




TopTop
« 1 2 3 (4) 5 6 7 ... 22 »



Login

Who's Online

209 user(s) are online (140 user(s) are browsing Support Forums)


Members: 0


Guests: 209


more...

Donat-O-Meter

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

Latest GitHub Commits