mirror of
https://github.com/WerySkok/nativegallery.git
synced 2024-11-14 19:19:15 +03:00
Update SetVisibility.php
This commit is contained in:
parent
428f47142a
commit
f238bf776e
1 changed files with 7 additions and 0 deletions
|
@ -13,6 +13,13 @@ class SetVisibility
|
|||
public function __construct()
|
||||
{
|
||||
DB::query('UPDATE photos SET moderated=:mod, timeupload=:time WHERE id=:id', array(':id'=>$_GET['id'], ':mod'=>$_GET['mod'], ':time'=>time()));
|
||||
$uid = DB::query('SELECT user_id FROM photos WHERE id=:id', array(':id'=>$_GET['id']))[0]['user_id'];
|
||||
if ($_GET['mod'] === 1) {
|
||||
$followers = DB::query('SELECT * FROM followers WHERE user_id=:uid', array(':uid'=>$uid));
|
||||
foreach ($followers as $f) {
|
||||
DB::query('INSERT INTO followers_notifications VALUES (\'0\', :uid, :fid, :pid, 0)', array(':uid'=>$uid, ':fid'=>$f['follower_id'], ':pid'=>$_GET['id']));
|
||||
}
|
||||
}
|
||||
header('Location: ' . $_SERVER['HTTP_REFERER']);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue