Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 2 of 8 FirstFirst 123456 ... LastLast
Results 11 to 20 of 71
  1. #11
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    pure rip source

    a function like this is good

    $userSys->getInfo( Column, Where, Return );

    eg:

    Receive the username for user ID 1

    $userSys->getInfo( 'UserID', 1, 'Username' );

    (I'll keep in your camel case)
    Last edited by Protege; 21-05-2009 at 10:16 PM.
    Hi, names James. I am a web developer.

  2. #12
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Quote Originally Posted by Source View Post
    Havnt seen how the class is written but, wouldn't it make more sense to merge

    $userSys->getUID()

    and

    $userSys->getName()


    into something like $userSys->getInfo( 'UID' )/( 'name' ); ?
    Hmm, i originally though having those two as separate functions would make working with it a little easier to novice users, although looking back you may have a point. Currenlty the method call for the info your after would be

    $userSys->currentUser->getAttribute('uid');
    or
    $userSys->currentUser->getAttribute('name');

    Quote Originally Posted by Protege View Post
    pure rip source

    a function like this is good

    $userSys->getInfo( Column, Where, Return );

    eg:

    Receive the username for user ID 1

    $userSys->getInfo( 'UserID', 1, 'Username' );

    (I'll keep in your camel case)
    pure rip source??

    Hmm, i think with that your moving more towards it simply being a layer in front of a database, which would really only service to limit what a user could normally do with SQL without really making it any easier.
    Currently all database interaction is completely abstracted, the system in the demo for example is currently running on the flat file engine

  3. #13
    Join Date
    Nov 2007
    Posts
    1,253
    Tokens
    150

    Latest Awards:

    Default

    Care to put what you have of the class on pastie.org ? No particular reason, just intrigued into the development.

  4. #14
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Update

    The Magic user system framework is going ahead as planned, I've created a project on google code to track the progress, so if your interested in this project feel free to download the current version off SVN.

    http://code.google.com/p/magic-usersystem-framework/

    If any of you want to get involved with this project the help would be welcomed.

    Also if any designers amongst you are willing to do a little spec work it, it would be great to get a nice looking default template for the demo. Aside from simply contributing, designing a template would also give you the option to have a template by link back to your own website placed in every copy of Magic replaced

    Changelog since last night;
    ] User class re abstracted, all modifications to a users profile are now handled through the user object.
    ] Register function completed
    ] Login function completed
    ] update profile function completed
    ] Fields to be used in profile can be specified in config. The profiles can be customised totally to your own likeing.
    ] Default profile layout updated.
    - uid,name,email,dob,register_date
    ] Additional fields specified in config updated
    - Usertitle,avatar,description,signature,postcount
    ] Validator class added
    ] Exception handler added
    ] None editable profile fields created
    Last edited by Mentor; 23-05-2009 at 04:18 PM.

  5. #15
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    If you really wanted to stay true to OOP then you should make it so that you can get a object for the user then have functions in that user class like getEmail, getTitle, etc.

  6. #16
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Quote Originally Posted by Tomm View Post
    If you really wanted to stay true to OOP then you should make it so that you can get a object for the user then have functions in that user class like getEmail, getTitle, etc.
    It is OOP? though somewhat more abstracted than your examples.
    PHP Code:
    <?php
    include('../Magic/magic.php');

    $userSys = new UserSystem();

    //get user 2 (me) (all hardcoded for example)
    $userObject $userSys->getUserInfo(2);//2 being my id

    echo 'Accounts name is'.$userObject->getAttribute('name');
    echo 
    'Accounts dob is'.$userObject->getAttribute('dob');
    echo 
    'Accounts avatar is'.$userObject->getAttribute('avatar');

    //equally if u were logged in you could get your user object via
    $me$userSys->getCurrentUser();//will be guest if not logged in
    $myarray$me->getAttributeArray();//return attributes as array

    //some things are accessed via direct accessors though.
    $permObj $me->getPermissions()

    //or if we wanted to we can get common options as an array via
    $common $userSys->getCurrentUserCommon();

    ?>
    The only code outside objects at all inside magic itself is the autoloader and config import (plus an installer redirect)
    Last edited by Mentor; 23-05-2009 at 04:34 PM.

  7. #17
    Join Date
    Oct 2008
    Location
    New York
    Posts
    308
    Tokens
    0

    Default

    I like how development is going. Also, I think I could give up some time to do some designing.
    ~ PixelPoco.com Co-Founder
    ~ Freelance Web developer.
    ~ Currently: Unavailable for work.



    Quote Originally Posted by Favourtism View Post
    i facebooked ur mum
    Lulz

  8. #18
    Join Date
    May 2007
    Posts
    10,481
    Tokens
    3,140

    Latest Awards:

    Default

    I couldn't see a function to get the user id from the username so perhaps:

    getUID($UName) To get the user id


    Also a plugs system would be useful
    Last edited by Chippiewill; 23-05-2009 at 07:11 PM.
    Chippiewill.


  9. #19
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Quote Originally Posted by 00chips View Post
    I couldn't see a function to get the user id from the username so perhaps:

    getUID($UName) To get the user id


    Also a plugs system would be useful
    The systems a little bit early on to be thinking about plugins, although it would be a great thing to have in the long run.

    Getting a user from there username is quite inefficient on the flat file db, so its reasonably well hidden. Currently you would need to make a call to the UserSystem method with the second parameter set as 'name'
    PHP Code:
    $name 'ted';
    $userObj $usrSys->getUserInfo($name'name'); 
    If you think it'd be useful i could easily add a wrapper object for example getUserByName('name'); or something.



    @Jaysun: thanks, any inputs good :p

  10. #20
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    3,285
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Mentor View Post
    The systems a little bit early on to be thinking about plugins, although it would be a great thing to have in the long run.

    Getting a user from there username is quite inefficient on the flat file db, so its reasonably well hidden. Currently you would need to make a call to the UserSystem method with the second parameter set as 'name'
    PHP Code:
    $name 'ted';
    $userObj $usrSys->getUserInfo($name'name'); 
    If you think it'd be useful i could easily add a wrapper object for example getUserByName('name'); or something.



    @Jaysun: thanks, any inputs good :p
    A getUserByName() functions seems reasonably sensible - the key with these framework probjects, in my view, is to make it is as easy as possible to integrate into any site in any situation.

    It seems that really the best way to do that is to add as many functions as possible for accessing data, even if they do bloat the framework - the tiny difference in loading time is probably worth it...



    i used to be NintendoNews. visit my blog or add me on twitter.
    need help with vista? i am a microsoft certified technology specialist in configuring windows vista and connected home integrator.. pm me for help!


    "I am the way, the truth, and the life. No one comes to the Father except through me"
    John 14:6 (NIV)


Page 2 of 8 FirstFirst 123456 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •