aboutsummaryrefslogtreecommitdiff
path: root/mod/twitterservice/start.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/twitterservice/start.php')
-rw-r--r--mod/twitterservice/start.php29
1 files changed, 9 insertions, 20 deletions
diff --git a/mod/twitterservice/start.php b/mod/twitterservice/start.php
index b387379f2..718db9ced 100644
--- a/mod/twitterservice/start.php
+++ b/mod/twitterservice/start.php
@@ -13,39 +13,28 @@
global $CONFIG;
require_once($CONFIG->pluginspath . "twitterservice/vendors/twitter/twitter.class.php");
- function twitterservice_init()
- {
+ function twitterservice_init() {
// Listen for wire create event
register_elgg_event_handler('create','object','twitterservice_wire_listener');
-
}
- /**
- * Post a message to a twitter feed.
- *
- */
- function twitterservice_send($twittername, $twitterpass, $twittermessage)
- {
+ // Post a message to a twitter feed.
+ function twitterservice_send($twittername, $twitterpass, $twittermessage) {
$twitter = new Twitter($twittername, $twitterpass);
-
return $twitter->send($twittermessage);
}
- /**
- * Listen for thewire and push messages accordingly.
- */
- function twitterservice_wire_listener($event, $object_type, $object)
- {
+ // Listen for thewire and push messages accordingly.
+ function twitterservice_wire_listener($event, $object_type, $object) {
- if (($object) && ($object->subtype == get_subtype_id('object', 'thewire')) )
- {
- if (get_plugin_usersetting('sendtowire', $object->owner_guid, 'twitterservice')=='yes')
- {
+ if (($object) && ($object->subtype == get_subtype_id('object', 'thewire')) ) {
+ if (get_plugin_usersetting('sendtowire', $object->owner_guid, 'twitterservice')=='yes') {
$twittername = get_plugin_usersetting('twittername', $object->owner_guid, 'twitterservice');
$twitterpass = get_plugin_usersetting('twitterpass', $object->owner_guid, 'twitterservice');
- if (($twittername) && ($twitterpass))
+ if (($twittername) && ($twitterpass)) {
twitterservice_send($twittername, $twitterpass, $object->description);
+ }
}
}
}