ZAPChat

Summary: Step by step procedure for creating a chat using ZAP.
Version:
Prerequisites: PmWiki, ZAP
Status:
Maintainer: BenoitDutilleul?
Categories:

Questions answered by this recipe

How to create a PmWiki chat based on the ZAP recipe?

Description

There are 3 simple steps to have your chat running.

Step 1: implement the form which will enable users to post their messages:

(:zapdata:)
(:zapform name=chat:)
||border=0 align=center width=100%
||[-'''Your name:'''-] ||
||(:input text Member size=13 {$AuthId}:) ||
||[-'''Your message:'''-] ||
||(:input textarea Remark rows=3 cols=20:) ||
(:zap datapage="Chat.+" chat:)
(:zap time="{#t +}" snipcom:)
(:zap savedata="Member,Remark,time" chat:)
(:zap authlist="datapage" chat:)
|| border=0 align=center width=100%
|| (:input submit value="Shout your message":) ||
(:zapend:)

This form stores the author name, its message and the date and hour he/she posted the message as variables in a page of the Chat group.

Step 2: display the messages posted with the pagelist function:

(:pagelist group="Chat" fmt="#chat" -RecentChanges count=3:)

This command will list :

  • The 3 last entries (count=3),
  • In the group Chat (group="Chat"),
  • Excluding the page RecentChanges (-RecentChanges) which isn't a chat message,
  • According to the template #chat (fmt="#chat").

Step 3: define the format "chat" in your own pmwiki installation. Templates are defined in the Site.LocalTemplates page.

Here is my template I use but you can adapt it easily to your own needs.

[[#chat]]
(:table cellpadding=0 cellspacing=0 width=100%:)
(:cellnr:)'''[-{=$:Member} shouted:-]'''
(:cellnr:)[=[-{=$:Remark}-]
(:if auth admin:)
(:cellnr align=right:)[-[[{=$FullName}|Edit]] this comment -]
(:ifend:)
(:tableend:)
[[#chatend]]

Notes

Release Notes

If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".

Comments

See Also

Contributors

BenoitDutilleul?