Drupal Social Network site Q&A

ncameron - January 14, 2007 - 13:53

Hi Guys,

I've recently finished and launched a social networking website made completely in Drupal 4.7. In the process of creating the site I received a lot of help from both the forum and the handbook. So I thought it was about time I gave something back. Social networks seem to be a pretty popular goal for Drupal developers so this thread might come in useful.

The site itself is using the principles of social networking to help people learn languages. Have a look here; www.huitalk.com and if you have any "how do you that" questions I'll do my best to help. I'll be a little busy over the next few weeks but I will try to respond to the questions as quickly as possible.

The site uses (among others) the following modules:

  • CCK
  • Views
  • Buddylist (hacked to pieces and reconstructed)
  • privatemsg
  • Forms
  • nice_menus
  • nodereference
  • pageroute
  • profile
  • registerprofile
  • tinymce
  • usernode
  • Looking forward to any questions!

    Neil

    Congratulations!

    funana - January 14, 2007 - 14:56

    Your site looks very nice!

    Did you know that there is a group for Social Network Sites with Drupal?

    Here we go: http://groups.drupal.org/social-networking-sites

    Have a nice day!

    __

    SEO Tips For Successful Drupal Sites
    __
    Cape Verde News & Community
    My Info Collection

    Buddylist

    dkruglyak - January 14, 2007 - 15:31

    Any possibility of releasing "hacked to pieces and reconstructed" version?

    Where are the weak spots you had to fix?

    The trouble is I'm in a

    ncameron - January 15, 2007 - 03:19

    The trouble is I'm in a slightly dangerous position. I have enough coding knowledge to hack away and make mods but not enough to constructively contribute to modules. There were not really weak points that I was working around, it was more a lack of functionality. The following were things I achieved through modifications:

    - Pics in the buddy list
    - Country info in buddy list
    - Using HEAD code enable 'confirmation' i.e you are not my buddy until you approve my request
    - Using HEAD code to enable a person to type a message when the invite someone
    - Auto sending an email when a buddy list is requested (v. important fo us)
    - Disabling the groups feature (unnecessarily complicated for our needs)
    - Slight changes in the appearance of the messages when adding a buddy.
    - creating a single page to view all buddy statuses.

    The other thing that complicates things is that the mods are spread over 3 areas. A few changes to the module file, a few changes that went into template.php and a static page for the MyFriends page.

    I'm sure this flies in the face of all coding standards but it certainly gets the job done. Many of the above features may well be implemented in the latest release of buddylist. If you are interested in the above mods, do so at your own risk - I think I will enter a world of pain when upgrade time comes!

    If you are seriously interested in implementing some of the above features let me know and I will try to explain. I say 'seriously' because it will be a fair bit of time and effort for me.

    Hope this helps,

    Neil

    - Connecting Language Learners
    www.huitalk.com

    Elaborate

    Zoologico - January 14, 2007 - 22:08

    Hi Neil,

    If it doesn't infringe too much would you kindly answer:

    1) Do you have a complete list of modules that you used?

    2) For what purpose and how do you use each module? Do you use each solely for their intended purpose or did you find an alternative way to use some?

    3) How much "hacking" did you have to do? Just looking for a general idea like "I had to modify the code on all, most, considerable, few, or none of the modules."

    4) If you did have to modify code, what are your plans when upgrade time comes around?

    Thanks kindly and nice work on the site. I like the concept and the graphics just on my first impression.

    Phew... ok, this will be a

    ncameron - January 15, 2007 - 03:47

    Phew... ok, this will be a long one:

    1) Do you have a complete list of modules that you used?

    block
    buddylist
    chatroom
    comment
    computed_field
    contemplate
    content
    date
    feedback
    filter
    forms
    help
    image
    image_exact
    imagefield
    inactive_user
    insert_view
    invite
    landing_page
    link
    locale
    menu
    nice_menus
    node
    nodefamily
    nodeprofile
    nodereference
    number
    optionwidgets
    page
    pageroute
    pageroute_ui
    path
    pathauto
    poll
    privatemsg
    profile
    registerprofile
    search
    simplenews
    statistics
    story
    system
    taxonomy
    text
    tinymce
    tracker
    user
    usernode
    userpoints
    userreference
    views
    views_fusion
    views_rss
    views_theme_wizard
    views_ui
    watchdog
    xstatistics

    2) For what purpose and how do you use each module? Do you use each solely for their intended purpose or did you find an alternative way to use some?

    All were used for there stated purpose. Have a look at the project pages for what that it is. The only module I modified were buddylist (see post above). I've done some heavy theming on all the node types of both the node and the form for creating the node.

    3) How much "hacking" did you have to do? Just looking for a general idea like "I had to modify the code on all, most, considerable, few, or none of the modules."

    See above. Aside from hacking, there are some sprinklings of code in the .tpl.php files, some heavy theming of those and a fair bit of css work. But the important difference is that this is all 'above board' and should be easy when upgrade time comes.

    4) If you did have to modify code, what are your plans when upgrade time comes around?

    Go to a dark corner, curl into a ball and rock back and forth until the problem goes away... Hmm. That was also a question I was also asking myself. In theory the only thing that will give me problems will be buddylist and even for that the data still goes into the database the same way so it will only really be cosmetic and process changes that will have to be re-done. The rest should be more or less painless (touch wood).

    The optimistic answer is that by the time we need to upgrade (i.e 4.7 is unsupported)(maybe 24 months?) we will either be making enough money to hand it all over to outside people or we will be looking to wind down the website.

    Hope all this helps,

    Neil

    - Connecting Language Learners
    www.huitalk.com

    Hi, this is a very nice

    msolt - February 12, 2007 - 09:32

    Hi,
    this is a very nice website. How did you print out the:

    Who's Online
    Total members: **
    Guests online: *
    Members online: *

    Is it possible that you upload the code?

    Best regards,
    Maik

    yup

    ncameron - April 2, 2007 - 08:46

    Again, sorry for the delay but better late than never eh? Below is the code for Who's online block. I have a feeling I copied and pasted this wholesale from another post on drupal.org.

    <?php
    $number
    = db_result(db_query('SELECT COUNT(uid) AS number FROM {users} WHERE status=1'));

             
    // Count users with activity in the past defined period.
             
    $time_period = variable_get('user_block_seconds_online', 900);

             
    // Perform database queries to gather online user lists.
             
    $guests = db_fetch_object(db_query('SELECT COUNT(sid) AS count FROM {sessions} WHERE timestamp >= %d AND uid = 0', time() - $time_period));
             
    $users = db_query('SELECT uid, name, access FROM {users} WHERE access >= %d AND uid != 0 ORDER BY access DESC', time() - $time_period);
             
    $members = db_fetch_object(db_query('SELECT COUNT(uid) AS count FROM {users} WHERE access >= %d AND uid != 0', time() - $time_period));
             
    $total_users = db_num_rows($users);
           
           
             
    // Format the output with proper grammar.
    echo '<id="sidebar-left" class="sidebar">';
    echo
    "Total members: $number <br>";
    echo
    "Guests online: $guests->count <br>";
    echo
    "Members online: $members->count <br>";
    ?>

    Note, if you check the site you'll see I've up graded this part to show the number of chatters. I've omitted this from the code as it is module specific. I have also omitted the part which prints the user photos and name. If you're interested in either of those parts let me know.

    Thanks,
    Neil

    - Connecting Language Learners
    www.huitalk.com

    Site looks good

    subirghosh - March 4, 2007 - 13:22

    Neil: Your site sure does look good. I mean, really good.

    But a few questions about the modules that you are using.

    i) I thought you might be using the flexinode module for the extra custom fields in the user registration form? So how have you created those?

    ii) Don't you need all the organic group modules for networking?

    And thanks for sharing. You have given back more than you think you have :)

    Hi there, Sorry for the

    ncameron - March 29, 2007 - 11:09

    Hi there,

    Sorry for the tardy response, the day job has been hectic recently. In answer to your Q's:

    i) The extra fields in the registration form is a neat optical illusion. first Usernode, nodeprofile, and nodefamily and CCK were used to create profiles as nodes. There is plenty written about how to do this. Second RegisterProfile module (http://drupal.org/project/registerprofile) was used to display these on the sign up page.

    ii) Hmm.. i looked at OG stuff thinking it might be useful but non of it was really applicable for our use. I think OG is more for giving people the spontaneous ability to form groups. Whilst this might be something for the future, at the moment we dont need it.

    Cheers for the complements, always good to hear.

    Thanks,
    Neil

    - Connecting Language Learners
    www.huitalk.com

    modules

    davidslee9 - July 16, 2007 - 22:25

    Hi

    Love the thread. I could not find all mods on the drupal site. Do you have a tar file of them?

    David

    Nice job!

    metoo - August 4, 2007 - 21:51

    I visited the site - and it is great.

    Would you be willing to tell how many hours it took to build, the duration, and the number of builders?

    Hey, Well, I don't know if

    ncameron - August 5, 2007 - 15:34

    Hey,

    Well, I don't know if my experience will help you... I built it single handedly and from nothing to running smoothly it took about 4 months but that was working about 15 hours a week on it. And I started knowing zero about Drupal/Php/MySql so there was a hell of a learning curve. Since it was completed I added a few features like the forums and vocabs and they took about 8 - 12 hours to get them up, running, themed and tested.

    Hope this helps,

    Neil

    - Connecting Language Learners
    www.huitalk.com

    Clear success

    metoo - August 7, 2007 - 10:36

    Neil,

    Building this site in less than 300 hours is great achievement.

    Nice job!

    Huitalk - your website looks

    omnyx - August 7, 2007 - 11:52

    Huitalk - your website looks really good.
    a question: how did you manage to have nice icons next to the menu items?

    cheers and keep up the good work!
    also, big thanks for 'giving back' to the community. we all appreciate that!

    So the menus are done with

    ncameron - August 7, 2007 - 23:21

    So the menus are done with nice_menus (link: http://drupal.org/project/nice_menus) which gives you nice java-esq pop out menus. It also allows you to theme a CSS file which affects the look of the menus. Each 'part' or menu option can be themed by referencing it's menu number, this can be found by going to mysite.com/admin/menu and then hovering over the 'edit' link and looking at the number in the URL.

    So your CSS file should look something like:

    #menu-142, #menu-203, #menu-217
    { /* General settings */
    background-repeat: no-repeat;
    background-position:3px 50%;
    text-indent: 20px;
    }
    /*ICONS*/
    #menu-142{/* FIND SOMEONE */
    background-image:url(http://mysite.com/files/icons/magnifier.png);
    }
    #menu-203{/* Chat*/
    background-image:url(http://mysite.com/files/icons/comments.png);
    }
    #menu-217{/* Forum*/
    background-image:url(http:/mysite.com/files/icons/user_comment.png);

    Note the first parts of the CSS which indents the text and positions the 'background' image (the icon).

    The actual icons are freely available from http://www.famfamfam.com/ they're cute, free and there are 1000's of them.

    Good luck!

    Neil

    - Connecting Language Learners
    www.huitalk.com

    thanks for your help

    omnyx - August 9, 2007 - 20:20

    thanks for your help Neil!

    before I download nice_menus two questions:
    1. it says it's still .dev version. Does that mean it's usable and will it create trouble with this particular task (i.e. putting icons next to menu items)
    2. do i need nice_menus to begin with if I'm just putting icons next to menu items? :)

    many thanks...i will be checking your site out and ask more questions if that's ok :)

    cheers

    Hey, As far as I know, 1)

    ncameron - August 11, 2007 - 09:34

    Hey,

    As far as I know,

    1) I've had no problems so far, its worked fine.
    2) I wanted nice pop out menus so I never checked any other way of doing it, I can't think of any other way of doing it but there might be!

    Cheers,
    Neil

    - Connecting Language Learners
    www.huitalk.com

    Clean theme and tight site.

    ulfk - August 8, 2007 - 00:23

    Clean theme and tight site. Really appreciate your sharing implementation details and challenges!

    duplicate

    ulfk - August 8, 2007 - 00:43

    -

    I would like to know

    touchcrew - August 10, 2007 - 16:08

    How did you get the images to show up in the buddy list this is sommething that I really want for my site?

    http://life1134.wordpress.com/
    http://www.touchcrew.com/

    Hey there, There is a lot

    ncameron - August 11, 2007 - 09:31

    Hey there,

    There is a lot already written on adding avatars to buddy lists, I would start by looking here: http://drupal.org/node/97060

    Cheers,

    Neil

    - Connecting Language Learners
    www.huitalk.com

    I saw that when i searched

    touchcrew - August 12, 2007 - 17:02

    I saw that when I searched http://drupal.org/node/97060 But I am new to Drupal and I really dont understand what it is. it does not tell me dto do anything? I can use all the help i can get. Thanks

    http://life1134.wordpress.com/
    http://www.touchcrew.com/

    I got it

    touchcrew - August 12, 2007 - 22:48

    I figured out what to do with it. But now I want to know how to get it all to work is there any way I can get you to help me out?

    http://life1134.wordpress.com/
    http://www.touchcrew.com/

    Member search

    lagatita - August 16, 2007 - 22:11

    Hi there, your site looks fantastic! I am in the process of creating a simple dating site and need a search feature which allows users to obtain a list of members, with thumbnails of their photo, based on age, location and some other fields.

    I have been looking through modules, but have not found the right one yet. I would like the user to be able to search using list selections and single line textfields. Do you have any suggestions, and how did you set up your member search?

    The search function in

    ncameron - August 17, 2007 - 08:36

    The search function in huitalk is created using views. Basically the profiles you see are created with CCK and limited to one per user see stuff about node profile module for how to do this. The profile content type mostly consists of text fields, which can be free-searched with views.

    So in conclusion views+node profile should do the job.

    Cheers,
    Neil

    - Connecting Language Learners
    www.huitalk.com

    Step by Step Instructions

    astawicki - October 1, 2007 - 01:38

    Is there a way you could give step by step instructions to make the site.

    Good Work

    sudesh_poojari - December 20, 2008 - 10:31

    Good work done,

    Your website looks good and works good too.

    registerprofile this module

    alb - February 3, 2009 - 18:37

    registerprofile: this module not exist.
    so actually 2009 which modules for manage user profile you are using?

    learning aides

    Robieoconnor - February 11, 2009 - 17:27

    Impressive site for 4 months from scratch knowledge, I would like to now what aides like books and web site you used to help master drupal php and sql.

    Robert

    At that point just

    ncameron - February 18, 2009 - 10:09

    At that point just drupal.org and lullabot podcasts. Nowerdays there are loads of resources out there. Have a look at this blog post: http://drupal.altate.ch/blog/drupal-learning-resources

    --
    Drupal Development for Pleasure and Profit
    http://drupal.altate.ch

    nice site

    sycorax - April 14, 2009 - 03:49

    nice site buddy.

    m in the process of makin one....:)

    awesome site man! can you

    Callaghan89 - April 14, 2009 - 03:51

    awesome site man!

    can you give me a step by step guide to getting Nice_menu's to work? I cant get mine too for the life of me!!!

    Cheers

    Callaghan

    a very small help...

    ashiali - April 18, 2009 - 08:05

    can anyone help me? plz its urgent
    i wanna a site where i allow people to become salesperson and earn commision on my products. each member can be visited by many people(guests) , i want to keep a track of visitors against each member so i could calculate commision of each member accordingly.
    u can also reply me at aliayesha23@yahoo.com

    Subscribing!!

    aac - May 22, 2009 - 17:44

    Subscribing!!

     
     

    Drupal is a registered trademark of Dries Buytaert.