表达式引擎成员导入 XML 自定义字段
我有一个 Excel 文档,其中包含 2000 个用户的详细信息,需要使用成员导入实用程序将这些用户作为成员导入到表达式引擎中。
我到底该从哪里开始呢?
第一个问题 - 将 Excel 文档转换为 XML 格式。
第二个问题 - 包括 60 多个自定义成员字段。
第三个问题 - 确保每个用户都有唯一的用户名、screen_name、密码、salt、unique_id 和 crypt_key。
非常感谢任何帮助。
I have an Excel document containing the details of 2000 users that need to be imported as Members in Expression Engine - using the Member Import utility.
Where on earth do I start?
First Problem
- converting the Excel doc into XML format.
Second Problem - including over 60 custom member fields.
Third Problem - ensuring each user has a unique username, screen_name, password, salt, unique_id and crypt_key.
Any help much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我建议绕过成员导入实用程序并编写直接写入数据库的自定义 PHP 脚本。您可以将 Excel 文档导出为 CSV,并使用 parsecsv 之类的内容来解析它到 PHP 数组中。
只需首先设置所有自定义成员字段,手动添加一些示例成员,然后检查 exp_member_* 数据库表以查看数据的排列方式。您可以以此为基础编写脚本插入。
如果您将此自定义脚本编写为 EE 模块或插件(或简单地编写为支持 PHP 的模板),则可以绕过设置数据库连接并使用 用于插入的数据库类。
I'd suggest bypassing the Member Import Utility and writing a custom PHP script that writes directly to the database. You can export your Excel doc to CSV and use something like parsecsv to parse it into a PHP array.
Just setup all of your custom member fields first, add few sample members manually, and then inspect the exp_member_* database tables to see how the data is arranged. You can base your script INSERTS off of that.
If you write this custom script as an EE module or plugin (or simply as a PHP-enabled template), you can bypass setting up database connections and use the Database class for your inserts.
我出去工作了。
创建 XML 架构,然后在 Excel 中 >开发者选项卡>来源>> XML 映射 >拖放 A:1 的地图,将制表符分隔的数据复制并粘贴到 A:2
在 EE 中,如果您只是不选中“创建自定义字段”,所有自定义成员字段/XML 标记都会相应插入。
使用此 - http://dosysadminsdream.wordpress.com /2011/07/01/generating-random-passwords-in-excel/ - 在 Excel VB 中创建密码模块。确保您的 XML 密码标签中具有 type='text' 属性,EE 将自行执行 MD5。
I worked in out.
Create an XML Schema, then in Excel > Developer tab > Source > XML Maps > Drag and Drop Map for A:1, copy and paste tab delimated data into A:2
In EE, if you simply leave the 'Create custom fields' unchecked - all custom member field/XML tags will insert correspondingly.
Use this - http://dosysadminsdream.wordpress.com/2011/07/01/generating-random-passwords-in-excel/ - to create a module in Excel VB for the passwords. Ensure your XML has type='text' attribute in the password tag, EE will do the MD5 on its own.
如果您可以接受商业插件,则可以结合使用 Zoo Visitor和 Andrew Weaver 的 DataGrab 来完成此任务。首先,设置 Zoo Visitor,并在 Zoo Visitor 通道中为要导入的所有数据创建字段。然后使用 DataGrab 将您的记录导入通道。由于 Zoo Visitor 在其频道中创建条目时会自动创建成员,因此在运行导入时您将获得成员以及频道条目。
如果这是一次性的事情,并且您希望所有数据都位于成员字段中(而不是 ZV 所做的渠道字段中),则可以轻松执行一些额外的步骤。创建所需的成员字段,直接对数据库运行快速查询以更新相应频道字段中的所有成员字段,然后终止频道并卸载 Zoo Visitor 和 DataGrab。 (如果导入是常规的事情,我建议跳过这部分并将内容留在 Zoo Visitor 和频道中。)
If you're okay with commercial addons, you can use a combination of Zoo Visitor and Andrew Weaver's DataGrab to accomplish this. First, set up Zoo Visitor, and create fields in the Zoo Visitor channel for all the data you want to import. Then use DataGrab to import your records into the channel. Since Zoo Visitor automatically creates members when an entry is created in its channel, you'll get members as well as channel entries when you run the import.
If it's a one-time thing, and you want all the data to be in Member Fields (instead of in Channel Fields, which is what ZV does), you can easily do a few extra steps. Create the Member Fields you want, run a quick query directly against the database to UPDATE all the Member Fields from the corresponding Channel Fields, and then kill the channel and uninstall Zoo Visitor and DataGrab. (If the import is going to be a regular thing, I'd advise skipping this part and leaving things in Zoo Visitor and channels instead.)
也许您可以使用 Zoo Visitor 来管理您的会员,并使用 DataGrab。
Maybe you could use Zoo Visitor to manage your member, and import with DataGrab.