Skip to content

Commit

Permalink
Merge pull request #2 from DevCraftClub/rel/173.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Gokujo authored Jan 17, 2025
2 parents 5b91a16 + 4892c04 commit c4b0327
Show file tree
Hide file tree
Showing 3,924 changed files with 46,518 additions and 620,021 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 2 additions & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# These are supported funding model platforms

github: [Gokujo,]
ko_fi: devcraft
custom: ['https://paypal.me/MaximH', 'https://sobe.ru/na/devcraftclub', 'https://yoomoney.ru/to/41001454367103', 'https://www.donationalerts.com/r/maharder', 'https://devcraft.club/donate/drives/na-chaj.1/']
custom: ['https://paypal.me/MaximH', 'https://sobe.ru/na/devcraftclub', 'https://yoomoney.ru/to/41001454367103', 'https://www.donationalerts.com/r/maharder']
10 changes: 9 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Ошибка
description: Сообщить об ошибке / баге
title: "[Ошибка]: "
labels:
- Ошибка
- bug
assignees:
- Gokujo
body:
Expand Down Expand Up @@ -47,7 +50,12 @@ body:
label: Версия DLE
description: На какой версии DLE это произошло?
options:
- "16.x (Default)"
- "17.3 (Default)"
- "17.2"
- "17.1"
- "17.0"
- "17.х"
- "16.x"
- "15.x"
- "14.x"
- "13.x"
Expand Down
69 changes: 69 additions & 0 deletions .github/ISSUE_TEMPLATE/custom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Другие запросы
description: Если не знаешь куда и где и что оформлять, то этот тикет для тебя
title: "[Прочее]: "
labels:
- Прочее
- Не знаю куда
assignees:
- Gokujo
body:
- type: markdown
attributes:
value: |
Спасибо, что нашли время, чтобы составить этот отчёт
- type: checkboxes
id: read-rules
attributes:
label: Пользовательское соглашение
description: Перед просьбой добавить или "починить" что-либо в срочном порядке - [нужно прочесть соглашение](https://devcraft.club/pages/licence-agreement/).
options:
- label: Я прочёл / прочла соглашение и согласен / согласна с ними
required: true
- type: textarea
id: what-do-you-need
attributes:
label: В чём соль?
description: Если можно, то пожалуйста, опиши то, что хочешь. Если можно пошагово и как можно детальней
placeholder: Я хочу, но не значю что...
value: "Моя хотелка или проблемка!"
validations:
required: true
- type: dropdown
id: dle-version
attributes:
label: Версия DLE
description: На какую версию DLE расчитывать?
options:
- "17.3 (Default)"
- "17.2"
- "17.1"
- "17.0"
- "17.х"
- "16.x"
- "15.x"
- "14.x"
- "13.x"
- "< 13.x"
validations:
required: true
- type: dropdown
id: php-version
attributes:
label: Версия PHP
description: На какой версии PHP работает сайт?
options:
- "8.x (Default)"
- "7.x"
- "5.x"
validations:
required: true

- type: textarea
id: "screenshots"
attributes:
label: Скриншоты и файлы
description: Если есть возможность, добавь скриншоты и / или файлы как ты себе представляешь новый функционал
value: |
![DESCRIPTION](LINK.png)
validations:
required: false
69 changes: 69 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Запрос на новый функционал
description: Опиши то, что хочешь видеть в плагине
title: "[Запрос]: "
labels:
- Запрос на функционал
- enhancement
assignees:
- Gokujo
body:
- type: markdown
attributes:
value: |
Спасибо, что нашли время, чтобы составить этот отчёт
- type: checkboxes
id: read-rules
attributes:
label: Пользовательское соглашение
description: Перед просьбой добавить или "починить" что-либо в срочном порядке - [нужно прочесть соглашение](https://devcraft.club/pages/licence-agreement/).
options:
- label: Я прочёл / прочла соглашение и согласен / согласна с ними
required: true
- type: textarea
id: what-do-you-need
attributes:
label: В чём соль?
description: Если можно, то пожалуйста, опиши то, что хочешь увидеть в плагине в дальнейшем. Если можно пошагово и как можно детальней
placeholder: Я хочу, но не значю что...
value: "Моя хотелка!"
validations:
required: true
- type: dropdown
id: dle-version
attributes:
label: Версия DLE
description: На какую версию DLE расчитывать?
options:
- "17.3 (Default)"
- "17.2"
- "17.1"
- "17.0"
- "17.х"
- "16.x"
- "15.x"
- "14.x"
- "13.x"
- "< 13.x"
validations:
required: true
- type: dropdown
id: php-version
attributes:
label: Версия PHP
description: На какой версии PHP работает сайт?
options:
- "8.x (Default)"
- "7.x"
- "5.x"
validations:
required: true

- type: textarea
id: "screenshots"
attributes:
label: Скриншоты и файлы
description: Если есть возможность, добавь скриншоты и / или файлы как ты себе представляешь новый функционал
value: |
![DESCRIPTION](LINK.png)
validations:
required: false
68 changes: 68 additions & 0 deletions .github/scripts/update_readme.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php
// Пути к файлам
$ROOT = dirname(__FILE__, 3);

$manifestPath = $ROOT . '/manifest.json';
$readmePath = $ROOT . '/README.md';

// Проверяем наличие manifest.json
if (!file_exists($manifestPath)) {
die("Файл manifest.json не найден.\n");
}

// Читаем и парсим manifest.json
$manifestContent = file_get_contents($manifestPath);
$manifest = json_decode($manifestContent, true);

// Проверяем корректность JSON
if (json_last_error() !== JSON_ERROR_NONE) {
die("Ошибка парсинга JSON: " . json_last_error_msg() . "\n");
}

// Формируем badges
$badges = [];

// Badge: Текущая версия
if (isset($manifest['version'])) {
$badges[] = "![Текущая версия](https://img.shields.io/badge/version-{$manifest['version']}-green?style=for-the-badge)";
}

// Badge: Статус
if (isset($manifest['status'])) {
$badges[] = "![Статус](https://img.shields.io/badge/status-{$manifest['status']}-orange?style=for-the-badge)";
}

// Badge: DLE Version
if (!empty($manifest['dle']) && is_array($manifest['dle'])) {
$dleVersions = implode(', ', $manifest['dle']);
$badges[] = "![DLE Version](https://img.shields.io/badge/DLE-$dleVersions-blue?style=for-the-badge)";
}

// Badge: PHP Version
if (!empty($manifest['php']) && is_array($manifest['php'])) {
$phpVersions = implode(', ', $manifest['php']);
$badges[] = "![PHP Version](https://img.shields.io/badge/PHP-$phpVersions-red?style=for-the-badge)";
}

// Генерируем Markdown для badges
$newBadgesMarkdown = implode("", $badges);

// Читаем README.md
if (!file_exists($readmePath)) {
die("Файл README.md не найден.\n");
}
$readmeContent = file_get_contents($readmePath);

// Обновляем badges в README.md
$updatedReadmeContent = preg_replace(
'/(?<=# MHAdmin\n\n)(.*?)(?=\n\n\[)/s',
$newBadgesMarkdown . "\n",
$readmeContent
);

// Сохраняем обновленный README.md
if (file_put_contents($readmePath, $updatedReadmeContent) !== false) {
echo "README.md успешно обновлен.\n";
} else {
echo "Ошибка обновления README.md.\n";
}
34 changes: 34 additions & 0 deletions .github/workflows/update-readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Update README

on:
push:
paths:
- "manifest.json"

jobs:
update-readme:
runs-on: ubuntu-latest

steps:
# Шаг 1: Клонируем репозиторий
- name: Checkout repository
uses: actions/checkout@v3

# Шаг 2: Устанавливаем PHP
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'

# Шаг 3: Запускаем скрипт
- name: Run PHP script
run: php ./.github/scripts/update_readme.php

# Шаг 4: Коммит изменений
- name: Commit changes
run: |
git config --local user.name "GitHub Actions"
git config --local user.email "[email protected]"
git add README.md .last_manifest_version
git commit -m "Update README.md based on manifest.json"
git push
27 changes: 26 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
/nbproject
.idea/*
.idea/*

upload/engine/inc/maharder/_cache
upload/engine/inc/maharder/_cache/*
upload/engine/inc/maharder/_cache/**/
upload/engine/inc/maharder/_cache/**/*
upload/engine/inc/maharder/_config
upload/engine/inc/maharder/_config/*
upload/engine/inc/maharder/_logs
upload/engine/inc/maharder/_logs/*
upload/engine/inc/maharder/_logs/**/
upload/engine/inc/maharder/_logs/**/*
upload/engine/inc/maharder/_migrations
upload/engine/inc/maharder/_migrations/*
upload/engine/inc/maharder/_includes/vendor
upload/engine/inc/maharder/_includes/vendor/*
upload/engine/inc/maharder/_includes/vendor/**/*
upload/engine/inc/maharder/_includes/composer
upload/engine/inc/maharder/_includes/composer/*
upload/engine/inc/maharder/_includes/composer/**/
upload/engine/inc/maharder/_includes/composer/**/*

upload/engine/inc/maharder/_includes/assets.json
upload/engine/inc/maharder/admin/composer.lock
upload/engine/inc/maharder/admin/composer.phar
!upload/engine/inc/maharder/_cache/.htaccess
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# MHAdmin

![Текуящая версия](https://img.shields.io/github/manifest-json/v/Gokujo/mhadmin?filename=manifest.json&style=for-the-badge)![DLE Version](https://img.shields.io/github/manifest-json/dle/Gokujo/mhadmin?label=DLE&style=for-the-badge&color=blue)![PHP Version](https://img.shields.io/github/manifest-json/php/Gokujo/mhadmin?label=PHP&style=for-the-badge&color=red)![Twig](https://img.shields.io/badge/Twig-3.x-green?style=for-the-badge)![Fomantic UI](https://img.shields.io/badge/Fomantic-2.8-blue?style=for-the-badge)
![Текущая версия](https://img.shields.io/badge/version-173.3.0-green?style=for-the-badge)![Статус](https://img.shields.io/badge/status-dev-orange?style=for-the-badge)![DLE Version](https://img.shields.io/badge/DLE-17.x-blue?style=for-the-badge)![PHP Version](https://img.shields.io/badge/PHP-8.3-red?style=for-the-badge)

![Название](https://img.shields.io/badge/Название-MaHarder%20Assets-yellowgreen?style=for-the-badge)

![Описание](https://img.shields.io/badge/Описание-Административная%20панель%20для%20DLE-lightgrey?style=for-the-badge)

![Twig](https://img.shields.io/badge/Twig-3.x-green?style=for-the-badge)![Fomantic UI](https://img.shields.io/badge/Fomantic-2.8-blue?style=for-the-badge)



[![GitHub issues](https://img.shields.io/github/issues/Gokujo/mhadmin.svg?style=flat-square)](https://github.com/Gokujo/mhadmin/issues)[![GitHub forks](https://img.shields.io/github/forks/Gokujo/mhadmin.svg?style=flat-square)](https://github.com/Gokujo/mhadmin/network)[![GitHub license](https://img.shields.io/github/license/Gokujo/mhadmin.svg?style=flat-square)](https://github.com/Gokujo/mhadmin/blob/master/LICENSE)
Expand Down
25 changes: 25 additions & 0 deletions install_archive.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# Создание временной директории
mkdir -p temp

# Копирование содержимого папки "upload" в "temp"
cp -r upload/* temp/

# Перейти в папку temp
cd temp || exit 1

# Упаковать содержимое в ZIP без сжатия (аналог -mx0 в 7-Zip)
zip -0 -r -o dle_faker.zip *

# Вернуться в родительскую директорию
cd ..

# Копировать файл в нужное место с перезаписью
cp -f temp/dle_faker.zip dle_faker_install.zip

# Удаление временной директории
rm -rf temp

# Завершение
exit 0
6 changes: 3 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"version": "2.0.8",
"version": "173.3.0",
"status": "dev",
"dle": [
"15.x"
"17.x"
],
"php": [
"7.2.9"
"8.3"
],
"name": "MaHarder Assets",
"description": "Административная панель для DLE"
Expand Down
Empty file modified upload/engine/ajax/maharder.php
100644 → 100755
Empty file.
11 changes: 3 additions & 8 deletions upload/engine/ajax/maharder/maharder/_functions.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}

if (!function_exists('clearfilepath')) {
function clearfilepath($file, $ext = []) {
function clearfilepath($file, $ext = []) : string {

$file = trim(str_replace(chr(0), '', (string)$file));
$file = str_replace(['/', '\\'], '/', $file);
Expand Down Expand Up @@ -47,7 +47,7 @@ function clearfilepath($file, $ext = []) {
}

if (!function_exists('execute_query')) {
function execute_query($id, $query) {
function execute_query($id, $query) : void {
global $config, $db;

if (!$query) return;
Expand All @@ -67,12 +67,7 @@ function execute_query($id, $query) {
if (count($db->query_errors_list)) {

foreach ($db->query_errors_list as $error) {
$db->query("INSERT INTO " . PREFIX . "_plugins_logs (plugin_id, area, error, type) values ('{$id}', '" . $db->safesql(htmlspecialchars($error['query'],
ENT_QUOTES,
$config['charset']),
false) . "', '" . $db->safesql(htmlspecialchars($error['error'],
ENT_QUOTES,
$config['charset'])) . "', 'mysql')");
$db->query("INSERT INTO " . PREFIX . "_plugins_logs (plugin_id, area, error, type) values ('{$id}', '" . $db->safesql(htmlspecialchars($error['query'],ENT_QUOTES, $config['charset'])) . "', '" . $db->safesql(htmlspecialchars($error['error'], ENT_QUOTES, $config['charset'])) . "', 'mysql')");
}

}
Expand Down
Loading

0 comments on commit c4b0327

Please sign in to comment.