mirror of
https://github.com/claradex/nativegallery.git
synced 2025-02-22 19:49:51 +03:00
prretend send
This commit is contained in:
parent
303d70d1a3
commit
8b8cedf6c1
4 changed files with 29 additions and 1 deletions
23
app/Controllers/Api/Images/Contests/SendPretend.php
Normal file
23
app/Controllers/Api/Images/Contests/SendPretend.php
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace App\Controllers\Api\Images\Contests;
|
||||
|
||||
|
||||
|
||||
use App\Services\{Auth, Router, GenerateRandomStr, DB, Json, EXIF};
|
||||
use App\Models\{User, Vote};
|
||||
|
||||
|
||||
class SendPretend
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
DB::query('UPDATE photos SET on_contest=1, contest_id=:id WHERE id=:idd', array(':id'=>$_POST['cid'], ':idd'=>$_POST['photo_id']));
|
||||
echo json_encode(
|
||||
array(
|
||||
'errorcode' => 0,
|
||||
'error' => 0
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -37,7 +37,7 @@ class Upload
|
|||
} else {
|
||||
$moderated = 1;
|
||||
}
|
||||
DB::query('INSERT INTO photos VALUES (\'0\', :userid, :postbody, :photourl, :time, :timeup, :exif, 0, :moderated, :place, 0, :gallery, :entityid, 0, 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, ':gallery'=>$_POST['gallery'], ':entityid'=>self::$entitydata_id));
|
||||
DB::query('INSERT INTO photos VALUES (\'0\', :userid, :postbody, :photourl, :time, :timeup, :exif, 0, :moderated, :place, 0, :gallery, :entityid, 0, 0, 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, ':gallery'=>$_POST['gallery'], ':entityid'=>self::$entitydata_id));
|
||||
if (($moderated === 1) && (self::$subsnotify != 'disabled')) {
|
||||
$followers = DB::query('SELECT * FROM followers WHERE user_id=:uid', array(':uid' => Auth::userid()));
|
||||
foreach ($followers as $f) {
|
||||
|
|
|
@ -20,6 +20,7 @@ use \App\Controllers\Api\Images\Comments\Delete as PhotoCommentDelete;
|
|||
use \App\Controllers\Api\Images\Comments\Pin as PhotoCommentPin;
|
||||
use \App\Controllers\Api\Images\Comments\Load as PhotoCommentLoad;
|
||||
use \App\Controllers\Api\Images\Comments\Rate as PhotoCommentVote;
|
||||
use \App\Controllers\Api\Images\Contests\SendPretend as PhotoContestsSendPretend;
|
||||
use \App\Controllers\Api\GeoDB\Search as GeoDBSearch;
|
||||
use \App\Controllers\Api\Vehicles\Load as VehiclesLoad;
|
||||
use \App\Controllers\Api\Profile\Update as ProfileUpdate;
|
||||
|
@ -100,6 +101,9 @@ class ApiController
|
|||
public static function recentphotos() {
|
||||
return new PhotoLoadRecent();
|
||||
}
|
||||
public static function sendpretendphoto() {
|
||||
return new PhotoContestsSendPretend();
|
||||
}
|
||||
public static function loaduser() {
|
||||
return new UserLoad();
|
||||
}
|
||||
|
|
|
@ -69,6 +69,7 @@ class Routes
|
|||
Router::post('/api/photo/comment/$id/edit', 'ApiController@photocommentedit');
|
||||
Router::post('/api/photo/comment/$id/delete', 'ApiController@photocommentdelete');
|
||||
Router::post('/api/photo/comment/$id/pin', 'ApiController@photocommentpin');
|
||||
Router::post('/api/photo/contests/sendpretend', 'ApiController@sendpretendphoto()');
|
||||
Router::get('/api/vehicles/load', 'ApiController@vehiclesload');
|
||||
Router::get('/api/geodb/search', 'ApiController@geodbsearch');
|
||||
if ($user->i('admin') > 0) {
|
||||
|
|
Loading…
Reference in a new issue