用于一次性活动注册的WordPress插件?

时间:2010-08-31 作者:Gabriel Solomon

我正在建立一个慈善活动的网站,我想让人们注册这个活动。

表单应包含姓名、电子邮件和其他自定义问题。此外,我想在一个页面上列出注册人员。我正在考虑使用用户系统+插件来列出用户列表。

你会使用什么插件?

谢谢

4 个回复
最合适的回答,由SO网友:MikeSchinkel 整理而成

你好solomongaby:

表格

对于我建议使用的表格GravityForms. 设计和发布表单非常简单an example form we made for requests to be a presenter.

GravityForms每台服务器39美元,但如果你问他们是否愿意给慈善机构一份免费的拷贝?

注册我可能会recommend using EventBrite 就像我们做的那样for our WordPress business conference.

如果你的活动是免费的,EventBrite是免费的,如果你收费的话,这些费用是值得的。使用EventBrite(或类似的服务)将比尝试在WordPress中为一次性事件实现某些东西要容易得多。

我写了一封信shortcode 为了便于显示(您可以将代码放在主题的functions.php 文件)。以下是短代码的原型用法:

[eventbrite src="{event_url}" width="{width}" height="{height}"]

这就是使用中的短代码(当然,请确保替换您自己的事件URL):

[eventbrite src="http://www.eventbrite.com/tickets-external?eid=582216425&ref=etckt" width="620" height="500"]

最后,这里是简短代码的PHP源代码:

<?php
add_shortcode(\'eventbrite\', \'eventbrite_show_widget\');

function eventbrite_show_widget($args) {
  $valid_types = array(\'ticket-form\',);
  $div_style = \'border:1px solid black;color:white;background:red;padding:10px;\';
  $default = array(
    \'type\' => \'ticket-form\',
    \'url\' => \'\',
    \'src\' => \'\',
    \'width\' => \'100%\',
    \'height\' => \'500\',
  );
  $args = array_merge($default,$args);
  extract($args);
  if (empty($url) && empty($src)) {
    $html =<<<HTML
<div style="$div_style">
<p>The "eventbrite" shortcode much have an attribute of either "<b><i>src</i></b>" or "<b><i>url</i></b>", i.e.:</p>
<ul>
<li>[eventbrite type="ticket-form" <b><i>src</i></b>="http://www.eventbrite.com/tickets-external?eid=582216425&ref=etckt"]</li>
<li>[eventbrite type="ticket-form" <b><i>url</i></b>="http://www.eventbrite.com/tickets-external?eid=582216425&ref=etckt"]</li>
</ul>
</div>
HTML;
  } else if (!empty($url) && !empty($src)) {
    $html =<<<HTML
<div style="$div_style">
You should only the "<b><i>src</i></b>" attribute or the "<b><i>url</i></b>" attribute when using the "eventbrite" shortcode.
</div>
HTML;
  } else if (!in_array($args[\'type\'],$valid_types)) {
    $valid_types = implode(\'</b></i>"</li><li>"<i><b>\',$valid_types);
    $html =<<<HTML
<div style="$div_style">
<p>When using the "eventbrite" shortcode you must specifiy an attribute of "<b><i>type</i></b>" with one of the following valid values:</p>
<ul><li>"<i><b>$valid_types</b></i>"</li></ul>
<p>i.e.:</p>
<ul>
<li>[eventbrite <b><i>type</i></b>="<b><i>ticket-form</i></b>" src="$url$src"]</li>
</ul>
</div>
HTML;
  } else  {
  $html = <<<HTML
<div id="eventbrite">
  <iframe src="$src$url" width="$width" height="$height" allowtransparency="true" scrolling="auto"></iframe>
</div>
HTML;
  }
  return $html;
}

SO网友:Norcross

签出EventExpresso(http://eventespresso.com/)它有付费版和免费版。这应该是你所需要的一切。

SO网友:Doug

您可以修改标准的WordPress用户注册表,以要求比通常的用户名+电子邮件地址更多的数据。

add_action(\'register_form\',\'my_show_extra_fields\');
add_action(\'register_post\',\'my_check_fields\',10,3);
add_action(\'user_register\',\'my_register_extra_fields\',10,3);

function my_show_extra_fields(){
    ?>
    <style>
    #user_first, #user_last, #hzip {
      background:none repeat scroll 0 0 #FBFBFB;
      border:1px solid #E5E5E5;
      font-size:24px;
      margin-bottom:16px;
      margin-right:6px;
      margin-top:2px;
      padding:3px;
      width:97%;
    }
    </style>
    <p><label>First Name<br/>
      <input id="user_first" type="text" tabindex="20" size="25" value="<?php echo $_POST[\'first\']; ?>" name="first"/>
      </label></p>
    <p><label>Last Name<br/>
      <input id="user_last" type="text" tabindex="20" size="25" value="<?php echo $_POST[\'last\']; ?>" name="last"/>
      </label></p>
    <p><label>Home ZIP Code<br/>
      <input id="hzip" type="text" tabindex="20" size="25" maxlength="10" value="<?php echo $_POST[\'hzip\']; ?>" name="hzip"/>
      </label></p>
    <?php
}

function my_check_fields($login, $email, $errors) {
  global $firstname, $lastname, $hzip;
  if ($_POST[\'first\'] == \'\') {
    $errors->add(\'empty_realname\', "<strong>ERROR</strong>: Please enter first name");
  } else {
    $firstname = $_POST[\'first\'];
  }
  if ($_POST[\'last\'] == \'\') {
    $errors->add(\'empty_realname\', "<strong>ERROR</strong>: Please enter last name");
  } else {
    $lastname = $_POST[\'last\'];
  }
  if ($_POST[\'hzip\'] == \'\') {
    $errors->add(\'empty_hzip\', "<strong>ERROR</strong>: Please enter home ZIP Code");
  } else {
    $hzip = $_POST[\'hzip\'];
  }
}

function my_register_extra_fields($user_id, $password="", $meta=array())  {
  $userdata = array();
  $userdata[\'ID\'] = $user_id;
  $userdata[\'first_name\'] = $_POST[\'first\'];
  $userdata[\'last_name\'] = $_POST[\'last\'];
  wp_update_user($userdata);
  update_usermeta( $user_id, \'hzip\', $_POST[\'hzip\'] );
}

add_action( \'show_user_profile\', \'my_show_extra_profile_fields\' );
add_action( \'edit_user_profile\', \'my_show_extra_profile_fields\' );

function my_show_extra_profile_fields( $user ) {
  $current_hzip = esc_attr( get_the_author_meta( \'hzip\', $user->ID ) );
    ?>
    <h3>Extra profile information</h3>
    <table class="form-table">
      <tr>
        <th><label for="hzip">Home ZIP Code</label></th>
        <td>
          <input type="text" name="hzip" id="hzip" size="10" maxlength="10" value="<?php echo $current_hzip ?>" class="regular-text" />
        </td>
      </tr>
    </table>
    <?php
}

add_action( \'personal_options_update\', \'my_save_extra_profile_fields\' );
add_action( \'edit_user_profile_update\', \'my_save_extra_profile_fields\' );

function my_save_extra_profile_fields($user_id) {
  if ( !current_user_can(\'edit_user\', $user_id) ) {
    return false;
  }
  update_usermeta( $user_id, \'hzip\', $_POST[\'hzip\'] );
}
将上述内容放入functions.php.

显示可自定义用户列表的一个很棒的插件是AmR User Lists

(Edit: 添加了用户注册内容。)

(Edit 2: 添加了WordPress通常不保存的自定义数据。)

SO网友:bueltge

或者使用BuddyPress,在定制后具有所有这些功能和更多功能

相关推荐

更改wp-admin/plugins.php上统计的插件数量

我已成功地使用从插件页面隐藏我的插件$wp_list_table 然而,顶部的分页仍然将插件列为“所有(3)”等。我成功地改变了$wp_list_table 的数组_pagination_args = total_items.但它仍然在页面顶部呈现插件-“全部(3)”。有什么办法可以解决这个问题吗?我找到了WP_Plugins_List_Table::prepare_items()具有全局$totals 变量,但我不确定我将如何改变这一点,在这个函数中$totals = array(); fore

用于一次性活动注册的WordPress插件? - 小码农CODE - 行之有效找到问题解决它

用于一次性活动注册的WordPress插件?

时间:2010-08-31 作者:Gabriel Solomon

我正在建立一个慈善活动的网站,我想让人们注册这个活动。

表单应包含姓名、电子邮件和其他自定义问题。此外,我想在一个页面上列出注册人员。我正在考虑使用用户系统+插件来列出用户列表。

你会使用什么插件?

谢谢

4 个回复
最合适的回答,由SO网友:MikeSchinkel 整理而成

你好solomongaby:

表格

对于我建议使用的表格GravityForms. 设计和发布表单非常简单an example form we made for requests to be a presenter.

GravityForms每台服务器39美元,但如果你问他们是否愿意给慈善机构一份免费的拷贝?

注册我可能会recommend using EventBrite 就像我们做的那样for our WordPress business conference.

如果你的活动是免费的,EventBrite是免费的,如果你收费的话,这些费用是值得的。使用EventBrite(或类似的服务)将比尝试在WordPress中为一次性事件实现某些东西要容易得多。

我写了一封信shortcode 为了便于显示(您可以将代码放在主题的functions.php 文件)。以下是短代码的原型用法:

[eventbrite src="{event_url}" width="{width}" height="{height}"]

这就是使用中的短代码(当然,请确保替换您自己的事件URL):

[eventbrite src="http://www.eventbrite.com/tickets-external?eid=582216425&amp;ref=etckt" width="620" height="500"]

最后,这里是简短代码的PHP源代码:

<?php
add_shortcode(\'eventbrite\', \'eventbrite_show_widget\');

function eventbrite_show_widget($args) {
  $valid_types = array(\'ticket-form\',);
  $div_style = \'border:1px solid black;color:white;background:red;padding:10px;\';
  $default = array(
    \'type\' => \'ticket-form\',
    \'url\' => \'\',
    \'src\' => \'\',
    \'width\' => \'100%\',
    \'height\' => \'500\',
  );
  $args = array_merge($default,$args);
  extract($args);
  if (empty($url) && empty($src)) {
    $html =<<<HTML
<div style="$div_style">
<p>The "eventbrite" shortcode much have an attribute of either "<b><i>src</i></b>" or "<b><i>url</i></b>", i.e.:</p>
<ul>
<li>[eventbrite type="ticket-form" <b><i>src</i></b>="http://www.eventbrite.com/tickets-external?eid=582216425&ref=etckt"]</li>
<li>[eventbrite type="ticket-form" <b><i>url</i></b>="http://www.eventbrite.com/tickets-external?eid=582216425&ref=etckt"]</li>
</ul>
</div>
HTML;
  } else if (!empty($url) && !empty($src)) {
    $html =<<<HTML
<div style="$div_style">
You should only the "<b><i>src</i></b>" attribute or the "<b><i>url</i></b>" attribute when using the "eventbrite" shortcode.
</div>
HTML;
  } else if (!in_array($args[\'type\'],$valid_types)) {
    $valid_types = implode(\'</b></i>"</li><li>"<i><b>\',$valid_types);
    $html =<<<HTML
<div style="$div_style">
<p>When using the "eventbrite" shortcode you must specifiy an attribute of "<b><i>type</i></b>" with one of the following valid values:</p>
<ul><li>"<i><b>$valid_types</b></i>"</li></ul>
<p>i.e.:</p>
<ul>
<li>[eventbrite <b><i>type</i></b>="<b><i>ticket-form</i></b>" src="$url$src"]</li>
</ul>
</div>
HTML;
  } else  {
  $html = <<<HTML
<div id="eventbrite">
  <iframe src="$src$url" width="$width" height="$height" allowtransparency="true" scrolling="auto"></iframe>
</div>
HTML;
  }
  return $html;
}

SO网友:Norcross

签出EventExpresso(http://eventespresso.com/)它有付费版和免费版。这应该是你所需要的一切。

SO网友:Doug

您可以修改标准的WordPress用户注册表,以要求比通常的用户名+电子邮件地址更多的数据。

add_action(\'register_form\',\'my_show_extra_fields\');
add_action(\'register_post\',\'my_check_fields\',10,3);
add_action(\'user_register\',\'my_register_extra_fields\',10,3);

function my_show_extra_fields(){
    ?>
    <style>
    #user_first, #user_last, #hzip {
      background:none repeat scroll 0 0 #FBFBFB;
      border:1px solid #E5E5E5;
      font-size:24px;
      margin-bottom:16px;
      margin-right:6px;
      margin-top:2px;
      padding:3px;
      width:97%;
    }
    </style>
    <p><label>First Name<br/>
      <input id="user_first" type="text" tabindex="20" size="25" value="<?php echo $_POST[\'first\']; ?>" name="first"/>
      </label></p>
    <p><label>Last Name<br/>
      <input id="user_last" type="text" tabindex="20" size="25" value="<?php echo $_POST[\'last\']; ?>" name="last"/>
      </label></p>
    <p><label>Home ZIP Code<br/>
      <input id="hzip" type="text" tabindex="20" size="25" maxlength="10" value="<?php echo $_POST[\'hzip\']; ?>" name="hzip"/>
      </label></p>
    <?php
}

function my_check_fields($login, $email, $errors) {
  global $firstname, $lastname, $hzip;
  if ($_POST[\'first\'] == \'\') {
    $errors->add(\'empty_realname\', "<strong>ERROR</strong>: Please enter first name");
  } else {
    $firstname = $_POST[\'first\'];
  }
  if ($_POST[\'last\'] == \'\') {
    $errors->add(\'empty_realname\', "<strong>ERROR</strong>: Please enter last name");
  } else {
    $lastname = $_POST[\'last\'];
  }
  if ($_POST[\'hzip\'] == \'\') {
    $errors->add(\'empty_hzip\', "<strong>ERROR</strong>: Please enter home ZIP Code");
  } else {
    $hzip = $_POST[\'hzip\'];
  }
}

function my_register_extra_fields($user_id, $password="", $meta=array())  {
  $userdata = array();
  $userdata[\'ID\'] = $user_id;
  $userdata[\'first_name\'] = $_POST[\'first\'];
  $userdata[\'last_name\'] = $_POST[\'last\'];
  wp_update_user($userdata);
  update_usermeta( $user_id, \'hzip\', $_POST[\'hzip\'] );
}

add_action( \'show_user_profile\', \'my_show_extra_profile_fields\' );
add_action( \'edit_user_profile\', \'my_show_extra_profile_fields\' );

function my_show_extra_profile_fields( $user ) {
  $current_hzip = esc_attr( get_the_author_meta( \'hzip\', $user->ID ) );
    ?>
    <h3>Extra profile information</h3>
    <table class="form-table">
      <tr>
        <th><label for="hzip">Home ZIP Code</label></th>
        <td>
          <input type="text" name="hzip" id="hzip" size="10" maxlength="10" value="<?php echo $current_hzip ?>" class="regular-text" />
        </td>
      </tr>
    </table>
    <?php
}

add_action( \'personal_options_update\', \'my_save_extra_profile_fields\' );
add_action( \'edit_user_profile_update\', \'my_save_extra_profile_fields\' );

function my_save_extra_profile_fields($user_id) {
  if ( !current_user_can(\'edit_user\', $user_id) ) {
    return false;
  }
  update_usermeta( $user_id, \'hzip\', $_POST[\'hzip\'] );
}
将上述内容放入functions.php.

显示可自定义用户列表的一个很棒的插件是AmR User Lists

(Edit: 添加了用户注册内容。)

(Edit 2: 添加了WordPress通常不保存的自定义数据。)

SO网友:bueltge

或者使用BuddyPress,在定制后具有所有这些功能和更多功能

相关推荐

如何从/wp-json/wp/v2/USERS/Me获取数据

我试图在wordpress中使用JWT auth获取用户数据。我被发送给/wp-json/wp/v2/users/me的邮递员get请求中包含了我从/wp-json/jwt-auth/v1/token获得的令牌。但我有一个错误:{ "code": "rest_not_logged_in", "message": "you are not logged in", "dat