vote[=|:](up|down|remove) metatag
This commit is contained in:
parent
2ffb9e9b8a
commit
d19e7fff7b
@ -256,6 +256,18 @@ class NumericScore extends Extension {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function onTagTermParse(TagTermParseEvent $event) {
|
||||||
|
$matches = array();
|
||||||
|
|
||||||
|
if(preg_match("/^vote[=|:](up|down|remove)$/", $event->term, $matches)) {
|
||||||
|
global $user;
|
||||||
|
$score = ($matches[1] == "up" ? 1 : ($matches[1] == "down" ? -1 : 0));
|
||||||
|
send_event(new NumericScoreSetEvent($event->id, $user, $score));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!empty($matches)) $event->metatag = true;
|
||||||
|
}
|
||||||
|
|
||||||
private function install() {
|
private function install() {
|
||||||
global $database;
|
global $database;
|
||||||
global $config;
|
global $config;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user