1
karuna
How to make the new added field in xoops_user show in newbb?
  • 2004/5/3 13:58

  • karuna

  • Not too shy to talk

  • Posts: 171

  • Since: 2002/5/29


Hi

i have added a field in xoops_uers
`new_field` tinytext NOT NULL

and added this

$posterarr =  array('poster_uid' => $eachposter->getVar('uid'), 'poster_name' => $eachposter->getVar('name'), 'poster_uname' => '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$eachposter->getVar('uid').'">'.$eachposter->getVar('uname').'</a>', 'poster_avatar' => $eachposter->getVar('user_avatar'), 'poster_from' => $eachposter->getVar('user_from'), 'poster_regdate' => formatTimestamp($eachposter->getVar('user_regdate'), 's'), 'poster_postnum' => $eachposter->getVar('posts'), 'poster_sendpmtext' => sprintf(_SENDPMTO,$eachposter->getVar('uname')), 'poster_rank_title' => $poster_rank['title'], 'poster_rank_image' => $poster_rank['image'], 'poster_status' => $poster_status, [color=0000FF]'poster_new_field' => $myts->makeTareaData4Show($eachposter->getVar('new_field', 'N'), 1, 1, 1)[/color]);

in viewtopic.php

but in use the <{$topic_post.poster_new_field}> didn't got the content show.

but use
'poster_new_field' => $myts->makeTareaData4Show($eachposter->getVar('user_sig', 'N'), 1, 1, 1)
works

What's wrong with it ??

Thanks~~~

2
phppp
Re: How to make the new added field in xoops_user show in newbb?
  • 2004/5/3 14:37

  • phppp

  • XOOPS Contributor

  • Posts: 2857

  • Since: 2004/1/25


How is the new_field value set?

3
Anonymous
Re: How to make the new added field in xoops_user show in newbb?
  • 2004/5/3 14:56

  • Anonymous

  • Posts: 0

  • Since: 0


Just adding a field to the user table will not shown via xoopsuser.

You also have to add this to the user.php in the kernel folder:

1. here

$this->initVar('new_field', XOBJ_DTYPE_TXTAREA, null, false, null);

function XoopsUser($id = null)
    {
        
$this->initVar('uid', XOBJ_DTYPE_INT, null, false);
        
$this->initVar('name', XOBJ_DTYPE_TXTBOX, null, false, 60);
        
$this->initVar('uname', XOBJ_DTYPE_TXTBOX, null, true, 25);
        
$this->initVar('email', XOBJ_DTYPE_TXTBOX, null, true, 60);
        
$this->initVar('url', XOBJ_DTYPE_TXTBOX, null, false, 100);
        
$this->initVar('user_avatar', XOBJ_DTYPE_TXTBOX, null, false, 30);
        
$this->initVar('user_regdate', XOBJ_DTYPE_INT, null, false);
        
$this->initVar('user_icq', XOBJ_DTYPE_TXTBOX, null, false, 15);
        
$this->initVar('user_from', XOBJ_DTYPE_TXTBOX, null, false, 100);
        
$this->initVar('user_sig', XOBJ_DTYPE_TXTAREA, null, false, null);
        
$this->initVar('user_viewemail', XOBJ_DTYPE_INT, 0, false);
        
$this->initVar('actkey', XOBJ_DTYPE_OTHER, null, false);
        
$this->initVar('user_aim', XOBJ_DTYPE_TXTBOX, null, false, 18);
        
$this->initVar('user_yim', XOBJ_DTYPE_TXTBOX, null, false, 25);
        
$this->initVar('user_msnm', XOBJ_DTYPE_TXTBOX, null, false, 100);
        
$this->initVar('pass', XOBJ_DTYPE_TXTBOX, null, false, 32);
        
$this->initVar('posts', XOBJ_DTYPE_INT, null, false);
        
$this->initVar('attachsig', XOBJ_DTYPE_INT, 0, false);
        
$this->initVar('rank', XOBJ_DTYPE_INT, 0, false);
        
$this->initVar('level', XOBJ_DTYPE_INT, 0, false);
        
$this->initVar('theme', XOBJ_DTYPE_OTHER, null, false);
        
$this->initVar('timezone_offset', XOBJ_DTYPE_OTHER, null, false);
        
$this->initVar('last_login', XOBJ_DTYPE_INT, 0, false);
        
$this->initVar('umode', XOBJ_DTYPE_OTHER, null, false);
        
$this->initVar('uorder', XOBJ_DTYPE_INT, 1, false);
        
// RMV-NOTIFY
        
$this->initVar('notify_method', XOBJ_DTYPE_OTHER, 1, false);
        
$this->initVar('notify_mode', XOBJ_DTYPE_OTHER, 0, false); 
        
$this->initVar('user_occ', XOBJ_DTYPE_TXTBOX, null, false, 100);
        
$this->initVar('bio', XOBJ_DTYPE_TXTAREA, null, false, null);
        
$this->initVar('user_intrest', XOBJ_DTYPE_TXTBOX, null, false, 150);
        
$this->initVar('user_mailok', XOBJ_DTYPE_INT, 1, false);

2. starting at line 287

function new_field()
    {
        return 
$this->getVar("new_field");
    }

And also in the function insert()

4
karuna
Re: How to make the new added field in xoops_user show in newbb?
  • 2004/5/3 15:14

  • karuna

  • Not too shy to talk

  • Posts: 171

  • Since: 2002/5/29


Thank you very much~~