1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Lack of Interest Add gender to UserModel::prepareUserConditions

Discussion in 'Closed Suggestions' started by ragtek, Sep 15, 2011.

  1. ragtek

    ragtek Guest

    We're having already a nice set of conditions here, but a IMO important condition is also the gender.

    I know that we're able to add this via add-ons, but nobody wants to use my framework which extends the xf core and i don't want to include the same event to extend the prepareUserConditions in all add-ons where it's needed.
  2. Cezz

    Cezz Well-Known Member

    You can check the gender in templates already...

    <xen:if is="{$visitor.gender} == "male">This would be displayed to all men</xen:if>
    <xen:if is="{$visitor.gender} =="female">This would be displayed to all women</xen:if>
    <xen:if is="!{$visitor.gender} OR {$visitor.gender} == """>This would be shown to anyone who hasn't set a gender</xen:if>
  3. ragtek

    ragtek Guest

    It's for grabbing all male/female users.

    $criteria = array( 'gender' => 'male') $usermodel->getUsers($criteria);

    will return only male users.

    ATM i would need to use a own query for this, or extend the prepareUserConditions method
  4. Cezz

    Cezz Well-Known Member

    ahhh right I understand sorry didn't read the thread title properly... Yes this would be very useful!

Share This Page