Смотрите видео ниже, чтобы узнать, как установить наш сайт в качестве веб-приложения на домашнем экране.
Примечание: this_feature_currently_requires_accessing_site_using_safari
Данный запрос в бд
INSERT INTO `modules` (`name`, `tpls`, `active`, `info`, `files`, `client_key`) VALUES ('reviews', 'none', 1, 'Модуль отзывы<br>\nСсылка на страницу отзывов: <a href="../reviews" target="_blank">перейти</a><br><br>', '<script src="{site_host}/modules_extra/reviews/ajax/ajax.js?v={cache}"></script>\r\n<link rel="stylesheet" href="{site_host}modules_extra/reviews/templates/{template}/css/style.css?v={cache}">', 'TopForo.ru');
INSERT INTO `pages` (`file`, `url`, `name`, `title`, `description`, `keywords`, `kind`, `image`, `robots`, `privacy`, `type`, `active`, `module`, `page`, `class`) VALUES ('modules_extra/reviews/base/index.php', 'reviews', 'reviews', 'Отзывы о проекте', 'Отзывы о проекте', 'reviews,reviews', 1, 'files/miniatures/standart.jpg', 1, 1, 1, 1, 47, 0, 0);
CREATE TABLE `reviews` (
`id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
`reauth` int(11) NOT NULL,
`estimation` int(22) NOT NULL,
`remsg` varchar(255) NOT NULL,
`date` date NOT NULL
);
CREATE TABLE `reviews_evaluations` (
`id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
`estimation` int(11) NOT NULL
);
INSERT INTO `reviews_evaluations` (`id`, `estimation`) VALUES
(1, 1),
(2, 2),
(3, 3),
(4, 4),
(5, 5);
Советую в файле base/index.php изменит данную строку
if($_SESSION['id'] == '2'){
$deleter = '<th class="table-text text-right punktrew" onclick="dell_reviews('.$row->id.');" style="border-bottom: none;cursor:pointer;">Удалить</th>';
}
в файл modules/index/index.php:
// вместо 2 id человека который может удалить отзыв
/* выше
$tpl->load_template('/home/index.tpl');
*/
$STH2 = $pdo->query("SELECT * FROM `reviews` ORDER BY id DESC LIMIT 3");
$STH2->setFetchMode(PDO::FETCH_OBJ);
while($row = $STH2->fetch()) {
$STH1 = $pdo->prepare("SELECT * FROM users WHERE id=:id LIMIT 1");
$STH1->setFetchMode(PDO::FETCH_OBJ);
$STH1->execute([':id' => $row->reauth]);
$row1 = $STH1->fetch();
$re_author = $row1->login;
$re_author_id = $row1->id;
$re_author_avatar = $row1->avatar;
$re_estimation = $row->estimation;
if($re_estimation == '5'){
$estimation = '⭐⭐⭐⭐⭐';
}
elseif($re_estimation == '4'){
$estimation = '⭐⭐⭐⭐';
}
elseif($re_estimation == '3'){
$estimation = '⭐⭐⭐';
}
elseif($re_estimation == '2'){
$estimation = '⭐⭐';
}
elseif($re_estimation == '1'){
$estimation = '⭐';
}
else{
$estimation = '0';
}
if(!$row->remsg) {
$row->remsg = '<span>Отзывов нету</span>';
}
$reviews_views[] = '
<tr class="cursor-pointer stats-lines">
<th class="text-right pointer td-custom">
<a href="../profile?id='.$re_author_id.'">
<img class="rounded-circle" src="'.$PI->compile_img_str($re_author_avatar).'">
</a>
</th>
<th class="text-left pointer td-custom">
<a href="../profile?id='.$re_author_id.'">
'.$re_author.'
</a>
</th>
<th class="text-center pointer td-custom">
'.$row->remsg.'
</th>
<th class="text-center pointer td-custom">
'.$estimation.'
</th>
<th class="text-left pointer td-custom">
'.$row->date.'
</th>
</tr>
';
}
/*
потом вставить вот так
$tpl->load_template('/home/index.tpl');
$tpl->set("{template}", configs()->template);
$tpl->set("{reviews_views}", implode('', $reviews_views));
$tpl->compile('content');
$tpl->clear();
*/
// и в файле ../temptales/твойшаб/tpl/home/index.tpl вставить тег {reviews_views}
//Ну конечно же сделать изначально для него место чтобы вставлять тег