mirror of
https://github.com/WerySkok/nativegallery.git
synced 2024-12-22 16:41:17 +03:00
Update Upload.php
This commit is contained in:
parent
5c91726bb2
commit
1c2b512f55
1 changed files with 6 additions and 0 deletions
|
@ -28,6 +28,12 @@ class Upload
|
|||
$moderated = 1;
|
||||
}
|
||||
DB::query('INSERT INTO photos VALUES (\'0\', :userid, :postbody, :photourl, :time, :timeup, :exif, 0, :moderated, :place, 0, :content)', array(':postbody' => $postbody, ':userid' => Auth::userid(), ':time' => mktime(0, 0, 0, $_POST['month'], $_POST['day'], $_POST['year']), ':content' => $content, ':photourl' => self::$photourl, ':exif' => $exif, ':place' => $_POST['place'], ':timeup'=>time(), ':moderated'=>$moderated));
|
||||
if ($moderated === 1) {
|
||||
$followers = DB::query('SELECT * FROM followers WHERE user_id=:uid', array(':uid'=>Auth::userid()));
|
||||
foreach ($followers as $f) {
|
||||
DB::query('INSERT INTO followers_notifications VALUES (\'0\', :uid, :fid, :pid, 0)', array(':uid'=>Auth::userid(), ':fid'=>$f['follower_id'], ':pid'=>DB::query('SELECT * FROM photos ORDER BY id DESC LIMIT 1')[0]['id']));
|
||||
}
|
||||
}
|
||||
echo json_encode(
|
||||
array(
|
||||
'id' => DB::query('SELECT id FROM photos ORDER BY id DESC LIMIT 1')[0]['id'],
|
||||
|
|
Loading…
Reference in a new issue