1
bluwu
Creating and printing a list from dB...
  • 2004/9/30 23:11

  • bluwu

  • Just popping in

  • Posts: 26

  • Since: 2004/6/29


I used the module kickstart instructions to create a test module. I would like the mod to simply list the names of selected users.

Using the Kickstart guide i learned how to create simple variables like name etc but is there a way to output a simple list of names?

NuB-All-the-Way,
bluwu

2
wcrwcr
Re: Creating and printing a list from dB...
  • 2004/9/30 23:30

  • wcrwcr

  • Home away from home

  • Posts: 1114

  • Since: 2003/12/12


hi bluwu

This possibility of printing some users info, sounds good to me

But what are you exactly trying to get?
Don?t forget that XOOPS already has a nice user management interface with a lot of filters.

However adding some printing funcionality to It would be really great.

I had a case that I did same printing but, since I?m not a coder, I did via phpMyAdmin.

Nice idea, bluwu.

Wilson

3
Dave_L
Re: Creating and printing a list from dB...
  • 2004/9/30 23:52

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


How much do you know about PHP, MySQL, HTML and Smarty?

4
bluwu
Re: Creating and printing a list from dB...
  • 2004/10/1 0:43

  • bluwu

  • Just popping in

  • Posts: 26

  • Since: 2004/6/29


Quote:

Dave_L wrote:
How much do you know about PHP, MySQL, HTML and Smarty?


I can work with them all but I am not 100% proficient in any of them. But explain away... I think I can follow. I've already hacked my XOOPS enough as it is to get it to do what I need for better or worse but it works...

I'm just playing so i can learn.

5
Dave_L
Re: Creating and printing a list from dB...
  • 2004/10/1 0:55

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Ok, I'll just outline the method.

In your .php file, put the items you want to display into an array, doing a database query if necessary.

So you might wind up with:

$data[0]['username'] = 'joe';
$data[1]['username'] = 'moe';
$data[2]['username'] = 'reginald';


Assign the array to a Smarty template variable:

$xoopsTpl->assign('usernames'$data);


Then in your .html file (Smarty template), display the array contents with a foreach or section loop:

<{foreach from=$usernames item='name'}>
   <{
$name.username}> <br />
<{/foreach}>


You can make it prettier by adding labels, tabulation, etc.

6
bluwu
Re: Creating and printing a list from dB...
  • 2004/10/1 1:11

  • bluwu

  • Just popping in

  • Posts: 26

  • Since: 2004/6/29


this is what i got so far for output...

$name.username
$name.username
$name.username


7
Dave_L
Re: Creating and printing a list from dB...
  • 2004/10/1 1:17

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Oops, I forgot to enclose $name.username in Smarty delimiters. I corrected my post above. (You should have caught that. )

8
bluwu
Re: Creating and printing a list from dB...
  • 2004/10/1 1:26

  • bluwu

  • Just popping in

  • Posts: 26

  • Since: 2004/6/29


true true... i think i should read up more on Smarty...

Thanks man... now i can finish jacking up my XOOPS...



Login

Who's Online

219 user(s) are online (149 user(s) are browsing Support Forums)


Members: 0


Guests: 219


more...

Donat-O-Meter

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

Latest GitHub Commits