【问题标题】:drupal combine account and profiledrupal 结合帐户和个人资料
【发布时间】:2011-03-02 13:11:27
【问题描述】:

谁能建议简单的代码 sn-p 用于在 drupal 6 中组合帐户和个人资料标签。我正在使用 onepageprofile 模块工作正常,但任何其他简单的解决方案?

【问题讨论】:

    标签: drupal profile account


    【解决方案1】:

    您需要在 profile.module 中注释第 567 和 568 行,但这是 hack。

    就是这样。

    function _profile_get_fields($category, $register = FALSE) {
      $args = array();
      $sql = 'SELECT * FROM {profile_fields} WHERE ';
      $filters = array();
      if ($register) {
        $filters[] = 'register = 1';
      }
      else {
        // Use LOWER('%s') instead of PHP's strtolower() to avoid UTF-8 conversion issues.
        //$filters[] = "LOWER(category) = LOWER('%s')";
        //$args[] = $category;
      }
      if (!user_access('administer users')) {
        $filters[] = 'visibility != %d';
        $args[] = PROFILE_HIDDEN;
      }
      $sql .= implode(' AND ', $filters);
      $sql .= ' ORDER BY category, weight';
      return db_query($sql, $args);
    }
    

    【讨论】:

      【解决方案2】:

      这很棘手。如果您在 Profile 模块中定义了组,例如关于我、地址信息等示例类别,它们会在主题模板的 $tabs2 数组中显示为选项卡。

      显而易见的解决方案是根本不对字段进行分组,但这可能会使用户编辑/注册表单变得非常大且垂直。

      【讨论】:

        猜你喜欢
        • 2010-12-01
        • 2021-02-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-11-15
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多