GameCMS Отзывы? [reviews]

Pr[E]fix

vk.com/cyxaruk1337
Пользователь
28.05.2022
112
369
Версия
1.0
Совместимость
  1. Лицензия
  2. Пиратская [Null]
1668176490238.png

Данный модуль позволяет игроку оставить отзыв на ваш проект



Данный запрос в бд



Советую в файле base/index.php изменит данную строку
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>';
        }
// вместо 2 id человека который может удалить отзыв

Скрытое содержимое могут видеть только пользователи групп(ы): Участник
 
Последнее редактирование модератором:

KHRYSTRAJ

vk.com/korolevkillo
Участник
15.05.2021
120
140
Посмотреть вложение 1191
Данный модуль позволяет игроку оставить отзыв на ваш проект
*** Скрытый текст не может быть процитирован. ***
Данный запрос в бд
*** Скрытый текст не может быть процитирован. ***
Если хотите вывести на главную стр вот код вывода
PHP:
$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';
        }
        $reviews_views[] = '
                                <div class="card">
                                    <div class="card-body">
                                        <div class="d-flex">
                                            <div class="flex-shrink-0 me-4">
                                                <a href="../profile?id='.$re_author_id.' title="" tooltip="yes" data-bs-original-title="'.$re_author.'">
                                                    <div class="avatar-md">
                                                        <span class="avatar-title rounded-circle bg-light text-danger font-size-16">
                                                            <img style="border-radius: 50%" src="'.$PI->compile_img_str($re_author_avatar).'" alt="'.$re_author.'">
                                                        </span>
                                                    </div>
                                                </a>
                                            </div>
                                            <div class="flex-grow-1 overflow-hidden">
                                                <h5 class="text-truncate font-size-15">
                                                    <a href="../profile?id='.$re_author_id.' class="text-dark">
                                                        Отзыв от пользователя '.$re_author.'
                                                    </a>
                                                </h5>
                                                <a href="../profile?id='.$re_author_id.'>
                                                    <p class="mb-4" style="color: #24a7c6;font-weight: bold;">'.$row->remsg.'</p>
                                                </a>
                                            </div>
                                        </div>
                                        <div class="px-4 py-3 border-top">
                                            <ul class="list-inline mb-0">
                                                <li class="list-inline-item me-3">
                                                    <svg class="svg-inline--fa fa-calendar me-1 mr-5" aria-hidden="true" focusable="false"
                                                        data-prefix="fal" data-icon="calendar" role="img" xmlns="http://www.w3.org/2000/svg"
                                                        viewBox="0 0 448 512" data-fa-i2svg="">
                                                        <path fill="currentColor"
                                                            d="M112 0C120.8 0 128 7.164 128 16V64H320V16C320 7.164 327.2 0 336 0C344.8 0 352 7.164 352 16V64H384C419.3 64 448 92.65 448 128V448C448 483.3 419.3 512 384 512H64C28.65 512 0 483.3 0 448V128C0 92.65 28.65 64 64 64H96V16C96 7.164 103.2 0 112 0zM416 192H32V448C32 465.7 46.33 480 64 480H384C401.7 480 416 465.7 416 448V192zM384 96H64C46.33 96 32 110.3 32 128V160H416V128C416 110.3 401.7 96 384 96z">
                                                        </path>
                                                    </svg>'.$row->date.' <span style="margin-left:570px;">Оценка: '.$estimation.'</span>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                            ';
    }
Советую в файле base/index.php изменит данную строку
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>';
        }
// вместо 2 id человека который может удалить отзыв
Почему-то не получается вывести на главную страницу
 

parliament

Команда форума
Гл.Администратор
14.05.2021
1 903
3 997
  • Администратор
  • Модер.
  • #4

Pr[E]fix

vk.com/cyxaruk1337
Пользователь
28.05.2022
112
369

Pr[E]fix

vk.com/cyxaruk1337
Пользователь
28.05.2022
112
369
Для overpro
Вставить в любое место:
<div class="row">
    <div class="col-lg-12">
        <div class="card h-100">
            <div class="top_players_header">
                <div class="top_phrase">
                    Отзывы проекта <i class="fa-solid fa-message"></i>
                </div>
            </div>

            <table class="table table-hover h-100">
                <thead class="thead-stats-table">
                    <tr>
                        <th class="text-right tb-custom">
                            <i class="fas fa-image" data-tippy-placement="top" data-tippy-content="Аватар пользователя"></i>
                        </th>
                        <th class="text-center tb-custom">Игрок</th>
                        <th class="text-center tb-custom">Отзыв</th>
                        <th class="text-center tb-custom">Оценка</th>
                        <th class="text-center tb-custom">Дата</th>
                    </tr>
                </thead>

                <tbody id="reviews">
                    {reviews_views}
                </tbody>
            </table>
        </div>
    </div>
</div>
Вставить перед компиляции шаблона после else:
    $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 = '<p class="otzov"">Не оставил отзыва</p>';
        $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();*/
P.S Если вы используете overpro то модуль в modules_extra/reviews/templates/standart переименовать в overpro
 

noaim

Пользователь
17.02.2022
94
42
Для overpro
Вставить в любое место:
<div class="row">
    <div class="col-lg-12">
        <div class="card h-100">
            <div class="top_players_header">
                <div class="top_phrase">
                    Отзывы проекта <i class="fa-solid fa-message"></i>
                </div>
            </div>

            <table class="table table-hover h-100">
                <thead class="thead-stats-table">
                    <tr>
                        <th class="text-right tb-custom">
                            <i class="fas fa-image" data-tippy-placement="top" data-tippy-content="Аватар пользователя"></i>
                        </th>
                        <th class="text-center tb-custom">Игрок</th>
                        <th class="text-center tb-custom">Отзыв</th>
                        <th class="text-center tb-custom">Оценка</th>
                        <th class="text-center tb-custom">Дата</th>
                    </tr>
                </thead>

                <tbody id="reviews">
                    {reviews_views}
                </tbody>
            </table>
        </div>
    </div>
</div>
Вставить перед компиляции шаблона после else:
    $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 = '<p class="otzov"">Не оставил отзыва</p>';
        $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();*/
P.S Если вы используете overpro то модуль в modules_extra/reviews/templates/standart переименовать в overpro
ну как бы все хорошо, вот только один минус есть, я уже посмотрел



1670007630235.png

Это /tpl/index
 
Сверху Снизу