7b1f27bf41
I'm slowly rolling this feature out to the various routes and doing tests. Added the notice system. Added the "You are banned" notice. Added the Sendmail experimental plugin for sending emails without needing a SMTP server. Added the debug flag for tuning down the amount of noise in the console. Converted a system notice over to the notice system. Changed the Activation Function signature to allow it to return errors which abort the process of plugin activation. Plugins can now set tags. These will be visible in the Plugin Manager at a later date to specify a small snippet of additional information. Variadic hooks are now first class citizens of the Plugin API rather than just an experiment. SessionCheck() and the new SimpleSessionCheck() can now halt further processing of a route. Deleted plugins are no longer shown on the Plugin Manager. The registration form no longer allows users with blank names, emails or passwords to register. The registration form now blocks some extremely common passwords. Added the new status CSS to the /forum/ route. Simplified some of the range loops in the templates.
23 lines
641 B
Go
23 lines
641 B
Go
package main
|
|
import "html/template"
|
|
|
|
func init() {
|
|
plugins["helloworld"] = Plugin{"helloworld","Hello World","Azareal","http://github.com/Azareal","",false,"","",init_helloworld,nil,deactivate_helloworld}
|
|
}
|
|
|
|
// init_helloworld is separate from init() as we don't want the plugin to run if the plugin is disabled
|
|
func init_helloworld() {
|
|
add_hook("rrow_assign", helloworld_reply)
|
|
}
|
|
|
|
func deactivate_helloworld() {
|
|
remove_hook("rrow_assign")
|
|
}
|
|
|
|
func helloworld_reply(data interface{}) interface{} {
|
|
reply := data.(Reply)
|
|
reply.Content = "Hello World!"
|
|
reply.ContentHtml = template.HTML("Hello World!")
|
|
reply.Tag = "Auto"
|
|
return reply
|
|
} |