]> git.mxchange.org Git - friendica.git/blobdiff - mod/mood.php
Merge pull request #3949 from annando/further-information
[friendica.git] / mod / mood.php
index c64dd0d9efbe2ae3baa68618d8c0c774115ea9a4..bffe37f3be7ced95cff2f60dbd5b3c8d71159b3e 100644 (file)
@@ -1,14 +1,19 @@
 <?php
 
+use Friendica\App;
+use Friendica\Core\System;
+use Friendica\Core\Worker;
+use Friendica\Database\DBM;
+
 require_once('include/security.php');
 require_once('include/bbcode.php');
 require_once('include/items.php');
 
+function mood_init(App $a) {
 
-function mood_init(&$a) {
-
-       if(! local_user())
+       if (! local_user()) {
                return;
+       }
 
        $uid = local_user();
        $verb = notags(trim($_GET['verb']));
@@ -36,7 +41,7 @@ function mood_init(&$a) {
                        intval($parent),
                        intval($uid)
                );
-               if (dbm::is_result($r)) {
+               if (DBM::is_result($r)) {
                        $parent_uri = $r[0]['uri'];
                        $private    = $r[0]['private'];
                        $allow_cid  = $r[0]['allow_cid'];
@@ -59,7 +64,7 @@ function mood_init(&$a) {
 
        $uri = item_new_uri($a->get_hostname(),$uid);
 
-       $action = sprintf( t('%1$s is currently %2$s'), '[url=' . $poster['url'] . ']' . $poster['name'] . '[/url]' , $verbs[$verb]); 
+       $action = sprintf( t('%1$s is currently %2$s'), '[url=' . $poster['url'] . ']' . $poster['name'] . '[/url]' , $verbs[$verb]);
 
        $arr = array();
        $arr['guid']          = get_guid(32);
@@ -91,26 +96,26 @@ function mood_init(&$a) {
        $item_id = item_store($arr);
        if($item_id) {
                q("UPDATE `item` SET `plink` = '%s' WHERE `uid` = %d AND `id` = %d",
-                       dbesc($a->get_baseurl() . '/display/' . $poster['nickname'] . '/' . $item_id),
+                       dbesc(System::baseUrl() . '/display/' . $poster['nickname'] . '/' . $item_id),
                        intval($uid),
                        intval($item_id)
                );
-               proc_run(PRIORITY_HIGH, "include/notifier.php", "tag", $item_id);
+               Worker::add(PRIORITY_HIGH, "Notifier", "tag", $item_id);
        }
 
 
        call_hooks('post_local_end', $arr);
 
-       proc_run(PRIORITY_HIGH, "include/notifier.php", "like", $post_id);
+       Worker::add(PRIORITY_HIGH, "Notifier", "like", $post_id);
 
        return;
 }
 
 
 
-function mood_content(&$a) {
+function mood_content(App $a) {
 
-       if(! local_user()) {
+       if (! local_user()) {
                notice( t('Permission denied.') . EOL);
                return;
        }