Welcome to the E-Blah Community!
We would like to welcome you to our community and invite you to register an account or login.
Being a registered member is important, as it gives you several advantages over the normal Guest status. After registering you will be able to download files and images, post messages, and access member-only portions of the forum - just to name a few. Registration is quick and simple, and only takes about a minute of your time.

E-Blah Community    Informational    Forum Updates  ›  Managing Users
Users Browsing Forum
No Members and 4 Guests

Managing Users  This thread currently has 630 views. Print
1 Pages 1 Recommend Thread
Justin
May 13, 2006, 1:43pm Report to Moderator Report to Moderator

The E-Blah Developer
E-Blah Programmer
Posts: 15,070
Gender: Male
Posts Per Day: 6.55
Reputation: 93.40%
Reputation Score: +297 / -21
Time Online: 36 days 23 hours 14 minutes
Location: Tallassee, AL
Age: 22
This is a quick tutorial on how to modify the new Member Database.  It's more module driven (I guess it could be called OO, although it's not technically written that way I don't think).

To save new member fields simply do the following:

Code
SaveMemberID(
'memberid',
%addtoID = (
'name1' => 'value1',
'name2' => 'value2'
)
);


You can also specify the names and values before calling SaveMemberID, such as:

Code
$addtoID{'name1'} = "value1";
$addtoID{'name2'} = "value2";

SaveMemberID('memberid');


or:

Code
%addtoID = (
'name1' => 'value1';
'name2' => 'value2';

SaveMemberID('memberid');


It's just a simple hash.  Once SaveMemberID is called the hash is destoryed.  So DO NOT try to gather these values later on because they won't be there.

If a value is blank, the name WILL NOT be written to the .dat file (so there won't be blank values which take up space on the server and are wasteful).

If you want to get the member data:

Code
GetMemberID('memberid');


You DO NOT need to call GetMemberID before saving.  When SaveMemberID is called the old hash refrence is destoryed, and the data is retrieved all over again.  This creates a hash refrence with the members data:

Code
$memberid{'memberid'}


This can be taken this way:

Code
$memberid{'memberid'}{'name1'}


I'm not really sure why anyone would need to use the hash refrence in basic coding though.

Hope this helps someone in adding new items to member data.  It's MUCH easier to manage than the old way ... much easier.  

Oh, one last thing, $username data is stored and retrieved the same way:

Code
$memberid{$username}{'name1'}


There's no longer seperate items for members and normal users.  This is a HUGE change, and that's why there were a lot of bugs yesterday.

DO NOT store names with spaces (ie: 'value 1'), either up an underscore or no space (ie: 'value_1' or 'value1').

If you are saving member data and then want to call it again WITHOUT a refresh, call:

Code
GetMemberID('memberid','force');


If 'force' is not there you WILL get old member data.

- Justin


I do installs for $25 and upgrades for $20.
Technical support is always free.

  Donate to E-Blah!  

My Websites: Revolution Reality (My Blog)  |  MinistryTalk.com  |  Portfolio

"But you, O Lord, are a compassionate and gracious God, slow to anger, abounding in love and faithfulness." — Psalm 86:15 NIV

Logged Offline
Site Site Private Message Private message
1 Pages 1 Recommend Thread
Print

E-Blah Community    Informational    Forum Updates  ›  Managing Users