]> git.mxchange.org Git - friendica.git/commitdiff
Remove unused code in mod/
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 7 Jan 2019 06:23:49 +0000 (01:23 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 21 Jan 2019 15:53:32 +0000 (10:53 -0500)
- Remove commented code
- Remove unused/immediately overwritten variables
- Remove extraneous parameters
- Remove unreachable code

34 files changed:
mod/allfriends.php
mod/api.php
mod/delegate.php
mod/dfrn_notify.php
mod/dfrn_poll.php
mod/dfrn_request.php
mod/directory.php
mod/display.php
mod/editpost.php
mod/events.php
mod/fbrowser.php
mod/fsuggest.php
mod/home.php
mod/hovercard.php
mod/item.php
mod/lostpass.php
mod/message.php
mod/network.php
mod/notes.php
mod/photos.php
mod/profile.php
mod/profile_photo.php
mod/profiles.php
mod/pubsub.php
mod/pubsubhubbub.php
mod/register.php
mod/repair_ostatus.php
mod/salmon.php
mod/settings.php
mod/videos.php
mod/view.php
mod/wall_attach.php
mod/wall_upload.php
src/Worker/PubSubPublish.php

index 5234ee8c697abe5db8a3456e25eec1349ed83559..ce648cc25a4844f7e428b918379c005937d06041 100644 (file)
@@ -60,8 +60,6 @@ function allfriends_content(App $a)
                //get further details of the contact
                $contact_details = Model\Contact::getDetailsByURL($rr['url'], $uid, $rr);
 
-               $photo_menu = '';
-
                $connlnk = '';
                // $rr[cid] is only available for common contacts. So if the contact is a common one, use contact_photo_menu to generate the photo_menu
                // If the contact is not common to the user, Connect/Follow' will be added to the photo menu
index 466bd7b34d989fea5b0fb0281e8c4343d9b398aa..4a1db1be5511c7a0f7f6d19daeae38065cc14d6d 100644 (file)
@@ -11,10 +11,8 @@ use Friendica\Module\Login;
 
 require_once 'include/api.php';
 
-function oauth_get_client($request)
+function oauth_get_client(OAuthRequest $request)
 {
-
-
        $params = $request->get_parameters();
        $token = $params['oauth_token'];
 
index b373c204025ea0483e067e48ddcc57cc28041c91..456078451570cbc1db5f929201f6de0fa5cd6ad3 100644 (file)
@@ -17,7 +17,7 @@ require_once 'mod/settings.php';
 
 function delegate_init(App $a)
 {
-       return settings_init($a);
+       settings_init($a);
 }
 
 function delegate_post(App $a)
index c67525810787470e0ee7eda429f676b707b7fef1..41b7684ac64f7392b2e6d9f9d55b5b916cbb5068 100644 (file)
@@ -253,7 +253,6 @@ function dfrn_notify_content(App $a) {
                 */
 
                $dfrn_id = Strings::escapeTags(trim($_GET['dfrn_id']));
-               $dfrn_version = (float) $_GET['dfrn_version'];
                $rino_remote = (!empty($_GET['rino']) ? intval($_GET['rino']) : 0);
                $type = "";
                $last_update = "";
index 928690060f4819c3904eaee8159808d11a15ed1d..5b72c0bf940cec4fa7d4ac0c643430c9b1e4c425 100644 (file)
@@ -28,7 +28,6 @@ function dfrn_poll_init(App $a)
        $challenge       = defaults($_GET, 'challenge'      , '');
        $sec             = defaults($_GET, 'sec'            , '');
        $dfrn_version    = (float) defaults($_GET, 'dfrn_version'   , 2.0);
-       $perm            = defaults($_GET, 'perm'           , 'r');
        $quiet                   = !empty($_GET['quiet']);
 
        // Possibly it is an OStatus compatible server that requests a user feed
@@ -319,15 +318,12 @@ function dfrn_poll_post(App $a)
        switch ($direction) {
                case -1:
                        $sql_extra = sprintf(" AND `issued-id` = '%s' ", DBA::escape($dfrn_id));
-                       $my_id = $dfrn_id;
                        break;
                case 0:
                        $sql_extra = sprintf(" AND `issued-id` = '%s' AND `duplex` = 1 ", DBA::escape($dfrn_id));
-                       $my_id = '1:' . $dfrn_id;
                        break;
                case 1:
                        $sql_extra = sprintf(" AND `dfrn-id` = '%s' AND `duplex` = 1 ", DBA::escape($dfrn_id));
-                       $my_id = '0:' . $dfrn_id;
                        break;
                default:
                        $a->internalRedirect();
@@ -420,7 +416,7 @@ function dfrn_poll_content(App $a)
                DBA::delete('challenge', ["`expire` < ?", time()]);
 
                if ($type !== 'profile') {
-                       $r = q("INSERT INTO `challenge` ( `challenge`, `dfrn-id`, `expire` , `type`, `last_update` )
+                       q("INSERT INTO `challenge` ( `challenge`, `dfrn-id`, `expire` , `type`, `last_update` )
                                VALUES( '%s', '%s', '%s', '%s', '%s' ) ",
                                DBA::escape($hash),
                                DBA::escape($dfrn_id),
index 7b446b5ead58610c1c76fa2229f850a195c4131b..7c76af1b6a2acf923eed7a42db1fd8bfeec22bec 100644 (file)
@@ -188,7 +188,7 @@ function dfrn_request_post(App $a)
                                }
 
                                if (strlen($dfrn_request) && strlen($confirm_key)) {
-                                       $s = Network::fetchUrl($dfrn_request . '?confirm_key=' . $confirm_key);
+                                       Network::fetchUrl($dfrn_request . '?confirm_key=' . $confirm_key);
                                }
 
                                // (ignore reply, nothing we can do it failed)
@@ -230,7 +230,6 @@ function dfrn_request_post(App $a)
        }
 
        $nickname       = $a->profile['nickname'];
-       $notify_flags   = $a->profile['notify-flags'];
        $uid            = $a->profile['uid'];
        $maxreq         = intval($a->profile['maxreq']);
        $contact_record = null;
@@ -271,8 +270,6 @@ function dfrn_request_post(App $a)
                        }
                }
 
-               $real_name = !empty($_POST['realname']) ? Strings::escapeTags(trim($_POST['realname'])) : '';
-
                $url = trim($_POST['dfrn_url']);
                if (!strlen($url)) {
                        notice(L10n::t("Invalid locator") . EOL);
@@ -420,7 +417,7 @@ function dfrn_request_post(App $a)
                        $hash = Strings::getRandomHex() . (string) time();   // Generate a confirm_key
 
                        if (is_array($contact_record)) {
-                               $ret = q("INSERT INTO `intro` ( `uid`, `contact-id`, `blocked`, `knowyou`, `note`, `hash`, `datetime`)
+                               q("INSERT INTO `intro` ( `uid`, `contact-id`, `blocked`, `knowyou`, `note`, `hash`, `datetime`)
                                        VALUES ( %d, %d, 1, %d, '%s', '%s', '%s' )",
                                        intval($uid),
                                        intval($contact_record['id']),
@@ -586,7 +583,7 @@ function dfrn_request_content(App $a)
                                // If we are auto_confirming, this record will have already been nuked
                                // in dfrn_confirm_post()
 
-                               $r = q("UPDATE `intro` SET `blocked` = 0 WHERE `hash` = '%s'",
+                               q("UPDATE `intro` SET `blocked` = 0 WHERE `hash` = '%s'",
                                        DBA::escape($_GET['confirm_key'])
                                );
                        }
@@ -657,6 +654,4 @@ function dfrn_request_content(App $a)
                ]);
                return $o;
        }
-
-       return; // Somebody is fishing.
 }
index 0a37c1dc04710e1609a0ae2a48f1e0dc04608d00..c32cf5dbb8f93e204f7db42f80551a166dd05c19 100644 (file)
@@ -112,7 +112,6 @@ function directory_content(App $a)
                }
 
                while ($rr = DBA::fetch($r)) {
-                       $itemurl= '';
 
                        $itemurl = (($rr['addr'] != "") ? $rr['addr'] : $rr['profile_url']);
 
index dc43e08d3486404e4c86d6f0667deaea01072e1b..3922c83f351b7b81428c5beaa6f96de88c9b09da 100644 (file)
@@ -35,7 +35,6 @@ function display_init(App $a)
        }
 
        $nick = (($a->argc > 1) ? $a->argv[1] : '');
-       $profiledata = [];
 
        if ($a->argc == 3) {
                if (substr($a->argv[2], -5) == '.atom') {
@@ -157,7 +156,6 @@ function display_fetchauthor($a, $item)
        }
 
        if (!$skip) {
-               $author = "";
                preg_match("/author='(.*?)'/ism", $attributes, $matches);
                if (!empty($matches[1])) {
                        $profiledata["name"] = html_entity_decode($matches[1],ENT_QUOTES,'UTF-8');
@@ -166,7 +164,6 @@ function display_fetchauthor($a, $item)
                if (!empty($matches[1])) {
                        $profiledata["name"] = html_entity_decode($matches[1],ENT_QUOTES,'UTF-8');
                }
-               $profile = "";
                preg_match("/profile='(.*?)'/ism", $attributes, $matches);
                if (!empty($matches[1])) {
                        $profiledata["url"] = $matches[1];
@@ -175,7 +172,6 @@ function display_fetchauthor($a, $item)
                if (!empty($matches[1])) {
                        $profiledata["url"] = $matches[1];
                }
-               $avatar = "";
                preg_match("/avatar='(.*?)'/ism", $attributes, $matches);
                if (!empty($matches[1])) {
                        $profiledata["photo"] = $matches[1];
index bf103cf23c8bb8de5bdb3b28094bd9c5b1e44536..c1c0d16d7fd712497476e6c7742a23624dac119d 100644 (file)
@@ -2,9 +2,9 @@
 /**
  * @file mod/editpost.php
  */
+
 use Friendica\App;
 use Friendica\Content\Feature;
-use Friendica\Core\Config;
 use Friendica\Core\Hook;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
@@ -63,25 +63,6 @@ function editpost_content(App $a)
        $jotplugins = '';
        $jotnets = '';
 
-       $mail_disabled = ((function_exists('imap_open') && !Config::get('system', 'imap_disabled')) ? 0 : 1);
-
-       $mail_enabled = false;
-       $pubmail_enabled = false;
-
-       if (!$mail_disabled) {
-               $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1",
-                       intval(local_user())
-               );
-
-               if (DBA::isResult($r)) {
-                       $mail_enabled = true;
-
-                       if (intval($r[0]['pubmail'])) {
-                               $pubmail_enabled = true;
-                       }
-               }
-       }
-
        Hook::callAll('jot_tool', $jotplugins);
 
        $tpl = Renderer::getMarkupTemplate("jot.tpl");
index 60fa0392213be1ccfc15b83d364876a882f8aec8..008cf643ceac1a670814ff90f15bfb85cea3b742 100644 (file)
@@ -213,14 +213,14 @@ function events_content(App $a)
        }
 
        if (($a->argc > 2) && ($a->argv[1] === 'ignore') && intval($a->argv[2])) {
-               $r = q("UPDATE `event` SET `ignore` = 1 WHERE `id` = %d AND `uid` = %d",
+               q("UPDATE `event` SET `ignore` = 1 WHERE `id` = %d AND `uid` = %d",
                        intval($a->argv[2]),
                        intval(local_user())
                );
        }
 
        if (($a->argc > 2) && ($a->argv[1] === 'unignore') && intval($a->argv[2])) {
-               $r = q("UPDATE `event` SET `ignore` = 0 WHERE `id` = %d AND `uid` = %d",
+               q("UPDATE `event` SET `ignore` = 0 WHERE `id` = %d AND `uid` = %d",
                        intval($a->argv[2]),
                        intval(local_user())
                );
@@ -300,21 +300,6 @@ function events_content(App $a)
                        $y = 2100;
                }
 
-               $nextyear = $y;
-               $nextmonth = $m + 1;
-               if ($nextmonth > 12) {
-                       $nextmonth = 1;
-                       $nextyear ++;
-               }
-
-               $prevyear = $y;
-               if ($m > 1) {
-                       $prevmonth = $m - 1;
-               } else {
-                       $prevmonth = 12;
-                       $prevyear --;
-               }
-
                $dim    = Temporal::getDaysInMonth($y, $m);
                $start  = sprintf('%d-%d-%d %d:%d:%d', $y, $m, 1, 0, 0, 0);
                $finish = sprintf('%d-%d-%d %d:%d:%d', $y, $m, $dim, 23, 59, 59);
@@ -526,7 +511,7 @@ function events_content(App $a)
                        '$s_text' => L10n::t('Event Starts:') . ' <span class="required" title="' . L10n::t('Required') . '">*</span>',
                        '$s_dsel' => Temporal::getDateTimeField(
                                new DateTime(),
-                               DateTime::createFromFormat('Y', $syear+5),
+                               DateTime::createFromFormat('Y', intval($syear) + 5),
                                DateTime::createFromFormat('Y-m-d H:i', "$syear-$smonth-$sday $shour:$sminute"),
                                L10n::t('Event Starts:'),
                                'start_text',
@@ -541,7 +526,7 @@ function events_content(App $a)
                        '$f_text' => L10n::t('Event Finishes:'),
                        '$f_dsel' => Temporal::getDateTimeField(
                                new DateTime(),
-                               DateTime::createFromFormat('Y', $fyear+5),
+                               DateTime::createFromFormat('Y', intval($fyear) + 5),
                                DateTime::createFromFormat('Y-m-d H:i', "$fyear-$fmonth-$fday $fhour:$fminute"),
                                L10n::t('Event Finishes:'),
                                'finish_text',
index 3401359052fa29c39a4992e6c641740d87f35dc0..d302383157a372fe2e4293a4c984837c326f981f 100644 (file)
@@ -28,10 +28,6 @@ function fbrowser_content(App $a)
        }
 
        $template_file = "filebrowser.tpl";
-       $mode = "";
-       if (!empty($_GET['mode'])) {
-               $mode  = "?mode=".$_GET['mode'];
-       }
 
        switch ($a->argv[1]) {
                case "image":
@@ -55,12 +51,11 @@ function fbrowser_content(App $a)
                                $albums = array_map("_map_folder1", $albums);
                        }
 
-                       $album = "";
-                       if ($a->argc==3) {
+                       if ($a->argc == 3) {
                                $album = hex2bin($a->argv[2]);
                                $sql_extra = sprintf("AND `album` = '%s' ", DBA::escape($album));
                                $sql_extra2 = "";
-                               $path[]=[$a->argv[2], $album];
+                               $path[] = [$a->argv[2], $album];
                        }
 
                        $r = q("SELECT `resource-id`, ANY_VALUE(`id`) AS `id`, ANY_VALUE(`filename`) AS `filename`, ANY_VALUE(`type`) AS `type`,
@@ -118,8 +113,7 @@ function fbrowser_content(App $a)
 
                                function _map_files2($rr)
                                {
-                                       $a = \get_app();
-                                       list($m1,$m2) = explode("/", $rr['filetype']);
+                                       list($m1, $m2) = explode("/", $rr['filetype']);
                                        $filetype = ( (file_exists("images/icons/$m1.png"))?$m1:"zip");
                                        $filename_e = $rr['filename'];
 
index 2195f455af56605e5ed3288ad74b02029f57c934..e84a42734c211e6288a3bc2288fa0ce3252c1e9d 100644 (file)
@@ -45,7 +45,7 @@ function fsuggest_post(App $a)
                        intval(local_user())
                );
                if (DBA::isResult($r)) {
-                       $x = q("INSERT INTO `fsuggest` ( `uid`,`cid`,`name`,`url`,`request`,`photo`,`note`,`created`)
+                       q("INSERT INTO `fsuggest` ( `uid`,`cid`,`name`,`url`,`request`,`photo`,`note`,`created`)
                                VALUES ( %d, %d, '%s','%s','%s','%s','%s','%s')",
                                intval(local_user()),
                                intval($contact_id),
index 8e53c24f3d4c1a5e0475695b3e1ee27ff1288924..34f6d436834eac34b5071b64c121e7be25309293 100644 (file)
@@ -61,7 +61,4 @@ function home_content(App $a) {
                '$login' => $login,
                '$content' => $content
        ]);
-
-       return $o;
-
 }}
index f71977f074e190ffb648295545d5967917c38bae..047502fc344a6545cab7d3d76ee175eefd07856d 100644 (file)
@@ -47,7 +47,6 @@ function hovercard_content()
        // If a contact is connected the url is internally changed to 'redir/CID'. We need the pure url to search for
        // the contact. So we strip out the contact id from the internal url and look in the contact table for
        // the real url (nurl)
-       $cid = 0;
        if (strpos($profileurl, 'redir/') === 0) {
                $cid = intval(substr($profileurl, 6));
                $remote_contact = DBA::selectFirst('contact', ['nurl'], ['id' => $cid]);
index 576ad09d6dfef004e2ad8fecd2153aa471820155..6276ba4d1e44e2187004a9ca9d02c210b31b0e5c 100644 (file)
@@ -125,8 +125,6 @@ function item_post(App $a) {
                $parent = $parent_item['id'];
                $parent_user = $parent_item['uid'];
 
-               $parent_contact = Contact::getDetailsByURL($parent_item["author-link"]);
-
                $objecttype = ACTIVITY_OBJ_COMMENT;
        }
 
@@ -386,7 +384,7 @@ function item_post(App $a) {
                                continue;
                        }
 
-                       $success = handle_tag($a, $body, $inform, $str_tags, local_user() ? local_user() : $profile_uid, $tag, $network);
+                       $success = handle_tag($body, $inform, $str_tags, local_user() ? local_user() : $profile_uid, $tag, $network);
                        if ($success['replaced']) {
                                $tagged[] = $tag;
                        }
@@ -723,8 +721,6 @@ function item_post(App $a) {
                        $a->internalRedirect($return_path);
                }
                exit();
-       } else {
-               $post_id = 0;
        }
 
        unset($datarray['edit']);
@@ -924,11 +920,10 @@ function item_content(App $a)
  * @throws ImagickException
  * @throws \Friendica\Network\HTTPException\InternalServerErrorException
  */
-function handle_tag(App $a, &$body, &$inform, &$str_tags, $profile_uid, $tag, $network = "")
+function handle_tag(&$body, &$inform, &$str_tags, $profile_uid, $tag, $network = "")
 {
        $replaced = false;
        $r = null;
-       $tag_type = '@';
 
        //is it a person tag?
        if ((strpos($tag, '@') === 0) || (strpos($tag, '!') === 0)) {
@@ -964,7 +959,6 @@ function handle_tag(App $a, &$body, &$inform, &$str_tags, $profile_uid, $tag, $n
                        return $replaced;
                }
 
-               $stat = false;
                //get the person's name
                $name = substr($tag, 1);
 
index cb2dd3ca3c9f03e565eb62f1218cba968016de64..548cea185cb943ac3c3f1e7cda039045f7514b12 100644 (file)
@@ -81,7 +81,6 @@ function lostpass_post(App $a)
 
 function lostpass_content(App $a)
 {
-       $o = '';
        if ($a->argc > 1) {
                $pwdreset_token = $a->argv[1];
 
@@ -127,7 +126,6 @@ function lostpass_form()
 function lostpass_generate_password($user)
 {
        $o = '';
-       $a = \get_app();
 
        $new_password = User::generateNewPassword();
        $result = User::updatePassword($user['uid'], $new_password);
index 3f1ec6a2e60db966132dc0244f3bee843e5aac35..3ff84a1e6684478b2200d2c552451aad2d2401c3 100644 (file)
@@ -185,7 +185,6 @@ function message_content(App $a)
                        );
                        if (DBA::isResult($r)) {
                                $parent = $r[0]['parent-uri'];
-                               $convid = $r[0]['convid'];
 
                                if (DBA::delete('mail', ['parent-uri' => $parent, 'uid' => local_user()])) {
                                        info(L10n::t('Conversation removed.') . EOL);
@@ -230,7 +229,6 @@ function message_content(App $a)
 
                        if (DBA::isResult($r)) {
                                $prename = $r[0]['name'];
-                               $preurl = $r[0]['url'];
                                $preid = $r[0]['id'];
                                $preselect = [$preid];
                        } else {
index a71447e5e5f9bbf5af8fe002d47f7195edf6ae74..e05f9814a0c23ec8a9c2a943362d56ab8f971345 100644 (file)
@@ -314,7 +314,7 @@ function networkSetSeen($condition)
        $unseen = Item::exists($condition);
 
        if ($unseen) {
-               $r = Item::update(['unseen' => false], $condition);
+               Item::update(['unseen' => false], $condition);
        }
 }
 
@@ -407,12 +407,6 @@ function networkFlatView(App $a, $update = 0)
        // Rawmode is used for fetching new content at the end of the page
        $rawmode = (isset($_GET['mode']) && ($_GET['mode'] == 'raw'));
 
-       if (isset($_GET['last_id'])) {
-               $last_id = intval($_GET['last_id']);
-       } else {
-               $last_id = 0;
-       }
-
        $o = '';
 
        $file = defaults($_GET, 'file', '');
@@ -449,8 +443,7 @@ function networkFlatView(App $a, $update = 0)
 
        $pager = new Pager($a->query_string);
 
-       /// @TODO Figure out why this variable is unused
-       $pager_sql = networkPager($a, $pager, $update);
+       networkPager($a, $pager, $update);
 
        if (strlen($file)) {
                $condition = ["`term` = ? AND `otype` = ? AND `type` = ? AND `uid` = ?",
@@ -621,7 +614,6 @@ function networkThreadedView(App $a, $update, $parent)
        $sql_extra3 = '';
        $sql_table = '`thread`';
        $sql_parent = '`iid`';
-       $sql_order = '';
 
        if ($update) {
                $sql_table = '`item`';
index 6ecc819240ff67d817f27dc9ee91c7aa540d61ec..fdb12d6cc5a6d0300aabe03671fad0759f69499e 100644 (file)
@@ -17,13 +17,7 @@ function notes_init(App $a)
                return;
        }
 
-       $profile = 0;
-
-       $which = $a->user['nickname'];
-
        Nav::setSelected('home');
-
-       //Profile::load($a, $which, $profile);
 }
 
 
index 3a927746547ed04f1d478de49f00ccd0d0f18b01..31b026f8995a40536a99dad17033be5e7898d6d0 100644 (file)
@@ -518,7 +518,6 @@ function photos_post(App $a)
                                                        $taginfo[] = [$newname, $profile, $salmon];
                                                } else {
                                                        $newname = $name;
-                                                       $alias = '';
                                                        $tagcid = 0;
 
                                                        if (strrpos($newname, '+')) {
@@ -655,7 +654,7 @@ function photos_post(App $a)
                                                . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . '</id>';
                                        $arr['target'] .= '<link>' . XML::escape('<link rel="alternate" type="text/html" href="' . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . '" />' . "\n" . '<link rel="preview" type="'.$photo['type'].'" href="' . System::baseUrl() . "/photo/" . $photo['resource-id'] . '-' . $best . '.' . $ext . '" />') . '</link></target>';
 
-                                       $item_id = Item::insert($arr);
+                                       Item::insert($arr);
                                }
                        }
                }
index 858748bb82e318ce3d68c52040dbb01b407bf621..8a21e24dc1e7e37067a9158c850d982503b0c37c 100644 (file)
@@ -130,7 +130,6 @@ function profile_content(App $a, $update = 0)
        $groups = [];
        $remote_cid = null;
 
-       $tab = 'posts';
        $o = '';
 
        if ($update) {
@@ -310,8 +309,7 @@ function profile_content(App $a, $update = 0)
        if ($is_owner) {
                $unseen = Item::exists(['wall' => true, 'unseen' => true, 'uid' => local_user()]);
                if ($unseen) {
-                       $r = Item::update(['unseen' => false],
-                                       ['wall' => true, 'unseen' => true, 'uid' => local_user()]);
+                       Item::update(['unseen' => false], ['wall' => true, 'unseen' => true, 'uid' => local_user()]);
                }
        }
 
index b802050b631f14cbd454dcf23ba7649728f11c37..a0faa40cf588134fdd8ba1db6e3e88bad1f05b66 100644 (file)
@@ -109,11 +109,11 @@ function profile_photo_post(App $a)
                                // If setting for the default profile, unset the profile photo flag from any other photos I own
 
                                if ($is_default_profile) {
-                                       $r = q("UPDATE `photo` SET `profile` = 0 WHERE `profile` = 1 AND `resource-id` != '%s' AND `uid` = %d",
+                                       q("UPDATE `photo` SET `profile` = 0 WHERE `profile` = 1 AND `resource-id` != '%s' AND `uid` = %d",
                                                DBA::escape($base_image['resource-id']), intval(local_user())
                                        );
                                } else {
-                                       $r = q("update profile set photo = '%s', thumb = '%s' where id = %d and uid = %d",
+                                       q("update profile set photo = '%s', thumb = '%s' where id = %d and uid = %d",
                                                DBA::escape(System::baseUrl() . '/photo/' . $base_image['resource-id'] . '-4.' . $Image->getExt()),
                                                DBA::escape(System::baseUrl() . '/photo/' . $base_image['resource-id'] . '-5.' . $Image->getExt()),
                                                intval($_REQUEST['profile']), intval(local_user())
@@ -215,9 +215,9 @@ function profile_photo_content(App $a)
                // set an already uloaded photo as profile photo
                // if photo is in 'Profile Photos', change it in db
                if (($r[0]['album'] == L10n::t('Profile Photos')) && ($havescale)) {
-                       $r = q("UPDATE `photo` SET `profile`=0 WHERE `profile`=1 AND `uid`=%d", intval(local_user()));
+                       q("UPDATE `photo` SET `profile`=0 WHERE `profile`=1 AND `uid`=%d", intval(local_user()));
 
-                       $r = q("UPDATE `photo` SET `profile`=1 WHERE `uid` = %d AND `resource-id` = '%s'", intval(local_user()),
+                       q("UPDATE `photo` SET `profile`=1 WHERE `uid` = %d AND `resource-id` = '%s'", intval(local_user()),
                                DBA::escape($resource_id)
                        );
 
@@ -275,8 +275,6 @@ function profile_photo_content(App $a)
                ]);
                return $o;
        }
-
-       return; // NOTREACHED
 }
 
 function profile_photo_crop_ui_head(App $a, Image $image)
index 74a3d91f0754126a5b5d7d9601c253d6ce7360be..b56a7911d3f7612371bb4b170fc5280e1920cd49 100644 (file)
@@ -48,12 +48,12 @@ function profiles_init(App $a) {
 
                // move every contact using this profile as their default to the user default
 
-               $r = q("UPDATE `contact` SET `profile-id` = (SELECT `profile`.`id` AS `profile-id` FROM `profile` WHERE `profile`.`is-default` = 1 AND `profile`.`uid` = %d LIMIT 1) WHERE `profile-id` = %d AND `uid` = %d ",
+               q("UPDATE `contact` SET `profile-id` = (SELECT `profile`.`id` AS `profile-id` FROM `profile` WHERE `profile`.`is-default` = 1 AND `profile`.`uid` = %d LIMIT 1) WHERE `profile-id` = %d AND `uid` = %d ",
                        intval(local_user()),
                        intval($a->argv[2]),
                        intval(local_user())
                );
-               $r = q("DELETE FROM `profile` WHERE `id` = %d AND `uid` = %d",
+               q("DELETE FROM `profile` WHERE `id` = %d AND `uid` = %d",
                        intval($a->argv[2]),
                        intval(local_user())
                );
@@ -79,7 +79,7 @@ function profiles_init(App $a) {
                $r1 = q("SELECT `name`, `photo`, `thumb` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
                        intval(local_user()));
 
-               $r2 = q("INSERT INTO `profile` (`uid` , `profile-name` , `name`, `photo`, `thumb`)
+               q("INSERT INTO `profile` (`uid` , `profile-name` , `name`, `photo`, `thumb`)
                        VALUES ( %d, '%s', '%s', '%s', '%s' )",
                        intval(local_user()),
                        DBA::escape($name),
@@ -118,7 +118,6 @@ function profiles_init(App $a) {
                if(! DBA::isResult($r1)) {
                        notice(L10n::t('Profile unavailable to clone.') . EOL);
                        exit();
-                       return;
                }
                unset($r1[0]['id']);
                $r1[0]['is-default'] = 0;
@@ -151,7 +150,6 @@ function profiles_init(App $a) {
                if (! DBA::isResult($r)) {
                        notice(L10n::t('Profile not found.') . EOL);
                        exit();
-                       return;
                }
 
                Profile::load($a, $a->user['nickname'], $r[0]['id']);
@@ -342,54 +340,42 @@ function profiles_post(App $a) {
                PConfig::set(local_user(), 'system', 'detailled_profile', (($_POST['detailled_profile'] == 1) ? 1: 0));
 
                $changes = [];
-               $value = '';
                if ($is_default) {
                        if ($marital != $orig[0]['marital']) {
                                $changes[] = '[color=#ff0000]&hearts;[/color] ' . L10n::t('Marital Status');
-                               $value = $marital;
                        }
                        if ($withchanged) {
                                $changes[] = '[color=#ff0000]&hearts;[/color] ' . L10n::t('Romantic Partner');
-                               $value = strip_tags($with);
                        }
                        if ($likes != $orig[0]['likes']) {
                                $changes[] = L10n::t('Likes');
-                               $value = $likes;
                        }
                        if ($dislikes != $orig[0]['dislikes']) {
                                $changes[] = L10n::t('Dislikes');
-                               $value = $dislikes;
                        }
                        if ($work != $orig[0]['work']) {
                                $changes[] = L10n::t('Work/Employment');
                        }
                        if ($religion != $orig[0]['religion']) {
                                $changes[] = L10n::t('Religion');
-                               $value = $religion;
                        }
                        if ($politic != $orig[0]['politic']) {
                                $changes[] = L10n::t('Political Views');
-                               $value = $politic;
                        }
                        if ($gender != $orig[0]['gender']) {
                                $changes[] = L10n::t('Gender');
-                               $value = $gender;
                        }
                        if ($sexual != $orig[0]['sexual']) {
                                $changes[] = L10n::t('Sexual Preference');
-                               $value = $sexual;
                        }
                        if ($xmpp != $orig[0]['xmpp']) {
                                $changes[] = L10n::t('XMPP');
-                               $value = $xmpp;
                        }
                        if ($homepage != $orig[0]['homepage']) {
                                $changes[] = L10n::t('Homepage');
-                               $value = $homepage;
                        }
                        if ($interest != $orig[0]['interest']) {
                                $changes[] = L10n::t('Interests');
-                               $value = $interest;
                        }
                        if ($address != $orig[0]['address']) {
                                $changes[] = L10n::t('Address');
@@ -400,9 +386,6 @@ function profiles_post(App $a) {
                        if ($locality != $orig[0]['locality'] || $region != $orig[0]['region']
                                || $country_name != $orig[0]['country-name']) {
                                $changes[] = L10n::t('Location');
-                               $comma1 = ((($locality) && ($region || $country_name)) ? ', ' : ' ');
-                               $comma2 = (($region && $country_name) ? ', ' : '');
-                               $value = $locality . $comma1 . $region . $comma2 . $country_name;
                        }
                }
 
@@ -487,7 +470,7 @@ function profiles_post(App $a) {
 
                if ($is_default) {
                        if ($namechanged) {
-                               $r = q("UPDATE `user` set `username` = '%s' where `uid` = %d",
+                               q("UPDATE `user` set `username` = '%s' where `uid` = %d",
                                        DBA::escape($name),
                                        intval(local_user())
                                );
index 9b5bf1209e81b1c941c15bbf605f12251964af5c..c5744f399b2443565525eb0293ef090f1a7875a0 100644 (file)
@@ -36,7 +36,6 @@ function pubsub_init(App $a)
                $hub_mode      = Strings::escapeTags(trim(defaults($_GET, 'hub_mode', '')));
                $hub_topic     = Strings::escapeTags(trim(defaults($_GET, 'hub_topic', '')));
                $hub_challenge = Strings::escapeTags(trim(defaults($_GET, 'hub_challenge', '')));
-               $hub_lease     = Strings::escapeTags(trim(defaults($_GET, 'hub_lease_seconds', '')));
                $hub_verify    = Strings::escapeTags(trim(defaults($_GET, 'hub_verify_token', '')));
 
                Logger::log('Subscription from ' . $_SERVER['REMOTE_ADDR'] . ' Mode: ' . $hub_mode . ' Nick: ' . $nick);
index 843406fe6f4c2945b316e5ad6ca160604bf9c9f9..342facd1076fa8b2c03cd56e9c5fb2d090c68c42 100644 (file)
@@ -33,7 +33,6 @@ function pubsubhubbub_init(App $a) {
        if ($_SERVER['REQUEST_METHOD'] === 'POST') {
                $hub_mode = post_var('hub_mode');
                $hub_callback = post_var('hub_callback');
-               $hub_verify = post_var('hub_verify');
                $hub_verify_token = post_var('hub_verify_token');
                $hub_secret = post_var('hub_secret');
                $hub_topic = post_var('hub_topic');
index 0125ae417e492d870337752db8ec01e46c425282..e69315a33a489a60be5ea6f76a04e8de67751301 100644 (file)
@@ -22,9 +22,6 @@ function register_post(App $a)
 {
        BaseModule::checkFormSecurityTokenRedirectOnError('/register', 'register');
 
-       $verified = 0;
-       $blocked  = 1;
-
        $arr = ['post' => $_POST];
        Hook::callAll('register_post', $arr);
 
index 5a6afd9fb4d4853af4391b073789157f553a28fe..51a6aadaad6659753ad30b62584c1ea266b3b266 100644 (file)
@@ -57,7 +57,7 @@ function repair_ostatus_content(App $a) {
 
        $o .= "<p>".L10n::t("Keep this window open until done.")."</p>";
 
-       $result = Contact::createFromProbe($uid, $r[0]["url"], true);
+       Contact::createFromProbe($uid, $r[0]["url"], true);
 
        $a->page['htmlhead'] = '<meta http-equiv="refresh" content="1; URL='.System::baseUrl().'/repair_ostatus?counter='.$counter.'">';
 
index eef25107626ac6754339780bbd995c5a61e6aeb9..536a4516ceb7948651a16f3768f6d203ba180662 100644 (file)
@@ -23,7 +23,6 @@ function salmon_post(App $a, $xml = '') {
        Logger::log('new salmon ' . $xml, Logger::DATA);
 
        $nick       = (($a->argc > 1) ? Strings::escapeTags(trim($a->argv[1])) : '');
-       $mentions   = (($a->argc > 2 && $a->argv[2] === 'mention') ? true : false);
 
        $r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
                DBA::escape($nick)
index 14c0cc64d7f32b09d8f30a04780b7faa9e608a98..567270c6ea24936b7e28be4423e105600ef71878 100644 (file)
@@ -367,7 +367,7 @@ function settings_post(App $a)
                }
                Theme::install($theme);
 
-               $r = q("UPDATE `user` SET `theme` = '%s' WHERE `uid` = %d",
+               q("UPDATE `user` SET `theme` = '%s' WHERE `uid` = %d",
                                DBA::escape($theme),
                                intval(local_user())
                );
@@ -484,8 +484,6 @@ function settings_post(App $a)
                $page_flags = Contact::PAGE_COMMUNITY;
        }
 
-       $email_changed = false;
-
        $err = '';
 
        if ($username != $a->user['username']) {
@@ -498,7 +496,6 @@ function settings_post(App $a)
        }
 
        if ($email != $a->user['email']) {
-               $email_changed = true;
                //  check for the correct password
                if (!User::authenticate(intval(local_user()), $_POST['mpassword'])) {
                        $err .= L10n::t('Wrong Password') . EOL;
@@ -611,7 +608,7 @@ function settings_post(App $a)
        // clear session language
        unset($_SESSION['language']);
 
-       $r = q("UPDATE `profile`
+       q("UPDATE `profile`
                SET `publish` = %d,
                `name` = '%s',
                `net-publish` = %d,
index 408e2acaa6dfc75ea408a899abc91f87a98fe477..df0fb237569882712791a0f21d30994008dab2fd 100644 (file)
@@ -31,8 +31,6 @@ function videos_init(App $a)
 
        Nav::setSelected('home');
 
-       $o = '';
-
        if ($a->argc > 1) {
                $nick = $a->argv[1];
                $user = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `blocked` = 0 LIMIT 1",
@@ -163,19 +161,12 @@ function videos_content(App $a)
        //
        if ($a->argc > 3) {
                $datatype = $a->argv[2];
-               $datum = $a->argv[3];
        } elseif(($a->argc > 2) && ($a->argv[2] === 'upload')) {
                $datatype = 'upload';
        } else {
                $datatype = 'summary';
        }
 
-       if ($a->argc > 4) {
-               $cmd = $a->argv[4];
-       } else {
-               $cmd = 'view';
-       }
-
        //
        // Setup permissions structures
        //
@@ -209,7 +200,6 @@ function videos_content(App $a)
 
                        if (DBA::isResult($r)) {
                                $can_post = true;
-                               $contact = $r[0];
                                $remote_contact = true;
                                $visitor = $contact_id;
                        }
@@ -239,17 +229,11 @@ function videos_content(App $a)
                        );
 
                        if (DBA::isResult($r)) {
-                               $contact = $r[0];
                                $remote_contact = true;
                        }
                }
        }
 
-       if (!$remote_contact && local_user()) {
-               $contact_id = $_SESSION['cid'];
-               $contact = $a->contact;
-       }
-
        if ($a->data['user']['hidewall'] && (local_user() != $owner_uid) && (!$remote_contact)) {
                notice(L10n::t('Access to this item is restricted.') . EOL);
                return;
index 640606bce1aeaca332705bf4c3c8b598584aa9ae..c59eea29827243de3b2f0fac316cb65465957182 100644 (file)
@@ -13,7 +13,6 @@ function view_init(App $a)
                
        if ($a->argc == 4){
                $theme = $a->argv[2];
-               $THEMEPATH = "view/theme/$theme";
                if(file_exists("view/theme/$theme/style.php"))
                        require_once("view/theme/$theme/style.php");
        }
index 40f82eef91271b191f21113de5c85ea0f61aa134..fb665ac2fa49c56518dcf90f0efb8f3d8fbd7b8d 100644 (file)
@@ -38,11 +38,9 @@ function wall_attach_post(App $a) {
        }
 
        $can_post  = false;
-       $visitor   = 0;
 
        $page_owner_uid   = $r[0]['uid'];
        $page_owner_cid   = $r[0]['id'];
-       $page_owner_nick  = $r[0]['nickname'];
        $community_page   = (($r[0]['page-flags'] == Contact::PAGE_COMMUNITY) ? true : false);
 
        if ((local_user()) && (local_user() == $page_owner_uid)) {
@@ -68,7 +66,6 @@ function wall_attach_post(App $a) {
 
                                if (DBA::isResult($r)) {
                                        $can_post = true;
-                                       $visitor = $contact_id;
                                }
                        }
                }
index d1fb918bfe124bf69c2848e1f0e9c229227eaa69..ea06b1d1c1a2deefb5e3c48f1c3777e9cb54a19c 100644 (file)
@@ -272,8 +272,6 @@ function wall_upload_post(App $a, $desktopmode = true)
                }
        }
 
-       $basename = basename($filename);
-
        if (!$desktopmode) {
                $r = q("SELECT `id`, `datasize`, `width`, `height`, `type` FROM `photo`
                        WHERE `resource-id` = '%s'
index 1fb19693104e6f423a5352b01c0ec2268824ab64..b6061f819995264c0abc83b1ba89f6ae3d1f106c 100644 (file)
@@ -5,7 +5,6 @@
 
 namespace Friendica\Worker;
 
-use Friendica\BaseObject;
 use Friendica\Core\Logger;
 use Friendica\Core\System;
 use Friendica\Database\DBA;