mirror of
https://github.com/claradex/nativegallery.git
synced 2024-11-15 19:49:08 +03:00
32 lines
790 B
PHP
32 lines
790 B
PHP
<?php
|
|
|
|
namespace App\Controllers\Api\Images\Comments;
|
|
|
|
|
|
|
|
use App\Services\{Auth, Router, GenerateRandomStr, DB, Json, EXIF};
|
|
use App\Models\{User, Vote, Comment};
|
|
|
|
|
|
class Load
|
|
{
|
|
public function __construct()
|
|
{
|
|
|
|
$comments = DB::query('SELECT * FROM photos_comments WHERE photo_id=:pid', array(':pid' => explode('/', $_SERVER['REQUEST_URI'])[4]));
|
|
$number = 1;
|
|
foreach ($comments as $c) {
|
|
$comm = new Comment($c);
|
|
if ($comm->content('deleted') != 'true') {
|
|
if ($number % 2 == 0) {
|
|
$class = 's11';
|
|
} else {
|
|
$class = 's1';
|
|
}
|
|
$comm->class($class);
|
|
$number++;
|
|
$comm->i();
|
|
}
|
|
}
|
|
}
|
|
}
|