Members: 183  ?  Posts: 8816  ?  Topics: 746  ?  Please welcome IBRRORG, our newest member.
Please login or register.

Login with username, password and session length
 

News:

Welcome To Graphics Mayhem

collapse

Author Topic: Gender calling  (Read 240 times)

0 Members and 1 Guest are viewing this topic.

SoLoGHoST

  • SoLoGHoSt
  • Connoisseur
  • Online
  • Posts: 1711
  • SMF MOD Expert!
  • OS:
  • Windows Vista/Server 2008
  • Browser:
  • MS Internet Explorer 8.0
Re: Gender calling
« Reply #15 on: August 03, 2009, 03:04:19 AM »
    Only goes up to 442 LINES.

    SoLoGHoST

    • SoLoGHoSt
    • Connoisseur
    • Online
    • Posts: 1711
    • SMF MOD Expert!
    • OS:
    • Windows Vista/Server 2008
    • Browser:
    • MS Internet Explorer 8.0
    Re: Gender calling
    « Reply #16 on: August 04, 2009, 10:35:57 AM »
      Ok, dobie, if the avatar image is working for you, I believe I have your fix without even using the database table I created for you the other day smf_chat.

      So, let's test this out first and see if this works, and if it does, we can worry about the placement of the gender images later...

      OPEN ./SSI.php

      FIND:
      Code: [Select]
      // Fetch a specific member.
      function ssi_fetchMember($member_ids, $output_method = 'echo')
      {
      // Can have more than one member if you really want...
      $member_ids = is_array($member_ids) ? $member_ids : array($member_ids);

      // Restrict it right!
      $query_where = '
      id_member IN ({array_int:member_list})';

      $query_where_params = array(
      'member_list' => $member_ids,
      );

      // Then make the query and dump the data.
      return ssi_queryMembers($query_where, $query_where_params, '', 'id_member', $output_method);
      }

      REPLACE WITH:
      Code: [Select]
      // Fetch a specific member.
      function ssi_fetchMember($member_ids, $output_method = 'echo', $gender = false)
      {
      // Can have more than one member if you really want...
      $member_ids = is_array($member_ids) ? $member_ids : array($member_ids);

      // Restrict it right!
      $query_where = '
      id_member IN ({array_int:member_list})';

      $query_where_params = array(
      'member_list' => $member_ids,
      );

      // Then make the query and dump the data.
      return ssi_queryMembers($query_where, $query_where_params, '', 'id_member', $output_method, $gender);
      }

      FIND:
      Code: [Select]
      // Fetch some member data!
      function ssi_queryMembers($query_where, $query_where_params = array(), $query_limit = '', $query_order = 'id_member DESC', $output_method = 'echo')
      {
      global $context, $settings, $scripturl, $txt, $db_prefix, $user_info;
      global $modSettings, $smcFunc, $memberContext;

      // Fetch the members in question.
      $request = $smcFunc['db_query']('', '
      SELECT id_member
      FROM {db_prefix}members
      WHERE ' . $query_where . '
      ORDER BY ' . $query_order . '
      ' . ($query_limit == '' ? '' : 'LIMIT ' . $query_limit),
      array_merge($query_where_params, array(
      ))
      );
      $members = array();
      while ($row = $smcFunc['db_fetch_assoc']($request))
      $members[] = $row['id_member'];
      $smcFunc['db_free_result']($request);

      if (empty($members))
      return array();

      // Load the members.
      loadMemberData($members);

      // Draw the table!
      if ($output_method == 'echo')
      echo '
      ';

      $query_members = array();
      foreach ($members as $member)
      {
      // Load their context data.
      if (!loadMemberContext($member))
      continue;

      // Store this member's information.
      $query_members[$member] = $memberContext[$member];

      // Only do something if we're echo'ing.
      if ($output_method == 'echo')
      echo '


      ';
      }

      // End the table if appropriate.
      if ($output_method == 'echo')
      echo '

      ', $query_members[$member]['link'], '

      ', $query_members[$member]['blurb'], '

      ', $query_members[$member]['avatar']['image'], '
      ';

      // Send back the data.
      return $query_members;
      }

      REPLACE WITH:
      Code: [Select]
      // Fetch some member data!
      function ssi_queryMembers($query_where, $query_where_params = array(), $query_limit = '', $query_order = 'id_member DESC', $output_method = 'echo', $gender = false)
      {
      global $context, $settings, $scripturl, $txt, $db_prefix, $user_info;
      global $modSettings, $smcFunc, $memberContext;

      // Fetch the members in question.
      $request = $smcFunc['db_query']('', '
      SELECT id_member
      FROM {db_prefix}members
      WHERE ' . $query_where . '
      ORDER BY ' . $query_order . '
      ' . ($query_limit == '' ? '' : 'LIMIT ' . $query_limit),
      array_merge($query_where_params, array(
      ))
      );
      $members = array();
      while ($row = $smcFunc['db_fetch_assoc']($request))
      $members[] = $row['id_member'];
      $smcFunc['db_free_result']($request);

      if (empty($members))
      return array();

      // Load the members.
      loadMemberData($members);

      // Draw the table!
      if ($output_method == 'echo')
      echo '
      ';

      $query_members = array();
      foreach ($members as $member)
      {
      // Load their context data.
      if (!loadMemberContext($member))
      continue;

      // Store this member's information.
      $query_members[$member] = $memberContext[$member];

      // Only do something if we're echo'ing.
      if ($output_method == 'echo')
      echo '


      ';
      }

      // End the table if appropriate.
      if ($output_method == 'echo')
      echo '

      ', $query_members[$member]['link'], '

      ', $query_members[$member]['blurb'], '

      ', $query_members[$member]['avatar']['image'];
      if (!empty($gender))
      echo '
      ', $query_members[$member]['gender']['image'];

      echo '
      ';

      // Send back the data.
      return $query_members;
      }

      Now in avc_settings.php

      Change:
      Code: [Select]
      ssi_fetchMember($id);
      TO:
      Code: [Select]
      ssi_fetchMember($id, 'echo', true);
      And that should do it, I hope.  Let me know, k?  And if you don't like the where the gender image gets shown we can fix this, but please try this out and let me know if it works, k?  If not, got a few more ideas.

      Thanks

      dobie

      • Proficient
      • Offline
      • Posts: 135
      • OS:
      • Windows Vista/Server 2008
      • Browser:
      • MS Internet Explorer 6.0
      Re: Gender calling
      « Reply #17 on: August 04, 2009, 05:50:43 PM »
        hi solo m8 i tried those edits  but still no go m8 still a male no female icon showing  but should i change the actual call for gender in avc also i have this at moment


        Code: [Select]
        $config['gender']=$memberContext[$user_info['id']]['gender']['name'];

        dobie

        SoLoGHoST

        • SoLoGHoSt
        • Connoisseur
        • Online
        • Posts: 1711
        • SMF MOD Expert!
        • OS:
        • Windows Vista/Server 2008
        • Browser:
        • MS Internet Explorer 8.0
        Re: Gender calling
        « Reply #18 on: August 04, 2009, 08:58:12 PM »
          No, with the code I gave you, you don't need any $memberContext coding as the ssi_fetchMember will fetch the Username as a link to their profile, the avatar image, and the gender of that user all in 1 go.  So you can get rid of all of that $memberContext coding.  Unless the ssi_fetchMember function is not working for you.

          dobie

          • Proficient
          • Offline
          • Posts: 135
          • OS:
          • Windows Vista/Server 2008
          • Browser:
          • MS Internet Explorer 6.0
          Re: Gender calling
          « Reply #19 on: August 05, 2009, 12:02:34 AM »
            hi solo i tried that still no go with gender icon still a male as a female thanx for your help and time

            SoLoGHoST

            • SoLoGHoSt
            • Connoisseur
            • Online
            • Posts: 1711
            • SMF MOD Expert!
            • OS:
            • Windows Vista/Server 2008
            • Browser:
            • MS Internet Explorer 8.0
            Re: Gender calling
            « Reply #20 on: August 05, 2009, 05:44:53 AM »
              Yeah, I don't see any other choice but to use that smf_chat table.  Will have to check which users are in chat everytime some enters chat.  This could be difficult unless there is a way to tell if a user leaves the chatroom via php.  Is there any options in that proggie to allow a query to be made in php if a user leaves the chat room???  I don't think so, but figured I'd ask nonetheless.

              Well, catch ya laterz...
               


              Search


              Latest Activity.
              CSS Help needed by SoLoGHoST
              [Today at 10:48:50 PM]


              GM Wall by Witcher
              [Today at 09:56:24 PM]


              September's Logo Challenge "Up Top" (2009)... by Shark
              [Today at 07:43:21 PM]


              Help Needed.. by Shortie
              [Today at 01:52:00 PM]


              The PlayGround Ultimate Support Thread by Shortie
              [Today at 08:46:15 AM]


              A Warm TN Hello by SoLoGHoST
              [Today at 07:02:05 AM]


              Typo by Shortie
              [Today at 01:19:57 AM]


              Graphics Mayhem Wallpaper Collection September 2009 by Witcher
              [Yesterday at 09:52:35 PM]


              Shortie's General wallpapers by NerdBoy
              [Yesterday at 06:44:34 PM]


              GM Dock Images by NerdBoy
              [Yesterday at 04:01:03 PM]


              SoLoSMiLeYS by SoLoGHoST
              [Yesterday at 03:41:21 PM]


              Some Blue and Black Icons by Shortie
              [Yesterday at 03:18:17 PM]


              Purple - To - Black Icons by Shortie
              [Yesterday at 01:58:46 PM]


              Some #400040 Dock Icons blending to Black by Shortie
              [Yesterday at 10:29:06 AM]


              Some Red and Black Dock icons by NerdBoy
              [Yesterday at 07:50:34 AM]



              Page created in 0.114 seconds with 25 queries.