1

我制作了一个表格,以便用户可以注册他们的电子邮件地址以参加比赛。我正在使用 powermail 表单,有人告诉我使用 dbEntry 来执行此操作,但我不知道该怎么做。到目前为止,这是我的代码:

plugin.tx_powermail_pi1{
    dbEntry{

        tt_address._enable = TEXT
        tt_address._enable.value = 1

        tt_address.email = TEXT
        tt_address.email.value = ????
    }

    debug.output = all
}​

我被告知要激活 _enable 以启用数据插入。但是现在我不知道如何访问表单的字段值。我可能应该使用模板 ID,即###UID71###,但我不知道如何。

4

1 回答 1

2

根据官方文档,您可以这样做:

plugin.tx_powermail.settings.setup {
    dbEntry {
        # enable or disable db entry for tt_address
        tt_address._enable = TEXT
        tt_address._enable.value = 1

        # write only if field email is not yet filled with current value
        # (update: update values of existing entry)
        # (none: no entry if field is filled)
        # (disable: always add values don't care about existing values)
        tt_address._ifUnique.email = update

        # fill table "tt_address" with field "pid" with the current pid (e.g. 12)
        tt_address.pid = TEXT
        tt_address.pid.data = TSFE:id

        # fill table "tt_address" with field "tstamp" with the current time as timestamp (like 123456789)
        tt_address.tstamp = TEXT
        tt_address.tstamp.data = date:U

        # fill table "tt_address" with field "name" with the value from powermail {firstname}
        tt_address.name = TEXT
        tt_address.name.field = firstname

        ...
    }
}

我还发现了一个(较旧的)论坛帖子(德语),其中包含使用用户会话数据的示例:

# table "tt_address" with field "last_name" is the value from powermail (tt_content uid 88) field uid18 (###uid18###)
tt_address.last_name = TEXT
tt_address.last_name.data = TSFE:fe_user|sesData|powermail_88|uid18
于 2012-06-26T19:55:54.820 回答