WODA: FAQs

 Users

How do I create a user database that will handle new member signups?
What I want to do is :

1. Create a user database that will handle new member signups, just take basic info from new members and store it in the database with a username/password.

2. Create a "Member's Rides" section that will provide a showcase for my members vehicles (pictures, modifications, general descriptions etc.). The users should be allowed to upload their own pics, change their own descriptions, etc. I would like for the same username/password to be used when they originally signed up and entered their info into the user database.

3. Create a Member of the Week feature on our main page that will randomly select one member and their picture to be displayed each week. This info should be pulled from the Member's Rides database.

---------------------------------------------------------------
What you want to do is easily and very simply done (one working hour) with Woda (and perl for the random function). Here's a little how-to:

You put all the common part (and the html) in a separate file. Let's call this file "main".
We define 2 related databases:
1. members (your first sample)
2. ride (your second sample)

In the main file, you put all the common configuration directives, like
--------------------
$WBB{'manager'}
$WBB{'managerEmail'}
$WBB{'sort;DEFAULT'}
$WBB{'cacheExpire'}
$WBB{'dfltHits'}
$WBB{'maxHits'}
$WBB{'language'}
$WBB{'ascii'}
$WBB{'hideUnderscore'}
$WBB{'iconOpen'}
$WBB{'searchCache'}
$WBB{'cacheExpire'}
$WBB{'rights'} = $WBB{'rights'} || '';
# because in your case, you need different rights for each database,
# but you will need common rights if you add other databases later

$WBB{'tables'} = <members /home/domain.org/HTML/cgi-bin/members.cgi /home/domain.org/data/members
ride /home/domain.org/HTML/cgi-bin/ride.cgi /home/domain.org/data/ride
EOM
$WBB{'userTable'} = 'members';
$WBB{'userScope'}='/cgi-bin';

# if you want to aprove all new members, add this
# in you members database add a field called "status" (see manual)
$WBB{'userAllow'} = 'eq "yes"';

# you can also define all the html stuff:
#the DEFAULT format, the pageTitle pageEnd and Detail format, etc.
-----------------------------

Then in all your others config files you just need:
----------------------------------------------------
$WBB{'dbTitle'}
$WBB{'recordTitle'}
$WBB{'docsDir'} =
$WBB{'docsURL'} =
$WBB{'requireFile'} = '/home/domain.org/HTML/cgi-bin/main';
$WBB{'tables'}= 'main';
$WBB{'userTable'} = 'members';
$WBB{'userScope'}='/cgi-bin';
$WBB{'rights'}
---------------------------------

The members database:
----------------------
The database key must be the username
like this: WBB{key} = "$rec{username}"
and in the fields definition, use:
$x= username;
WBF{$x}=etc.
The password used to lock the record will be used to log in the database.
Don't forget to define a group field, for the rights in your ride database.

If you want to aprove all new members, add a field called "status" (see manual), like this:
$x='status'; #############
$WBF{$x,srt}=$i--;
$WBF{$x} = '1;';
$WBF{$x,'type'} = 'OPTION';
$WBF{$x,'typePar'} = 'RADIO';
$WBF{$x,'options'} = <<'EOF';
no
yes
EOF
$WBF{$x,'d'} = 'no'; # default value
$WBF{$x,'modifies'}='admin'; # only admin can modify
$WBF{$x,'sees'}='admin'; # only admin can see the content
--------------------------

The ride database:
-------------------
nothing special, but the rights.
The username field take its value from the member database (the key of the record, i.e. the username used to log in). If I'm not wrong, you can use:
$WBF{$x,'d'} = '$User';
------------------------

The member of the week feature will need some perl coding for the random. Use a QRY to call the record.


If you need more explanations, it will be in another mail.

Regards Xavier
modify the informationdelete entire recordexplain the meaning of the fieldsbrowse recordsAdd a new questionHome page of this databaselogin Valid HTML 4.01 Transitional Valid CSS! Powered by WODA 4.6x trunk