Remove unused code in mod/

- Remove commented code
- Remove unused/immediately overwritten variables
- Remove extraneous parameters
- Remove unreachable code
This commit is contained in:
Hypolite Petovan 2019-01-07 01:23:49 -05:00
parent 4a95ca280d
commit dbc6eb5422
34 changed files with 32 additions and 173 deletions

View 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;