-
Notifications
You must be signed in to change notification settings - Fork 0
server plugin
Obtain information about users and groups
##Functions
Obtain the member id of the user calling the server.
Example:
client.coffee:
Db = require 'db'
Dom = require 'dom'
Ui = require 'ui'
Modal = require 'modal'
Dom.section !->
Dom.h4 "You opinion about the following:"
Ui.bigImg "http://imgs.xkcd.com/comics/voice.png", !->
Dom.style
'height': 362
'width': 281
Dom.div !->
if Db.shared.get 'comment'
Dom.userText Db.shared.get('comment', 'value')
Dom.userText "\n *By: " + Db.shared.get('comment', 'user') + "*"
else
Dom.userText "*No comment yet*"
Ui.button "Comment", !->
Modal.prompt "What do you think about this?", (val) !->
Server.call 'comment', val
Ui.button "Remove comment", !->
Server.call 'removeComment'
server.coffee:
Db = require 'db'
Plugin = require 'plugin'
exports.client_comment = (data) !->
Db.shared.set 'comment' {"value": data, "user", Plugin.memberId()} Returns the unique user id in exchange for the group-bound member Id. The uuid is unique for that user through the entire system, and can be used to identify a user through multiple plugins.
Example:
server.coffee:
Plugin = require 'plugin'
userUuid = Plugin.uuid Plugin.memberId()Returns the group name as a string.
Returns the screen name for user.
Returns the key of avatar for user, or false if there's none. The only practical usage of this is to feed it into Ui.avatar.
Throws an error when the current user is not an admin.
Returns a boolean indicating the user is flagged as admin.
Returns a boolean indicating the user is banned.
Returns a boolean indicating the user is flagged as mock user.
Returns the id of the person who initiated the plug-in
Returns an epoch timestamp from when this plug-in instance has been created.
Returns the current server time as an UNIX epoch in seconds.
Returns the code used for this plugin/group combination. As notes in the URL. (example: '13c') The number stands for the group. The character for the plugin.
Returns just the number used to identify the group.
- [How it works](How it works)
- [Your first plugin](Your first plugin)
- Submitting and distributing your plugin
- Using the Developer Tools
- Example plugins on Github
-
API Reference
- Client
- [client plugin](client plugin)
- [client dom](client dom)
- [client obs](client obs)
- [client db](client db)
- [client server](client server)
- [client page](client page)
- [client ui](client ui)
- [client form](client form)
- [client icon](client icon)
- [client modal](client modal)
- [client photo](client photo)
- [client photoview](client photoview)
- [client time](client time)
- [client share](client share)
- [client map](client map)
- [client geoloc](client geoloc)
- Server
- [server event](server event)
- [server plugin](server plugin)
- [server http](server http)
- [server db](server db)
- [server photo](server photo)
- [server time](server time)
- Client
- Example UI elements