$$$$ to whoever thinks they can do this for me

Discussion in 'Programming' started by jupiter23, Aug 19, 2009.

  1. #1
    http://www.muscle-book.com

    need to know if someone can make the popular members, into 2 sections, Popular Males and Popular Females..

    i was told to edit this file here

    "Please check out include/functions_general.php line 1124 and you will see popular_users(). That is the function that generates the popular members array. You will need to modify is, or make a copy of that function that only generates a specific gender."

    // THIS FUNCTION RETURNS AN ARRAY CONTAINING THE MOST POPULAR USERS
    // INPUT:
    // OUTPUT:
    function popular_users()
    {
    global $setting, $database;

    $popular_users = NULL;

    // CACHING
    $cache_object = SECache::getInstance('serial');
    if( is_object($cache_object) )
    {
    $popular_users = $cache_object->get('popular_users');
    }

    // RETRIEVAL
    //if( !is_array($popular_users) || empty($popular_users) )
    if( !is_array($popular_users) )
    {




    $sql = "SELECT count(se_friends.friend_user_id2) AS num_friends, se_users.user_id, se_users.user_username, se_users.user_fname, se_users.user_lname, se_users.user_photo FROM se_friends LEFT JOIN se_users ON se_friends.friend_user_id1=se_users.user_id WHERE se_friends.friend_status='1' AND se_users.user_search='1' GROUP BY se_users.user_id ORDER BY num_friends DESC LIMIT 20";
    $resource = $database->database_query($sql);

    $popular_users = array();
    while( $user_info = $database->database_fetch_assoc($resource) )
    {
    $popular_user = new se_user();
    $popular_user->user_info['user_id'] = $user_info['user_id'];
    $popular_user->user_info['user_username'] = $user_info['user_username'];
    $popular_user->user_info['user_photo'] = $user_info['user_photo'];
    $popular_user->user_info['user_fname'] = $user_info['user_fname'];
    $popular_user->user_info['user_lname'] = $user_info['user_lname'];
    $popular_user->user_displayname();

    $popular_users[] = array(
    'friend' => &$popular_user,
    'total_friends' => $user_info['num_friends']
    );

    unset($popular_user);
    }

    // CACHE
    if( is_object($cache_object) )
    {
    $cache_object->store($popular_users, 'popular_users');
    }
    }

    return $popular_users;
    }

    // END popular_users() FUNCTION
     
    jupiter23, Aug 19, 2009 IP
  2. dpacmittal

    dpacmittal Well-Known Member

    Messages:
    155
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    103
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    Does the database have a gender/sex column?
     
    dpacmittal, Aug 19, 2009 IP
  3. omgitsfletch

    omgitsfletch Well-Known Member

    Messages:
    1,222
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    145
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    I can easily do this for you. If you want to get in touch via PM or instant messaging, I can take a closer look at the exact changes you need (just code, or implement the code into the design, etc.) and we can discuss price and take it from there. Hope to hear from you soon!
     
    omgitsfletch, Aug 19, 2009 IP
  4. ankit_frenz

    ankit_frenz Active Member

    Messages:
    1,111
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    63
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    ankit_frenz, Aug 19, 2009 IP
  5. jupiter23

    jupiter23 Peon

    Messages:
    327
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #5
    thanks guys, someone already got the job... thanks for all your offers, much appreciated
     
    jupiter23, Aug 19, 2009 IP