This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # 1. Chặn các popup tương tác và cấu hình tự động restart dịch vụ | |
| export DEBIAN_FRONTEND=noninteractive | |
| export NEEDRESTART_MODE=a | |
| # Kiểm tra quyền root | |
| if [[ $EUID -ne 0 ]]; then | |
| echo "Vui lòng chạy với quyền sudo." | |
| exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # 1. Chặn các popup tương tác và cấu hình tự động restart dịch vụ | |
| export DEBIAN_FRONTEND=noninteractive | |
| export NEEDRESTART_MODE=a | |
| # Script cài MongoDB extension phiên bản 1.17.3 CHO TẤT CẢ PHIÊN BẢN PHP | |
| # Cách compile thủ công riêng biệt → HOÀN TOÀN KHÔNG CONFLICT giữa các version | |
| # Ubuntu 22.04+ (hỗ trợ PHP 7.4, 8.1, 8.2, ...) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $items_per_page = 2; | |
| $page = isset( $_GET['cpage'] ) ? abs( (int) $_GET['cpage'] ) : 1; | |
| $offset = ( $page * $items_per_page ) - $items_per_page; | |
| $query = 'SELECT * FROM '.$table_name; | |
| $total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table"; | |
| $total = $wpdb->get_var( $total_query ); |