xoops forums


Just popping in
Posted on: 2012/8/2 21:22
BaptX (Show more)
Just popping in
Posts: 1
Since: 2012/8/2 2

Get Uname from Uid in my own module

Hi there,

First, i'm sorry if my question is not in the good section. Don't hesitate to move this post in the correct one. Then, i'm totaly beginner in PHP /Xoops developpment. I try to develop a module for the website of my association. Last, my english is not fluent, so i'm sorry if my explanations are bad :)

So, in order to save in database additionals informations about users, i created a new table. In order to link this table with the 'user' table, i save the uid in a column.

Now, i would to print in the admin part of my module an array with informations about all users, and the first column must be the nickname of the user.

So i created a new object which extends XoopsObject and a handler which extends XoopsPersistableObjectHandler in order to get simply datas from database. But i don't success to retrieve the uname of each user. I don't know if i need to do this in the smarty script or in my object.

I tried to do this in my class :
function __construct()
$handler =& xoops_gethandler('users');

but it is not working.

After, i tried this in my php page :
$userhandler =& xoops_gethandler('user');

and this in my smarty script :
<{foreach item=member from=$members}>
tr class="<{cycle values='odd, even'}>">

but compilation failed.

Anyone have an idea ?

Thanks in advance :)

Edit : I think it's quite difficult to find a correct way because I need to call a function from Xoops Kernel but all members are feach in the smarty script. May I have to code my own SQL request ?