SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2007
    Posts
    496
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Different Home page for each user

    I have developed a MLM system and now what I need is to have the feature of different homepage for different users.Is that possible ?

    Any idea ?

  2. #2
    I Never Give Up roosevelt's Avatar
    Join Date
    May 2005
    Posts
    515
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Well I don't know how you are tracking your users but I would store the users into groups, and display web pages depending on the groups.

    PHP Code:
    <?php

    switch($groupid)
    {
         case 
    1:
              include(
    'group1homepage.php');
              break;
         case 
    2:
              include(
    'group1homepage.php');
              break;
    }

    ?>

  3. #3
    SitePoint Guru
    Join Date
    Jan 2005
    Location
    heaven
    Posts
    953
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @priyakochin It's completely possible.

    Quote Originally Posted by roosevelt View Post
    Well I don't know how you are tracking your users but I would store the users into groups, and display web pages depending on the groups.

    PHP Code:
    <?php

    switch($groupid)
    {
         case 
    1:
              include(
    'group1homepage.php');
              break;
         case 
    2:
              include(
    'group1homepage.php');
              break;
    }

    ?>
    That's horribly inefficient.
    Creativity knows no other restraint than the
    confines of a small mind.
    - Me
    Geekly Humor
    Oh baby! Check out the design patterns on that framework!

  4. #4
    I Never Give Up roosevelt's Avatar
    Join Date
    May 2005
    Posts
    515
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    haha, I was gonna suggest a CMS or MVC, but from the looks of post priyakochin seems new in PHP and building his own. So, don't want to take the excitement away by throwing something that's already done.

    However, I do agree with you.

  5. #5
    SitePoint Guru
    Join Date
    Jan 2005
    Location
    heaven
    Posts
    953
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    CMS? MVC? I don't see how even apply to his question... But chances are if he's willing to build his own, he's at least making an attempt to learn you could at least encourage his attempts at knowledge by providing him with information. If he doesn't know or understand he'll ask for clarification or better yet go searching for clarity.
    Creativity knows no other restraint than the
    confines of a small mind.
    - Me
    Geekly Humor
    Oh baby! Check out the design patterns on that framework!

  6. #6
    SitePoint Evangelist
    Join Date
    Jun 2007
    Posts
    496
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by roosevelt View Post
    haha, I was gonna suggest a CMS or MVC, but from the looks of post priyakochin seems new in PHP and building his own. So, don't want to take the excitement away by throwing something that's already done.

    However, I do agree with you.
    No Mate I am not new to php, I am not looking for such a method
    What I am looking is not that you suggest.Its a simple method, that a newbie can think of.

  7. #7
    I Never Give Up roosevelt's Avatar
    Join Date
    May 2005
    Posts
    515
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I was referring to my example. First I wanted to suggest a MVC, so he can learn about it and build a good software from that framework. And from my experience you don't even have to an expert to get the basics of a framework.

    However, then I realized, he probably isn't familiar with the switch statements, or perhaps he's looking for the quickest way to accomplish what he wants to do. That's why I suggested that.

    What would you recommend? It's not his question but from your suggestions, it seems you got much better information. I am curious to learn as well.

    Edit:

    Some methods would be.

    1) Build a membership database where users are assigned to specific groups. And depending on the group you load contents.

    2) If the memberlist isn't that big, then you can store the user ids in a file, and later parse it to generate customized pages for different users.

  8. #8
    SitePoint Guru
    Join Date
    Jan 2005
    Location
    heaven
    Posts
    953
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It would be far simpler to just create a template for each user when an account is created.
    Creativity knows no other restraint than the
    confines of a small mind.
    - Me
    Geekly Humor
    Oh baby! Check out the design patterns on that framework!

  9. #9
    SitePoint Evangelist
    Join Date
    Jun 2007
    Posts
    496
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by imaginethis View Post
    It would be far simpler to just create a template for each user when an account is created.
    I am just going to try one thing, just pass a tempid with the user, so the template with that id is shown.



    let me try it.

  10. #10
    SitePoint Guru
    Join Date
    Jan 2005
    Location
    heaven
    Posts
    953
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by priyakochin View Post
    I am just going to try one thing, just pass a tempid with the user, so the template with that id is shown.



    let me try it.
    Er... When you said different home page for each user, I thought you were talking about something more like giving users their "own" home page that they can customize.... I may have read a little bit too much into your statement ^_^
    Creativity knows no other restraint than the
    confines of a small mind.
    - Me
    Geekly Humor
    Oh baby! Check out the design patterns on that framework!


Bookmarks

Posting Permissions

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