Compare commits

...

288 commits

Author SHA1 Message Date
Roman Kelesidis
144aa0558d
chore: Removed deploy pipeline (#2047)
Some checks failed
Continuous Integration / Nightly builds 📦 (push) Has been cancelled
PHPMD / Run PHPMD scanning (push) Has been cancelled
2025-07-16 10:15:09 +03:00
Roman Kelesidis
6e7e3dd9ef
fix: handle Nette DateTime objects in birthday validation (#2032)
Some checks failed
Continuous Integration / Nightly builds 📦 (push) Has been cancelled
Continuous Integration / 🎉 Deploy (push) Has been cancelled
PHPMD / Run PHPMD scanning (push) Has been cancelled
* fix: handle Nette DateTime objects in birthday validation

* Update register.php

* Update User.php
2025-07-03 23:07:09 +02:00
Roman Kelesidis
423fb65dbf
release: v2.8.3
Some checks are pending
Continuous Integration / Nightly builds 📦 (push) Waiting to run
Continuous Integration / 🎉 Deploy (push) Waiting to run
PHPMD / Run PHPMD scanning (push) Waiting to run
2025-07-03 10:51:21 +03:00
Roman Kelesidis
51f2c70d81
feat(updater): Added exceptions logging (#2026)
* feat(updater): Added exceptions logging
* refactor(updater): Use `sha256` hash if available
2025-07-03 10:48:25 +03:00
Roman Kelesidis
fd46d3d04a
feat(lang): Added RTL languages support (#2031) 2025-07-03 10:43:02 +03:00
Roman Kelesidis
d4d82101dd
refactor(TorrentFileList): Reduce duplication in root directory unset logic (#2027) 2025-07-03 10:40:56 +03:00
Roman Kelesidis
9e3f3588f2
release: v2.8.2
Some checks failed
PHPMD / Run PHPMD scanning (push) Has been cancelled
Continuous Integration / Nightly builds 📦 (push) Has been cancelled
Continuous Integration / 🎉 Deploy (push) Has been cancelled
2025-06-30 10:49:42 +03:00
Roman Kelesidis
915e1d817c
fix(TorrentFileList): Avoid array_merge reindexing for numeric folder names (#2014)
Some checks are pending
Continuous Integration / Nightly builds 📦 (push) Waiting to run
Continuous Integration / 🎉 Deploy (push) Waiting to run
PHPMD / Run PHPMD scanning (push) Waiting to run
Co-authored-by: zxc <17812947+metalwarrior88@users.noreply.github.com>
2025-06-29 15:03:56 +03:00
Roman Kelesidis
7ac335974b
refactor: Use DEFAULT_CHARSET constant instead of hardcoded string (#2011)
Some checks failed
PHPMD / Run PHPMD scanning (push) Has been cancelled
Continuous Integration / Nightly builds 📦 (push) Has been cancelled
Continuous Integration / 🎉 Deploy (push) Has been cancelled
2025-06-26 13:32:45 +03:00
Roman Kelesidis
c2e3a13a04
release: v2.8.1 2025-06-24 13:00:37 +03:00
Roman Kelesidis
f1d6e74e5d
fix(ip-api): Add error handling and logging for freeipapi.com requests (#2006) 2025-06-24 12:55:41 +03:00
Roman Kelesidis
7f4cc9d3b9
fix(filelist): Undefined property: FileTree::$length when v2 torrent only (#2004) 2025-06-23 21:49:53 +03:00
Roman Kelesidis
a0fc2a9da9
release: v2.8.0
Some checks failed
Continuous Integration / Nightly builds 📦 (push) Has been cancelled
Continuous Integration / 🎉 Deploy (push) Has been cancelled
PHPMD / Run PHPMD scanning (push) Has been cancelled
2025-06-21 22:16:28 +03:00
Yury Pikhtarev
c6076c2c27
fix(template): handle L_ variables in template vars when not found in lang vars (#1998)
Template variables starting with L_ (like L_MY_PROFILE) are now properly
resolved when they exist in template variables but not in language variables.
Previously, these would fall back to showing the literal variable name.

The L_ variable regex now checks both $L (language) and $V (template) arrays
before falling back to the literal string, maintaining backward compatibility
while fixing composite language variables set via template assignment.
2025-06-21 22:13:01 +03:00
Roman Kelesidis
714dd6255e
release: v2.7.0 🐈‍⬛
Some checks are pending
Continuous Integration / Nightly builds 📦 (push) Waiting to run
Continuous Integration / 🎉 Deploy (push) Waiting to run
PHPMD / Run PHPMD scanning (push) Waiting to run
2025-06-21 10:52:01 +03:00
Roman Kelesidis
9b322c7093
chore: Update minimum PHP requirement to 8.2 (#1987)
* chore: Update minimum PHP requirement to 8.2

* chore: Update PHP version references to 8.2 in documentation and templates

* chore: Update issue template labels to array format for consistency

* refactor: Changed `local` environment name to `development`

* chore(composer.json): Changed version of `gemorroj/m3u-parser` package

* chore(composer): Removed `matthiasmullie/scrapbook` package

* fix(template): Update variable fallback behavior to return empty string for missing variables

---------

Co-authored-by: Yury Pikhtarev <exileum@icloud.com>
2025-06-21 11:45:56 +04:00
Roman Kelesidis
423424e947
chore: Removed useless composer update from workflows & installer (#1986) 2025-06-21 09:25:43 +03:00
belomaxorka
27b5815aee changelog: Update CHANGELOG.md 📖 2025-06-21 01:39:56 +00:00
Yury Pikhtarev
bccbad0c57
New Crowdin updates (#1983)
Some checks are pending
Continuous Integration / Nightly builds 📦 (push) Waiting to run
Continuous Integration / 🎉 Deploy (push) Waiting to run
PHPMD / Run PHPMD scanning (push) Waiting to run
* New translations main.php (Romanian)

* New translations main.php (French)

* New translations main.php (Spanish)

* New translations main.php (Afrikaans)

* New translations main.php (Arabic)

* New translations main.php (Belarusian)

* New translations main.php (Bulgarian)

* New translations main.php (Catalan)

* New translations main.php (Czech)

* New translations main.php (Danish)

* New translations main.php (German)

* New translations main.php (Greek)

* New translations main.php (Finnish)

* New translations main.php (Hebrew)

* New translations main.php (Hungarian)

* New translations main.php (Armenian)

* New translations main.php (Italian)

* New translations main.php (Japanese)

* New translations main.php (Georgian)

* New translations main.php (Korean)

* New translations main.php (Lithuanian)

* New translations main.php (Dutch)

* New translations main.php (Norwegian)

* New translations main.php (Polish)

* New translations main.php (Russian)

* New translations main.php (Slovak)

* New translations main.php (Slovenian)

* New translations main.php (Albanian)

* New translations main.php (Serbian (Cyrillic))

* New translations main.php (Swedish)

* New translations main.php (Turkish)

* New translations main.php (Ukrainian)

* New translations main.php (Chinese Traditional)

* New translations main.php (English)

* New translations main.php (Vietnamese)

* New translations main.php (Portuguese, Brazilian)

* New translations main.php (Indonesian)

* New translations main.php (Thai)

* New translations main.php (Croatian)

* New translations main.php (Kazakh)

* New translations main.php (Estonian)

* New translations main.php (Latvian)

* New translations main.php (Azerbaijani)

* New translations main.php (Hindi)

* New translations main.php (Bosnian)

* New translations main.php (Uzbek)

* New translations main.php (Tajik)

* New translations admin_send_email.html (Japanese)

* New translations admin_send_email.html (Chinese Traditional)

* New translations admin_send_email.html (Portuguese, Brazilian)

* New translations group_added.html (Spanish)

* New translations group_added.html (Japanese)

* New translations group_added.html (Chinese Traditional)

* New translations group_added.html (Thai)

* New translations group_approved.html (Spanish)

* New translations group_approved.html (Japanese)

* New translations group_approved.html (Chinese Traditional)

* New translations group_approved.html (Thai)

* New translations group_request.html (Chinese Traditional)

* New translations privmsg_notify.html (Spanish)

* New translations privmsg_notify.html (Japanese)

* New translations privmsg_notify.html (Chinese Traditional)

* New translations profile_send_email.html (Spanish)

* New translations profile_send_email.html (Japanese)

* New translations profile_send_email.html (Thai)

* New translations topic_notify.html (Spanish)

* New translations topic_notify.html (Chinese Traditional)

* New translations topic_notify.html (Thai)

* New translations user_activate.html (Spanish)

* New translations user_activate.html (Chinese Traditional)

* New translations user_activate_passwd.html (Spanish)

* New translations user_activate_passwd.html (Japanese)

* New translations user_activate_passwd.html (Chinese Traditional)

* New translations user_activate_passwd.html (Portuguese, Brazilian)

* New translations user_activate_passwd.html (Thai)

* New translations user_welcome.html (German)

* New translations user_welcome.html (Chinese Traditional)

* New translations user_welcome.html (Portuguese, Brazilian)

* New translations user_welcome.html (Thai)

* New translations user_welcome_inactive.html (Spanish)

* New translations user_welcome_inactive.html (Chinese Traditional)

* New translations user_welcome_inactive.html (Portuguese, Brazilian)

* New translations user_welcome_inactive.html (Thai)

* New translations copyright_holders.html (Chinese Traditional)

* New translations copyright_holders.html (Thai)

* New translations sidebar2.html (Romanian)

* New translations sidebar2.html (French)

* New translations sidebar2.html (Spanish)

* New translations sidebar2.html (Afrikaans)

* New translations sidebar2.html (Arabic)

* New translations sidebar2.html (Belarusian)

* New translations sidebar2.html (Bulgarian)

* New translations sidebar2.html (Catalan)

* New translations sidebar2.html (Czech)

* New translations sidebar2.html (Danish)

* New translations sidebar2.html (German)

* New translations sidebar2.html (Greek)

* New translations sidebar2.html (Finnish)

* New translations sidebar2.html (Hebrew)

* New translations sidebar2.html (Hungarian)

* New translations sidebar2.html (Armenian)

* New translations sidebar2.html (Italian)

* New translations sidebar2.html (Japanese)

* New translations sidebar2.html (Georgian)

* New translations sidebar2.html (Korean)

* New translations sidebar2.html (Lithuanian)

* New translations sidebar2.html (Dutch)

* New translations sidebar2.html (Norwegian)

* New translations sidebar2.html (Polish)

* New translations sidebar2.html (Russian)

* New translations sidebar2.html (Slovak)

* New translations sidebar2.html (Slovenian)

* New translations sidebar2.html (Albanian)

* New translations sidebar2.html (Serbian (Cyrillic))

* New translations sidebar2.html (Swedish)

* New translations sidebar2.html (Turkish)

* New translations sidebar2.html (Ukrainian)

* New translations sidebar2.html (Chinese Traditional)

* New translations sidebar2.html (English)

* New translations sidebar2.html (Vietnamese)

* New translations sidebar2.html (Portuguese, Brazilian)

* New translations sidebar2.html (Indonesian)

* New translations sidebar2.html (Thai)

* New translations sidebar2.html (Croatian)

* New translations sidebar2.html (Kazakh)

* New translations sidebar2.html (Estonian)

* New translations sidebar2.html (Latvian)

* New translations sidebar2.html (Azerbaijani)

* New translations sidebar2.html (Hindi)

* New translations sidebar2.html (Bosnian)

* New translations sidebar2.html (Uzbek)

* New translations sidebar2.html (Tajik)

* New translations user_agreement.html (Thai)

* New translations main.php (Russian)

* New translations sidebar2.html (Russian)

* New translations main.php (Russian)

* New translations main.php (Ukrainian)

* New translations main.php (Romanian)

* New translations main.php (French)

* New translations main.php (Spanish)

* New translations main.php (Afrikaans)

* New translations main.php (Arabic)

* New translations main.php (Belarusian)

* New translations main.php (Bulgarian)

* New translations main.php (Catalan)

* New translations main.php (Czech)

* New translations main.php (Danish)

* New translations main.php (German)

* New translations main.php (Greek)

* New translations main.php (Finnish)

* New translations main.php (Hebrew)

* New translations main.php (Hungarian)

* New translations main.php (Armenian)

* New translations main.php (Italian)

* New translations main.php (Japanese)

* New translations main.php (Georgian)

* New translations main.php (Korean)

* New translations main.php (Lithuanian)

* New translations main.php (Dutch)

* New translations main.php (Norwegian)

* New translations main.php (Polish)

* New translations main.php (Russian)

* New translations main.php (Slovak)

* New translations main.php (Slovenian)

* New translations main.php (Albanian)

* New translations main.php (Serbian (Cyrillic))

* New translations main.php (Swedish)

* New translations main.php (Turkish)

* New translations main.php (Ukrainian)

* New translations main.php (Chinese Traditional)

* New translations main.php (English)

* New translations main.php (Vietnamese)

* New translations main.php (Portuguese, Brazilian)

* New translations main.php (Indonesian)

* New translations main.php (Thai)

* New translations main.php (Croatian)

* New translations main.php (Kazakh)

* New translations main.php (Estonian)

* New translations main.php (Latvian)

* New translations main.php (Azerbaijani)

* New translations main.php (Hindi)

* New translations main.php (Bosnian)

* New translations main.php (Uzbek)

* New translations main.php (Tajik)
2025-06-21 03:52:59 +04:00
Yury Pikhtarev
728116d6dc
refactor(stats): improve database row fetching in tr_stats.php (#1985)
- Updated the method of fetching rows from the database to use a more streamlined approach with `DB()->fetch_row()`.
- Extracted the first column value directly from the result array for clarity and maintainability.
2025-06-21 03:34:11 +04:00
Yury Pikhtarev
a33574c28f
feat(language): add new language variable for migration file and enhance template fallback logic (#1984)
* feat(language): add new language variable for migration file and enhance template fallback logic

- Introduced a new language variable 'MIGRATIONS_FILE' to improve migration management clarity.
- Updated template handling to provide graceful fallbacks for missing language and regular variables, ensuring better user experience and debugging capabilities.
- Added comprehensive unit tests to validate the new fallback logic and ensure existing functionality remains intact.

* refactor(tests): remove debugging test for compiled template output

- Removed the test case that debugged compiled output for troubleshooting in the TemplateGracefulFallbackTest.
- This change streamlines the test suite by focusing on essential functionality, specifically the handling of missing language variables.

* feat(tests): introduce executeTemplate function for streamlined template execution

- Added a new helper function `executeTemplate` to encapsulate the logic for executing compiled templates, improving code readability and reducing duplication in unit tests.
- Updated existing tests in `TemplateGracefulFallbackTest.php` to utilize the new function, ensuring consistent handling of template execution and variable scope.
- Enhanced test coverage by adding edge case scenarios for variable handling, including special characters, empty values, and nested braces.
2025-06-21 03:09:59 +04:00
Roman Kelesidis
e9a9e09576
chore: Added --no-dev composer flag for some workflows (#1982) 2025-06-20 22:39:17 +03:00
Roman Kelesidis
e8cba5dd3f
chore: Added --no-dev composer flag for some workflows (#1981) 2025-06-20 22:27:34 +03:00
Yury Pikhtarev
4f9cc9fe0f
fix(database): update affected rows tracking in Database class (#1980)
* fix(database): update affected rows tracking in Database class

- Enhanced the logic for tracking affected rows in the Database class to accurately reflect the number of rows modified by INSERT, UPDATE, and DELETE operations using the getRowCount() method.
- Added a new unit test suite for the affected_rows method, ensuring comprehensive coverage for various scenarios including tracking of affected rows and validation of the last_affected_rows property.

This update improves the reliability of the Database class's affected rows reporting, facilitating better data handling and debugging.

* feat(install): add developer prompt for dependency installation

- Introduced a prompt during the installation process to ask users if they require development tools and dependencies.
- Adjusted the dependency installation command to conditionally include or exclude development dependencies based on user input.
- Added warnings for users with PHP versions below 8.2 when opting for development dependencies.

This enhancement improves the installation experience by allowing developers to easily set up their environment while ensuring compatibility checks are in place.

* docs(README): clarify PHP version requirements and installation instructions

- Updated PHP version requirements to specify that PHP 8.2+ is required for development dependencies.
- Enhanced installation instructions to differentiate between production and development setups, including commands for Composer installation.
- Added a note regarding the necessity of PHP 8.2+ for running tests, improving clarity for developers.

These changes aim to provide clearer guidance for users setting up their development environments.
2025-06-20 23:06:36 +04:00
Yury Pikhtarev
cc9d412522
feat(test): add comprehensive testing infrastructure with Pest PHP (#1979)
* feat(tests): integrate Pest testing framework and set up initial test structure

- Added Pest as a development dependency for enhanced testing capabilities.
- Created a PHPUnit configuration file (`phpunit.xml`) for test suite management.
- Established a base test case class (`TestCase.php`) for consistent test structure.
- Implemented example tests in both feature and unit directories to demonstrate usage.
- Introduced a custom Pest file (`Pest.php`) to extend functionality and define global helpers.

This setup streamlines the testing process and provides a foundation for future test development.

* feat(test): add comprehensive testing infrastructure with Pest PHP

- Add complete Pest PHP testing suite with extensive helper functions
- Implement unit tests for Database and DatabaseDebugger classes
- Implement unit tests for CacheManager and DatastoreManager classes
- Add comprehensive mock factories and test data generators
- Add custom Pest expectations for TorrentPier-specific validation
- Create detailed testing documentation with examples and best practices
- Update main README.md and UPGRADE_GUIDE.md with testing sections
- Update dependencies to support testing infrastructure
- Remove example test file and replace with production-ready tests

BREAKING CHANGE: None - all existing functionality maintained

The testing infrastructure includes:
- 25+ helper functions for test setup and mocking
- Singleton pattern testing for all major components
- Mock factories for Database, Cache, and external dependencies
- Custom expectations: toBeValidDatabaseConfig, toHaveDebugInfo
- Comprehensive documentation with real-world examples
- Performance testing utilities and execution time assertions
2025-06-20 22:00:12 +04:00
Yury Pikhtarev
7aed6bc7d8
refactor(database): enhance error logging and various fixes (#1978)
Some checks are pending
Continuous Integration / Nightly builds 📦 (push) Waiting to run
Continuous Integration / 🎉 Deploy (push) Waiting to run
PHPMD / Run PHPMD scanning (push) Waiting to run
* refactor(database): enhance error logging and handling in Database and DatabaseDebugger classes

- Updated error handling in Database class to provide more meaningful error messages, including detailed PDO error information.
- Enhanced log_error method in DatabaseDebugger to accept exceptions, allowing for more reliable error logging with comprehensive context.
- Improved user-facing error messages while maintaining detailed logging for administrators and developers.
- Added checks for connection status and query context in error logs to aid in debugging.

* refactor(database): streamline error handling and improve code clarity in Database class

- Removed unused imports and global variable references to enhance code readability.
- Simplified error handling by refining conditions for empty input arrays.
- Defined variables early in the error logging method to ensure consistent access throughout.
- Improved comments for better understanding of the error handling logic.

* fix(database): refine development mode condition in Database class

- Removed unnecessary function check from the development mode condition to streamline the logic.

* fix(redirect): add no-cache headers to prevent browser caching of redirects

- Implemented `send_no_cache_headers()` in the redirect function to ensure that browsers do not cache redirect responses, adhering to best practices for HTTP redirects.

* refactor(database): enhance error handling and logging in Database and Whoops classes

- Improved error handling in the Database class to log detailed information for duplicate column errors and automatically retry problematic queries using PDO.
- Introduced a new DatabaseErrorHandler to enhance Whoops error reporting with comprehensive database context and recent query history.
- Updated EnhancedPrettyPageHandler to include dynamic database information in error outputs, improving debugging capabilities.
- Added legacy query tracking in DatabaseDebugger to identify and log queries needing compatibility fixes, ensuring better maintenance of legacy code.

* refactor(posting): rollback changes in SQL queries up to legacy format
2025-06-20 18:52:30 +04:00
belomaxorka
7e723d6ad8 changelog: Update CHANGELOG.md 📖 2025-06-20 09:44:57 +00:00
Yury Pikhtarev
fbde8cd421
feat(migrations): implement Phinx database migration system (#1976)
* feat(migrations): implement Phinx database migration system and update installation process

- Introduced a modern database migration system using Phinx, replacing the legacy SQL import method.
- Updated `install.php` to run migrations instead of importing SQL dumps.
- Added migration configuration file `phinx.php` and initial migration files for schema and data seeding.
- Created a new admin panel for migration status management.
- Updated UPGRADE_GUIDE.md to include migration setup instructions and benefits.
- Ensured backward compatibility for existing installations while facilitating a smoother transition to the new system.

* update runProcess to return process exit code

* refactor(migrations): clean up whitespace and formatting in migration files

- Removed unnecessary whitespace and adjusted formatting for consistency across migration files.

* fix(migrations): enforce NOT NULL constraints on migration columns

- Updated various migration columns to enforce NOT NULL constraints, ensuring data integrity across the schema.
- Adjusted default values and nullability for multiple fields in the initial schema migration files.

* refactor(database): standardize table engines to InnoDB for reliability

- Updated UPGRADE_GUIDE.md to reflect the use of InnoDB for all tables, emphasizing data integrity and reliability.
- Modified migration files to change table engines from MyISAM to InnoDB for various tracker and temporary tables.
- Optimized session variable settings in cron jobs for InnoDB compatibility.
- Ensured consistency across the schema by enforcing InnoDB usage in all relevant areas.

* fix(migrations): correct MySQL integer field types to match original schema

- Fix bb_forums table: forum_status (INT→TINYINT), forum_tpl_id (INT→SMALLINT)
- Fix bb_users table: avatar_ext_id remains TINYINT as per original schema
- Fix bb_groups table: avatar_ext_id (SMALLINT→INT) to match original INT(15)
- Fix bb_topics table: topic_show_first_post, topic_allow_robots (TINYINT(1)→TINYINT UNSIGNED)
- Remove incorrect 'limit' => 11 from standard INT fields, use default Phinx behavior
- Fix search_size field to use proper INT type instead of maximum value hack
- Correct poll table field types: vote_id (TINYINT), user_id (MEDIUMINT), vote_result (MEDIUMINT UNSIGNED)
- Standardize all timestamp and ID fields to use appropriate MySQL integer types

Ensures migration creates database schema identical to install/sql/mysql.sql
while maintaining InnoDB engine for all tables instead of MyISAM.

* fix(cache): auto-create cache directories when using FileStorage

The UnifiedCacheSystem was constructing directory paths for Nette FileStorage
but not creating them, causing "Directory not found" errors when accessing
caches like 'bb_login_err'. FileStorage expects directories to already exist.

Changes:
- Add automatic directory creation using bb_mkdir() before FileStorage init
- Handle both regular cache directories and SQLite parent directories
- Apply to both _buildStorage() and _buildDatastoreStorage() methods
- Add proper error handling with RuntimeException for failed creation
- Maintain consistency with TorrentPier's directory creation patterns

This ensures cache directories are created automatically when first accessed,
eliminating the need for manual directory creation during deployment.

Fixes: Cache initialization failures with missing directories

* refactor(docs): update README for clarity and remove legacy SQL file

- Improved formatting and clarity in the README, ensuring consistent line breaks and spacing.
- Updated installation instructions to reflect the new migration process, emphasizing the use of `phinx` for database setup.
- Removed the legacy SQL dump file `mysql.sql` and the `legacy-changes.txt` file, streamlining the installation process and reducing confusion for new users.
- Enhanced the documentation to guide users through the setup process more effectively.

* docs: enhance CLAUDE.md with migration details and directory updates

- Updated the `/library/` section to clarify its purpose.
- Added a new `/migrations/` directory section detailing database migration files managed by Phinx.
- Included migration commands for running and checking migration status.
- Revised the initial schema and seed data references for clarity.
- Improved formatting for consistency throughout the document.

* refactor(cron): remove demo_mode.php cron job and related functionality

- Deleted the demo_mode.php cron job file, which was responsible for managing demo mode operations.
- Added a migration to remove the demo_mode.php entry from the bb_cron table, ensuring a clean database state.
- Updated the initial schema migration comment to reflect the creation of essential database schema for fresh installations.

* refactor(docs): Fixed some typos

* chore: update changelog generation starting from v2.4.6-alpha.4

* refactor: Changed some `php_sapi_name()` to `PHP_SAPI` constants

* refactor: Extract hardcoded migrations to class property

* refactor: Use `count()` to count $initialMigrations elements

* feat(migrations): enhance migration management UI with new language variables

- Added new language variables for migration status, instructions, and applied/pending migrations to improve user interface clarity.
- Updated admin migration template to utilize these new language variables for better localization and maintainability.
- Introduced a new file 'CLAUDE.md' to the cleanup process for documentation purposes.

---------

Co-authored-by: Roman Kelesidis <roman25052006.kelesh@gmail.com>
2025-06-20 13:23:33 +04:00
belomaxorka
0d4c869f30 changelog: Update CHANGELOG.md 📖
Some checks failed
PHPMD / Run PHPMD scanning (push) Has been cancelled
Continuous Integration / Nightly builds 📦 (push) Has been cancelled
Continuous Integration / 🎉 Deploy (push) Has been cancelled
2025-06-19 01:42:40 +00:00
Yury Pikhtarev
49717d3a68
feat: implement Language singleton with shorthand functions (#1966)
Some checks are pending
Continuous Integration / Nightly builds 📦 (push) Waiting to run
Continuous Integration / 🎉 Deploy (push) Waiting to run
PHPMD / Run PHPMD scanning (push) Waiting to run
- Add Language singleton class (src/Language.php) following TorrentPier patterns
- Implement automatic source language fallback loading
- Add dot notation support for nested language arrays
- Provide convenient shorthand functions __() and _e() in common.php
- Maintain 100% backward compatibility with global $lang variable
- Replace manual language file loading in bb_die() and bb_date() functions
- Update poll.php as modern usage example with __() shorthand
- Integrate with User.php initialization via lang()->initializeLanguage()
- Clean up Template.php compilation removing legacy source language logic
- Add comprehensive UPGRADE_GUIDE.md documentation section

BREAKING CHANGE: None - full backward compatibility maintained
2025-06-18 19:29:06 +04:00
Yury Pikhtarev
2fd306704f
feat(database): add visual markers for Nette Explorer queries in debug panel (#1965)
Add automatic detection and colorful badges to distinguish Nette Explorer
queries from legacy database calls, helping track modernization progress.

- Detect Nette SQL patterns (backticks, parentheses)
- Add green styled [Nette Explorer] badges
- Fix HTML escaping in debug tooltips
- Prevent marker duplication
2025-06-18 18:13:34 +04:00
Yury Pikhtarev
6c0219d53c
refactor(database): rename DB to Database and extract debug functionality (#1964)
- Rename DB → Database, DbFactory → DatabaseFactory for consistency
- Extract 8 debug methods from Database to dedicated DatabaseDebugger class
- Add DebugSelection wrapper for debug-enabled Nette Selection
- Update all references across codebase (common.php, Dev.php, page_footer)
- Maintain backward compatibility via magic methods (__get, __isset)
- Update documentation (README.md, UPGRADE_GUIDE.md)

No breaking changes - all existing DB() calls work unchanged
2025-06-18 17:46:12 +04:00
Roman Kelesidis
f2fca0de85
release: v2.6.0 🐂 2025-06-18 14:15:53 +03:00
Yury Pikhtarev
07a06a33cd
feat!: implement unified cache system with Nette Caching (#1963)
* feat!: implement unified cache system with Nette Caching

Replace legacy Cache and Datastore systems with modern unified implementation using Nette Caching v3.3 while maintaining 100% backward compatibility.

BREAKING CHANGE: Internal cache architecture completely rewritten, though all public APIs remain compatible.

### Added
- src/Cache/UnifiedCacheSystem.php: Main singleton orchestrator following TorrentPier patterns
- src/Cache/CacheManager.php: Cache interface using Nette Caching with singleton pattern
- src/Cache/DatastoreManager.php: Datastore interface using CacheManager internally
- src/Cache/README.md: Comprehensive documentation and migration guide

### Changed
- common.php: Updated to use singleton pattern instead of global variables
- src/Dev.php: Added compatibility with unified cache system debug functionality
- composer.json: Added nette/caching dependency
- UPGRADE_GUIDE.md: Added unified cache system migration documentation

### Removed
- src/Legacy/Cache/*: All legacy cache implementations (APCu, File, Memcached, Redis, SQLite, Common)
- src/Legacy/Datastore/*: All legacy datastore implementations (APCu, File, Memcached, Redis, SQLite, Common)
- src/Legacy/Caches.php: Legacy cache factory replaced by UnifiedCacheSystem

### Performance
- 456,647+ operations per second verified in production testing
- Memory optimization through efficient singleton pattern
- Modern Nette Caching algorithms and bulk operations

### Compatibility
- All existing CACHE() calls work unchanged
- All existing $datastore operations work unchanged
- Full backward compatibility with Dev.php debugging
- Resolved Sessions TypeError and debug property access issues

### Architecture
- Consistent singleton pattern matching config(), dev(), censor(), DB()
- Clean function interfaces with proper return types
- No global variables, modern initialization pattern
- Single source of truth replacing duplicate Cache/Datastore code

* fix: update datastore type from 'filecache' to 'file' for consistency

Modified the datastore type in common.php and README.md to reflect the new unified cache system terminology. This change ensures consistency across the codebase and documentation following the recent implementation of the unified cache system.

* refactor(cache): centralize storage creation and eliminate redundancy

- Remove redundant initializeStorage() from CacheManager
- Update CacheManager to receive pre-built Storage instances
- Centralize all storage creation logic in UnifiedCacheSystem
- Remove unused properties and fix method signatures
- Update documentation to reflect simplified architecture

No breaking changes - all public APIs unchanged.
2025-06-18 15:05:22 +04:00
Yury Pikhtarev
e458109eef
fix(User): add null and array checks before session data operations (#1962)
Ensure that session data is only processed if it exists and is an array. This prevents potential errors when attempting to cache or remove user session data. Updated methods `cache_set_userdata` and `cache_rm_userdata` to include necessary checks.
2025-06-18 12:43:58 +04:00
Yury Pikhtarev
f50b914cc1
feat: replace legacy database layer with Nette Database implementation (#1961)
* feat: replace legacy database layer with Nette Database implementation

Replace legacy SqlDb/Dbs classes with modern Nette Database implementation
while maintaining complete backward compatibility.

- Replace SqlDb with singleton DB class using Nette Database Connection
- Replace Dbs factory with DbFactory maintaining full compatibility
- Implement complete feature parity including debug, explain, and logging
- Add proper type declarations and modern PHP standards
- Remove legacy SqlDb.php and Dbs.php files
- Update common.php DB() function with proper PHPDoc and return types
- Fix affected_rows() implementation for Nette Database compatibility
- Fix explain() method to handle missing debug array keys
- Maintain 100% backward compatibility - no code changes required

The new implementation uses Nette Database v3.2 internally while preserving
all existing functionality. All existing DB() calls work unchanged.
All debugging, explain, error handling, and performance tracking features
are fully preserved with enhanced reliability.

Files added:
- src/Database/DB.php - Main database class with singleton pattern
- src/Database/DbFactory.php - Factory for database instance management
- src/Database/README.md - Comprehensive documentation

Files removed:
- src/Database/Config.php - Unused configuration helper
- src/Legacy/SqlDb.php - Legacy database class
- src/Legacy/Dbs.php - Legacy database factory

Files modified:
- common.php - Updated DB() function with proper types and documentation
- viewtopic.php - Fixed duplicate column SQL query issues
- src/Dev.php - Updated to use DbFactory instead of legacy $DBS
- library/includes/page_footer*.php - Replaced $DBS references with DbFactory

* docs: Update UPGRADE_GUIDE.md with Database Layer Migration details

Add a comprehensive section on the new database layer migration to Nette Database, highlighting key improvements, no code changes required, and verification steps. Document the removal of legacy database files and provide links to detailed documentation for further reference. Ensure clarity on backward compatibility and performance benefits.

* docs: Enhance README.md with future migration strategy to Nette Database Explorer

Add detailed sections outlining a phased approach for migrating to Nette Database Explorer, including hybrid methods, advanced features, and migration strategies. Highlight benefits such as improved developer experience, code quality, and performance optimizations. This documentation aims to guide developers through the transition while maintaining backward compatibility.
2025-06-18 12:29:13 +04:00
Roman Kelesidis
edda2306f2
release: v2.5.0 🐂
Some checks are pending
Continuous Integration / Nightly builds 📦 (push) Waiting to run
Continuous Integration / 🎉 Deploy (push) Waiting to run
PHPMD / Run PHPMD scanning (push) Waiting to run
2025-06-18 09:52:20 +03:00
Roman Kelesidis
86abafb114
docs: Add Select class migration guide (#1960) 2025-06-18 09:43:55 +03:00
Yury Pikhtarev
74a564d795
refactor(censor): migrate Censor class to singleton pattern (#1954)
* refactor(censor): migrate Censor class to singleton pattern

- Convert TorrentPier\Censor to singleton pattern following Config class design
- Add global censor() helper function for consistent API access
- Replace all global $wordCensor declarations and usage across 12 files
- Implement automatic reload functionality in admin panel
- Add enhanced methods: isEnabled(), addWord(), getWordsCount(), reload()

Files updated:
- src/Legacy/Atom.php, src/Legacy/Post.php
- viewforum.php, posting.php, search.php, index.php, viewtopic.php, privmsg.php
- library/ajax/posts.php, library/includes/bbcode.php, library/includes/ucp/topic_watch.php
- admin/admin_words.php, library/includes/init_bb.php
- common.php (added global helper)
- UPGRADE_GUIDE.md (documentation)

Benefits:
- Single instance shared across application for better performance
- Memory efficient word loading only when censoring enabled
- Consistent API pattern matching config() singleton
- Automatic word reloading when admin updates censored words
- Enhanced developer experience with new utility methods

BREAKING CHANGE: None - full backward compatibility maintained.
The global $wordCensor variable continues to work as before.
New censor() function is the recommended approach going forward.

* refactor(censor): add enable check to censorString method

* refactor(dev): convert Dev class to singleton pattern (#1955)

* refactor(dev): convert Dev class to singleton pattern

- Convert TorrentPier\Dev class from direct instantiation to singleton pattern
- Add getInstance() method and private constructor for singleton implementation
- Introduce new instance methods with improved naming:
  * getSqlDebugLog() (replaces getSqlLog())
  * checkSqlDebugAllowed() (replaces sqlDebugAllowed())
  * formatShortQuery() (replaces shortQuery())
- Add dev() global helper function for consistent access pattern
- Maintain full backward compatibility with existing static method calls
- Update all internal usage across 18 files to use new singleton pattern:
  * src/Ajax.php, src/Legacy/SqlDb.php
  * All Cache classes (APCu, File, Memcached, Redis, Sqlite, Common)
  * All Datastore classes (APCu, File, Memcached, Redis, Sqlite, Common)
  * library/includes/page_footer_dev.php
- Implement lazy initialization consistent with Config and Censor singletons
- Add comprehensive migration guide in UPGRADE_GUIDE.md

This refactoring improves resource management, provides consistent API patterns
across all singleton classes, and maintains zero breaking changes for existing code.

* refactor(dev): Added missing `\TorrentPier\Dev::init()`

---------

Co-authored-by: Roman Kelesidis <roman25052006.kelesh@gmail.com>
2025-06-18 10:38:23 +04:00
Roman Kelesidis
b1b2618757
chore(cliff): Add conventional commit prefix to changelog message (#1957) 2025-06-18 07:06:11 +03:00
belomaxorka
62f49beb0b Update CHANGELOG.md 📖 2025-06-18 01:41:26 +00:00
Yury Pikhtarev
bf9100fbfa
feat: implement centralized Config class to replace global $bb_cfg array (#1953)
Some checks failed
Continuous Integration / Nightly builds 📦 (push) Has been cancelled
Continuous Integration / 🎉 Deploy (push) Has been cancelled
PHPMD / Run PHPMD scanning (push) Has been cancelled
* feat: implement centralized Config class to replace global $bb_cfg array

- Add singleton Config class with dot notation support for nested configuration
- Implement thread-safe configuration access with magic methods (__get, __set, __isset)
- Add global config() helper function for convenient access
- Support for getSection(), merge(), has(), all() methods with type safety

BREAKING CHANGE: While $bb_cfg global array still works for backward compatibility,
new code should use config()->get() method with dot notation

Updated files:
- src/Config.php: New Config singleton class implementation
- common.php: Initialize Config singleton and add global helper
- src/Emailer.php: Replace $bb_cfg with config()->get()
- src/Ajax.php: Replace $bb_cfg with config()->get()
- src/Censor.php: Replace $bb_cfg with config()->get()
- src/Validate.php: Replace $bb_cfg with config()->get()
- src/Dev.php: Replace $bb_cfg with config()->get()
- src/Sitemap.php: Replace $bb_cfg with config()->get()
- src/TorrServerAPI.php: Replace $bb_cfg with config()->get()
- src/Sessions.php: Replace $bb_cfg with config()->get()
- src/Legacy/TorrentFileList.php: Replace $bb_cfg with config()->get()
- src/Legacy/Poll.php: Replace $bb_cfg with config()->get()
- src/Legacy/Torrent.php: Replace $bb_cfg with config()->get()
- src/Legacy/Common/User.php: Replace $bb_cfg with config()->get()
- src/Legacy/Template.php: Replace $bb_cfg with config()->get()
- src/Legacy/Atom.php: Replace $bb_cfg with config()->get()
- src/Legacy/Admin/Common.php: Replace $bb_cfg with config()->get()
- viewforum.php: Replace $bb_cfg with config()->get()
- posting.php: Replace $bb_cfg with config()->get()
- dl.php: Replace $bb_cfg with config()->get()
- feed.php: Replace $bb_cfg with config()->get()
- filelist.php: Replace $bb_cfg with config()->get()
- group_edit.php: Replace $bb_cfg with config()->get()
- group.php: Replace $bb_cfg with config()->get()
- index.php: Replace $bb_cfg with config()->get()
- login.php: Replace $bb_cfg with config()->get()
- memberlist.php: Replace $bb_cfg with config()->get()
- modcp.php: Replace $bb_cfg with config()->get()
- playback_m3u.php: Replace $bb_cfg with config()->get()
- poll.php: Replace $bb_cfg with config()->get()

* refactor: replace $bb_cfg with config() in various admin files

- Updated multiple admin files to utilize the new Config class for configuration access.
- Replaced instances of $bb_cfg with config()->get() for improved maintainability and consistency.
- Ensured backward compatibility while transitioning to the new configuration system.

Files modified:
- common.php
- index.php
- admin_attach_cp.php
- admin_log.php
- admin_mass_email.php
- admin_sitemap.php
- admin_smilies.php
- admin_terms.php
- admin_user_search.php
- admin_words.php
- admin/index.php
- admin/stats/tracker.php

* refactor: update init_bb.php to use config() for configuration management

- Replaced the merging of $bb_cfg with a call to config()->merge() for improved clarity and maintainability.
- Updated the retrieval of all configuration settings to use config()->all().

This change continues the transition towards a centralized configuration system.

* refactor: replace $bb_cfg with config() in various files

- Updated multiple files to utilize the new Config class for configuration access.
- Replaced instances of $bb_cfg with config()->get() for improved maintainability and consistency.
- Ensured backward compatibility while transitioning to the new configuration system.

Files modified:
- privmsg.php
- search.php
- terms.php
- tracker.php
- viewtopic.php
- bt/announce.php
- bt/scrape.php
- bt/includes/init_tr.php
- library/ajax/*.php
- src/Config.php

* refactor: replace $bb_cfg with config() in attachment and display files

- Updated multiple files to utilize the new Config class for configuration access.
- Replaced instances of $bb_cfg with config()->get() for improved maintainability and consistency.
- Ensured backward compatibility while transitioning to the new configuration system.

Files modified:
- attachment_mod.php
- displaying_torrent.php
- functions_delete.php
- bbcode.php
- functions.php
- init_bb.php
- online_userlist.php
- page_footer.php
- page_header.php
- torrent_show_dl_list.php
- cron jobs (various files)
- datastore build files (various files)

* refactor: replace $bb_cfg with config() in user control panel files

- Updated multiple user control panel files to utilize the new Config class for configuration access.
- Replaced instances of $bb_cfg with config()->get() for improved maintainability and consistency.
- Ensured backward compatibility while transitioning to the new configuration system.

Files modified:
- bonus.php
- email.php
- register.php
- sendpasswd.php
- topic_watch.php
- viewprofile.php

* refactor: replace $bb_cfg with config() in various legacy files

- Updated multiple legacy files to utilize the new Config class for configuration access.
- Replaced instances of $bb_cfg with config()->get() for improved maintainability and consistency.
- Ensured backward compatibility while transitioning to the new configuration system.

Files modified:
- sidebar2.html
- BBCode.php
- LogAction.php
- Post.php
- Template.php
- Torrent.php
- Common/User.php
- Common/Select.php
- Common/Upload.php
- Admin/Common.php
- tpl_config.php

* refactor: remove legacy DOCUMENTATION.md and add UPGRADE_GUIDE.md

- Deleted the outdated DOCUMENTATION.md file, which contained legacy configuration information.
- Introduced a new UPGRADE_GUIDE.md to assist users in migrating to the new configuration system.
- The upgrade guide includes migration strategies, breaking changes, and best practices for using the new Config class.

Files modified:
- DOCUMENTATION.md (deleted)
- UPGRADE_GUIDE.md (new)

* refactor: update legacy files to maintain compatibility with bb_cfg deprecation

- Added comments in init_bb.php, Template.php, and Cron.php to indicate that bb_cfg is deprecated but retained for compatibility with non-adapted code.
- Ensured clarity in documentation for future reference while transitioning to the new configuration system.

Files modified:
- init_bb.php
- Template.php
- Cron.php
2025-06-18 01:19:49 +04:00
Yury Pikhtarev
37a0675adf
fix(sql): resolve only_full_group_by compatibility issues in tracker cleanup (#1951)
- Replace non-aggregated 'seeder' column with MAX(seeder) in GROUP BY query
- Remove ORDER BY clause incompatible with GROUP BY in seeder update query

Fixes MySQL 5.7+ strict SQL mode errors in tr_cleanup_and_dlstat cron job.
2025-06-17 20:28:14 +04:00
Roman Kelesidis
81bf67c2be
fix(installer): Strip protocol from TP_HOST to keep only hostname (#1952)
Some checks are pending
Continuous Integration / Nightly builds 📦 (push) Waiting to run
Continuous Integration / 🎉 Deploy (push) Waiting to run
PHPMD / Run PHPMD scanning (push) Waiting to run
2025-06-17 18:14:47 +03:00
Yury Pikhtarev
5842994782
refactor(config): encapsulate global $bb_cfg array in Config class (#1950)
- Create new TorrentPier\Config singleton class with dot notation support
- Add config() helper function for global access
- Replace direct $bb_cfg access in core files (common.php, Emailer.php, Ajax.php)
- Implement methods: get(), set(), has(), all(), getSection(), merge()
- Add magic methods for property-like access
- Maintain backward compatibility with existing $bb_cfg usage

BREAKING CHANGE: None - maintains full backward compatibility
2025-06-17 18:41:45 +04:00
Yury Pikhtarev
8907dbf991
Update composer.lock and improve SQL queries in online_userlist.php and tr_cleanup_and_dlstat.php (#1949)
- Updated plugin API version in composer.lock from 2.3.0 to 2.6.0.
- Modified SQL queries in online_userlist.php to use MAX() for session data and adjusted GROUP BY clause for better accuracy.
- Enhanced SQL logic in tr_cleanup_and_dlstat.php to utilize MAX() for determining the releaser status.
2025-06-17 18:07:31 +04:00
belomaxorka
d8b1489b06 Update CHANGELOG.md 📖
Some checks are pending
Continuous Integration / Nightly builds 📦 (push) Waiting to run
Continuous Integration / 🎉 Deploy (push) Waiting to run
PHPMD / Run PHPMD scanning (push) Waiting to run
2025-06-17 01:42:31 +00:00
dependabot[bot]
b4776804a4
Composer(deps): Bump filp/whoops from 2.18.2 to 2.18.3 (#1948)
Some checks are pending
Continuous Integration / Nightly builds 📦 (push) Waiting to run
Continuous Integration / 🎉 Deploy (push) Waiting to run
PHPMD / Run PHPMD scanning (push) Waiting to run
Bumps [filp/whoops](https://github.com/filp/whoops) from 2.18.2 to 2.18.3.
- [Changelog](https://github.com/filp/whoops/blob/master/CHANGELOG.md)
- [Commits](https://github.com/filp/whoops/compare/2.18.2...2.18.3)

---
updated-dependencies:
- dependency-name: filp/whoops
  dependency-version: 2.18.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-16 15:07:06 +03:00
belomaxorka
633051bb99 Update CHANGELOG.md 📖
Some checks are pending
Continuous Integration / Nightly builds 📦 (push) Waiting to run
Continuous Integration / 🎉 Deploy (push) Waiting to run
PHPMD / Run PHPMD scanning (push) Waiting to run
2025-06-16 01:45:24 +00:00
belomaxorka
224f0ffa1f Update CHANGELOG.md 📖
Some checks failed
Continuous Integration / Nightly builds 📦 (push) Has been cancelled
Continuous Integration / 🎉 Deploy (push) Has been cancelled
PHPMD / Run PHPMD scanning (push) Has been cancelled
2025-06-15 01:50:26 +00:00
belomaxorka
b530268826 Update CHANGELOG.md 📖 2025-06-13 08:21:18 +00:00
Roman Kelesidis
9c7d270598
misc(_release.php): Finally! Removed some useless params (#1947) 2025-06-13 11:20:11 +03:00
Roman Kelesidis
e7d3133aa8
release: v2.4.6-alpha.4 2025-06-13 11:06:10 +03:00
Roman Kelesidis
0271b21a5e
misc(_release.php): Use GPG sign for tags by default (#1946) 2025-06-13 11:04:49 +03:00
Roman Kelesidis
374a74c91f
release: v2.4.6-alpha.3 2025-06-13 10:53:29 +03:00
Roman Kelesidis
e5811f9c66
misc(_release.php): Minor improvements (#1945)
* misc(_release.php): Minor improvements

* Update _release.php
2025-06-13 10:51:50 +03:00
Roman Kelesidis
b6b38adea3 release: v2.4.6-alpha.2 2025-06-12 22:15:07 +03:00
Roman Kelesidis
5e6fb3ef42
misc(cliff.toml): Use correct nightly link (#1944) 2025-06-12 21:06:00 +03:00
dependabot[bot]
9a529558b4
Composer(deps): Bump filp/whoops from 2.18.1 to 2.18.2 (#1943)
Bumps [filp/whoops](https://github.com/filp/whoops) from 2.18.1 to 2.18.2.
- [Changelog](https://github.com/filp/whoops/blob/master/CHANGELOG.md)
- [Commits](https://github.com/filp/whoops/compare/2.18.1...2.18.2)

---
updated-dependencies:
- dependency-name: filp/whoops
  dependency-version: 2.18.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-12 20:33:12 +07:00
belomaxorka
62ab980027 Update CHANGELOG.md 📖 2025-06-12 01:41:04 +00:00
Roman Kelesidis
bcf4eb4e9b
feat(ajax): Log full ajax request/response data to console in explain mode (#1942)
* feat(ajax): log full ajax request data to console in explain mode

* Update Ajax.php
2025-06-11 21:42:13 +03:00
Roman Kelesidis
6f03f750ba
feat: Improved ajax debug (#1941) 2025-06-11 21:32:23 +03:00
belomaxorka
a27d504c7d Update CHANGELOG.md 📖 2025-06-11 18:21:14 +00:00
Roman Kelesidis
345dd1bc20
feat: Add console log for ajax actions when explain cookie is set (#1940) 2025-06-11 21:20:08 +03:00
Roman Kelesidis
28e38aa781
removed: 'cat_forums' from enqueue list in get_forum_mods ajax (#1939) 2025-06-11 21:03:15 +03:00
belomaxorka
1ece8ba830 Update CHANGELOG.md 📖 2025-06-11 01:42:18 +00:00
Roman Kelesidis
f9db78d266
misc(_release.php): Minor improvements (#1938) 2025-06-10 13:54:54 +03:00
Roman Kelesidis
bf328dd69e
fix: Set $datastore->enqueue before $datastore->get (#1937) 2025-06-10 13:47:57 +03:00
belomaxorka
74d3b76f73 Update CHANGELOG.md 📖 2025-06-09 20:22:52 +00:00
Roman Kelesidis
4b16b847f5
removed: Extra CFG_DIR constant (#1936) 2025-06-09 21:47:02 +03:00
Roman Kelesidis
dcd7002c2a
misc(_release.php): Temporary removed automatic push origin (#1935) 2025-06-09 18:46:51 +03:00
Roman Kelesidis
75ef57474c
misc(_release.php): Added ability to set version emoji (#1934) 2025-06-09 17:23:36 +03:00
Roman Kelesidis
867359a89e
misc(_release.php): Added automatic CHANGELOG.md update (#1933) 2025-06-09 17:05:12 +03:00
belomaxorka
eecfc44046 Update CHANGELOG.md 📖 2025-06-09 13:12:00 +00:00
Roman Kelesidis
5561e0022c
misc(_release.php): Added push origin command (#1932) 2025-06-09 16:10:57 +03:00
Roman Kelesidis
128f917d76 release: v2.4.6-alpha.1 2025-06-09 15:55:47 +03:00
Roman Kelesidis
8ecc61719a
misc(_release.php): Added GPG sign for tags (#1931) 2025-06-09 15:55:14 +03:00
belomaxorka
bef5328d1e Update CHANGELOG.md 📖 2025-06-09 12:22:30 +00:00
Roman Kelesidis
6adde35849
misc(cliff): Added automated script for releases creation (#1930)
* misc(cliff): Added automated script for releases creation

* Updated

* Update functions_cli.php

* Updated

* Updated

* Update functions_cli.php

* Updated

* Update _release.php

* Update cliff.toml

* Update _release.php

* Update _release.php

* Update _release.php

* Update _release.php

* Update _release.php

* Update _release.php

* Update _release.php

* Update _release.php

* Update _release.php

* Update _release.php

* Update _release.php

* Update _release.php

* Update _release.php
2025-06-09 15:21:17 +03:00
belomaxorka
c9aff2a152 Update CHANGELOG.md 📖 2025-06-09 10:48:52 +00:00
Roman Kelesidis
cef041c0d1
misc(cliff): Completely removed cliff-releases.toml (#1929) 2025-06-09 13:48:25 +03:00
Roman Kelesidis
212e5c5283
misc(cliff): Updated config (#1928) 2025-06-09 13:44:17 +03:00
belomaxorka
5e291f3043 Update CHANGELOG.md 📖 2025-06-08 19:46:50 +00:00
Roman Kelesidis
4d0b2941e3
feat(meta): Minor improvements to description generation (#1926) 2025-06-08 22:44:50 +03:00
Yury Pikhtarev
2487d130bb
crodwin: New Crowdin updates (#1925) 2025-06-08 18:11:59 +03:00
Yury Pikhtarev
0515670bee
crowdin: New Crowdin updates (#1924)
* New translations main.php (Romanian)

* New translations main.php (French)

* New translations main.php (Spanish)

* New translations main.php (Afrikaans)

* New translations main.php (Arabic)

* New translations main.php (Belarusian)

* New translations main.php (Bulgarian)

* New translations main.php (Catalan)

* New translations main.php (Czech)

* New translations main.php (Danish)

* New translations main.php (German)

* New translations main.php (Greek)

* New translations main.php (Finnish)

* New translations main.php (Hebrew)

* New translations main.php (Hungarian)

* New translations main.php (Armenian)

* New translations main.php (Italian)

* New translations main.php (Japanese)

* New translations main.php (Georgian)

* New translations main.php (Korean)

* New translations main.php (Lithuanian)

* New translations main.php (Dutch)

* New translations main.php (Norwegian)

* New translations main.php (Polish)

* New translations main.php (Russian)

* New translations main.php (Slovak)

* New translations main.php (Slovenian)

* New translations main.php (Albanian)

* New translations main.php (Serbian (Cyrillic))

* New translations main.php (Swedish)

* New translations main.php (Turkish)

* New translations main.php (Ukrainian)

* New translations main.php (Chinese Traditional)

* New translations main.php (English)

* New translations main.php (Vietnamese)

* New translations main.php (Portuguese, Brazilian)

* New translations main.php (Indonesian)

* New translations main.php (Thai)

* New translations main.php (Croatian)

* New translations main.php (Kazakh)

* New translations main.php (Estonian)

* New translations main.php (Latvian)

* New translations main.php (Azerbaijani)

* New translations main.php (Hindi)

* New translations main.php (Bosnian)

* New translations main.php (Uzbek)

* New translations main.php (Tajik)
2025-06-08 18:47:14 +07:00
Roman Kelesidis
f64c340563
feat(bbcode): Added [nfo] and [pre] tags (#1923) 2025-06-08 12:44:04 +03:00
belomaxorka
5768fe7071 Update CHANGELOG.md 📖 2025-06-08 01:48:39 +00:00
Yury Pikhtarev
8e965fb1ce
crowdin: New translations main.php (Russian) (#1922) 2025-06-07 19:29:59 +03:00
Yury Pikhtarev
daeb7fe87e
crowdin: New Crowdin updates (#1921)
* New translations main.php (Romanian)

* New translations main.php (French)

* New translations main.php (Spanish)

* New translations main.php (Afrikaans)

* New translations main.php (Arabic)

* New translations main.php (Belarusian)

* New translations main.php (Bulgarian)

* New translations main.php (Catalan)

* New translations main.php (Czech)

* New translations main.php (Danish)

* New translations main.php (German)

* New translations main.php (Greek)

* New translations main.php (Finnish)

* New translations main.php (Hebrew)

* New translations main.php (Hungarian)

* New translations main.php (Armenian)

* New translations main.php (Italian)

* New translations main.php (Japanese)

* New translations main.php (Georgian)

* New translations main.php (Korean)

* New translations main.php (Lithuanian)

* New translations main.php (Dutch)

* New translations main.php (Norwegian)

* New translations main.php (Polish)

* New translations main.php (Russian)

* New translations main.php (Slovak)

* New translations main.php (Slovenian)

* New translations main.php (Albanian)

* New translations main.php (Serbian (Cyrillic))

* New translations main.php (Swedish)

* New translations main.php (Turkish)

* New translations main.php (Ukrainian)

* New translations main.php (Chinese Traditional)

* New translations main.php (English)

* New translations main.php (Vietnamese)

* New translations main.php (Portuguese, Brazilian)

* New translations main.php (Indonesian)

* New translations main.php (Thai)

* New translations main.php (Croatian)

* New translations main.php (Kazakh)

* New translations main.php (Estonian)

* New translations main.php (Latvian)

* New translations main.php (Azerbaijani)

* New translations main.php (Hindi)

* New translations main.php (Bosnian)

* New translations main.php (Uzbek)

* New translations main.php (Tajik)
2025-06-07 15:00:23 +03:00
Roman Kelesidis
4c24cb65bf
feat(bbcode): Implement color customization for [box] tag (#1920)
* feat(bbcode): implement color customization for `[box]` tag

* feat(bbcode): implement color customization for `[box]` tag
2025-06-07 14:46:42 +03:00
belomaxorka
6d6786481e Update CHANGELOG.md 📖 2025-06-05 01:40:24 +00:00
dependabot[bot]
125366147c
Composer(deps): Bump filp/whoops from 2.18.0 to 2.18.1 (#1919)
Bumps [filp/whoops](https://github.com/filp/whoops) from 2.18.0 to 2.18.1.
- [Changelog](https://github.com/filp/whoops/blob/master/CHANGELOG.md)
- [Commits](https://github.com/filp/whoops/compare/2.18.0...2.18.1)

---
updated-dependencies:
- dependency-name: filp/whoops
  dependency-version: 2.18.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-04 09:43:43 +03:00
belomaxorka
efa39767a6 Update CHANGELOG.md 📖 2025-05-31 20:09:52 +00:00
Roman Kelesidis
46f29bc68a
misc: Minor improvements (#1918) 2025-05-31 10:19:24 +03:00
Roman Kelesidis
7b8b9a0bba
feat: Added ability to set page meta description (#1917)
* feat: Added ability to set page meta description

* Update page_header.php

* Update viewforum.php

* Updated

* Update viewtopic.php

* Update viewtopic.php

* Update viewtopic.php

* Update viewtopic.php
2025-05-31 10:13:55 +03:00
belomaxorka
5a60ee0193 Update CHANGELOG.md 📖 2025-05-30 18:58:22 +00:00
Roman Kelesidis
03eeb08ad1
feat(install): Autofill Host in robots.txt file (#1916) 2025-05-30 21:53:24 +03:00
Yury Pikhtarev
a3da6f5386
crowdin: New Crowdin updates (#1915) 2025-05-30 20:27:13 +03:00
Yury Pikhtarev
a15baef69a
crowdin: New Crowdin updates (#1914)
* New translations main.php (Romanian)

* New translations main.php (French)

* New translations main.php (Spanish)

* New translations main.php (Afrikaans)

* New translations main.php (Arabic)

* New translations main.php (Belarusian)

* New translations main.php (Bulgarian)

* New translations main.php (Catalan)

* New translations main.php (Czech)

* New translations main.php (Danish)

* New translations main.php (German)

* New translations main.php (Greek)

* New translations main.php (Finnish)

* New translations main.php (Hebrew)

* New translations main.php (Hungarian)

* New translations main.php (Armenian)

* New translations main.php (Italian)

* New translations main.php (Japanese)

* New translations main.php (Georgian)

* New translations main.php (Korean)

* New translations main.php (Lithuanian)

* New translations main.php (Dutch)

* New translations main.php (Norwegian)

* New translations main.php (Polish)

* New translations main.php (Russian)

* New translations main.php (Slovak)

* New translations main.php (Slovenian)

* New translations main.php (Albanian)

* New translations main.php (Serbian (Cyrillic))

* New translations main.php (Swedish)

* New translations main.php (Turkish)

* New translations main.php (Ukrainian)

* New translations main.php (Chinese Traditional)

* New translations main.php (English)

* New translations main.php (Vietnamese)

* New translations main.php (Portuguese, Brazilian)

* New translations main.php (Indonesian)

* New translations main.php (Thai)

* New translations main.php (Croatian)

* New translations main.php (Kazakh)

* New translations main.php (Estonian)

* New translations main.php (Latvian)

* New translations main.php (Azerbaijani)

* New translations main.php (Hindi)

* New translations main.php (Bosnian)

* New translations main.php (Uzbek)

* New translations main.php (Tajik)
2025-05-30 22:59:14 +07:00
Roman Kelesidis
79bb13e17d
feat(ACP): Added robots.txt editor (#1913)
* feat(admin): Added robots.txt editor

* Update admin_robots.tpl

* Update admin_robots.php

* Update admin_robots.php

* Update admin_robots.php

* Update admin_robots.tpl

* Updated

* Updated

* Update main.php

* Updated
2025-05-30 17:53:22 +03:00
belomaxorka
d18f99fa1c Update CHANGELOG.md 📖 2025-05-23 01:38:55 +00:00
dependabot[bot]
f76e351b32
Composer(deps): Bump arokettu/bencode from 4.3.0 to 4.3.1 (#1912)
Bumps [arokettu/bencode](https://github.com/arokettu/bencode) from 4.3.0 to 4.3.1.
- [Release notes](https://github.com/arokettu/bencode/releases)
- [Changelog](https://github.com/arokettu/bencode/blob/master/CHANGELOG.md)
- [Commits](https://github.com/arokettu/bencode/compare/4.3.0...4.3.1)

---
updated-dependencies:
- dependency-name: arokettu/bencode
  dependency-version: 4.3.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-22 21:57:40 +07:00
belomaxorka
21b1eef59d Update CHANGELOG.md 📖 2025-05-19 01:43:37 +00:00
Yury Pikhtarev
174f44160e
crowdin: New Crowdin updates (#1911) 2025-05-18 07:52:16 +03:00
belomaxorka
025a1944b9 Update CHANGELOG.md 📖 2025-05-17 17:36:06 +00:00
Yury Pikhtarev
c40aad20ad
crowdin: New Crowdin updates (#1910) 2025-05-17 22:46:27 +07:00
Yury Pikhtarev
999ae1eff9
crowdin: New Crowdin updates (#1907)
* New translations main.php (Russian)

* New translations main.php (Azerbaijani)

* New translations main.php (Romanian)

* New translations main.php (French)

* New translations main.php (Spanish)

* New translations main.php (Afrikaans)

* New translations main.php (Arabic)

* New translations main.php (Belarusian)

* New translations main.php (Bulgarian)

* New translations main.php (Catalan)

* New translations main.php (Czech)

* New translations main.php (Danish)

* New translations main.php (German)

* New translations main.php (Greek)

* New translations main.php (Finnish)

* New translations main.php (Hebrew)

* New translations main.php (Hungarian)

* New translations main.php (Armenian)

* New translations main.php (Italian)

* New translations main.php (Japanese)

* New translations main.php (Georgian)

* New translations main.php (Korean)

* New translations main.php (Lithuanian)

* New translations main.php (Dutch)

* New translations main.php (Norwegian)

* New translations main.php (Polish)

* New translations main.php (Russian)

* New translations main.php (Slovak)

* New translations main.php (Slovenian)

* New translations main.php (Albanian)

* New translations main.php (Serbian (Cyrillic))

* New translations main.php (Swedish)

* New translations main.php (Turkish)

* New translations main.php (Ukrainian)

* New translations main.php (Chinese Traditional)

* New translations main.php (English)

* New translations main.php (Vietnamese)

* New translations main.php (Portuguese, Brazilian)

* New translations main.php (Indonesian)

* New translations main.php (Thai)

* New translations main.php (Croatian)

* New translations main.php (Kazakh)

* New translations main.php (Estonian)

* New translations main.php (Latvian)

* New translations main.php (Azerbaijani)

* New translations main.php (Hindi)

* New translations main.php (Bosnian)

* New translations main.php (Uzbek)

* New translations main.php (Tajik)
2025-05-17 17:37:09 +03:00
Roman Kelesidis
897edfc371
crowdin: Updated translations (#1909) 2025-05-17 17:24:01 +03:00
Roman Kelesidis
6d0499dd02
crowdin: Updated translations (#1908) 2025-05-17 17:22:20 +03:00
Roman Kelesidis
8a3b12c119
crowdin: New translations (#1906)
* crowdin: New translations

* Update main.php
2025-05-17 08:26:34 +03:00
Yury Pikhtarev
dee7b4acf9
New Crowdin updates (#1905)
* New translations main.php (Romanian)

* New translations main.php (French)

* New translations main.php (Spanish)

* New translations main.php (Afrikaans)

* New translations main.php (Arabic)

* New translations main.php (Belarusian)

* New translations main.php (Bulgarian)

* New translations main.php (Catalan)

* New translations main.php (Czech)

* New translations main.php (Danish)

* New translations main.php (German)

* New translations main.php (Greek)

* New translations main.php (Finnish)

* New translations main.php (Hebrew)

* New translations main.php (Hungarian)

* New translations main.php (Armenian)

* New translations main.php (Italian)

* New translations main.php (Japanese)

* New translations main.php (Georgian)

* New translations main.php (Korean)

* New translations main.php (Lithuanian)

* New translations main.php (Dutch)

* New translations main.php (Norwegian)

* New translations main.php (Polish)

* New translations main.php (Russian)

* New translations main.php (Slovak)

* New translations main.php (Slovenian)

* New translations main.php (Albanian)

* New translations main.php (Serbian (Cyrillic))

* New translations main.php (Swedish)

* New translations main.php (Turkish)

* New translations main.php (Ukrainian)

* New translations main.php (Chinese Traditional)

* New translations main.php (English)

* New translations main.php (Vietnamese)

* New translations main.php (Portuguese, Brazilian)

* New translations main.php (Indonesian)

* New translations main.php (Thai)

* New translations main.php (Croatian)

* New translations main.php (Kazakh)

* New translations main.php (Estonian)

* New translations main.php (Latvian)

* New translations main.php (Azerbaijani)

* New translations main.php (Hindi)

* New translations main.php (Bosnian)

* New translations main.php (Uzbek)

* New translations main.php (Tajik)

* New translations admin_send_email.html (Japanese)

* New translations admin_send_email.html (Chinese Traditional)

* New translations admin_send_email.html (Portuguese, Brazilian)

* New translations group_added.html (Spanish)

* New translations group_added.html (Japanese)

* New translations group_added.html (Chinese Traditional)

* New translations group_added.html (Thai)

* New translations group_approved.html (Spanish)

* New translations group_approved.html (Japanese)

* New translations group_approved.html (Chinese Traditional)

* New translations group_approved.html (Thai)

* New translations group_request.html (Chinese Traditional)

* New translations privmsg_notify.html (Spanish)

* New translations privmsg_notify.html (Japanese)

* New translations privmsg_notify.html (Chinese Traditional)

* New translations profile_send_email.html (Spanish)

* New translations profile_send_email.html (Japanese)

* New translations profile_send_email.html (Thai)

* New translations topic_notify.html (Spanish)

* New translations topic_notify.html (Chinese Traditional)

* New translations topic_notify.html (Thai)

* New translations user_activate.html (Spanish)

* New translations user_activate.html (Chinese Traditional)

* New translations user_activate_passwd.html (Spanish)

* New translations user_activate_passwd.html (Japanese)

* New translations user_activate_passwd.html (Chinese Traditional)

* New translations user_activate_passwd.html (Portuguese, Brazilian)

* New translations user_activate_passwd.html (Thai)

* New translations user_welcome.html (German)

* New translations user_welcome.html (Chinese Traditional)

* New translations user_welcome.html (Portuguese, Brazilian)

* New translations user_welcome.html (Thai)

* New translations user_welcome_inactive.html (Spanish)

* New translations user_welcome_inactive.html (Chinese Traditional)

* New translations user_welcome_inactive.html (Portuguese, Brazilian)

* New translations user_welcome_inactive.html (Thai)

* New translations copyright_holders.html (Chinese Traditional)

* New translations copyright_holders.html (Thai)

* New translations user_agreement.html (Thai)
2025-05-17 11:50:07 +07:00
belomaxorka
1738624d04 Update CHANGELOG.md 📖 2025-05-12 01:41:59 +00:00
Roman Kelesidis
cd450e67bb release: v2.4.5 🐠 2025-05-11 21:39:24 +03:00
belomaxorka
44bdd13df8 Update CHANGELOG.md 📖 2025-05-08 01:38:38 +00:00
Roman Kelesidis
3cdf843a04
misc: Minor improvements (#1904)
* misc: Minor improvements

* Update legacy-changes.txt

* Update composer.lock
2025-05-07 22:26:51 +03:00
belomaxorka
19ef9efc6a Update CHANGELOG.md 📖 2025-05-06 17:06:37 +00:00
Roman Kelesidis
3a64f8595c
feat: Added ability to hide peer username in peer list (#1903)
* Added ability to hide peer username in peer list

* Updated
2025-05-06 20:04:17 +03:00
Roman Kelesidis
4b7203f8ae
fix(peers list): IPv6 showing (#1902)
* fix(peers list): `IPv6` showing

* Update functions.php
2025-05-06 19:41:17 +03:00
Roman Kelesidis
6e0786bdee
feat(announcer): Check for frozen torrents (#1770)
* feat(announcer): Check for frozen torrents

* Update announce.php

* Update announce.php

* Update announce.php

* Update announce.php

* Update announce.php

* Update announce.php

* Updated

* Update announce.php

* Update announce.php

* Update announce.php

* Update announce.php

* Update announce.php
2025-05-06 12:55:18 +03:00
belomaxorka
d3b8c38f7a Update CHANGELOG.md 📖 2025-05-05 16:12:44 +00:00
Roman Kelesidis
2f026921ee
misc: Minor improvements (#1898)
* misc: Minor improvements

* Update functions.php

* Update functions.php
2025-05-05 19:11:22 +03:00
Roman Kelesidis
513e3065d3
feat(freeipapi): Added ability to use own API token (#1901)
* feat(freeipapi): Added ability to use own API token

* Updated

* Update displaying_torrent.php

* Update usercp_register.tpl

* Update register.php
2025-05-05 18:58:08 +03:00
dependabot[bot]
a4793f6ce1
Composer(deps): Bump symfony/polyfill from 1.31.0 to 1.32.0 (#1900)
Bumps [symfony/polyfill](https://github.com/symfony/polyfill) from 1.31.0 to 1.32.0.
- [Changelog](https://github.com/symfony/polyfill/blob/1.x/CHANGELOG.md)
- [Commits](https://github.com/symfony/polyfill/compare/v1.31.0...v1.32.0)

---
updated-dependencies:
- dependency-name: symfony/polyfill
  dependency-version: 1.32.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-05 14:26:46 +07:00
belomaxorka
ab7ea901ec Update CHANGELOG.md 📖 2025-05-05 01:40:58 +00:00
Roman Kelesidis
781b7240c4
fix: Incorrect rounding in execution time counter (#1899)
* fix: Incorrect rounding in execution time counter

* Update page_footer.php
2025-05-04 20:16:58 +03:00
Roman Kelesidis
14086a0ed6
misc: Minor improvements (#1897) 2025-05-04 19:40:57 +03:00
Roman Kelesidis
36d399220e
fix: Undefined array key "smile" when are no smilies (#1896) 2025-05-04 17:28:22 +03:00
Roman Kelesidis
b51820e186
feat(admin_smilies): Added confirmation on smilie deleting (#1895)
* feat(admin_smilies): Added confirmation on smilie deleting

* Update admin_smilies.php
2025-05-04 16:50:17 +03:00
belomaxorka
bdd4d9322b Update CHANGELOG.md 📖 2025-05-04 13:25:46 +00:00
Roman Kelesidis
8edba72f09
fix: Peer country flag not shown in peers list (#1894)
* fix: Peer country flag not shown in peers list

* Update functions.php
2025-05-04 16:20:02 +03:00
Roman Kelesidis
90ece5c762
misc: Minor improvements (#1893) 2025-05-04 12:33:08 +03:00
Roman Kelesidis
1e5b93d2c0
misc: Minor improvements (#1892) 2025-05-04 12:27:13 +03:00
Roman Kelesidis
2555ebce47
feat: Added ability to hide peer country in peer list (#1891)
* feat: Added ability to hide peer country in peer list

* Update displaying_torrent.php

* Update displaying_torrent.php

* Updated

* Update usercp_register.tpl

* Update main.php

* Update functions.php
2025-05-04 11:55:28 +03:00
Roman Kelesidis
f5d65b8911
feat: Added ability to hide BitTorrent client in peers list (#1890)
* feat: Added ability to hide peer torrent client

* Update displaying_torrent.php

* Update functions.php

* Update register.php

* Updated
2025-05-04 10:38:38 +03:00
belomaxorka
ccb122f9cb Update CHANGELOG.md 📖 2025-05-03 17:50:28 +00:00
Roman Kelesidis
1db9412957 release: v2.4.5-rc.5 🐑 2025-05-03 20:43:45 +03:00
belomaxorka
3a679bc253 Update CHANGELOG.md 📖 2025-05-03 13:32:36 +00:00
Roman Kelesidis
75e9d5e4a8
feat(atom): Hide topics from private forums (#1889) 2025-05-03 16:24:48 +03:00
belomaxorka
071fc04b48 Update CHANGELOG.md 📖 2025-05-03 01:26:39 +00:00
Roman Kelesidis
e510ebc3ba
feat(admin_ranks): Added confirmation on rank deleting (#1888)
* feat(admin_ranks): Added confirmation on rank deleting

* Update functions.php

* Update admin_ranks.php
2025-05-02 14:43:36 +03:00
belomaxorka
25224e6dfd Update CHANGELOG.md 📖 2025-05-02 01:36:51 +00:00
dependabot[bot]
7a14464d20
Composer(deps): Bump vlucas/phpdotenv from 5.6.1 to 5.6.2 (#1887)
Bumps [vlucas/phpdotenv](https://github.com/vlucas/phpdotenv) from 5.6.1 to 5.6.2.
- [Release notes](https://github.com/vlucas/phpdotenv/releases)
- [Commits](https://github.com/vlucas/phpdotenv/compare/v5.6.1...v5.6.2)

---
updated-dependencies:
- dependency-name: vlucas/phpdotenv
  dependency-version: 5.6.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-01 19:36:22 +03:00
belomaxorka
0b489a25fd Update CHANGELOG.md 📖 2025-04-30 01:36:25 +00:00
Roman Kelesidis
1663e19c3f
misc(password_hash): Changed cost to 12 by default (#1886) 2025-04-29 20:41:03 +03:00
Roman Kelesidis
6bd000bc0d
misc: Updated nightly builds link (#1885) 2025-04-29 20:36:15 +03:00
Roman Kelesidis
5fe770070e
misc: Composer dependencies are installed according to the minimum supported PHP version (#1884) 2025-04-29 20:26:03 +03:00
belomaxorka
c98a4f760e Update CHANGELOG.md 📖 2025-04-24 01:27:35 +00:00
Roman Kelesidis
c0cdcff488
feat(magnet): Added xl (eXact Length) parametr (#1883) 2025-04-23 19:57:03 +03:00
belomaxorka
04b0a477d3 Update CHANGELOG.md 📖 2025-04-22 18:13:23 +00:00
Roman Kelesidis
53e944be51 Revert "style: Correct sidebar2 displaying" 2025-04-22 16:16:04 +03:00
Roman Kelesidis
bc1713abdd
misc: Corrected php version in composer.json (#1882) 2025-04-22 10:45:43 +03:00
Roman Kelesidis
5c4972ec12
misc: Composer dependencies are installed according to the minimum supported PHP version (#1881) 2025-04-22 10:33:08 +03:00
belomaxorka
ec0efe5790 Update CHANGELOG.md 📖 2025-04-18 01:25:35 +00:00
Roman Kelesidis
de8f1925ba
misc: Minor improvements (#1880)
* misc: Minor improvements

* Update index.php
2025-04-17 19:18:29 +03:00
belomaxorka
9e85a00464 Update CHANGELOG.md 📖 2025-04-17 01:26:28 +00:00
Roman Kelesidis
9f96090cc4
fix: Displaying Network news and Latest news for guests when foums are private (#1879) 2025-04-16 19:29:00 +03:00
Roman Kelesidis
eeb391da6a
misc: Minor improvements (#1876)
* misc: Minor improvements

* Update viewprofile.php

* Update viewprofile.php

* Update functions.php

* Update filelist.php

* Revert "Update filelist.php"

This reverts commit e5eb9a6b3f.

* Update .cliffignore

* Updated

* Update viewtopic_attach_guest.tpl
2025-04-16 13:40:36 +03:00
Roman Kelesidis
1073f19013 Revert "feat: Improvements for Torrent Files List functionality (#1878)"
This reverts commit e59adce848.
2025-04-16 13:27:21 +03:00
belomaxorka
cb36715583 Update CHANGELOG.md 📖 2025-04-16 01:27:40 +00:00
Roman Kelesidis
e59adce848
feat: Improvements for Torrent Files List functionality (#1878)
* feat: Improvements for `Torrent Files List` functionality

* Updated

* Updated

* Update filelist.php

* Update filelist.php

* Update filelist.php

* Updated

* Update filelist.php

* Update filelist.php

* Update filelist.php

* Updated

* Update filelist.php

* Update filelist.php
2025-04-15 20:31:45 +03:00
belomaxorka
1374479fa2 Update CHANGELOG.md 📖 2025-04-11 01:26:04 +00:00
Roman Kelesidis
c3b40003b7
fix(cache): Implicitly marking parameter $name as nullable is deprecated (#1877) 2025-04-10 12:19:22 +03:00
belomaxorka
1dc84f666f Update CHANGELOG.md 📖 2025-04-06 01:37:25 +00:00
Roman Kelesidis
41a78ddbcb
misc: Minor improvements (#1875)
* misc: Minor improvements

* Update activate.php

* Update admin_ug_auth.php

* Update admin_ug_auth.php

* Update register.php

* Update index.php

* Update admin_ug_auth.php
2025-04-05 17:01:59 +03:00
belomaxorka
36ff584e69 Update CHANGELOG.md 📖 2025-04-04 01:24:41 +00:00
Roman Kelesidis
0f1a69e32d
misc: Minor improvements (#1874) 2025-04-03 19:16:08 +03:00
belomaxorka
578a064303 Update CHANGELOG.md 📖 2025-04-01 15:44:55 +00:00
Roman Kelesidis
f9c8160f8e
misc: Fetch only necessary sitemap parameters in admin_sitemap.php (#1873) 2025-04-01 18:40:47 +03:00
Roman Kelesidis
8358aa00de
fix: Pagination issue in Report on action page (#1872) 2025-04-01 18:06:36 +03:00
belomaxorka
0e72537188 Update CHANGELOG.md 📖 2025-03-31 17:17:00 +00:00
Roman Kelesidis
595adbe4da
fix: tablesorting issues & incorrect user_role for pending users (#1871) 2025-03-31 19:54:53 +03:00
Roman Kelesidis
12792e74f7
fix: Fixed TorrentPier build-in emojis showing in ACP (#1870) 2025-03-31 17:50:07 +03:00
Roman Kelesidis
84e2392896
misc: Changed placeholder IP address from 7f000001 to 0 (#1869) 2025-03-31 17:42:36 +03:00
belomaxorka
0a5d14fb6b Update CHANGELOG.md 📖 2025-03-28 01:24:16 +00:00
Roman Kelesidis
72376532b3
misc: Minor improvements (#1866)
* misc:  Minor improvements

* Update _cleanup.php

* Update TorrServerAPI.php

* Update TorrServerAPI.php
2025-03-27 21:29:49 +03:00
belomaxorka
83c03ae08e Update CHANGELOG.md 📖 2025-03-27 01:24:16 +00:00
dependabot[bot]
bd5aa2a5e7
Composer(deps): Bump php-curl-class/php-curl-class from 11.1.0 to 12.0.0 (#1868)
Bumps [php-curl-class/php-curl-class](https://github.com/php-curl-class/php-curl-class) from 11.1.0 to 12.0.0.
- [Release notes](https://github.com/php-curl-class/php-curl-class/releases)
- [Changelog](https://github.com/php-curl-class/php-curl-class/blob/master/CHANGELOG.md)
- [Commits](https://github.com/php-curl-class/php-curl-class/compare/11.1.0...12.0.0)

---
updated-dependencies:
- dependency-name: php-curl-class/php-curl-class
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-26 13:28:20 +07:00
belomaxorka
ab4602e38f Update CHANGELOG.md 📖 2025-03-26 01:24:34 +00:00
Roman Kelesidis
eabf851ee6 revert: Added TorrentPier instance hash generation 2025-03-25 14:02:35 +03:00
Roman Kelesidis
1b288a96e4 revert: Added IndexNow protocol support 🤖 2025-03-25 13:48:52 +03:00
dependabot[bot]
6440162187
Composer(deps): Bump monolog/monolog from 3.8.1 to 3.9.0 (#1865)
Bumps [monolog/monolog](https://github.com/Seldaek/monolog) from 3.8.1 to 3.9.0.
- [Release notes](https://github.com/Seldaek/monolog/releases)
- [Changelog](https://github.com/Seldaek/monolog/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Seldaek/monolog/compare/3.8.1...3.9.0)

---
updated-dependencies:
- dependency-name: monolog/monolog
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-25 13:23:47 +07:00
dependabot[bot]
de2fceabed
Composer(deps): Bump php-curl-class/php-curl-class from 11.0.5 to 11.1.0 (#1864)
Bumps [php-curl-class/php-curl-class](https://github.com/php-curl-class/php-curl-class) from 11.0.5 to 11.1.0.
- [Release notes](https://github.com/php-curl-class/php-curl-class/releases)
- [Changelog](https://github.com/php-curl-class/php-curl-class/blob/master/CHANGELOG.md)
- [Commits](https://github.com/php-curl-class/php-curl-class/compare/11.0.5...11.1.0)

---
updated-dependencies:
- dependency-name: php-curl-class/php-curl-class
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-25 13:23:32 +07:00
belomaxorka
1523a37fea Update CHANGELOG.md 📖 2025-03-23 01:36:27 +00:00
Roman Kelesidis
83e42bc5db
misc(render_flag): Hide names for specified ($nameIgnoreList) flags (#1862) 2025-03-22 12:19:29 +03:00
Roman Kelesidis
e9920ab598
misc(README): Removed Build actions badge (#1861) 2025-03-22 11:21:30 +03:00
Roman Kelesidis
974d3590c1
misc(.cliffignore): Added one more commit (#1860) 2025-03-22 08:52:06 +03:00
belomaxorka
02b418ac34 Update CHANGELOG.md 📖 2025-03-22 05:48:52 +00:00
Roman Kelesidis
2eab551bd7
misc(cliff): Added .cliffignore file to ignore reverted commits (#1859) 2025-03-22 08:47:51 +03:00
belomaxorka
a791d4db81 Update CHANGELOG.md 📖 2025-03-22 01:22:28 +00:00
dependabot[bot]
3ced460640
Composer(deps): Bump egulias/email-validator from 4.0.3 to 4.0.4 (#1858)
Bumps [egulias/email-validator](https://github.com/egulias/EmailValidator) from 4.0.3 to 4.0.4.
- [Release notes](https://github.com/egulias/EmailValidator/releases)
- [Commits](https://github.com/egulias/EmailValidator/compare/4.0.3...4.0.4)

---
updated-dependencies:
- dependency-name: egulias/email-validator
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-21 13:15:40 +07:00
belomaxorka
3a2dcab561 Update CHANGELOG.md 📖 2025-03-21 02:12:39 +00:00
Roman Kelesidis
df500c4dfa
Update CHANGELOG.md 2025-03-21 09:11:39 +07:00
Roman Kelesidis
467225e6e4 Revert "feat: Added secure headers configuring (#1856)"
This reverts commit 9766c534bd.
2025-03-19 14:25:51 +03:00
belomaxorka
4f8b51febd Update CHANGELOG.md 📖 2025-03-19 01:24:08 +00:00
Roman Kelesidis
9766c534bd
feat: Added secure headers configuring (#1856)
* feat: Added secure headers configuring

* Update config.secure-headers.php
2025-03-18 21:05:15 +03:00
Roman Kelesidis
3cc880eeb8
misc: Some minor improvements (#1855)
* misc: Some minor improvements

* Update config.php

* Update Env.php

* Update Env.php

* Update tr_seed_bonus.php
2025-03-18 20:52:11 +03:00
belomaxorka
056bf046c1 Update CHANGELOG.md 📖 2025-03-18 01:23:15 +00:00
dependabot[bot]
7ca0582561
Composer(deps): Bump filp/whoops from 2.17.0 to 2.18.0 (#1853)
Bumps [filp/whoops](https://github.com/filp/whoops) from 2.17.0 to 2.18.0.
- [Changelog](https://github.com/filp/whoops/blob/master/CHANGELOG.md)
- [Commits](https://github.com/filp/whoops/compare/2.17.0...2.18.0)

---
updated-dependencies:
- dependency-name: filp/whoops
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-17 13:34:11 +07:00
belomaxorka
4df48751c0 Update CHANGELOG.md 📖 2025-03-17 01:25:22 +00:00
Roman Kelesidis
9e0a64108d
style: Correct sidebar2 displaying (#1852) 2025-03-16 08:53:13 +03:00
belomaxorka
36430c22ce Update CHANGELOG.md 📖 2025-03-14 01:22:05 +00:00
Roman Kelesidis
299d9a1f6c
misc(nightly builds): Added cleanup step (#1851) 2025-03-13 19:51:03 +03:00
dependabot[bot]
37ad07a40c
Composer(deps): Bump php-curl-class/php-curl-class from 11.0.4 to 11.0.5 (#1849)
Bumps [php-curl-class/php-curl-class](https://github.com/php-curl-class/php-curl-class) from 11.0.4 to 11.0.5.
- [Release notes](https://github.com/php-curl-class/php-curl-class/releases)
- [Changelog](https://github.com/php-curl-class/php-curl-class/blob/master/CHANGELOG.md)
- [Commits](https://github.com/php-curl-class/php-curl-class/compare/11.0.4...11.0.5)

---
updated-dependencies:
- dependency-name: php-curl-class/php-curl-class
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-13 10:33:19 +07:00
belomaxorka
5f7cfb455f Update CHANGELOG.md 📖 2025-03-12 01:22:02 +00:00
Roman Kelesidis
0b8d8a5210
feat(playback_m3u.php): Added checking auth to download (#1848) 2025-03-11 20:04:04 +03:00
Roman Kelesidis
af2403f191
refactor: Password generation (#1847)
* refactor: Password generation

* Update main.js

* Update usercp_register.tpl

* Update main.js

* Updated

* Update main.js
2025-03-11 18:14:28 +03:00
Roman Kelesidis
bd0ef063fa
refactor: Moved Select class into Legacy\Common (#1846) 2025-03-11 17:30:40 +03:00
Roman Kelesidis
5a4fc121ba
Merge pull request #1845 from torrentpier/misc(text-captcha)-Disabled-scatter-effect-by-default
misc(text captcha): Disabled scatter effect by default
2025-03-11 18:08:54 +07:00
Roman Kelesidis
3af5202f7b misc(text captcha): Disabled scatter effect by default 2025-03-11 14:08:08 +03:00
Roman Kelesidis
37f0fb93f3
Merge pull request #1844 from torrentpier/feat(emailer)-Added-ability-to-configure-sendmail
feat(emailer): Added ability to configure `sendmail`
2025-03-11 18:04:57 +07:00
Roman Kelesidis
5ad4a7019d feat(emailer): Added ability to configure sendmail 2025-03-11 14:03:52 +03:00
belomaxorka
a62a61b008 Update CHANGELOG.md 📖 2025-03-11 06:38:00 +00:00
Roman Kelesidis
ba19130cae
Merge pull request #1843 from torrentpier/dependabot/composer/belomaxorka/captcha-1.2.4
Composer(deps): Bump belomaxorka/captcha from 1.2.3 to 1.2.4
2025-03-11 13:36:24 +07:00
dependabot[bot]
4641b0a0d0
Composer(deps): Bump belomaxorka/captcha from 1.2.3 to 1.2.4
Bumps [belomaxorka/captcha](https://github.com/belomaxorka/Captcha) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/belomaxorka/Captcha/releases)
- [Commits](https://github.com/belomaxorka/Captcha/compare/v1.2.3...v1.2.4)

---
updated-dependencies:
- dependency-name: belomaxorka/captcha
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-11 06:35:33 +00:00
belomaxorka
edad1785ce Update CHANGELOG.md 📖 2025-03-11 01:22:54 +00:00
dependabot[bot]
be65f7c55c
Composer(deps): Bump belomaxorka/captcha from 1.2.2 to 1.2.3 (#1842)
Bumps [belomaxorka/captcha](https://github.com/belomaxorka/Captcha) from 1.2.2 to 1.2.3.
- [Release notes](https://github.com/belomaxorka/Captcha/releases)
- [Commits](https://github.com/belomaxorka/Captcha/compare/v1.2.2...v1.2.3)

---
updated-dependencies:
- dependency-name: belomaxorka/captcha
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-10 15:34:08 +07:00
belomaxorka
ead48923b9 Update CHANGELOG.md 📖 2025-03-10 01:10:01 +00:00
Roman Kelesidis
56d531aa5d
feat(avatar upload): Added accept="image/*" attribute (#1841) 2025-03-09 19:49:10 +03:00
Roman Kelesidis
4e6aadac8c release: v2.4.5-rc.4 🐦🔥 2025-03-09 15:33:18 +03:00
belomaxorka
aa54b3c9ad Update CHANGELOG.md 📖 2025-03-09 12:31:04 +00:00
Roman Kelesidis
858556043d
misc: Replaced gregwar/captcha with my own fork (#1840) 2025-03-09 09:57:35 +03:00
belomaxorka
01c2f3763f Update CHANGELOG.md 📖 2025-03-09 01:12:01 +00:00
Roman Kelesidis
74ea1573b2
feat(captcha): Added Text Captcha provider (#1839)
* feat(captcha): Added `Text Captcha` provider

* Create TextCaptcha.php

* Updated

* Update composer.lock

* Updated

* Update config.php

* Update functions.php

* Update TextCaptcha.php

* Update TextCaptcha.php

* Update TextCaptcha.php

* Update TextCaptcha.php

* Update TextCaptcha.php

* Update TextCaptcha.php

* Update TextCaptcha.php
2025-03-08 20:12:48 +03:00
belomaxorka
8ad080ff2f Update CHANGELOG.md 📖 2025-03-08 01:06:19 +00:00
Roman Kelesidis
dd721367c7
misc(installer): Added cleanup step (for master builds) (#1838)
* misc(installer): Added cleanup step (for master builds)

* Update _cleanup.php

* Update install.php

* Update install.php

* Update install.php

* Update install.php
2025-03-07 17:13:31 +03:00
dependabot[bot]
b954815f5d
Composer(deps): Bump bugsnag/bugsnag from 3.29.2 to 3.29.3 (#1837)
Bumps [bugsnag/bugsnag](https://github.com/bugsnag/bugsnag-php) from 3.29.2 to 3.29.3.
- [Release notes](https://github.com/bugsnag/bugsnag-php/releases)
- [Changelog](https://github.com/bugsnag/bugsnag-php/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bugsnag/bugsnag-php/compare/v3.29.2...v3.29.3)

---
updated-dependencies:
- dependency-name: bugsnag/bugsnag
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-07 10:28:38 +03:00
belomaxorka
492a6d105a Update CHANGELOG.md 📖 2025-03-07 01:23:04 +00:00
Roman Kelesidis
f8c4e8fb14
fix(info.php): Undefined array key "show" (#1836) 2025-03-06 14:58:47 +03:00
belomaxorka
b4624aec5a Update CHANGELOG.md 📖 2025-03-05 01:22:13 +00:00
Roman Kelesidis
b550fa59f9
feat: Added $bb_cfg['auto_language_detection'] parametr (#1835)
* feat: Added `$bb_cfg['auto_language_detection']` parametr

* Update config.php
2025-03-04 20:35:03 +03:00
belomaxorka
bb022e9a57 Update CHANGELOG.md 📖 2025-03-03 01:23:30 +00:00
Roman Kelesidis
5dc9a5475c
misc(_cleanup.php): Added CLI mode check (#1834) 2025-03-02 19:57:56 +03:00
Roman Kelesidis
68bf26d0f4
misc: Created cleanup script (for releases preparation) (#1833)
* misc: Created cleanup script (for releases preparation)

* Update _cleanup.php

* Update _cleanup.php

* Update _cleanup.php
2025-03-02 19:52:43 +03:00
Roman Kelesidis
bc95e14be3
feat(sitemap): Update lastmod when a new reply in topic (#1737)
* Sitemap: Update `lastmod` when topic edited

* Update CHANGELOG.md

* Update Sitemap.php

* Update Sitemap.php

* Update Sitemap.php

* Update CHANGELOG.md

* Update Sitemap.php

* Update Sitemap.php

* Update Sitemap.php

* Update Sitemap.php

* Update Sitemap.php

* Update Sitemap.php
2025-03-02 17:51:01 +03:00
Roman Kelesidis
249c988989
misc: Bring back missing cache & log directories (#1832)
* misc: Bring back missing `cache` & `log` directories

* Update .gitignore
2025-03-02 17:32:46 +03:00
Roman Kelesidis
f2e513dd8b
feat: Easter egg for the 20th anniversary of the TorrentPier! (#1831) 2025-03-02 10:59:49 +03:00
Roman Kelesidis
4dcd1fb16e
feat(show post bbcode): Added 'only_for_first_post' param (#1830)
* feat(show post bbcode): Added `'only_for_first_post'` param

* Update config.php
2025-03-02 10:48:02 +03:00
Roman Kelesidis
3b8ee4c4d3
misc: Some minor improvements (#1829) 2025-03-02 10:15:41 +03:00
Roman Kelesidis
380c94ff07 Revert "refactor: Moved classes from Legacy folder to src root (#1828)"
This reverts commit 92ce77ec0e.
2025-03-02 10:07:04 +03:00
belomaxorka
680bd77920 Update CHANGELOG.md 📖 2025-03-02 01:25:41 +00:00
Roman Kelesidis
92ce77ec0e
refactor: Moved classes from Legacy folder to src root (#1828)
* refactor: Moved classes from `Legacy` folder to `src` root

* Updated

* Updated

* Updated

* Updated

* Updated

* Updated

* Updated

* Updated

* Updated

* Updated

* Updated

* Updated

* Updated

* Updated

* Updated

* Updater

* Update Caches.php

* Updater

* Updater

* Updater

* Updater

* Update Attach.php

* Update Post.php

* Update BBCode.php

* Update SqlDb.php

* Update Upload.php

* Update Upload.php

* Updated

* Updated

* Revert "Updated"

This reverts commit 9ecc26b048.

* Revert "Updated"

This reverts commit 22db50889c.

* Revert "Update Upload.php"

This reverts commit a6faf4191a.
2025-03-01 21:18:26 +03:00
Roman Kelesidis
ba3ce885c8
removed: Integrity checker 🥺🪦 (#1827)
* removed: Integrity checker

* Update schedule.yml
2025-03-01 20:22:50 +03:00
Roman Kelesidis
912b080b16
removed: Redundant .htaccess files (#1826) 2025-03-01 20:00:06 +03:00
belomaxorka
1418d2173a Update checksums.md5 📄 2025-02-27 01:21:19 +00:00
belomaxorka
652708952d Update checksums.md5 📄 2025-02-23 01:24:54 +00:00
belomaxorka
cef5c7c2a6 Update CHANGELOG.md 📖 2025-02-23 01:24:35 +00:00
Roman Kelesidis
4f896854d3
misc(installer): Some minor improvements (#1825) 2025-02-22 10:54:28 +03:00
Roman Kelesidis
f3714f02f2
misc(installer): Some minor improvements (#1824) 2025-02-22 10:46:35 +03:00
belomaxorka
0cfb34ce58 Update checksums.md5 📄 2025-02-22 01:17:37 +00:00
belomaxorka
5b3d5333d5 Update CHANGELOG.md 📖 2025-02-22 01:17:18 +00:00
dependabot[bot]
1c323a45d7
Composer(deps): Bump php-curl-class/php-curl-class from 11.0.3 to 11.0.4 (#1823)
Bumps [php-curl-class/php-curl-class](https://github.com/php-curl-class/php-curl-class) from 11.0.3 to 11.0.4.
- [Release notes](https://github.com/php-curl-class/php-curl-class/releases)
- [Changelog](https://github.com/php-curl-class/php-curl-class/blob/master/CHANGELOG.md)
- [Commits](https://github.com/php-curl-class/php-curl-class/compare/11.0.3...11.0.4)

---
updated-dependencies:
- dependency-name: php-curl-class/php-curl-class
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-21 14:57:56 +07:00
belomaxorka
5340f301e4 Update checksums.md5 📄 2025-02-21 01:20:02 +00:00
belomaxorka
023d912f24 Update CHANGELOG.md 📖 2025-02-21 01:19:43 +00:00
Roman Kelesidis
6f641aa9d8
misc(Caddyfile): Some minor fixes (#1822) 2025-02-20 18:48:56 +03:00
dependabot[bot]
dedf35b794
Composer(deps): Bump php-curl-class/php-curl-class from 11.0.1 to 11.0.3 (#1821)
Bumps [php-curl-class/php-curl-class](https://github.com/php-curl-class/php-curl-class) from 11.0.1 to 11.0.3.
- [Release notes](https://github.com/php-curl-class/php-curl-class/releases)
- [Changelog](https://github.com/php-curl-class/php-curl-class/blob/master/CHANGELOG.md)
- [Commits](https://github.com/php-curl-class/php-curl-class/compare/11.0.1...11.0.3)

---
updated-dependencies:
- dependency-name: php-curl-class/php-curl-class
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-20 13:23:07 +07:00
belomaxorka
34c429e9e6 Update checksums.md5 📄 2025-02-20 01:19:52 +00:00
belomaxorka
75bf819391 Update CHANGELOG.md 📖 2025-02-20 01:19:32 +00:00
Roman Kelesidis
dfd4e5ebc9
fix(tr_seed_bonus.php): Incorrect GROUP BY (#1820) 2025-02-19 18:15:47 +03:00
Roman Kelesidis
bdefed4dab
misc(announcer): Some minor improvements (#1819)
* misc(announcer): Some minor improvements

* Update announce.php

* Update README.md

* Update Post.php
2025-02-19 14:58:37 +03:00
belomaxorka
61253b6c94 Update checksums.md5 📄 2025-02-17 01:21:50 +00:00
belomaxorka
0b04d71ea0 Update CHANGELOG.md 📖 2025-02-17 01:21:31 +00:00
Roman Kelesidis
f7d394607e
feat: Added configuration files for nginx & caddy (#1787)
* feat(web servers configs): Added configuration files for `nginx` & `caddy`

* Update nginx.conf

* Updated

* Update Caddyfile

* Update Caddyfile

* Update Caddyfile

* Update Caddyfile
2025-02-16 16:48:13 +03:00
belomaxorka
fd98854977 Update checksums.md5 📄 2025-02-13 01:19:22 +00:00
belomaxorka
0dc788ea05 Update CHANGELOG.md 📖 2025-02-13 01:19:01 +00:00
Roman Kelesidis
03ebbda6be
removed(posting.php): Unused 'U_VIEWTOPIC variable (#1818) 2025-02-12 20:04:53 +03:00
belomaxorka
6c6b7ad194 Update checksums.md5 📄 2025-02-12 01:18:46 +00:00
belomaxorka
7df3e4c617 Update CHANGELOG.md 📖 2025-02-12 01:18:27 +00:00
Roman Kelesidis
7794242750
misc(cliff): Removed TorrentPier logo (#1817) 2025-02-11 20:20:12 +03:00
belomaxorka
7fc26743a7 Update checksums.md5 📄 2025-02-09 01:22:39 +00:00
belomaxorka
f723588d43 Update CHANGELOG.md 📖 2025-02-09 01:22:19 +00:00
Roman Kelesidis
c57db2104d
misc(workflow): Short release_name (#1816) 2025-02-08 13:36:24 +03:00
Roman Kelesidis
f2aea92b3d
misc(cliff): Synced cliff-releases.toml with cliff.toml changes (#1815) 2025-02-08 07:02:52 +03:00
belomaxorka
6640d9eb5a Update checksums.md5 📄 2025-02-08 04:00:41 +00:00
belomaxorka
5b3e948da4 Update CHANGELOG.md 📖 2025-02-08 04:00:22 +00:00
Roman Kelesidis
2593f093a3
misc(cliff): Added missing line breaks after body (#1814)
* misc(cliff): Minor improvements

* Update cliff.toml
2025-02-08 06:59:46 +03:00
belomaxorka
b4e177b6f2 Update checksums.md5 📄 2025-02-08 03:51:05 +00:00
belomaxorka
cdd22df66a Update CHANGELOG.md 📖 2025-02-08 03:50:48 +00:00
Roman Kelesidis
d54c07b3da
misc(workflow): Added workflow_dispatch for schedule.yml (#1813) 2025-02-08 06:49:55 +03:00
belomaxorka
aa866d19e6 Update checksums.md5 📄 2025-02-08 01:16:45 +00:00
belomaxorka
7973c85962 Update CHANGELOG.md 📖 2025-02-08 01:16:27 +00:00
B. Zach
bea3b0bccf
misc(README): Fixed all grammatical errors, sentence structure and readibility (#1812)
Fixed all grammatical errors, sentence structure and readibility of readme.
2025-02-07 18:58:10 +03:00
Roman Kelesidis
3a9dd6a3c9
misc(workflow): Some improvements (#1811) 2025-02-07 15:49:22 +03:00
belomaxorka
b286e35638 Update checksums.md5 📄 2025-02-07 01:19:03 +00:00
belomaxorka
401263001e Update CHANGELOG.md 📖 2025-02-07 01:18:45 +00:00
Roman Kelesidis
c168c3956c
misc(workflow): Some improvements (#1810)
* misc(workflow): Some improvements

* Updated

* Update cd.yml

* Update schedule.yml

* Create cd.yml

* Update cd.yml

* Update schedule.yml

* Update cd.yml
2025-02-06 19:43:44 +03:00
belomaxorka
1b751c72a7 release(preparing): Update checksums.md5 📄 2025-02-06 15:41:15 +00:00
belomaxorka
ad5d20cf87 release(preparing): Update CHANGELOG.md 📖 2025-02-06 15:40:55 +00:00
359 changed files with 23048 additions and 11825 deletions

7
.cliffignore Normal file
View file

@ -0,0 +1,7 @@
9766c534bddad8e82e6d19f9bad5cf70b9887f9a
92ce77ec0ec703c08a659419087a373f76e711f7
2d53efc945c7747be1755d0b66557a86bdc12cbd
602137b65129b817811b80975a369ebde3270c6d
4eb26ae37e1f4c82a45961517ffeb54c20200408
e59adce848a9e10ee5775254045cbbd915236b8b
9e0a64108d62236ab07b3f8d10e8c78269b8e1d1

View file

@ -1,7 +1,7 @@
name: Bug Report name: Bug Report
description: File a bug report description: File a bug report
title: "[Bug]" title: "[Bug]"
labels: Bug labels: [Bug]
body: body:
- type: markdown - type: markdown
attributes: attributes:
@ -21,7 +21,7 @@ body:
attributes: attributes:
label: PHP & Platform label: PHP & Platform
description: Exact PHP and Platform (OS) versions your using. description: Exact PHP and Platform (OS) versions your using.
placeholder: 8.1.2 - Ubuntu 22.04 x64 placeholder: 8.2.2 - Ubuntu 22.04 x64
validations: validations:
required: true required: true
- type: checkboxes - type: checkboxes

View file

@ -2,6 +2,6 @@
name: Feature / Enhancement request name: Feature / Enhancement request
about: Suggest an idea for TorrentPier about: Suggest an idea for TorrentPier
title: "[Feature]" title: "[Feature]"
labels: Feature, Enhancement labels: [Feature, Enhancement]
assignees: '' assignees: ''
--- ---

View file

@ -6,8 +6,9 @@ on:
- "v*.*.*" - "v*.*.*"
jobs: jobs:
changelog: generate-changelog:
runs-on: ubuntu-latest name: Generate changelog
runs-on: ubuntu-22.04
outputs: outputs:
release_body: ${{ steps.git-cliff.outputs.content }} release_body: ${{ steps.git-cliff.outputs.content }}
steps: steps:
@ -15,72 +16,24 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
token: ${{ secrets.REPO_TOKEN }}
- name: Generate a changelog - name: Generate a changelog
uses: orhun/git-cliff-action@v4 uses: orhun/git-cliff-action@v4
id: git-cliff id: git-cliff
with: with:
config: cliff.toml config: cliff.toml
args: v2.4.5-rc.2.. --verbose args: -vv --latest --no-exec --github-repo ${{ github.repository }}
env:
OUTPUT: CHANGELOG.md
GITHUB_REPO: ${{ github.repository }}
- name: Print the changelog - name: Print the changelog
run: cat "${{ steps.git-cliff.outputs.changelog }}" run: cat "${{ steps.git-cliff.outputs.changelog }}"
- name: Commit changelog
run: |
git checkout master
git config --local user.name 'belomaxorka'
git config --local user.email 'roman25052006.kelesh@gmail.com'
set +e
git add CHANGELOG.md
git commit -m "release(preparing): Update CHANGELOG.md 📖"
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git master
checksums:
runs-on: ubuntu-latest
needs:
- changelog
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: master
token: ${{ secrets.REPO_TOKEN }}
- name: Generate checksums.md5 file
run: |
find . -type f -not -path "./.git/*" -exec md5sum {} \; > internal_data/checksums.md5
- name: Commit and push checksums.md5 if changed
run: |
git checkout master
git config --local user.name 'belomaxorka'
git config --local user.email 'roman25052006.kelesh@gmail.com'
if git diff --quiet internal_data/checksums.md5; then
echo "No changes in internal_data/checksums.md5"
else
set +e
git add internal_data/checksums.md5
git commit -m "release(preparing): Update checksums.md5 📄"
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git master
fi
release: release:
name: Create release name: Create release
needs: needs: [ generate-changelog ]
- checksums runs-on: ubuntu-22.04
- changelog
runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Set the release version - name: Set the release version
shell: bash shell: bash
run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV
@ -88,16 +41,19 @@ jobs:
- name: Setup PHP - name: Setup PHP
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2
with: with:
php-version: '8.1' php-version: '8.2'
- name: Install Composer dependencies - name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader run: composer install --no-dev --no-progress --prefer-dist --optimize-autoloader
- name: Cleanup
run: php _cleanup.php && rm _cleanup.php
- name: Create archive - name: Create archive
id: create_zip id: create-zip
run: | run: |
ZIP_NAME="torrentpier-v${{ env.RELEASE_VERSION }}.zip" ZIP_NAME="torrentpier-v${{ env.RELEASE_VERSION }}.zip"
zip -r "$ZIP_NAME" . -x ".git/*" ".github/*" zip -r "$ZIP_NAME" . -x ".git/*"
echo "ZIP_NAME=$ZIP_NAME" >> $GITHUB_OUTPUT echo "ZIP_NAME=$ZIP_NAME" >> $GITHUB_OUTPUT
- name: Publish to GitHub - name: Publish to GitHub
@ -105,22 +61,20 @@ jobs:
uses: svenstaro/upload-release-action@v2 uses: svenstaro/upload-release-action@v2
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.create_zip.outputs.ZIP_NAME }} file: ${{ steps.create-zip.outputs.ZIP_NAME }}
file_glob: true
overwrite: true overwrite: true
tag: ${{ github.ref }} tag: ${{ github.ref }}
release_name: "TorrentPier v${{ env.RELEASE_VERSION }}" release_name: "v${{ env.RELEASE_VERSION }}"
body: "${{ needs.changelog.outputs.release_body }}" body: "${{ needs.generate-changelog.outputs.release_body }}"
- name: Publish to GitHub (pre-release) - name: Publish to GitHub (pre-release)
if: ${{ contains(github.ref, '-') }} if: ${{ contains(github.ref, '-') }}
uses: svenstaro/upload-release-action@v2 uses: svenstaro/upload-release-action@v2
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.create_zip.outputs.ZIP_NAME }} file: ${{ steps.create-zip.outputs.ZIP_NAME }}
file_glob: true
overwrite: true overwrite: true
tag: ${{ github.ref }} tag: ${{ github.ref }}
release_name: "TorrentPier v${{ env.RELEASE_VERSION }}" release_name: "v${{ env.RELEASE_VERSION }}"
body: "${{ needs.changelog.outputs.release_body }}" body: "${{ needs.generate-changelog.outputs.release_body }}"
prerelease: true prerelease: true

View file

@ -7,64 +7,39 @@ on:
jobs: jobs:
nightly: nightly:
runs-on: ubuntu-latest name: Nightly builds 📦
runs-on: ubuntu-22.04
steps: steps:
- name: Checkout code - name: Checkout code 🗳
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup PHP - name: Setup PHP 🔩
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2
with: with:
php-version: '8.1' php-version: '8.2'
- name: Install Composer dependencies - name: Install Composer dependencies 🪚
run: composer install --no-progress --prefer-dist --optimize-autoloader run: composer install --no-dev --no-progress --prefer-dist --optimize-autoloader
- name: Get commit hash - name: Get commit hash 🔗
id: get_commit_hash id: get-commit-hash
run: | run: |
COMMIT_HASH=$(git rev-parse --short HEAD) COMMIT_HASH=$(git rev-parse --short HEAD)
echo "COMMIT_HASH=$COMMIT_HASH" >> $GITHUB_OUTPUT echo "COMMIT_HASH=$COMMIT_HASH" >> $GITHUB_OUTPUT
- name: Create archive - name: Cleanup
id: create_zip run: php _cleanup.php && rm _cleanup.php
- name: Create archive 🗞
id: create-zip
run: | run: |
ZIP_NAME="torrentpier-${{ steps.get_commit_hash.outputs.COMMIT_HASH }}.zip" ZIP_NAME="torrentpier-${{ steps.get-commit-hash.outputs.COMMIT_HASH }}.zip"
zip -r "$ZIP_NAME" . -x ".git/*" ".github/*" zip -r "$ZIP_NAME" . -x ".git/*"
echo "ZIP_NAME=$ZIP_NAME" >> $GITHUB_OUTPUT echo "ZIP_NAME=$ZIP_NAME" >> $GITHUB_OUTPUT
- name: Upload Archive - name: Upload Archive 📤
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: TorrentPier name: TorrentPier-master
path: ${{ steps.create_zip.outputs.ZIP_NAME }} path: ${{ steps.create-zip.outputs.ZIP_NAME }}
deploy:
name: 🎉 Deploy
runs-on: ubuntu-latest
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v4
- name: 🔩 Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
- name: 🖇 Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: 📂 Sync files
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
server-dir: ${{ secrets.FTP_DIR }}
protocol: ${{ secrets.FTP_PROTOCOL }}
port: ${{ secrets.FTP_PORT }}
exclude: |
**/.git*
**/.git*/**
.env

41
.github/workflows/schedule.yml vendored Normal file
View file

@ -0,0 +1,41 @@
name: Changelog generation
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
changelog:
name: Changelog generation
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: master
token: ${{ secrets.REPO_TOKEN }}
- name: Generate a changelog
uses: orhun/git-cliff-action@v4
id: git-cliff
with:
config: cliff.toml
args: v2.4.6-alpha.4.. --verbose
env:
OUTPUT: CHANGELOG.md
GITHUB_REPO: ${{ github.repository }}
- name: Print the changelog
run: cat "${{ steps.git-cliff.outputs.changelog }}"
- name: Commit changelog
run: |
git checkout master
git config --local user.name 'belomaxorka'
git config --local user.email 'roman25052006.kelesh@gmail.com'
set +e
git add CHANGELOG.md
git commit -m "changelog: Update CHANGELOG.md 📖"
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git master

2
.gitignore vendored
View file

@ -4,8 +4,6 @@
### TorrentPier ### ### TorrentPier ###
*.log *.log
/*.txt
*.integrity
install.php_* install.php_*
composer-setup.php composer-setup.php
.env .env

View file

@ -2,92 +2,112 @@
# 📖 Change Log # 📖 Change Log
> [!NOTE] ## [v2.8.3](https://github.com/torrentpier/torrentpier/compare/v2.8.2..v2.8.3) (2025-07-03)
> To view changelog from **v2.0.0** to **v2.4.5-rc.2** navigate to [HISTORY.md](HISTORY.md).
## [v2.4.5-rc.3](https://github.com/torrentpier/torrentpier/compare/v2.4.5-rc.2..v2.4.5-rc.3) (2025-02-06)
### 🚀 Features ### 🚀 Features
- *(announcer)* Added some disallowed ports by default ([#1767](https://github.com/torrentpier/torrentpier/pull/1767)) - ([46288ec](https://github.com/torrentpier/torrentpier/commit/46288ec19830c84aedb156e1f30d7ec8a0803e0d)) - *(lang)* Added `RTL` languages support ([#2031](https://github.com/torrentpier/torrentpier/pull/2031)) - ([fd46d3d](https://github.com/torrentpier/torrentpier/commit/fd46d3d04ad3ab1453256b2ab620508e2ba33586))
- *(announcer)* Added `is_numeric()` checking for some fields ([#1766](https://github.com/torrentpier/torrentpier/pull/1766)) - ([096bb51](https://github.com/torrentpier/torrentpier/commit/096bb5124fa27d27c3e60031edc432d877f1c507)) - *(updater)* Added exceptions logging ([#2026](https://github.com/torrentpier/torrentpier/pull/2026)) - ([51f2c70](https://github.com/torrentpier/torrentpier/commit/51f2c70d81b910012cdecd111b5b92c1dfd0d6f6))
- *(announcer)* Added `event` verifying ([#1765](https://github.com/torrentpier/torrentpier/pull/1765)) - ([6a19323](https://github.com/torrentpier/torrentpier/commit/6a1932313801e55fbcfb047fdcef87266f472c33))
- *(announcer)* Block browser by checking the `User-Agent` ([#1764](https://github.com/torrentpier/torrentpier/pull/1764)) - ([7b64b50](https://github.com/torrentpier/torrentpier/commit/7b64b508199af568472fe6ac2edf333a3e274a00)) ### 🚜 Refactor
- *(announcer)* Block `User-Agent` strings that are too long ([#1763](https://github.com/torrentpier/torrentpier/pull/1763)) - ([a98f8f1](https://github.com/torrentpier/torrentpier/commit/a98f8f102a8253b0b22c80ef444fed1ec29177f3))
- *(announcer)* Blocking all ports lower then `1024` ([#1762](https://github.com/torrentpier/torrentpier/pull/1762)) - ([1bc7e09](https://github.com/torrentpier/torrentpier/commit/1bc7e09ddbeaf680b86095eed9a80b8ebf6169b3)) - *(TorrentFileList)* Reduce duplication in root directory unset logic ([#2027](https://github.com/torrentpier/torrentpier/pull/2027)) - ([d4d8210](https://github.com/torrentpier/torrentpier/commit/d4d82101dd67c9f4cd86e0f6f909495696974354))
- *(cache)* Checking if extensions are installed ([#1759](https://github.com/torrentpier/torrentpier/pull/1759)) - ([7f31022](https://github.com/torrentpier/torrentpier/commit/7f31022cfca2acb28a5cba06961eeaf8d2c9de51))
- *(captcha)* Added some new services 🤖 ([#1771](https://github.com/torrentpier/torrentpier/pull/1771)) - ([d413c71](https://github.com/torrentpier/torrentpier/commit/d413c717188c9bd906f715e7137955dc9a42a003))
- *(environment)* Make configurable `TP_HOST` and `TP_PORT` ([#1780](https://github.com/torrentpier/torrentpier/pull/1780)) - ([e51e091](https://github.com/torrentpier/torrentpier/commit/e51e09159333382a77b809b5f1da5e152a713143)) ## [v2.8.2](https://github.com/torrentpier/torrentpier/compare/v2.8.1..v2.8.2) (2025-06-30)
- *(installer)* Fully show non-installed extensions ([#1761](https://github.com/torrentpier/torrentpier/pull/1761)) - ([8fcc62d](https://github.com/torrentpier/torrentpier/commit/8fcc62d2a2fd41927b2f5dae215fe5bbf95f2c96))
- *(installer)* More explanations ([#1758](https://github.com/torrentpier/torrentpier/pull/1758)) - ([48ab52a](https://github.com/torrentpier/torrentpier/commit/48ab52ac8674afcb607c8e49134316a3e117236a))
- *(installer)* Check `Composer` dependencies after installing ([#1756](https://github.com/torrentpier/torrentpier/pull/1756)) - ([262b887](https://github.com/torrentpier/torrentpier/commit/262b8872a5b14068eb73d745adea6203c557e192))
- *(installer)* More explanations ([#1754](https://github.com/torrentpier/torrentpier/pull/1754)) - ([fd6f1f8](https://github.com/torrentpier/torrentpier/commit/fd6f1f86a5e9216469cd648601ecb9ba875f9eb6))
- *(installer)* Create `config.local.php` on local environment ([#1745](https://github.com/torrentpier/torrentpier/pull/1745)) - ([0d93b2c](https://github.com/torrentpier/torrentpier/commit/0d93b2c768c2965c12ac62e2f3b2886dc1ef31c2))
- *(torrent)* Bring back old torrent file naming ([#1783](https://github.com/torrentpier/torrentpier/pull/1783)) - ([314c592](https://github.com/torrentpier/torrentpier/commit/314c592affbef4b8db48d562b9633aad27059a76))
- *(workflow)* Automated deploy actual changes to `TorrentPier Demo` ([#1788](https://github.com/torrentpier/torrentpier/pull/1788)) - ([4333d6a](https://github.com/torrentpier/torrentpier/commit/4333d6aca4aeb8584ff8a8ef0bf76c537a3f371a))
- Used `TORRENT_MIMETYPE` constant instead of hardcoded string ([#1757](https://github.com/torrentpier/torrentpier/pull/1757)) - ([4b0d270](https://github.com/torrentpier/torrentpier/commit/4b0d270c89ec06abed590504f6a0cb70076a9e59))
### 🐛 Bug Fixes ### 🐛 Bug Fixes
- *(announcer)* Null `event` exception ([#1784](https://github.com/torrentpier/torrentpier/pull/1784)) - ([b06e327](https://github.com/torrentpier/torrentpier/commit/b06e327cbb285a676814699eb5fb1fbc0e1f22e8)) - *(TorrentFileList)* Avoid `array_merge` reindexing for numeric folder names ([#2014](https://github.com/torrentpier/torrentpier/pull/2014)) - ([915e1d8](https://github.com/torrentpier/torrentpier/commit/915e1d817c61d2a4f0691b24ec1bc6577a9cd44b))
- *(bb_die)* HTML characters converting ([#1744](https://github.com/torrentpier/torrentpier/pull/1744)) - ([4f1c7e4](https://github.com/torrentpier/torrentpier/commit/4f1c7e40d82e52f81eba44ead501e1f01058cc4f))
- *(debug)* Disabled `Bugsnag` reporting on local environment ([#1751](https://github.com/torrentpier/torrentpier/pull/1751)) - ([1f3b629](https://github.com/torrentpier/torrentpier/commit/1f3b629e9cea4d11fbf3cf29f575ba730bad898d))
- *(installer)* Missing `gd` extension ([#1749](https://github.com/torrentpier/torrentpier/pull/1749)) - ([a1c519d](https://github.com/torrentpier/torrentpier/commit/a1c519d938b848edffcbf7fbbe6a3fdb9a5394f1))
- *(youtube player)* Mixed content issue ([#1795](https://github.com/torrentpier/torrentpier/pull/1795)) - ([3c0a1d5](https://github.com/torrentpier/torrentpier/commit/3c0a1d5d0018daa87ad3914ea04078a9a6d05fc2))
- Null `$bb_cfg['tp_instance_hash']` ([#1790](https://github.com/torrentpier/torrentpier/pull/1790)) - ([602137b](https://github.com/torrentpier/torrentpier/commit/602137b65129b817811b80975a369ebde3270c6d))
- Incorrect peer country flag ([#1768](https://github.com/torrentpier/torrentpier/pull/1768)) - ([0f091eb](https://github.com/torrentpier/torrentpier/commit/0f091eb546e34923d9d1ab34be5faf92080ec198))
### 📦 Dependencies ### 🚜 Refactor
- *(deps)* Bump jacklul/monolog-telegram from 3.1.0 to 3.2.0 ([#1776](https://github.com/torrentpier/torrentpier/pull/1776)) - ([420c92c](https://github.com/torrentpier/torrentpier/commit/420c92c0addf4dee91f3ae872517cb3224827a1f)) - Use `DEFAULT_CHARSET` constant instead of hardcoded string ([#2011](https://github.com/torrentpier/torrentpier/pull/2011)) - ([7ac3359](https://github.com/torrentpier/torrentpier/commit/7ac335974baa44a8575bebb71ae2fbc0902d10e7))
- *(deps)* Bump filp/whoops from 2.16.0 to 2.17.0 ([#1777](https://github.com/torrentpier/torrentpier/pull/1777)) - ([a71609b](https://github.com/torrentpier/torrentpier/commit/a71609ba67a89480fabb7b62de450d9be09373fa))
- *(deps)* Bump php-curl-class/php-curl-class from 11.0.0 to 11.0.1 ([#1753](https://github.com/torrentpier/torrentpier/pull/1753)) - ([ce32031](https://github.com/torrentpier/torrentpier/commit/ce32031a0fb14cdf6c3f4ba379b530cbb52b0fea))
- *(deps)* Bump bugsnag/bugsnag from 3.29.1 to 3.29.2 ([#1752](https://github.com/torrentpier/torrentpier/pull/1752)) - ([f63d15c](https://github.com/torrentpier/torrentpier/commit/f63d15c49e3992837413b2c7a0160d599b44f2ef))
### 🗑️ Removed
- *(environment)* Extra `DB_CONNECTION` variable ([#1775](https://github.com/torrentpier/torrentpier/pull/1775)) - ([cd2786b](https://github.com/torrentpier/torrentpier/commit/cd2786bb69c74cec88a447f66750d014fc4d3612)) ## [v2.8.1](https://github.com/torrentpier/torrentpier/compare/v2.8.0..v2.8.1) (2025-06-24)
- Some unused tracker config variables ([#1769](https://github.com/torrentpier/torrentpier/pull/1769)) - ([7f9df35](https://github.com/torrentpier/torrentpier/commit/7f9df35d3bd0e9d23284b8bd9c36a0f52158f5d7))
### 📚 Documentation ### 🐛 Bug Fixes
- Minor improvements ([#1750](https://github.com/torrentpier/torrentpier/pull/1750)) - ([3e850ac](https://github.com/torrentpier/torrentpier/commit/3e850ac724c43e813aa077b272b498e2b0477260)) - *(filelist)* `Undefined property: FileTree::$length` when v2 torrent only ([#2004](https://github.com/torrentpier/torrentpier/pull/2004)) - ([7f4cc9d](https://github.com/torrentpier/torrentpier/commit/7f4cc9d3b9a5b87100f710cc60f636d6e7d5a34e))
- *(ip-api)* Add error handling and logging for freeipapi.com requests ([#2006](https://github.com/torrentpier/torrentpier/pull/2006)) - ([f1d6e74](https://github.com/torrentpier/torrentpier/commit/f1d6e74e5d4c74b6e12e9e742f60f62e71783d11))
## [v2.8.0](https://github.com/torrentpier/torrentpier/compare/v2.7.0..v2.8.0) (2025-06-21)
### 🐛 Bug Fixes
- *(template)* Handle L_ variables in template vars when not found in lang vars ([#1998](https://github.com/torrentpier/torrentpier/pull/1998)) - ([c6076c2](https://github.com/torrentpier/torrentpier/commit/c6076c2c278e9a423f3862670236b75bddeadd87))
## [v2.7.0](https://github.com/torrentpier/torrentpier/compare/v2.6.0..v2.7.0) (2025-06-21)
### 🚀 Features
- *(database)* Add visual markers for Nette Explorer queries in debug panel ([#1965](https://github.com/torrentpier/torrentpier/pull/1965)) - ([2fd3067](https://github.com/torrentpier/torrentpier/commit/2fd306704f21febee7d53f4b4531601ce0cb81ce))
- *(language)* Add new language variable for migration file and enhance template fallback logic ([#1984](https://github.com/torrentpier/torrentpier/pull/1984)) - ([a33574c](https://github.com/torrentpier/torrentpier/commit/a33574c28f2eb6267a74fa6c9d97fea86527157a))
- *(migrations)* Implement Phinx database migration system ([#1976](https://github.com/torrentpier/torrentpier/pull/1976)) - ([fbde8cd](https://github.com/torrentpier/torrentpier/commit/fbde8cd421c9048afe70ddb41d0a9ed26d3fbef5))
- *(test)* [**breaking**] Add comprehensive testing infrastructure with Pest PHP ([#1979](https://github.com/torrentpier/torrentpier/pull/1979)) - ([cc9d412](https://github.com/torrentpier/torrentpier/commit/cc9d412522938a023bd2b8eb880c4d2dd307c82a))
- [**breaking**] Implement Language singleton with shorthand functions ([#1966](https://github.com/torrentpier/torrentpier/pull/1966)) - ([49717d3](https://github.com/torrentpier/torrentpier/commit/49717d3a687b95885fe9773f2597354aed4b2b60))
### 🐛 Bug Fixes
- *(database)* Update affected rows tracking in Database class ([#1980](https://github.com/torrentpier/torrentpier/pull/1980)) - ([4f9cc9f](https://github.com/torrentpier/torrentpier/commit/4f9cc9fe0f7f4a85c90001a3f5514efdf04836da))
### 🚜 Refactor
- *(database)* Enhance error logging and various fixes ([#1978](https://github.com/torrentpier/torrentpier/pull/1978)) - ([7aed6bc](https://github.com/torrentpier/torrentpier/commit/7aed6bc7d89f4ed31e7ed6c6eeecc6e08d348c24))
- *(database)* Rename DB to Database and extract debug functionality ([#1964](https://github.com/torrentpier/torrentpier/pull/1964)) - ([6c0219d](https://github.com/torrentpier/torrentpier/commit/6c0219d53c7544b7d8a6374c0d0848945d32ae17))
- *(stats)* Improve database row fetching in tr_stats.php ([#1985](https://github.com/torrentpier/torrentpier/pull/1985)) - ([728116d](https://github.com/torrentpier/torrentpier/commit/728116d6dc9cf4476cce572ced5e8a7ef529ead8))
### ⚙️ Miscellaneous ### ⚙️ Miscellaneous
- *(cd workflow)* Fixed release body creation ([#1807](https://github.com/torrentpier/torrentpier/pull/1807)) - ([cc679a8](https://github.com/torrentpier/torrentpier/commit/cc679a80246f3ff65136653025d826bf1458db3a)) - Update minimum `PHP` requirement to `8.2` ([#1987](https://github.com/torrentpier/torrentpier/pull/1987)) - ([9b322c7](https://github.com/torrentpier/torrentpier/commit/9b322c7093a634669e9f17a32ac42500f44f2496))
- *(changelog workflow)* Minor improvements ([#1802](https://github.com/torrentpier/torrentpier/pull/1802)) - ([15ca21f](https://github.com/torrentpier/torrentpier/commit/15ca21f03840281f7d4402959aa8bfb7d407b45b)) - Removed useless `composer update` from workflows & installer ([#1986](https://github.com/torrentpier/torrentpier/pull/1986)) - ([423424e](https://github.com/torrentpier/torrentpier/commit/423424e9478e0772957014fb30f5e84158067af7))
- *(changelog workflow)* Some minor improvements ([#1801](https://github.com/torrentpier/torrentpier/pull/1801)) - ([2d53efc](https://github.com/torrentpier/torrentpier/commit/2d53efc945c7747be1755d0b66557a86bdc12cbd)) - Added --no-dev composer flag for some workflows ([#1982](https://github.com/torrentpier/torrentpier/pull/1982)) - ([e9a9e09](https://github.com/torrentpier/torrentpier/commit/e9a9e095768ba68aa5d5058a3e152ffaec916117))
- *(checksum workflow)* Fixed incorrect file path ([#1799](https://github.com/torrentpier/torrentpier/pull/1799)) - ([4eb5a9a](https://github.com/torrentpier/torrentpier/commit/4eb5a9adc61c4e116feb09208091efb914275da2)) - Added `--no-dev` composer flag for some workflows ([#1981](https://github.com/torrentpier/torrentpier/pull/1981)) - ([e8cba5d](https://github.com/torrentpier/torrentpier/commit/e8cba5dd3fc83b616f83c24991f79dc7258c5df3))
- *(cliff)* Changed emoji for dependencies ([#1755](https://github.com/torrentpier/torrentpier/pull/1755)) - ([55d4670](https://github.com/torrentpier/torrentpier/commit/55d467048370b51cd592982c8026702dca8813d5))
- *(cliff)* Use blockquote for notice ([#1748](https://github.com/torrentpier/torrentpier/pull/1748)) - ([61e5592](https://github.com/torrentpier/torrentpier/commit/61e55925f312417bdb63c88a7c8939c3b2eb2ac5))
- *(cliff)* Fixed typo ([#1747](https://github.com/torrentpier/torrentpier/pull/1747)) - ([4936af7](https://github.com/torrentpier/torrentpier/commit/4936af7d3d10f553d8586a14de249c32e50f3494))
- *(cliff)* Notice about previous changelog file ([#1746](https://github.com/torrentpier/torrentpier/pull/1746)) - ([85395be](https://github.com/torrentpier/torrentpier/commit/85395be5e7c6a891c79ec72cf215894af097f819))
- *(copyright)* Updated copyright year ([#1760](https://github.com/torrentpier/torrentpier/pull/1760)) - ([6697410](https://github.com/torrentpier/torrentpier/commit/6697410c1df6c8d9d7f511b1e984ae90d888ae0e))
- *(database)* Use `DEFAULT ''` for `privmsgs_subject` ([#1786](https://github.com/torrentpier/torrentpier/pull/1786)) - ([387a258](https://github.com/torrentpier/torrentpier/commit/387a25870abd37b641b55ffd98e13f4aaecb73b1))
- *(deploy action)* Specify some missing params ([#1789](https://github.com/torrentpier/torrentpier/pull/1789)) - ([6115900](https://github.com/torrentpier/torrentpier/commit/6115900b765752209a6ed1dfb83e4f0cbee2ae77))
- *(emailer)* Use constants for email types ([#1794](https://github.com/torrentpier/torrentpier/pull/1794)) - ([c95d414](https://github.com/torrentpier/torrentpier/commit/c95d414ef63ca37118f1f660880cd58b4480c414))
- *(integrity checker)* Disabled by default in `Demo mode` ([#1804](https://github.com/torrentpier/torrentpier/pull/1804)) - ([44be40c](https://github.com/torrentpier/torrentpier/commit/44be40c2e849c60eb4f10ca7e0bae0463791355e))
- *(integrity checker)* Some enhancements ([#1797](https://github.com/torrentpier/torrentpier/pull/1797)) - ([09cafc2](https://github.com/torrentpier/torrentpier/commit/09cafc2285dd171cb2213ece9549993a3321527c))
- *(issue template)* Improved `Feature request` template ([#1774](https://github.com/torrentpier/torrentpier/pull/1774)) - ([268f79d](https://github.com/torrentpier/torrentpier/commit/268f79d7259de67aa8877fcf7130ff0069469ab2))
- *(issue template)* Improved `Bug report` template ([#1773](https://github.com/torrentpier/torrentpier/pull/1773)) - ([53ebfef](https://github.com/torrentpier/torrentpier/commit/53ebfef32c0e9016257e03b96ef96349e22d3e9b))
- *(notify)* Hide notify checkbox in topic for guests ([#1793](https://github.com/torrentpier/torrentpier/pull/1793)) - ([8e4cd97](https://github.com/torrentpier/torrentpier/commit/8e4cd97734fc46f33459c4b00a0fe38b0597f92b))
- *(readme)* Improved installation guide ([#1781](https://github.com/torrentpier/torrentpier/pull/1781)) - ([e579b81](https://github.com/torrentpier/torrentpier/commit/e579b816b4dc346b3242cb3d9db292ad05596c1f))
- *(readme)* Minor improvements ([#1779](https://github.com/torrentpier/torrentpier/pull/1779)) - ([5b0ed02](https://github.com/torrentpier/torrentpier/commit/5b0ed020890a8f938df912f9215cccbda42b0317))
- *(readme)* Added Caddy webserver ([#1778](https://github.com/torrentpier/torrentpier/pull/1778)) - ([970a028](https://github.com/torrentpier/torrentpier/commit/970a0282e3631c403029c959ffd46b21c5cad0cd))
- *(workflow)* Refactored all workflows ([#1803](https://github.com/torrentpier/torrentpier/pull/1803)) - ([a29d57b](https://github.com/torrentpier/torrentpier/commit/a29d57b2f8673733bbfbea3fb96eebe841078d49))
- *(workflow)* Trying combine `changelog workflow` with `checksums workflow` ([#1800](https://github.com/torrentpier/torrentpier/pull/1800)) - ([60c6057](https://github.com/torrentpier/torrentpier/commit/60c605778412335ce97d41489c3b6ee9c051454b))
- Automated releases generation ([#1808](https://github.com/torrentpier/torrentpier/pull/1808)) - ([6c9372c](https://github.com/torrentpier/torrentpier/commit/6c9372c407327c9bb443b2ecf16eff64c0245c4b))
- Automated releases generation ([#1806](https://github.com/torrentpier/torrentpier/pull/1806)) - ([bc74550](https://github.com/torrentpier/torrentpier/commit/bc745502940207f3f24c83057cd680fe69355961))
- Automated releases generation ([#1805](https://github.com/torrentpier/torrentpier/pull/1805)) - ([425e2e8](https://github.com/torrentpier/torrentpier/commit/425e2e87d5a7f097b961b1a14fbafcdabb9d1666))
- Minor improvements ([#1796](https://github.com/torrentpier/torrentpier/pull/1796)) - ([8650ad3](https://github.com/torrentpier/torrentpier/commit/8650ad30f429ab14a03f44b26d7be7701f1985f1))
- Update `cliff.toml` - ([254dca2](https://github.com/torrentpier/torrentpier/commit/254dca2b27c2d92421d3e639c80b0adf1172202f))
- Minor improvements ([#1743](https://github.com/torrentpier/torrentpier/pull/1743)) - ([e73d650](https://github.com/torrentpier/torrentpier/commit/e73d65011fff0a8b8e1368eef61bbfb67e87eab8))
- Enabled `$bb_cfg['integrity_check']` by defaul ([#1742](https://github.com/torrentpier/torrentpier/pull/1742)) - ([7e3601e](https://github.com/torrentpier/torrentpier/commit/7e3601e63aff73be1428969ca37dda3da2537d9b))
### ◀️ Revert
- Fix: Null `$bb_cfg['tp_instance_hash']` ([#1792](https://github.com/torrentpier/torrentpier/pull/1792)) - ([4eb26ae](https://github.com/torrentpier/torrentpier/commit/4eb26ae37e1f4c82a45961517ffeb54c20200408)) ## [v2.6.0](https://github.com/torrentpier/torrentpier/compare/v2.5.0..v2.6.0) (2025-06-18)
### 🚀 Features
- [**breaking**] Implement unified cache system with Nette Caching ([#1963](https://github.com/torrentpier/torrentpier/pull/1963)) - ([07a06a3](https://github.com/torrentpier/torrentpier/commit/07a06a33cd97b37f68b533a87cdb5f7578f2c86f))
- Replace legacy database layer with Nette Database implementation ([#1961](https://github.com/torrentpier/torrentpier/pull/1961)) - ([f50b914](https://github.com/torrentpier/torrentpier/commit/f50b914cc18f777d92002baf2c812a635d5eed4b))
### 🐛 Bug Fixes
- *(User)* Add null and array checks before session data operations ([#1962](https://github.com/torrentpier/torrentpier/pull/1962)) - ([e458109](https://github.com/torrentpier/torrentpier/commit/e458109eefc54d86a78a1ddb3954581524852516))
## [v2.5.0](https://github.com/torrentpier/torrentpier/compare/v2.4.6-alpha.4..v2.5.0) (2025-06-18)
### 🚀 Features
- [**breaking**] Implement centralized Config class to replace global $bb_cfg array ([#1953](https://github.com/torrentpier/torrentpier/pull/1953)) - ([bf9100f](https://github.com/torrentpier/torrentpier/commit/bf9100fbfa74768edb01c62636198a44739d9923))
### 🐛 Bug Fixes
- *(installer)* Strip protocol from TP_HOST to keep only hostname ([#1952](https://github.com/torrentpier/torrentpier/pull/1952)) - ([81bf67c](https://github.com/torrentpier/torrentpier/commit/81bf67c2be85d49e988b7802ca7e9738ff580031))
- *(sql)* Resolve only_full_group_by compatibility issues in tracker cleanup ([#1951](https://github.com/torrentpier/torrentpier/pull/1951)) - ([37a0675](https://github.com/torrentpier/torrentpier/commit/37a0675adfb02014e7068f4aa82301e29f39eab6))
### 📦 Dependencies
- *(deps)* Bump filp/whoops from 2.18.2 to 2.18.3 ([#1948](https://github.com/torrentpier/torrentpier/pull/1948)) - ([b477680](https://github.com/torrentpier/torrentpier/commit/b4776804a408217229caa327c79849cf13ce2aa5))
### 🚜 Refactor
- *(censor)* [**breaking**] Migrate Censor class to singleton pattern ([#1954](https://github.com/torrentpier/torrentpier/pull/1954)) - ([74a564d](https://github.com/torrentpier/torrentpier/commit/74a564d7954c6f8745ebcffdcd9c8997e371d47a))
- *(config)* [**breaking**] Encapsulate global $bb_cfg array in Config class ([#1950](https://github.com/torrentpier/torrentpier/pull/1950)) - ([5842994](https://github.com/torrentpier/torrentpier/commit/5842994782dfa62788f8427c55045abdbfb5b8e9))
### 📚 Documentation
- Add Select class migration guide ([#1960](https://github.com/torrentpier/torrentpier/pull/1960)) - ([86abafb](https://github.com/torrentpier/torrentpier/commit/86abafb11469d14a746d12725b15cf6b7015ec44))
### ⚙️ Miscellaneous
- *(_release.php)* Finally! Removed some useless params ([#1947](https://github.com/torrentpier/torrentpier/pull/1947)) - ([9c7d270](https://github.com/torrentpier/torrentpier/commit/9c7d270598c0153fb82f4b7ad96f5b59399b2159))
- *(cliff)* Add conventional commit prefix to changelog message ([#1957](https://github.com/torrentpier/torrentpier/pull/1957)) - ([b1b2618](https://github.com/torrentpier/torrentpier/commit/b1b26187579f6981165d85c316a3c5b7199ce2ee))
## New Contributors ❤️
* [@actions-user](https://github.com/actions-user) made their first contribution<!-- generated by git-cliff -->

144
CLAUDE.md Normal file
View file

@ -0,0 +1,144 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
TorrentPier is a BitTorrent tracker engine written in PHP, designed for hosting BitTorrent communities with forum functionality. The project is in active modernization, transitioning from legacy code to modern PHP practices while maintaining backward compatibility.
## Technology Stack & Architecture
- **PHP 8.2+** with modern features
- **MySQL/MariaDB/Percona** database
- **Nette Database** with backward-compatible wrapper
- **Composer** for dependency management
- **Custom BitTorrent tracker** implementation
## Key Directory Structure
- `/src/` - Modern PHP classes (PSR-4 autoloaded as `TorrentPier\`)
- `/library/` - Core application logic and legacy code
- `/admin/` - Administrative interface
- `/bt/` - BitTorrent tracker functionality (announce.php, scrape.php)
- `/styles/` - Templates, CSS, JS, images
- `/internal_data/` - Cache, logs, compiled templates
- `/install/` - Installation scripts and configuration examples
- `/migrations/` - Database migration files (Phinx)
## Entry Points & Key Files
- `index.php` - Main forum homepage
- `tracker.php` - Torrent search/browse interface
- `bt/announce.php` - BitTorrent announce endpoint
- `bt/scrape.php` - BitTorrent scrape endpoint
- `admin/index.php` - Administrative panel
- `cron.php` - Background task runner (CLI only)
- `install.php` - Installation script (CLI only)
## Development Commands
### Installation & Setup
```bash
# Automated installation (CLI)
php install.php
# Install dependencies
composer install
# Update dependencies
composer update
```
### Maintenance & Operations
```bash
# Run background maintenance tasks
php cron.php
```
### Code Quality
The project uses **StyleCI** with PSR-2 preset for code style enforcement. StyleCI configuration is in `.styleci.yml` targeting `src/` directory.
## Modern Architecture Components
### Database Layer (`/src/Database/`)
- **Nette Database** with full old SqlDb backward compatibility
- Singleton pattern accessible via `DB()` function
- Support for multiple database connections and debug functionality
- Migration path to ORM-style Explorer queries
### Cache System (`/src/Cache/`)
- **Unified caching** using Nette Caching internally
- 100% backward compatibility with existing `CACHE()` and $datastore calls
- Supports file, SQLite, memory, and Memcached storage
- Advanced features: memoization, cache dependencies
### Configuration Management
- Environment-based config with `.env` files
- Singleton `Config` class accessible via `config()` function
- Local overrides supported via `library/config.local.php`
## Configuration Files
- `.env` - Environment variables (copy from `.env.example`)
- `library/config.php` - Main application configuration
- `library/config.local.php` - Local configuration overrides
- `composer.json` - Dependencies and PSR-4 autoloading
## Development Workflow
### CI/CD Pipeline
- **GitHub Actions** for automated testing and deployment
- **StyleCI** for code style enforcement
- **Dependabot** for dependency updates
- **FTP deployment** to demo environment
### Installation Methods
1. **Automated**: `php install.php` (recommended)
2. **Composer**: `composer create-project torrentpier/torrentpier`
3. **Manual**: Git clone + `composer install` + database setup
## Database & Schema
- **Database migrations** managed via Phinx in `/migrations/` directory
- Initial schema: `20250619000001_initial_schema.php`
- Initial seed data: `20250619000002_seed_initial_data.php`
- UTF-8 (utf8mb4) character set required
- Multiple database alias support for different components
### Migration Commands
```bash
# Run all pending migrations
php vendor/bin/phinx migrate --configuration=phinx.php
# Check migration status
php vendor/bin/phinx status --configuration=phinx.php
# Mark migrations as applied (for existing installations)
php vendor/bin/phinx migrate --fake --configuration=phinx.php
```
## Legacy Compatibility Strategy
The codebase maintains 100% backward compatibility while introducing modern alternatives:
- **Database layer**: Existing old SqlDb calls work while new code can use Nette Database
- **Cache system**: All existing `CACHE()` and $datastore calls preserved while adding modern features
- **Configuration**: Legacy config access maintained alongside new singleton pattern
This approach allows gradual modernization without breaking existing functionality - critical for a mature application with existing deployments.
## Security & Performance
- **Environment-based secrets** management via `.env`
- **CDN/proxy support** (Cloudflare, Fastly)
- **Input sanitization** and CSRF protection
- **Advanced caching** with multiple storage backends
- **Rate limiting** and IP-based restrictions
## BitTorrent Tracker Features
- **BitTorrent v1 & v2** support
- **TorrServer integration** capability
- **Client ban system** for problematic torrent clients
- **Scrape support** for tracker statistics
When working with this codebase, prioritize understanding the legacy compatibility approach and modern architecture patterns. Always test both legacy and modern code paths when making changes to core systems.

1131
HISTORY.md

File diff suppressed because it is too large Load diff

View file

@ -8,9 +8,8 @@
<p align="center"> <p align="center">
<a href="https://github.com/torrentpier/torrentpier/blob/master/LICENSE"><img src="https://img.shields.io/github/license/torrentpier/torrentpier" alt="License"></a> <a href="https://github.com/torrentpier/torrentpier/blob/master/LICENSE"><img src="https://img.shields.io/github/license/torrentpier/torrentpier" alt="License"></a>
<a href="https://packagist.org/packages/torrentpier/torrentpier"><img src="https://img.shields.io/packagist/stars/torrentpier/torrentpier" alt="Stars Packagist"></a> <a href="https://packagist.org/packages/torrentpier/torrentpier"><img src="https://img.shields.io/packagist/stars/torrentpier/torrentpier" alt="Stars Packagist"></a>
<a href="https://github.com/torrentpier/torrentpier/actions"><img src="https://img.shields.io/github/actions/workflow/status/torrentpier/torrentpier/phpmd.yml" alt="Build status"></a>
<a href="https://crowdin.com/project/torrentpier"><img src="https://badges.crowdin.net/torrentpier/localized.svg" alt="Crowdin"></a> <a href="https://crowdin.com/project/torrentpier"><img src="https://badges.crowdin.net/torrentpier/localized.svg" alt="Crowdin"></a>
<a href="https://nightly.link/torrentpier/torrentpier/workflows/build/master/TorrentPier"><img src="https://img.shields.io/badge/Nightly%20release-gray?logo=hackthebox&logoColor=fff" alt="TorrentPier nightly"></a> <a href="https://nightly.link/torrentpier/torrentpier/workflows/ci/master/TorrentPier-master"><img src="https://img.shields.io/badge/Nightly%20release-gray?logo=hackthebox&logoColor=fff" alt="TorrentPier nightly"></a>
<a href="https://packagist.org/packages/torrentpier/torrentpier"><img src="https://img.shields.io/packagist/dt/torrentpier/torrentpier" alt="Downloads"></a> <a href="https://packagist.org/packages/torrentpier/torrentpier"><img src="https://img.shields.io/packagist/dt/torrentpier/torrentpier" alt="Downloads"></a>
<a href="https://packagist.org/packages/torrentpier/torrentpier"><img src="https://img.shields.io/packagist/v/torrentpier/torrentpier" alt="Version"></a> <a href="https://packagist.org/packages/torrentpier/torrentpier"><img src="https://img.shields.io/packagist/v/torrentpier/torrentpier" alt="Version"></a>
<a href="https://github.com/torrentpier/torrentpier/releases"><img src="https://img.shields.io/github/release-date/torrentpier/torrentpier" alt="Last release"></a> <a href="https://github.com/torrentpier/torrentpier/releases"><img src="https://img.shields.io/github/release-date/torrentpier/torrentpier" alt="Last release"></a>
@ -20,18 +19,18 @@
## 🐂 About TorrentPier ## 🐂 About TorrentPier
TorrentPier — bull-powered BitTorrent Public/Private tracker engine, written in php. High speed, simple modification, high load TorrentPier — bull-powered BitTorrent Public/Private tracker engine, written in PHP. High speed, simple modifications, load-balanced
architecture. In addition, we have very helpful architecture. In addition, we have a very helpful
[official support forum](https://torrentpier.com), where it's possible to get any support and download modifications for engine. [official support forum](https://torrentpier.com), where it's possible to get support and download modifications for the engine.
## 🌈 Current status ## 🌈 Current status
TorrentPier is currently in active development. The goal is to remove all legacy code and rewrite existing to TorrentPier is currently in active development. The goal is to remove all legacy code and rewrite the existing code to
modern standards. If you want to go deep on the code, check our [issues](https://github.com/torrentpier/torrentpier/issues) modern specifications. If you want to delve deep into the code, check our [issues](https://github.com/torrentpier/torrentpier/issues)
and go from there. The documentation will be translated into english in the near future, currently russian is the main language of it. and go from there. The documentation will be translated to English in the near future, currently Russian is the main language.
## ✨ Features ## ✨ Features
* Rich forum browsing/moderation tools * Rich forum with browsing/moderation tools
* High-load capable, heavily configurable announcer * High-load capable, heavily configurable announcer
* Scrape support * Scrape support
* FreeLeech * FreeLeech
@ -39,11 +38,11 @@ and go from there. The documentation will be translated into english in the near
* BitTorrent v2 support * BitTorrent v2 support
* Event-based invite system * Event-based invite system
* Bonus points * Bonus points
* Polls system * Polling system
* PM system * PM/DM system
* Multilingual support (Fully supported for now only Russia and English languages) * Multilingual support (Russian and English are currently fully supported, with others in the future)
* Atom feeds * Atom/RSS feeds
* ... and MUCH MORE! * ... and so MUCH MORE!
## 🖥️ Demo ## 🖥️ Demo
@ -52,38 +51,38 @@ and go from there. The documentation will be translated into english in the near
* Password: `admin` * Password: `admin`
> [!NOTE] > [!NOTE]
> Demo is resetting every 24 hours! > Demo resets every 24 hours!
## 🔧 Requirements ## 🔧 Requirements
* Apache / nginx / caddy * Apache / nginx ([example config](install/nginx.conf)) / caddy ([example config](install/Caddyfile))
* MySQL 5.5.3 or above / MariaDB 10.0 or above / Percona * MySQL 5.5.3 or above (including MySQL 8.0+) / MariaDB 10.0 or above / Percona
* PHP: 8.1 / 8.2 / 8.3 * PHP: 8.2 / 8.3 / 8.4
* PHP Extensions: mbstring, gd, bcmath, intl, tidy (optional), xml, xmlwriter * PHP Extensions: mbstring, gd, bcmath, intl, tidy (optional), xml, xmlwriter
* Crontab (Recommended) * Crontab (Recommended)
## 💾 Installation ## 💾 Installation
For installation, select one of installation variants below. For the installation, select one of the installation variants below:
### Quick (Clean install) 🚀 ### Quick (Clean install) 🚀
Check out our [autoinstall](https://github.com/torrentpier/autoinstall) repository with detailed instructions. Check out our [autoinstall](https://github.com/torrentpier/autoinstall) repository with detailed instructions.
> [!IMPORTANT] > [!NOTE]
> Thanks to [Sergei Solovev](https://github.com/SeAnSolovev) for installation script ❤️ > Thanks to [Sergei Solovev](https://github.com/SeAnSolovev) for this installation script ❤️
### Quick (For web-panels) ☕️ ### Quick (For web-panels) ☕️
1. Select the folder where you want to install TorrentPier 1. Select the folder where you want TorrentPier installed
```shell ```shell
cd /path/to/public_html cd /path/to/public_html
``` ```
2. Download latest version of TorrentPier 2. Download the latest version of TorrentPier
```shell ```shell
sudo git clone https://github.com/torrentpier/torrentpier.git . sudo git clone https://github.com/torrentpier/torrentpier.git .
``` ```
3. After, run command below and follow the given steps 3. After completing, execute the command below and follow the instructions
```shell ```shell
php install.php php install.php
``` ```
@ -92,46 +91,66 @@ Check out our [autoinstall](https://github.com/torrentpier/autoinstall) reposito
### Manual 🔩 ### Manual 🔩
1. Install [Composer](https://getcomposer.org/) 1. Install [Composer](https://getcomposer.org/)
2. Run command below to create TorrentPier project 2. Run the following command to create the TorrentPier project
```shell ```shell
composer create-project torrentpier/torrentpier composer create-project torrentpier/torrentpier
``` ```
3. [Check our system requirements](#-requirements) 3. [Check our system requirements](#-requirements)
4. After, run command below on the project directory, to install Composer dependencies 4. After, run this command in the project directory to install Composer dependencies
```shell ```shell
composer install composer install
``` ```
5. Create database and import dump located at `install/sql/mysql.sql` 5. Edit database configuration settings in the environment (`.env.example`), after, rename to `.env`
6. Edit database configuration settings in the environment (`.env.example`), after, rename to `.env` 6. Create a database and run migrations to set up the schema
```shell
php vendor/bin/phinx migrate --configuration=phinx.php
```
7. Provide write permissions to the specified folders: 7. Provide write permissions to the specified folders:
* `data/avatars`, `data/uploads`, `data/uploads/thumbs` * `data/avatars`, `data/uploads`, `data/uploads/thumbs`
* `internal_data/atom`, `internal_data/cache`, `internal_data/log`, `internal_data/triggers` * `internal_data/atom`, `internal_data/cache`, `internal_data/log`, `internal_data/triggers`
* `sitemap` * `sitemap`
8. Voila! ✨ 8. Voila! ✨
> [!TIP]
> You can automate steps 4-7 by running `php install.php` instead, which will guide you through the setup process interactively.
> [!IMPORTANT] > [!IMPORTANT]
> The specific settings depend on the server you are using, but in general case we recommend chmod **0755** for folders, and chmod **0644** for files in them. > The specific settings depend on the server you are using, but in general we recommend chmod **0755** for folders, and chmod **0644** for the files in them.
### Additional steps 👣 ### Additional steps 👣
1. Edit this files: 1. Edit these files:
* `favicon.png` (change on your own) * `favicon.png` (change to your own)
* `robots.txt` (change the addresses in lines `Host` and `Sitemap` on your own) * `robots.txt` (change the addresses in lines `Host` and `Sitemap` to your own)
2. Log in to the forum with **admin/admin** login/password and finish setting up via admin panel 2. Log in to the forum using the **admin/admin** login/password, and finish setting up via admin panel. Don't forget to change your password!
## 🔐 Security vulnerabilities ## 🔐 Security vulnerabilities
If you discover a security vulnerability within TorrentPier, please follow our [security policy](https://github.com/torrentpier/torrentpier/security/policy), so we can address it promptly. If you discover a security vulnerability within TorrentPier, please follow our [security policy](https://github.com/torrentpier/torrentpier/security/policy), so we can address it promptly.
## 🧪 Testing
TorrentPier includes a comprehensive testing suite built with **Pest PHP**. Run tests to ensure code quality and system reliability:
```shell
# Run all tests
./vendor/bin/pest
# Run with coverage
./vendor/bin/pest --coverage
```
For detailed testing documentation, see [tests/README.md](tests/README.md).
## 📌 Our recommendations ## 📌 Our recommendations
* *The recommended way to run `cron.php`.* - For significant tracker speed increase may be required to replace built-in cron.php by operating system daemon. * *It's recommended to run `cron.php`.* - For significant tracker speed increase it may be required to replace the built-in cron.php with an operating system daemon.
* *Local configuration copy.* - You can override the settings using local configuration file `library/config.local.php`. * *Local configuration copy.* - You can override the settings using the local configuration file `library/config.local.php`.
## 💚 Contributing / Contributors ## 💚 Contributing / Contributors
Please read our [contributing policy](CONTRIBUTING.md) and [code of conduct](CODE_OF_CONDUCT.md) for details, and the process for Please read our [contributing policy](CONTRIBUTING.md) and [code of conduct](CODE_OF_CONDUCT.md) for details, and the process for
submitting pull requests to us. But we are always ready to renew your pull-request for compliance with submitting pull requests to us. But we are always ready to review your pull-request for compliance with
these requirements. Just send it! these requirements. Just send it!
<a href="https://github.com/torrentpier/torrentpier/graphs/contributors"> <a href="https://github.com/torrentpier/torrentpier/graphs/contributors">
@ -142,7 +161,7 @@ Made with [contrib.rocks](https://contrib.rocks).
## 💞 Sponsoring ## 💞 Sponsoring
Support this project by becoming a sponsor or a backer. Support this project by becoming a sponsor or a backer.
[![OpenCollective sponsors](https://opencollective.com/torrentpier/sponsors/badge.svg)](https://opencollective.com/torrentpier) [![OpenCollective sponsors](https://opencollective.com/torrentpier/sponsors/badge.svg)](https://opencollective.com/torrentpier)
[![OpenCollective backers](https://opencollective.com/torrentpier/backers/badge.svg)](https://opencollective.com/torrentpier) [![OpenCollective backers](https://opencollective.com/torrentpier/backers/badge.svg)](https://opencollective.com/torrentpier)
@ -165,7 +184,7 @@ Support this project by becoming a sponsor or a backer.
## 📦 Versioning ## 📦 Versioning
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/torrentpier/torrentpier/tags). We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/torrentpier/torrentpier/tags).
## 📖 License ## 📖 License

1261
UPGRADE_GUIDE.md Normal file

File diff suppressed because it is too large Load diff

57
_cleanup.php Normal file
View file

@ -0,0 +1,57 @@
<?php
/**
* TorrentPier Bull-powered BitTorrent tracker engine
*
* @copyright Copyright (c) 2005-2025 TorrentPier (https://torrentpier.com)
* @link https://github.com/torrentpier/torrentpier for the canonical source repository
* @license https://github.com/torrentpier/torrentpier/blob/master/LICENSE MIT License
*/
if (!defined('BB_ROOT')) {
define('BB_ROOT', __DIR__ . DIRECTORY_SEPARATOR);
define('BB_PATH', BB_ROOT);
}
// Check CLI mode
if (PHP_SAPI != 'cli') {
exit;
}
if (!function_exists('removeFile')) {
// Get all constants
require_once BB_ROOT . 'library/defines.php';
// Include CLI functions
require INC_DIR . '/functions_cli.php';
}
$items = [
'.github',
'.cliffignore',
'.editorconfig',
'.gitignore',
'.styleci.yml',
'_release.php',
'CHANGELOG.md',
'CLAUDE.md',
'cliff.toml',
'CODE_OF_CONDUCT.md',
'CONTRIBUTING.md',
'crowdin.yml',
'HISTORY.md',
'phpunit.xml',
'README.md',
'SECURITY.md',
'tests',
'UPGRADE_GUIDE.md'
];
foreach ($items as $item) {
$path = BB_ROOT . $item;
if (is_file($path)) {
removeFile($path);
} elseif (is_dir($path)) {
removeDir($path);
}
}

130
_release.php Normal file
View file

@ -0,0 +1,130 @@
<?php
/**
* TorrentPier Bull-powered BitTorrent tracker engine
*
* @copyright Copyright (c) 2005-2025 TorrentPier (https://torrentpier.com)
* @link https://github.com/torrentpier/torrentpier for the canonical source repository
* @license https://github.com/torrentpier/torrentpier/blob/master/LICENSE MIT License
*/
define('BB_ROOT', __DIR__ . DIRECTORY_SEPARATOR);
define('BB_PATH', BB_ROOT);
// Check CLI mode
if (PHP_SAPI != 'cli') {
die('Please run <code style="background:#222;color:#00e01f;padding:2px 6px;border-radius:3px;">php ' . basename(__FILE__) . '</code> in CLI mode');
}
// Get all constants
require_once BB_ROOT . 'library/defines.php';
// Include CLI functions
require INC_DIR . '/functions_cli.php';
// Welcoming message
out("--- Release creation tool ---\n", 'info');
$configFile = BB_PATH . '/library/config.php';
if (!is_file($configFile)) {
out('- Config file ' . basename($configFile) . ' not found', 'error');
exit;
}
if (!is_readable($configFile)) {
out('- Config file ' . basename($configFile) . ' is not readable', 'error');
exit;
}
if (!is_writable($configFile)) {
out('- Config file ' . basename($configFile) . ' is not writable', 'error');
exit;
}
// Ask for version
fwrite(STDOUT, 'Enter version number (e.g, v2.4.0): ');
$version = trim(fgets(STDIN));
if (empty($version)) {
out("- Version cannot be empty. Please enter a valid version number", 'error');
exit;
} else {
// Add 'v' prefix if missing
if (!str_starts_with($version, 'v')) {
$version = 'v' . $version;
}
out("- Using version: $version", 'info');
}
// Ask for version emoji
fwrite(STDOUT, 'Enter version emoji: ');
$versionEmoji = trim(fgets(STDIN));
if (!empty($versionEmoji)) {
out("- Using version emoji: $versionEmoji", 'info');
}
// Ask for release date or use today's date
fwrite(STDOUT, "Enter release date (e.g. 25-05-2025), leave empty to use today's date: ");
$date = trim(fgets(STDIN));
if (empty($date)) {
$date = date('d-m-Y');
out("- Using current date: $date", 'info');
} else {
// Validate date format (dd-mm-yyyy)
$dateObj = DateTime::createFromFormat('d-m-Y', $date);
if (!$dateObj || $dateObj->format('d-m-Y') !== $date) {
out("- Invalid date format. Expected format: DD-MM-YYYY", 'error');
exit;
}
out("- Using date: $date", 'info');
}
// Read config file content
$content = file_get_contents($configFile);
// Update version
$content = preg_replace(
"/\\\$bb_cfg\['tp_version'\]\s*=\s*'[^']*';/",
"\$bb_cfg['tp_version'] = '$version';",
$content
);
// Update release date
$content = preg_replace(
"/\\\$bb_cfg\['tp_release_date'\]\s*=\s*'[^']*';/",
"\$bb_cfg['tp_release_date'] = '$date';",
$content
);
// Save updated config
$bytesWritten = file_put_contents($configFile, $content);
if ($bytesWritten === false) {
out("- Failed to write to config file", 'error');
exit;
}
if ($bytesWritten === 0) {
out("- Config file was not updated (0 bytes written)", 'error');
exit;
}
out("\n- Config file has been updated!", 'success');
// Update CHANGELOG.md
runProcess('npx git-cliff v2.4.6-alpha.4.. --config cliff.toml --tag "' . $version . '" > CHANGELOG.md');
// Git add & commit
runProcess('git add -A && git commit -m "release: ' . escapeshellarg($version) . (!empty($versionEmoji) ? (' ' . $versionEmoji) : '') . '"');
// Git tag
runProcess("git tag -a \"$version\" -m \"Release $version\"");
runProcess("git tag -v \"$version\"");
// Git push
runProcess("git push origin master");
runProcess("git push origin $version");
out("\n- Release $version has been successfully prepared, committed and pushed!", 'success');

View file

@ -69,44 +69,44 @@ $order_by = '';
if ($view === 'username') { if ($view === 'username') {
switch ($mode) { switch ($mode) {
case 'username': case 'username':
$order_by = 'ORDER BY u.username ' . $sort_order . ' LIMIT ' . $start . ', ' . $bb_cfg['topics_per_page']; $order_by = 'ORDER BY u.username ' . $sort_order . ' LIMIT ' . $start . ', ' . config()->get('topics_per_page');
break; break;
case 'attachments': case 'attachments':
$order_by = 'ORDER BY total_attachments ' . $sort_order . ' LIMIT ' . $start . ', ' . $bb_cfg['topics_per_page']; $order_by = 'ORDER BY total_attachments ' . $sort_order . ' LIMIT ' . $start . ', ' . config()->get('topics_per_page');
break; break;
case 'filesize': case 'filesize':
$order_by = 'ORDER BY total_size ' . $sort_order . ' LIMIT ' . $start . ', ' . $bb_cfg['topics_per_page']; $order_by = 'ORDER BY total_size ' . $sort_order . ' LIMIT ' . $start . ', ' . config()->get('topics_per_page');
break; break;
default: default:
$mode = 'attachments'; $mode = 'attachments';
$sort_order = 'DESC'; $sort_order = 'DESC';
$order_by = 'ORDER BY total_attachments ' . $sort_order . ' LIMIT ' . $start . ', ' . $bb_cfg['topics_per_page']; $order_by = 'ORDER BY total_attachments ' . $sort_order . ' LIMIT ' . $start . ', ' . config()->get('topics_per_page');
break; break;
} }
} elseif ($view === 'attachments') { } elseif ($view === 'attachments') {
switch ($mode) { switch ($mode) {
case 'real_filename': case 'real_filename':
$order_by = 'ORDER BY a.real_filename ' . $sort_order . ' LIMIT ' . $start . ', ' . $bb_cfg['topics_per_page']; $order_by = 'ORDER BY a.real_filename ' . $sort_order . ' LIMIT ' . $start . ', ' . config()->get('topics_per_page');
break; break;
case 'comment': case 'comment':
$order_by = 'ORDER BY a.comment ' . $sort_order . ' LIMIT ' . $start . ', ' . $bb_cfg['topics_per_page']; $order_by = 'ORDER BY a.comment ' . $sort_order . ' LIMIT ' . $start . ', ' . config()->get('topics_per_page');
break; break;
case 'extension': case 'extension':
$order_by = 'ORDER BY a.extension ' . $sort_order . ' LIMIT ' . $start . ', ' . $bb_cfg['topics_per_page']; $order_by = 'ORDER BY a.extension ' . $sort_order . ' LIMIT ' . $start . ', ' . config()->get('topics_per_page');
break; break;
case 'filesize': case 'filesize':
$order_by = 'ORDER BY a.filesize ' . $sort_order . ' LIMIT ' . $start . ', ' . $bb_cfg['topics_per_page']; $order_by = 'ORDER BY a.filesize ' . $sort_order . ' LIMIT ' . $start . ', ' . config()->get('topics_per_page');
break; break;
case 'downloads': case 'downloads':
$order_by = 'ORDER BY a.download_count ' . $sort_order . ' LIMIT ' . $start . ', ' . $bb_cfg['topics_per_page']; $order_by = 'ORDER BY a.download_count ' . $sort_order . ' LIMIT ' . $start . ', ' . config()->get('topics_per_page');
break; break;
case 'post_time': case 'post_time':
$order_by = 'ORDER BY a.filetime ' . $sort_order . ' LIMIT ' . $start . ', ' . $bb_cfg['topics_per_page']; $order_by = 'ORDER BY a.filetime ' . $sort_order . ' LIMIT ' . $start . ', ' . config()->get('topics_per_page');
break; break;
default: default:
$mode = 'a.real_filename'; $mode = 'a.real_filename';
$sort_order = 'ASC'; $sort_order = 'ASC';
$order_by = 'ORDER BY a.real_filename ' . $sort_order . ' LIMIT ' . $start . ', ' . $bb_cfg['topics_per_page']; $order_by = 'ORDER BY a.real_filename ' . $sort_order . ' LIMIT ' . $start . ', ' . config()->get('topics_per_page');
break; break;
} }
} }
@ -470,8 +470,8 @@ if ($view === 'attachments') {
} }
// Generate Pagination // Generate Pagination
if ($do_pagination && $total_rows > $bb_cfg['topics_per_page']) { if ($do_pagination && $total_rows > config()->get('topics_per_page')) {
generate_pagination('admin_attach_cp.php?view=' . $view . '&amp;mode=' . $mode . '&amp;order=' . $sort_order . '&amp;uid=' . $uid, $total_rows, $bb_cfg['topics_per_page'], $start); generate_pagination('admin_attach_cp.php?view=' . $view . '&amp;mode=' . $mode . '&amp;order=' . $sort_order . '&amp;uid=' . $uid, $total_rows, config()->get('topics_per_page'), $start);
} }
print_page('admin_attach_cp.tpl', 'admin'); print_page('admin_attach_cp.tpl', 'admin');

View file

@ -136,8 +136,8 @@ switch ($mode) {
'POSTS_PER_PAGE' => $new['posts_per_page'], 'POSTS_PER_PAGE' => $new['posts_per_page'],
'HOT_TOPIC' => $new['hot_threshold'], 'HOT_TOPIC' => $new['hot_threshold'],
'DEFAULT_DATEFORMAT' => $new['default_dateformat'], 'DEFAULT_DATEFORMAT' => $new['default_dateformat'],
'LANG_SELECT' => \TorrentPier\Legacy\Select::language($new['default_lang'], 'default_lang'), 'LANG_SELECT' => \TorrentPier\Legacy\Common\Select::language($new['default_lang'], 'default_lang'),
'TIMEZONE_SELECT' => \TorrentPier\Legacy\Select::timezone($new['board_timezone'], 'board_timezone'), 'TIMEZONE_SELECT' => \TorrentPier\Legacy\Common\Select::timezone($new['board_timezone'], 'board_timezone'),
'MAX_LOGIN_ATTEMPTS' => $new['max_login_attempts'], 'MAX_LOGIN_ATTEMPTS' => $new['max_login_attempts'],
'LOGIN_RESET_TIME' => $new['login_reset_time'], 'LOGIN_RESET_TIME' => $new['login_reset_time'],
'PRUNE_ENABLE' => (bool)$new['prune_enable'], 'PRUNE_ENABLE' => (bool)$new['prune_enable'],

View file

@ -123,6 +123,7 @@ if ($submit) {
} }
$datastore->update('cat_forums'); $datastore->update('cat_forums');
CACHE('bb_cache')->rm();
bb_die($lang['FORUM_AUTH_UPDATED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_FORUMAUTH'], '<a href="' . 'admin_forumauth.php' . '">', '</a>')); bb_die($lang['FORUM_AUTH_UPDATED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_FORUMAUTH'], '<a href="' . 'admin_forumauth.php' . '">', '</a>'));
} }

View file

@ -153,6 +153,7 @@ if ($submit) {
} }
$datastore->update('cat_forums'); $datastore->update('cat_forums');
CACHE('bb_cache')->rm();
bb_die($lang['FORUM_AUTH_UPDATED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_FORUMAUTH'], '<a href="admin_forumauth_list.php">', '</a>')); bb_die($lang['FORUM_AUTH_UPDATED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_FORUMAUTH'], '<a href="admin_forumauth_list.php">', '</a>'));
} // End of submit } // End of submit

View file

@ -151,7 +151,7 @@ if ($var =& $_REQUEST[$daysback_key] && $var != $def_days) {
$url = url_arg($url, $daysback_key, $daysback_val); $url = url_arg($url, $daysback_key, $daysback_val);
} }
if ($var =& $_REQUEST[$datetime_key] && $var != $def_datetime) { if ($var =& $_REQUEST[$datetime_key] && $var != $def_datetime) {
$tz = TIMENOW + (3600 * $bb_cfg['board_timezone']); $tz = TIMENOW + (3600 * config()->get('board_timezone'));
if (($tmp_timestamp = strtotime($var, $tz)) > 0) { if (($tmp_timestamp = strtotime($var, $tz)) > 0) {
$datetime_val = $tmp_timestamp; $datetime_val = $tmp_timestamp;
$url = url_arg($url, $datetime_key, date($dt_format, $datetime_val)); $url = url_arg($url, $datetime_key, date($dt_format, $datetime_val));

View file

@ -14,7 +14,7 @@ if (!empty($setmodules)) {
require __DIR__ . '/pagestart.php'; require __DIR__ . '/pagestart.php';
if (!$bb_cfg['emailer']['enabled']) { if (!config()->get('emailer.enabled')) {
bb_die($lang['EMAILER_DISABLED']); bb_die($lang['EMAILER_DISABLED']);
} }
@ -23,7 +23,7 @@ set_time_limit(1200);
$subject = trim(request_var('subject', '')); $subject = trim(request_var('subject', ''));
$message = (string)request_var('message', ''); $message = (string)request_var('message', '');
$group_id = (int)request_var(POST_GROUPS_URL, 0); $group_id = (int)request_var(POST_GROUPS_URL, 0);
$reply_to = (string)request_var('reply_to', $bb_cfg['board_email']); $reply_to = (string)request_var('reply_to', config()->get('board_email'));
$message_type = (string)request_var('message_type', ''); $message_type = (string)request_var('message_type', '');
$errors = $user_id_sql = []; $errors = $user_id_sql = [];

View file

@ -0,0 +1,79 @@
<?php
/**
* TorrentPier Bull-powered BitTorrent tracker engine
*
* @copyright Copyright (c) 2005-2025 TorrentPier (https://torrentpier.com)
* @link https://github.com/torrentpier/torrentpier for the canonical source repository
* @license https://github.com/torrentpier/torrentpier/blob/master/LICENSE MIT License
*/
if (!empty($setmodules)) {
if (IS_SUPER_ADMIN) {
$module['GENERAL']['MIGRATIONS_STATUS'] = basename(__FILE__);
}
return;
}
require __DIR__ . '/pagestart.php';
if (!IS_SUPER_ADMIN) {
bb_die(__('ONLY_FOR_SUPER_ADMIN'));
}
use TorrentPier\Database\MigrationStatus;
// Initialize migration status
$migrationStatus = new MigrationStatus();
$status = $migrationStatus->getMigrationStatus();
$schemaInfo = $migrationStatus->getSchemaInfo();
// Template variables
$template->assign_vars([
'PAGE_TITLE' => __('MIGRATIONS_STATUS'),
'CURRENT_TIME' => date('Y-m-d H:i:s'),
// Migration status individual fields
'MIGRATION_TABLE_EXISTS' => $status['table_exists'],
'MIGRATION_CURRENT_VERSION' => $status['current_version'],
'MIGRATION_APPLIED_COUNT' => count($status['applied_migrations']),
'MIGRATION_PENDING_COUNT' => count($status['pending_migrations']),
// Setup status fields
'SETUP_REQUIRES_SETUP' => $status['requires_setup'] ?? false,
'SETUP_TYPE' => $status['setup_status']['type'] ?? __('UNKNOWN'),
'SETUP_MESSAGE' => $status['setup_status']['message'] ?? '',
'SETUP_ACTION_REQUIRED' => $status['setup_status']['action_required'] ?? false,
'SETUP_INSTRUCTIONS' => $status['setup_status']['instructions'] ?? '',
// Schema info individual fields
'SCHEMA_DATABASE_NAME' => $schemaInfo['database_name'],
'SCHEMA_TABLE_COUNT' => $schemaInfo['table_count'],
'SCHEMA_SIZE_MB' => $schemaInfo['size_mb'],
]);
// Assign migration data for template
if (!empty($status['applied_migrations'])) {
foreach ($status['applied_migrations'] as $i => $migration) {
$template->assign_block_vars('applied_migrations', [
'VERSION' => $migration['version'],
'NAME' => $migration['migration_name'] ?? __('UNKNOWN'),
'START_TIME' => $migration['start_time'] ?? __('UNKNOWN'),
'END_TIME' => $migration['end_time'] ?? __('UNKNOWN'),
'ROW_CLASS' => ($i % 2) ? 'row1' : 'row2'
]);
}
}
if (!empty($status['pending_migrations'])) {
foreach ($status['pending_migrations'] as $i => $migration) {
$template->assign_block_vars('pending_migrations', [
'VERSION' => $migration['version'],
'NAME' => $migration['name'],
'FILENAME' => $migration['filename'],
'ROW_CLASS' => ($i % 2) ? 'row1' : 'row2'
]);
}
}
// Output template using standard admin pattern
print_page('admin_migrations.tpl', 'admin');

View file

@ -29,6 +29,10 @@ if (isset($_GET['mode']) || isset($_POST['mode'])) {
} }
} }
if ($mode == 'delete' && isset($_POST['cancel'])) {
$mode = '';
}
if ($mode != '') { if ($mode != '') {
if ($mode == 'edit' || $mode == 'add') { if ($mode == 'edit' || $mode == 'add') {
// //
@ -123,29 +127,40 @@ if ($mode != '') {
// Ok, they want to delete their rank // Ok, they want to delete their rank
// //
$confirmed = isset($_POST['confirm']);
if (isset($_POST['id']) || isset($_GET['id'])) { if (isset($_POST['id']) || isset($_GET['id'])) {
$rank_id = isset($_POST['id']) ? (int)$_POST['id'] : (int)$_GET['id']; $rank_id = isset($_POST['id']) ? (int)$_POST['id'] : (int)$_GET['id'];
} else { } else {
$rank_id = 0; $rank_id = 0;
} }
if ($rank_id) { if ($confirmed) {
$sql = 'DELETE FROM ' . BB_RANKS . " WHERE rank_id = $rank_id"; if ($rank_id) {
$sql = 'DELETE FROM ' . BB_RANKS . " WHERE rank_id = $rank_id";
if (!$result = DB()->sql_query($sql)) { if (!$result = DB()->sql_query($sql)) {
bb_die('Could not delete rank data'); bb_die('Could not delete rank data');
}
$sql = 'UPDATE ' . BB_USERS . " SET user_rank = 0 WHERE user_rank = $rank_id";
if (!$result = DB()->sql_query($sql)) {
bb_die($lang['NO_UPDATE_RANKS']);
}
$datastore->update('ranks');
bb_die($lang['RANK_REMOVED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_RANKADMIN'], '<a href="admin_ranks.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
} else {
bb_die($lang['MUST_SELECT_RANK']);
} }
$sql = 'UPDATE ' . BB_USERS . " SET user_rank = 0 WHERE user_rank = $rank_id";
if (!$result = DB()->sql_query($sql)) {
bb_die($lang['NO_UPDATE_RANKS']);
}
$datastore->update('ranks');
bb_die($lang['RANK_REMOVED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_RANKADMIN'], '<a href="admin_ranks.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
} else { } else {
bb_die($lang['MUST_SELECT_RANK']); $hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '" />';
$hidden_fields .= '<input type="hidden" name="id" value="' . $rank_id . '" />';
print_confirmation([
'FORM_ACTION' => 'admin_ranks.php',
'HIDDEN_FIELDS' => $hidden_fields,
]);
} }
} else { } else {
bb_die('Invalid mode'); bb_die('Invalid mode');

45
admin/admin_robots.php Normal file
View file

@ -0,0 +1,45 @@
<?php
/**
* TorrentPier Bull-powered BitTorrent tracker engine
*
* @copyright Copyright (c) 2005-2025 TorrentPier (https://torrentpier.com)
* @link https://github.com/torrentpier/torrentpier for the canonical source repository
* @license https://github.com/torrentpier/torrentpier/blob/master/LICENSE MIT License
*/
if (!empty($setmodules)) {
$module['MODS']['ROBOTS_TXT_EDITOR_TITLE'] = basename(__FILE__);
return;
}
require __DIR__ . '/pagestart.php';
$robots_file = BB_ROOT . 'robots.txt';
// Обработка сохранения
if (isset($_POST['save'])) {
$robots_txt = $_POST['robots_txt'] ?? '';
if (!is_writable($robots_file) && is_file($robots_file)) {
bb_die('File robots.txt is not writable #1');
}
$bytes = file_put_contents($robots_file, $robots_txt);
if ($bytes === false) {
bb_die('Could not write robots.txt #2');
}
bb_die($lang['ROBOTS_TXT_UPDATED_SUCCESSFULLY'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_ROBOTS_TXT_CONFIG'], '<a href="admin_robots.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
}
$current_content = '';
if (is_file($robots_file)) {
$current_content = file_get_contents($robots_file);
}
$template->assign_vars([
'S_ACTION' => 'admin_robots.php',
'ROBOTS_TXT' => htmlCHR($current_content),
]);
print_page('admin_robots.tpl', 'admin');

View file

@ -14,7 +14,7 @@ if (!empty($setmodules)) {
require __DIR__ . '/pagestart.php'; require __DIR__ . '/pagestart.php';
$sql = 'SELECT * FROM ' . BB_CONFIG; $sql = "SELECT * FROM " . BB_CONFIG . " WHERE config_name IN('sitemap_time', 'static_sitemap')";
if (!$result = DB()->sql_query($sql)) { if (!$result = DB()->sql_query($sql)) {
bb_die('Could not query config information in admin_sitemap'); bb_die('Could not query config information in admin_sitemap');
@ -39,7 +39,7 @@ if (!$result = DB()->sql_query($sql)) {
} }
} }
$s_mess = $lang['SITEMAP_CREATED'] . ': <b>' . bb_date($new['sitemap_time'], $bb_cfg['post_date_format']) . '</b> ' . $lang['SITEMAP_AVAILABLE'] . ': <a href="' . make_url('sitemap/sitemap.xml') . '" target="_blank">' . make_url('sitemap/sitemap.xml') . '</a>'; $s_mess = $lang['SITEMAP_CREATED'] . ': <b>' . bb_date($new['sitemap_time'], config()->get('post_date_format')) . '</b> ' . $lang['SITEMAP_AVAILABLE'] . ': <a href="' . make_url('sitemap/sitemap.xml') . '" target="_blank">' . make_url('sitemap/sitemap.xml') . '</a>';
$message = is_file(SITEMAP_DIR . '/sitemap.xml') ? $s_mess : $lang['SITEMAP_NOT_CREATED']; $message = is_file(SITEMAP_DIR . '/sitemap.xml') ? $s_mess : $lang['SITEMAP_NOT_CREATED'];
$template->assign_vars([ $template->assign_vars([

View file

@ -22,7 +22,11 @@ if (isset($_POST['mode']) || isset($_GET['mode'])) {
$mode = ''; $mode = '';
} }
$pathToSmilesDir = BB_ROOT . $bb_cfg['smilies_path']; if ($mode == 'delete' && isset($_POST['cancel'])) {
$mode = '';
}
$pathToSmilesDir = BB_ROOT . config()->get('smilies_path');
$delimeter = '=+:'; $delimeter = '=+:';
$s_hidden_fields = ''; $s_hidden_fields = '';
$smiley_paks = $smiley_images = []; $smiley_paks = $smiley_images = [];
@ -174,17 +178,28 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) {
} elseif ($mode != '') { } elseif ($mode != '') {
switch ($mode) { switch ($mode) {
case 'delete': case 'delete':
$confirmed = isset($_POST['confirm']);
$smiley_id = (!empty($_POST['id'])) ? $_POST['id'] : $_GET['id']; $smiley_id = (!empty($_POST['id'])) ? $_POST['id'] : $_GET['id'];
$smiley_id = (int)$smiley_id; $smiley_id = (int)$smiley_id;
$sql = 'DELETE FROM ' . BB_SMILIES . ' WHERE smilies_id = ' . $smiley_id; if ($confirmed) {
$result = DB()->sql_query($sql); $sql = 'DELETE FROM ' . BB_SMILIES . ' WHERE smilies_id = ' . $smiley_id;
if (!$result) { $result = DB()->sql_query($sql);
bb_die('Could not delete smiley'); if (!$result) {
} bb_die('Could not delete smiley');
$datastore->update('smile_replacements'); }
bb_die($lang['SMILEY_DEL_SUCCESS'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_SMILEADMIN'], '<a href="admin_smilies.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>')); $datastore->update('smile_replacements');
bb_die($lang['SMILEY_DEL_SUCCESS'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_SMILEADMIN'], '<a href="admin_smilies.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
} else {
$hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '" />';
$hidden_fields .= '<input type="hidden" name="id" value="' . $smiley_id . '" />';
print_confirmation([
'FORM_ACTION' => 'admin_smilies.php',
'HIDDEN_FIELDS' => $hidden_fields,
]);
}
break; break;
case 'edit': case 'edit':

View file

@ -17,15 +17,15 @@ require INC_DIR . '/bbcode.php';
$preview = isset($_POST['preview']); $preview = isset($_POST['preview']);
if (isset($_POST['post']) && ($bb_cfg['terms'] !== $_POST['message'])) { if (isset($_POST['post']) && (config()->get('terms') !== $_POST['message'])) {
bb_update_config(['terms' => $_POST['message']]); bb_update_config(['terms' => $_POST['message']]);
bb_die($lang['CONFIG_UPDATED']); bb_die($lang['TERMS_UPDATED_SUCCESSFULLY'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_TERMS_CONFIG'], '<a href="admin_terms.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
} }
$template->assign_vars([ $template->assign_vars([
'S_ACTION' => 'admin_terms.php', 'S_ACTION' => 'admin_terms.php',
'EXT_LINK_NW' => $bb_cfg['ext_link_new_win'], 'EXT_LINK_NW' => config()->get('ext_link_new_win'),
'MESSAGE' => $preview ? $_POST['message'] : $bb_cfg['terms'], 'MESSAGE' => $preview ? $_POST['message'] : config()->get('terms'),
'PREVIEW_HTML' => $preview ? bbcode2html($_POST['message']) : '', 'PREVIEW_HTML' => $preview ? bbcode2html($_POST['message']) : '',
]); ]);

View file

@ -20,9 +20,9 @@ $max_forum_name_length = 50;
$yes_sign = '&radic;'; $yes_sign = '&radic;';
$no_sign = 'x'; $no_sign = 'x';
$group_id = isset($_REQUEST['g']) ? (int)$_REQUEST['g'] : 0; $group_id = isset($_REQUEST[POST_GROUPS_URL]) ? (int)$_REQUEST[POST_GROUPS_URL] : 0;
$user_id = isset($_REQUEST['u']) ? (int)$_REQUEST['u'] : 0; $user_id = isset($_REQUEST[POST_USERS_URL]) ? (int)$_REQUEST[POST_USERS_URL] : 0;
$cat_id = isset($_REQUEST['c']) ? (int)$_REQUEST['c'] : 0; $cat_id = isset($_REQUEST[POST_CAT_URL]) ? (int)$_REQUEST[POST_CAT_URL] : 0;
$mode = isset($_REQUEST['mode']) ? (string)$_REQUEST['mode'] : ''; $mode = isset($_REQUEST['mode']) ? (string)$_REQUEST['mode'] : '';
$submit = isset($_REQUEST['submit']); $submit = isset($_REQUEST['submit']);
@ -200,7 +200,7 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) {
'CAT_HREF' => "$base_url&amp;" . POST_CAT_URL . "=$c_id", 'CAT_HREF' => "$base_url&amp;" . POST_CAT_URL . "=$c_id",
)); ));
if (!$c =& $_REQUEST['c'] or !in_array($c, array('all', $c_id)) or empty($c_data['forums'])) { if (!$c =& $_REQUEST[POST_CAT_URL] or !in_array($c, array('all', $c_id)) or empty($c_data['forums'])) {
continue; continue;
} }
@ -316,7 +316,7 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) {
'CAT_HREF' => "$base_url&amp;" . POST_CAT_URL . "=$c_id", 'CAT_HREF' => "$base_url&amp;" . POST_CAT_URL . "=$c_id",
)); ));
if (!($c =& $_REQUEST['c']) || !in_array($c, array('all', $c_id)) || empty($c_data['forums'])) { if (!($c =& $_REQUEST[POST_CAT_URL]) || !in_array($c, array('all', $c_id)) || empty($c_data['forums'])) {
continue; continue;
} }

View file

@ -52,8 +52,8 @@ if (!isset($_REQUEST['dosearch'])) {
} }
} }
$language_list = \TorrentPier\Legacy\Select::language('', 'language_type'); $language_list = \TorrentPier\Legacy\Common\Select::language('', 'language_type');
$timezone_list = \TorrentPier\Legacy\Select::timezone('', 'timezone_type'); $timezone_list = \TorrentPier\Legacy\Common\Select::timezone('', 'timezone_type');
$sql = 'SELECT f.forum_id, f.forum_name, f.forum_parent, c.cat_id, c.cat_title $sql = 'SELECT f.forum_id, f.forum_name, f.forum_parent, c.cat_id, c.cat_title
FROM ( ' . BB_FORUMS . ' AS f INNER JOIN ' . BB_CATEGORIES . ' AS c ON c.cat_id = f.cat_id ) FROM ( ' . BB_FORUMS . ' AS f INNER JOIN ' . BB_CATEGORIES . ' AS c ON c.cat_id = f.cat_id )
@ -841,10 +841,10 @@ if (!isset($_REQUEST['dosearch'])) {
if ($page == 1) { if ($page == 1) {
$offset = 0; $offset = 0;
} else { } else {
$offset = (($page - 1) * $bb_cfg['topics_per_page']); $offset = (($page - 1) * config()->get('topics_per_page'));
} }
$limit = "LIMIT $offset, " . $bb_cfg['topics_per_page']; $limit = "LIMIT $offset, " . config()->get('topics_per_page');
$select_sql .= " $limit"; $select_sql .= " $limit";
@ -859,7 +859,7 @@ if (!isset($_REQUEST['dosearch'])) {
bb_die($lang['SEARCH_NO_RESULTS']); bb_die($lang['SEARCH_NO_RESULTS']);
} }
} }
$num_pages = ceil($total_pages['total'] / $bb_cfg['topics_per_page']); $num_pages = ceil($total_pages['total'] / config()->get('topics_per_page'));
$pagination = ''; $pagination = '';

View file

@ -14,8 +14,8 @@ if (!empty($setmodules)) {
require __DIR__ . '/pagestart.php'; require __DIR__ . '/pagestart.php';
if (!$bb_cfg['use_word_censor']) { if (!config()->get('use_word_censor')) {
bb_die('Word censor disabled <br /><br /> ($bb_cfg[\'use_word_censor\'] in config.php)'); bb_die('Word censor disabled <br /><br /> (use_word_censor in config.php)');
} }
$mode = request_var('mode', ''); $mode = request_var('mode', '');
@ -81,6 +81,7 @@ if ($mode != '') {
} }
$datastore->update('censor'); $datastore->update('censor');
censor()->reload(); // Reload the singleton instance with updated words
$message .= '<br /><br />' . sprintf($lang['CLICK_RETURN_WORDADMIN'], '<a href="admin_words.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'); $message .= '<br /><br />' . sprintf($lang['CLICK_RETURN_WORDADMIN'], '<a href="admin_words.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>');
bb_die($message); bb_die($message);
@ -95,6 +96,7 @@ if ($mode != '') {
} }
$datastore->update('censor'); $datastore->update('censor');
censor()->reload(); // Reload the singleton instance with updated words
bb_die($lang['WORD_REMOVED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_WORDADMIN'], '<a href="admin_words.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>')); bb_die($lang['WORD_REMOVED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_WORDADMIN'], '<a href="admin_words.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
} else { } else {

View file

@ -15,12 +15,6 @@ if (!$stats = $datastore->get('stats')) {
$stats = $datastore->get('stats'); $stats = $datastore->get('stats');
} }
// Files integrity check
if (!$files_integrity_data = $datastore->get('files_integrity')) {
$datastore->update('files_integrity');
$files_integrity_data = $datastore->get('files_integrity');
}
// Check for updates // Check for updates
if (!$update_data = $datastore->get('check_updates')) { if (!$update_data = $datastore->get('check_updates')) {
$datastore->update('check_updates'); $datastore->update('check_updates');
@ -84,20 +78,10 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') {
} elseif (isset($_GET['pane']) && $_GET['pane'] == 'right') { } elseif (isset($_GET['pane']) && $_GET['pane'] == 'right') {
$template->assign_vars([ $template->assign_vars([
'TPL_ADMIN_MAIN' => true, 'TPL_ADMIN_MAIN' => true,
'ADMIN_LOCK' => (bool)$bb_cfg['board_disable'], 'ADMIN_LOCK' => (bool)config()->get('board_disable'),
'ADMIN_LOCK_CRON' => is_file(BB_DISABLED), 'ADMIN_LOCK_CRON' => is_file(BB_DISABLED),
]); ]);
// Files integrity check results
if (!empty($files_integrity_data)) {
$template->assign_block_vars('integrity_check', [
'INTEGRITY_SUCCESS' => (bool)$files_integrity_data['success'],
'INTEGRITY_WRONG_FILES_LIST' => implode("\n</li>\n<li>\n", $files_integrity_data['wrong_files']),
'INTEGRITY_LAST_CHECK_TIME' => sprintf($lang['INTEGRITY_LAST_CHECK'], bb_date($files_integrity_data['timestamp'])),
'INTEGRITY_CHECKED_FILES' => sprintf($lang['INTEGRITY_CHECKED'], $files_integrity_data['total_num'], ($files_integrity_data['total_num'] - $files_integrity_data['wrong_files_num'])),
]);
}
// Check for updates // Check for updates
if (isset($update_data['available_update'])) { if (isset($update_data['available_update'])) {
$template->assign_block_vars('updater', [ $template->assign_block_vars('updater', [
@ -106,7 +90,7 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') {
'NEW_VERSION_SIZE' => $update_data['latest_version_size'], 'NEW_VERSION_SIZE' => $update_data['latest_version_size'],
'NEW_VERSION_DL_LINK' => $update_data['latest_version_dl_link'], 'NEW_VERSION_DL_LINK' => $update_data['latest_version_dl_link'],
'NEW_VERSION_LINK' => $update_data['latest_version_link'], 'NEW_VERSION_LINK' => $update_data['latest_version_link'],
'NEW_VERSION_MD5' => $update_data['latest_version_checksum'] 'NEW_VERSION_HASH' => $update_data['latest_version_checksum']
]); ]);
} }
@ -114,8 +98,8 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') {
$total_posts = $stats['postcount']; $total_posts = $stats['postcount'];
$total_topics = $stats['topiccount']; $total_topics = $stats['topiccount'];
$total_users = $stats['usercount']; $total_users = $stats['usercount'];
$start_date = bb_date($bb_cfg['board_startdate']); $start_date = bb_date(config()->get('board_startdate'));
$boarddays = (TIMENOW - $bb_cfg['board_startdate']) / 86400; $boarddays = (TIMENOW - config()->get('board_startdate')) / 86400;
$posts_per_day = sprintf('%.2f', $total_posts / $boarddays); $posts_per_day = sprintf('%.2f', $total_posts / $boarddays);
$topics_per_day = sprintf('%.2f', $total_topics / $boarddays); $topics_per_day = sprintf('%.2f', $total_topics / $boarddays);
@ -123,10 +107,10 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') {
$avatar_dir_size = 0; $avatar_dir_size = 0;
if ($avatar_dir = opendir($bb_cfg['avatars']['upload_path'])) { if ($avatar_dir = opendir(config()->get('avatars.upload_path'))) {
while ($file = readdir($avatar_dir)) { while ($file = readdir($avatar_dir)) {
if ($file != '.' && $file != '..') { if ($file != '.' && $file != '..') {
$avatar_dir_size += @filesize($bb_cfg['avatars']['upload_path'] . $file); $avatar_dir_size += @filesize(config()->get('avatars.upload_path') . $file);
} }
} }
closedir($avatar_dir); closedir($avatar_dir);
@ -203,7 +187,7 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') {
'STARTED' => bb_date($onlinerow_reg[$i]['session_start'], 'd-M-Y H:i', false), 'STARTED' => bb_date($onlinerow_reg[$i]['session_start'], 'd-M-Y H:i', false),
'LASTUPDATE' => bb_date($onlinerow_reg[$i]['user_session_time'], 'd-M-Y H:i', false), 'LASTUPDATE' => bb_date($onlinerow_reg[$i]['user_session_time'], 'd-M-Y H:i', false),
'IP_ADDRESS' => $reg_ip, 'IP_ADDRESS' => $reg_ip,
'U_WHOIS_IP' => $bb_cfg['whois_info'] . $reg_ip, 'U_WHOIS_IP' => config()->get('whois_info') . $reg_ip,
]); ]);
} }
} }
@ -222,7 +206,7 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') {
'STARTED' => bb_date($onlinerow_guest[$i]['session_start'], 'd-M-Y H:i', false), 'STARTED' => bb_date($onlinerow_guest[$i]['session_start'], 'd-M-Y H:i', false),
'LASTUPDATE' => bb_date($onlinerow_guest[$i]['session_time'], 'd-M-Y H:i', false), 'LASTUPDATE' => bb_date($onlinerow_guest[$i]['session_time'], 'd-M-Y H:i', false),
'IP_ADDRESS' => $guest_ip, 'IP_ADDRESS' => $guest_ip,
'U_WHOIS_IP' => $bb_cfg['whois_info'] . $guest_ip, 'U_WHOIS_IP' => config()->get('whois_info') . $guest_ip,
]); ]);
} }
} }

View file

@ -31,7 +31,8 @@ echo '<html><body><head></head>';
echo '<br /><br /><table border="1" cellspacing="0" cellpadding="6" align="center">'; echo '<br /><br /><table border="1" cellspacing="0" cellpadding="6" align="center">';
foreach ($sql as $i => $query) { foreach ($sql as $i => $query) {
$row = mysqli_fetch_row(DB()->query($query))[0]; $result = DB()->fetch_row($query);
$row = array_values($result)[0]; // Get first column value
$row = ($i == 2) ? humn_size($row) : $row; $row = ($i == 2) ? humn_size($row) : $row;
echo "<tr><td>{$lang['TR_STATS'][$i]}</td><td><b>$row</b></td>"; echo "<tr><td>{$lang['TR_STATS'][$i]}</td><td><b>$row</b></td>";
} }
@ -39,7 +40,7 @@ foreach ($sql as $i => $query) {
echo '</table>'; echo '</table>';
echo '<div align="center"><pre>'; echo '<div align="center"><pre>';
echo 'gen time: <b>' . sprintf('%.4f', array_sum(explode(' ', microtime())) - TIMESTART) . "</b> sec\n"; echo 'gen time: <b>' . sprintf('%.3f', array_sum(explode(' ', microtime())) - TIMESTART) . "</b> sec\n";
echo '</pre></div>'; echo '</pre></div>';
echo '</body></html>'; echo '</body></html>';

View file

@ -21,7 +21,7 @@ if (!IS_ADMIN) {
$peers_in_last_minutes = [30, 15, 5, 1]; $peers_in_last_minutes = [30, 15, 5, 1];
$peers_in_last_sec_limit = 300; $peers_in_last_sec_limit = 300;
$announce_interval = (int)$bb_cfg['announce_interval']; $announce_interval = (int)config()->get('announce_interval');
$stat = []; $stat = [];
define('TMP_TRACKER_TABLE', 'tmp_tracker'); define('TMP_TRACKER_TABLE', 'tmp_tracker');
@ -173,7 +173,7 @@ echo '</table>';
echo !$client_full ? '<p style = "text-align:right;">Simple stats for clients are being cached for one hour.</p>' : ''; echo !$client_full ? '<p style = "text-align:right;">Simple stats for clients are being cached for one hour.</p>' : '';
echo '<div align="center"><pre>'; echo '<div align="center"><pre>';
echo 'gen time: <b>' . sprintf('%.4f', array_sum(explode(' ', microtime())) - TIMESTART) . "</b> sec\n"; echo 'gen time: <b>' . sprintf('%.3f', array_sum(explode(' ', microtime())) - TIMESTART) . "</b> sec\n";
echo '</pre></div>'; echo '</pre></div>';
echo '</body></html>'; echo '</body></html>';

View file

@ -41,5 +41,5 @@ $ajax->exec();
/** /**
* @deprecated ajax_common * @deprecated ajax_common
* Dirty class removed from here since 2.2.0 * Dirty class removed from here since 2.2.0
* To add new actions see at src/Legacy/Ajax.php * To add new actions see at src/Ajax.php
*/ */

View file

@ -11,15 +11,15 @@ define('IN_TRACKER', true);
define('BB_ROOT', './../'); define('BB_ROOT', './../');
require dirname(__DIR__) . '/common.php'; require dirname(__DIR__) . '/common.php';
global $bb_cfg; // Check User-Agent for existence
$userAgent = (string)$_SERVER['HTTP_USER_AGENT'];
if (empty($_SERVER['HTTP_USER_AGENT'])) { if (empty($userAgent)) {
header('Location: http://127.0.0.1', true, 301); header('Location: http://127.0.0.1', true, 301);
die; die;
} }
$announce_interval = $bb_cfg['announce_interval']; $announce_interval = config()->get('announce_interval');
$passkey_key = $bb_cfg['passkey_key']; $passkey_key = config()->get('passkey_key');
// Recover info_hash // Recover info_hash
if (isset($_GET['?info_hash']) && !isset($_GET['info_hash'])) { if (isset($_GET['?info_hash']) && !isset($_GET['info_hash'])) {
@ -65,10 +65,10 @@ if (strlen($peer_id) !== 20) {
} }
// Check for client ban // Check for client ban
if ($bb_cfg['client_ban']['enabled']) { if (config()->get('client_ban.enabled')) {
$targetClient = []; $targetClient = [];
foreach ($bb_cfg['client_ban']['clients'] as $clientId => $banReason) { foreach (config()->get('client_ban.clients') as $clientId => $banReason) {
if (str_starts_with($peer_id, $clientId)) { if (str_starts_with($peer_id, $clientId)) {
$targetClient = [ $targetClient = [
'peer_id' => $clientId, 'peer_id' => $clientId,
@ -78,7 +78,7 @@ if ($bb_cfg['client_ban']['enabled']) {
} }
} }
if ($bb_cfg['client_ban']['only_allow_mode']) { if (config()->get('client_ban.only_allow_mode')) {
if (empty($targetClient['peer_id'])) { if (empty($targetClient['peer_id'])) {
msg_die('Your BitTorrent client has been banned!'); msg_die('Your BitTorrent client has been banned!');
} }
@ -115,7 +115,7 @@ $stopped = ($event === 'stopped');
// Check info_hash length // Check info_hash length
if (strlen($info_hash) !== 20) { if (strlen($info_hash) !== 20) {
msg_die('Invalid info_hash: ' . (mb_check_encoding($info_hash, 'UTF8') ? $info_hash : $info_hash_hex)); msg_die('Invalid info_hash: ' . (mb_check_encoding($info_hash, DEFAULT_CHARSET) ? $info_hash : $info_hash_hex));
} }
/** /**
@ -129,7 +129,7 @@ if (
|| !is_numeric($port) || !is_numeric($port)
|| ($port < 1024 && !$stopped) || ($port < 1024 && !$stopped)
|| $port > 0xFFFF || $port > 0xFFFF
|| (!empty($bb_cfg['disallowed_ports']) && in_array($port, $bb_cfg['disallowed_ports'])) || (!empty(config()->get('disallowed_ports')) && in_array($port, config()->get('disallowed_ports')))
) { ) {
msg_die('Invalid port: ' . $port); msg_die('Invalid port: ' . $port);
} }
@ -151,7 +151,6 @@ if (!isset($left) || !is_numeric($left) || $left < 0) {
* *
* @see https://github.com/HDInnovations/UNIT3D-Community-Edition/blob/c64275f0b5dcb3c4c845d5204871adfe24f359d6/app/Http/Controllers/AnnounceController.php#L177 * @see https://github.com/HDInnovations/UNIT3D-Community-Edition/blob/c64275f0b5dcb3c4c845d5204871adfe24f359d6/app/Http/Controllers/AnnounceController.php#L177
*/ */
$userAgent = (string)$_SERVER['HTTP_USER_AGENT'];
if (strlen($userAgent) > 64) { if (strlen($userAgent) > 64) {
msg_die('User-Agent must be less than 64 characters long'); msg_die('User-Agent must be less than 64 characters long');
} }
@ -169,13 +168,13 @@ if (preg_match('/(Mozilla|Browser|Chrome|Safari|AppleWebKit|Opera|Links|Lynx|Bot
$ip = $_SERVER['REMOTE_ADDR']; $ip = $_SERVER['REMOTE_ADDR'];
// 'ip' query handling // 'ip' query handling
if (!$bb_cfg['ignore_reported_ip'] && isset($_GET['ip']) && $ip !== $_GET['ip']) { if (!config()->get('ignore_reported_ip') && isset($_GET['ip']) && $ip !== $_GET['ip']) {
if (!$bb_cfg['verify_reported_ip'] && isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { if (!config()->get('verify_reported_ip') && isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$x_ip = $_SERVER['HTTP_X_FORWARDED_FOR']; $x_ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
if ($x_ip === $_GET['ip']) { if ($x_ip === $_GET['ip']) {
$filteredIp = filter_var($x_ip, FILTER_VALIDATE_IP); $filteredIp = filter_var($x_ip, FILTER_VALIDATE_IP);
if ($filteredIp !== false && ($bb_cfg['allow_internal_ip'] || !filter_var($filteredIp, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE))) { if ($filteredIp !== false && (config()->get('allow_internal_ip') || !filter_var($filteredIp, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE))) {
$ip = $filteredIp; $ip = $filteredIp;
} }
} }
@ -247,9 +246,10 @@ if ($lp_info) {
$passkey_sql = DB()->escape($passkey); $passkey_sql = DB()->escape($passkey);
$sql = " $sql = "
SELECT tor.topic_id, tor.poster_id, tor.tor_type, tor.info_hash, tor.info_hash_v2, u.* SELECT tor.topic_id, tor.poster_id, tor.tor_type, tor.tor_status, tor.info_hash, tor.info_hash_v2, bt.*, u.user_level
FROM " . BB_BT_TORRENTS . " tor FROM " . BB_BT_TORRENTS . " tor
LEFT JOIN " . BB_BT_USERS . " u ON u.auth_key = '$passkey_sql' LEFT JOIN " . BB_BT_USERS . " bt ON bt.auth_key = '$passkey_sql'
LEFT JOIN " . BB_USERS . " u ON u.user_id = bt.user_id
$info_hash_where $info_hash_where
LIMIT 1 LIMIT 1
"; ";
@ -257,7 +257,7 @@ if ($lp_info) {
// Verify if torrent registered on tracker and user authorized // Verify if torrent registered on tracker and user authorized
if (empty($row['topic_id'])) { if (empty($row['topic_id'])) {
msg_die('Torrent not registered, info_hash = ' . (mb_check_encoding($info_hash, 'UTF8') ? $info_hash : $info_hash_hex)); msg_die('Torrent not registered, info_hash = ' . (mb_check_encoding($info_hash, DEFAULT_CHARSET) ? $info_hash : $info_hash_hex));
} }
if (empty($row['user_id'])) { if (empty($row['user_id'])) {
msg_die('Please LOG IN and RE-DOWNLOAD this torrent (user not found)'); msg_die('Please LOG IN and RE-DOWNLOAD this torrent (user not found)');
@ -265,13 +265,26 @@ if ($lp_info) {
// Assign variables // Assign variables
$user_id = $row['user_id']; $user_id = $row['user_id'];
define('IS_GUEST', (int)$user_id === GUEST_UID);
define('IS_ADMIN', !IS_GUEST && (int)$row['user_level'] === ADMIN);
define('IS_MOD', !IS_GUEST && (int)$row['user_level'] === MOD);
define('IS_GROUP_MEMBER', !IS_GUEST && (int)$row['user_level'] === GROUP_MEMBER);
define('IS_USER', !IS_GUEST && (int)$row['user_level'] === USER);
define('IS_SUPER_ADMIN', IS_ADMIN && isset(config()->get('super_admins')[$user_id]));
define('IS_AM', IS_ADMIN || IS_MOD);
$topic_id = $row['topic_id']; $topic_id = $row['topic_id'];
$releaser = (int)($user_id == $row['poster_id']); $releaser = (int)($user_id == $row['poster_id']);
$tor_type = $row['tor_type']; $tor_type = $row['tor_type'];
$tor_status = $row['tor_status'];
// Check tor status
if (!IS_AM && isset(config()->get('tor_frozen')[$tor_status]) && !(isset(config()->get('tor_frozen_author_download')[$tor_status]) && $releaser)) {
msg_die('Torrent frozen and cannot be downloaded');
}
// Check hybrid status // Check hybrid status
if (!empty($row['info_hash']) && !empty($row['info_hash_v2'])) { if (!empty($row['info_hash']) && !empty($row['info_hash_v2'])) {
$stat_protocol = match ((int)$bb_cfg['tracker']['hybrid_stat_protocol']) { $stat_protocol = match ((int)config()->get('tracker.hybrid_stat_protocol')) {
2 => substr($row['info_hash_v2'], 0, 20), 2 => substr($row['info_hash_v2'], 0, 20),
default => $row['info_hash'] // 1 default => $row['info_hash'] // 1
}; };
@ -281,7 +294,7 @@ if ($lp_info) {
} }
// Ratio limits // Ratio limits
if ((RATIO_ENABLED || $bb_cfg['tracker']['limit_concurrent_ips']) && !$stopped) { if ((RATIO_ENABLED || config()->get('tracker.limit_concurrent_ips')) && !$stopped) {
$user_ratio = get_bt_ratio($row); $user_ratio = get_bt_ratio($row);
if ($user_ratio === null) { if ($user_ratio === null) {
$user_ratio = 1; $user_ratio = 1;
@ -289,10 +302,10 @@ if ($lp_info) {
$rating_msg = ''; $rating_msg = '';
if (!$seeder) { if (!$seeder) {
foreach ($bb_cfg['rating'] as $ratio => $limit) { foreach (config()->get('rating') as $ratio => $limit) {
if ($user_ratio < $ratio) { if ($user_ratio < $ratio) {
$bb_cfg['tracker']['limit_active_tor'] = 1; config()->set('tracker.limit_active_tor', 1);
$bb_cfg['tracker']['limit_leech_count'] = $limit; config()->set('tracker.limit_leech_count', $limit);
$rating_msg = " (ratio < $ratio)"; $rating_msg = " (ratio < $ratio)";
break; break;
} }
@ -300,29 +313,29 @@ if ($lp_info) {
} }
// Limit active torrents // Limit active torrents
if (!isset($bb_cfg['unlimited_users'][$user_id]) && $bb_cfg['tracker']['limit_active_tor'] && (($bb_cfg['tracker']['limit_seed_count'] && $seeder) || ($bb_cfg['tracker']['limit_leech_count'] && !$seeder))) { if (!isset(config()->get('unlimited_users')[$user_id]) && config()->get('tracker.limit_active_tor') && ((config()->get('tracker.limit_seed_count') && $seeder) || (config()->get('tracker.limit_leech_count') && !$seeder))) {
$sql = "SELECT COUNT(DISTINCT topic_id) AS active_torrents $sql = "SELECT COUNT(DISTINCT topic_id) AS active_torrents
FROM " . BB_BT_TRACKER . " FROM " . BB_BT_TRACKER . "
WHERE user_id = $user_id WHERE user_id = $user_id
AND seeder = $seeder AND seeder = $seeder
AND topic_id != $topic_id"; AND topic_id != $topic_id";
if (!$seeder && $bb_cfg['tracker']['leech_expire_factor'] && $user_ratio < 0.5) { if (!$seeder && config()->get('tracker.leech_expire_factor') && $user_ratio < 0.5) {
$sql .= " AND update_time > " . (TIMENOW - 60 * $bb_cfg['tracker']['leech_expire_factor']); $sql .= " AND update_time > " . (TIMENOW - 60 * config()->get('tracker.leech_expire_factor'));
} }
$sql .= " GROUP BY user_id"; $sql .= " GROUP BY user_id";
if ($row = DB()->fetch_row($sql)) { if ($row = DB()->fetch_row($sql)) {
if ($seeder && $bb_cfg['tracker']['limit_seed_count'] && $row['active_torrents'] >= $bb_cfg['tracker']['limit_seed_count']) { if ($seeder && config()->get('tracker.limit_seed_count') && $row['active_torrents'] >= config()->get('tracker.limit_seed_count')) {
msg_die('Only ' . $bb_cfg['tracker']['limit_seed_count'] . ' torrent(s) allowed for seeding'); msg_die('Only ' . config()->get('tracker.limit_seed_count') . ' torrent(s) allowed for seeding');
} elseif (!$seeder && $bb_cfg['tracker']['limit_leech_count'] && $row['active_torrents'] >= $bb_cfg['tracker']['limit_leech_count']) { } elseif (!$seeder && config()->get('tracker.limit_leech_count') && $row['active_torrents'] >= config()->get('tracker.limit_leech_count')) {
msg_die('Only ' . $bb_cfg['tracker']['limit_leech_count'] . ' torrent(s) allowed for leeching' . $rating_msg); msg_die('Only ' . config()->get('tracker.limit_leech_count') . ' torrent(s) allowed for leeching' . $rating_msg);
} }
} }
} }
// Limit concurrent IPs // Limit concurrent IPs
if ($bb_cfg['tracker']['limit_concurrent_ips'] && (($bb_cfg['tracker']['limit_seed_ips'] && $seeder) || ($bb_cfg['tracker']['limit_leech_ips'] && !$seeder))) { if (config()->get('tracker.limit_concurrent_ips') && ((config()->get('tracker.limit_seed_ips') && $seeder) || (config()->get('tracker.limit_leech_ips') && !$seeder))) {
$sql = "SELECT COUNT(DISTINCT ip) AS ips $sql = "SELECT COUNT(DISTINCT ip) AS ips
FROM " . BB_BT_TRACKER . " FROM " . BB_BT_TRACKER . "
WHERE topic_id = $topic_id WHERE topic_id = $topic_id
@ -330,16 +343,16 @@ if ($lp_info) {
AND seeder = $seeder AND seeder = $seeder
AND $ip_version != '$ip_sql'"; AND $ip_version != '$ip_sql'";
if (!$seeder && $bb_cfg['tracker']['leech_expire_factor']) { if (!$seeder && config()->get('tracker.leech_expire_factor')) {
$sql .= " AND update_time > " . (TIMENOW - 60 * $bb_cfg['tracker']['leech_expire_factor']); $sql .= " AND update_time > " . (TIMENOW - 60 * config()->get('tracker.leech_expire_factor'));
} }
$sql .= " GROUP BY topic_id"; $sql .= " GROUP BY topic_id";
if ($row = DB()->fetch_row($sql)) { if ($row = DB()->fetch_row($sql)) {
if ($seeder && $bb_cfg['tracker']['limit_seed_ips'] && $row['ips'] >= $bb_cfg['tracker']['limit_seed_ips']) { if ($seeder && config()->get('tracker.limit_seed_ips') && $row['ips'] >= config()->get('tracker.limit_seed_ips')) {
msg_die('You can seed only from ' . $bb_cfg['tracker']['limit_seed_ips'] . " IP's"); msg_die('You can seed only from ' . config()->get('tracker.limit_seed_ips') . " IP's");
} elseif (!$seeder && $bb_cfg['tracker']['limit_leech_ips'] && $row['ips'] >= $bb_cfg['tracker']['limit_leech_ips']) { } elseif (!$seeder && config()->get('tracker.limit_leech_ips') && $row['ips'] >= config()->get('tracker.limit_leech_ips')) {
msg_die('You can leech only from ' . $bb_cfg['tracker']['limit_leech_ips'] . " IP's"); msg_die('You can leech only from ' . config()->get('tracker.limit_leech_ips') . " IP's");
} }
} }
} }
@ -363,7 +376,7 @@ $up_add = ($lp_info && $uploaded > $lp_info['uploaded']) ? $uploaded - $lp_info[
$down_add = ($lp_info && $downloaded > $lp_info['downloaded']) ? $downloaded - $lp_info['downloaded'] : 0; $down_add = ($lp_info && $downloaded > $lp_info['downloaded']) ? $downloaded - $lp_info['downloaded'] : 0;
// Gold/Silver releases // Gold/Silver releases
if ($bb_cfg['tracker']['gold_silver_enabled'] && $down_add) { if (config()->get('tracker.gold_silver_enabled') && $down_add) {
if ($tor_type == TOR_TYPE_GOLD) { if ($tor_type == TOR_TYPE_GOLD) {
$down_add = 0; $down_add = 0;
} // Silver releases } // Silver releases
@ -373,7 +386,7 @@ if ($bb_cfg['tracker']['gold_silver_enabled'] && $down_add) {
} }
// Freeleech // Freeleech
if ($bb_cfg['tracker']['freeleech'] && $down_add) { if (config()->get('tracker.freeleech') && $down_add) {
$down_add = 0; $down_add = 0;
} }
@ -451,8 +464,8 @@ $output = CACHE('tr_cache')->get(PEERS_LIST_PREFIX . $topic_id);
if (!$output) { if (!$output) {
// Retrieve peers // Retrieve peers
$numwant = (int)$bb_cfg['tracker']['numwant']; $numwant = (int)config()->get('tracker.numwant');
$compact_mode = ($bb_cfg['tracker']['compact_mode'] || !empty($compact)); $compact_mode = (config()->get('tracker.compact_mode') || !empty($compact));
$rowset = DB()->fetch_rowset(" $rowset = DB()->fetch_rowset("
SELECT ip, ipv6, port SELECT ip, ipv6, port
@ -497,7 +510,7 @@ if (!$output) {
$seeders = $leechers = $client_completed = 0; $seeders = $leechers = $client_completed = 0;
if ($bb_cfg['tracker']['scrape']) { if (config()->get('tracker.scrape')) {
$row = DB()->fetch_row(" $row = DB()->fetch_row("
SELECT seeders, leechers, completed SELECT seeders, leechers, completed
FROM " . BB_BT_TRACKER_SNAP . " FROM " . BB_BT_TRACKER_SNAP . "

View file

@ -1 +0,0 @@
Require all denied

View file

@ -11,11 +11,9 @@ if (!defined('IN_TRACKER')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
global $bb_cfg;
// Exit if tracker is disabled // Exit if tracker is disabled
if ($bb_cfg['tracker']['bt_off']) { if (config()->get('tracker.bt_off')) {
msg_die($bb_cfg['tracker']['bt_off_reason']); msg_die(config()->get('tracker.bt_off_reason'));
} }
// //

View file

@ -11,9 +11,7 @@ define('IN_TRACKER', true);
define('BB_ROOT', './../'); define('BB_ROOT', './../');
require dirname(__DIR__) . '/common.php'; require dirname(__DIR__) . '/common.php';
global $bb_cfg; if (!config()->get('tracker.scrape')) {
if (!$bb_cfg['tracker']['scrape']) {
msg_die('Please disable SCRAPE!'); msg_die('Please disable SCRAPE!');
} }
@ -34,7 +32,7 @@ $info_hash_hex = bin2hex($info_hash);
// Check info_hash length // Check info_hash length
if (strlen($info_hash) !== 20) { if (strlen($info_hash) !== 20) {
msg_die('Invalid info_hash: ' . (mb_check_encoding($info_hash, 'UTF8') ? $info_hash : $info_hash_hex)); msg_die('Invalid info_hash: ' . (mb_check_encoding($info_hash, DEFAULT_CHARSET) ? $info_hash : $info_hash_hex));
} }
// Handle multiple hashes // Handle multiple hashes
@ -60,8 +58,8 @@ foreach ($info_hash_array[1] as $hash) {
$info_hash_count = count($info_hashes); $info_hash_count = count($info_hashes);
if (!empty($info_hash_count)) { if (!empty($info_hash_count)) {
if ($info_hash_count > $bb_cfg['max_scrapes']) { if ($info_hash_count > config()->get('max_scrapes')) {
$info_hashes = array_slice($info_hashes, 0, $bb_cfg['max_scrapes']); $info_hashes = array_slice($info_hashes, 0, config()->get('max_scrapes'));
} }
$info_hashes_sql = implode('\', \'', $info_hashes); $info_hashes_sql = implode('\', \'', $info_hashes);
@ -99,7 +97,7 @@ if (!empty($info_hash_count)) {
// Verify if torrent registered on tracker // Verify if torrent registered on tracker
if (empty($torrents)) { if (empty($torrents)) {
msg_die('Torrent not registered, info_hash = ' . (mb_check_encoding($info_hash, 'UTF8') ? $info_hash : $info_hash_hex)); msg_die('Torrent not registered, info_hash = ' . (mb_check_encoding($info_hash, DEFAULT_CHARSET) ? $info_hash : $info_hash_hex));
} }
die(\Arokettu\Bencode\Bencode::encode($torrents)); die(\Arokettu\Bencode\Bencode::encode($torrents));

View file

@ -14,8 +14,6 @@ repo = "torrentpier"
header = """ header = """
[![TorrentPier](https://raw.githubusercontent.com/torrentpier/.github/refs/heads/main/versions/Cattle.png)](https://github.com/torrentpier)\n [![TorrentPier](https://raw.githubusercontent.com/torrentpier/.github/refs/heads/main/versions/Cattle.png)](https://github.com/torrentpier)\n
# 📖 Change Log\n # 📖 Change Log\n
> [!NOTE]
> To view changelog from **v2.0.0** to **v2.4.5-rc.2** navigate to [HISTORY.md](HISTORY.md).
""" """
# template for the changelog body # template for the changelog body
# https://keats.github.io/tera/docs/#introduction # https://keats.github.io/tera/docs/#introduction
@ -25,7 +23,7 @@ body = """
{%- endmacro -%} {%- endmacro -%}
{%- macro nightly_url() -%} {%- macro nightly_url() -%}
https://nightly.link/{{ remote.github.owner }}/{{ remote.github.repo }}/workflows/build/master/TorrentPier https://nightly.link/{{ remote.github.owner }}/{{ remote.github.repo }}/workflows/ci/master/TorrentPier-master
{%- endmacro -%} {%- endmacro -%}
{% macro print_commit(commit) -%} {% macro print_commit(commit) -%}
@ -64,16 +62,17 @@ body = """
## New Contributors ❤️ ## New Contributors ❤️
{% endif %}\ {% endif %}\
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %} {% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
* [@{{ contributor.username }}](https://github.com/{{ contributor.username }}) made their first contribution * @{{ contributor.username }} made their first contribution
{%- if contributor.pr_number %} in \ {%- if contributor.pr_number %} in \
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \ [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
{%- endif %} {%- endif %}
{%- endfor -%} {%- endfor -%}
{%- endif %} {%- endif %}
""" """
# template for the changelog footer # template for the changelog footer
footer = """ footer = """
<!-- generated by git-cliff -->
""" """
# remove the leading and trailing whitespace from the templates # remove the leading and trailing whitespace from the templates
trim = true trim = true
@ -106,11 +105,11 @@ commit_parsers = [
{ message = "^refactor", group = "<!-- 2 -->🚜 Refactor" }, { message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
{ message = "^style", group = "<!-- 5 -->🎨 Styling" }, { message = "^style", group = "<!-- 5 -->🎨 Styling" },
{ message = "^test", group = "<!-- 6 -->🧪 Testing" }, { message = "^test", group = "<!-- 6 -->🧪 Testing" },
{ message = "^ignore|^release", skip = true }, { message = "^ignore|^release|^changelog", skip = true },
{ message = "^chore|^ci|^misc", group = "<!-- 7 -->⚙️ Miscellaneous" }, { message = "^chore|^ci|^misc", group = "<!-- 7 -->⚙️ Miscellaneous" },
{ body = ".*security", group = "<!-- 8 -->🛡️ Security" }, { body = ".*security", group = "<!-- 8 -->🛡️ Security" },
{ message = "^revert", group = "<!-- 9 -->◀️ Revert" }, { message = "^revert", group = "<!-- 9 -->◀️ Revert" },
{ message = "^crowdin", group = "<!-- 10 -->🈳 New translations" }, # crowdin pulls supporting { message = "^crowdin|^crodwin", group = "<!-- 10 -->🈳 New translations" }, # crowdin pulls supporting
{ message = "^Composer", group = "<!-- 11 -->📦 Dependencies" }, # dependabot pulls supporting { message = "^Composer", group = "<!-- 11 -->📦 Dependencies" }, # dependabot pulls supporting
{ message = "^rem|^drop|^removed", group = "<!-- 12 -->🗑️ Removed" }, { message = "^rem|^drop|^removed", group = "<!-- 12 -->🗑️ Removed" },
{ message = ".*", group = "<!-- 13 -->💼 Other" }, { message = ".*", group = "<!-- 13 -->💼 Other" },

View file

@ -86,69 +86,138 @@ if (is_file(BB_PATH . '/library/config.local.php')) {
require_once BB_PATH . '/library/config.local.php'; require_once BB_PATH . '/library/config.local.php';
} }
/** @noinspection PhpUndefinedVariableInspection */
// Initialize Config singleton, bb_cfg from global file config
$config = \TorrentPier\Config::init($bb_cfg);
/**
* Get the Config instance
*
* @return \TorrentPier\Config
*/
function config(): \TorrentPier\Config
{
return \TorrentPier\Config::getInstance();
}
/**
* Get the Censor instance
*
* @return \TorrentPier\Censor
*/
function censor(): \TorrentPier\Censor
{
return \TorrentPier\Censor::getInstance();
}
/**
* Get the Dev instance
*
* @return \TorrentPier\Dev
*/
function dev(): \TorrentPier\Dev
{
return \TorrentPier\Dev::getInstance();
}
/**
* Get the Language instance
*
* @return \TorrentPier\Language
*/
function lang(): \TorrentPier\Language
{
return \TorrentPier\Language::getInstance();
}
/**
* Get a language string (shorthand for lang()->get())
*
* @param string $key Language key, supports dot notation (e.g., 'DATETIME.TODAY')
* @param mixed $default Default value if key doesn't exist
* @return mixed Language string or default value
*/
function __(string $key, mixed $default = null): mixed
{
return \TorrentPier\Language::getInstance()->get($key, $default);
}
/**
* Echo a language string (shorthand for echo __())
*
* @param string $key Language key, supports dot notation
* @param mixed $default Default value if key doesn't exist
* @return void
*/
function _e(string $key, mixed $default = null): void
{
echo \TorrentPier\Language::getInstance()->get($key, $default);
}
/** /**
* Initialize debug * Initialize debug
*/ */
define('APP_ENV', env('APP_ENV', 'production')); define('APP_ENV', env('APP_ENV', 'production'));
if (APP_ENV === 'local') { if (APP_ENV === 'development') {
define('DBG_USER', true); // forced debug define('DBG_USER', true); // forced debug
} else { } else {
define('DBG_USER', isset($_COOKIE[COOKIE_DBG])); define('DBG_USER', isset($_COOKIE[COOKIE_DBG]));
} }
(new \TorrentPier\Dev()); (\TorrentPier\Dev::init());
/** /**
* Server variables initialize * Server variables initialize
*/ */
$server_protocol = $bb_cfg['cookie_secure'] ? 'https://' : 'http://'; $server_protocol = config()->get('cookie_secure') ? 'https://' : 'http://';
$server_port = in_array((int)$bb_cfg['server_port'], [80, 443], true) ? '' : ':' . $bb_cfg['server_port']; $server_port = in_array((int)config()->get('server_port'), [80, 443], true) ? '' : ':' . config()->get('server_port');
define('FORUM_PATH', $bb_cfg['script_path']); define('FORUM_PATH', config()->get('script_path'));
define('FULL_URL', $server_protocol . $bb_cfg['server_name'] . $server_port . $bb_cfg['script_path']); define('FULL_URL', $server_protocol . config()->get('server_name') . $server_port . config()->get('script_path'));
unset($server_protocol, $server_port); unset($server_protocol, $server_port);
/** // Initialize the new DB factory with database configuration
* Database TorrentPier\Database\DatabaseFactory::init(config()->get('db'), config()->get('db_alias', []));
*/
$DBS = new TorrentPier\Legacy\Dbs($bb_cfg);
function DB(string $db_alias = 'db') /**
* Get the Database instance
*
* @param string $db_alias
* @return \TorrentPier\Database\Database
*/
function DB(string $db_alias = 'db'): \TorrentPier\Database\Database
{ {
global $DBS; return TorrentPier\Database\DatabaseFactory::getInstance($db_alias);
return $DBS->get_db_obj($db_alias);
} }
/** // Initialize Unified Cache System
* Cache TorrentPier\Cache\UnifiedCacheSystem::getInstance(config()->all());
*/
$CACHES = new TorrentPier\Legacy\Caches($bb_cfg);
function CACHE(string $cache_name) /**
* Get cache manager instance (replaces legacy cache system)
*
* @param string $cache_name
* @return \TorrentPier\Cache\CacheManager
*/
function CACHE(string $cache_name): \TorrentPier\Cache\CacheManager
{ {
global $CACHES; return TorrentPier\Cache\UnifiedCacheSystem::getInstance()->get_cache_obj($cache_name);
return $CACHES->get_cache_obj($cache_name);
} }
/** /**
* Datastore * Get datastore manager instance (replaces legacy datastore system)
*
* @return \TorrentPier\Cache\DatastoreManager
*/ */
switch ($bb_cfg['datastore_type']) { function datastore(): \TorrentPier\Cache\DatastoreManager
case 'apcu': {
$datastore = new TorrentPier\Legacy\Datastore\APCu($bb_cfg['cache']['prefix']); return TorrentPier\Cache\UnifiedCacheSystem::getInstance()->getDatastore(config()->get('datastore_type', 'file'));
break;
case 'memcached':
$datastore = new TorrentPier\Legacy\Datastore\Memcached($bb_cfg['cache']['memcached'], $bb_cfg['cache']['prefix']);
break;
case 'sqlite':
$datastore = new TorrentPier\Legacy\Datastore\Sqlite($bb_cfg['cache']['db_dir'] . 'datastore', $bb_cfg['cache']['prefix']);
break;
case 'redis':
$datastore = new TorrentPier\Legacy\Datastore\Redis($bb_cfg['cache']['redis'], $bb_cfg['cache']['prefix']);
break;
case 'filecache':
default:
$datastore = new TorrentPier\Legacy\Datastore\File($bb_cfg['cache']['db_dir'] . 'datastore/', $bb_cfg['cache']['prefix']);
} }
/**
* Backward compatibility: Global datastore variable
* This allows existing code to continue using global $datastore
*/
$datastore = datastore();
// Functions // Functions
function utime() function utime()
{ {
@ -364,9 +433,9 @@ if (!defined('IN_TRACKER')) {
} else { } else {
define('DUMMY_PEER', pack('Nn', \TorrentPier\Helpers\IPHelper::ip2long($_SERVER['REMOTE_ADDR']), !empty($_GET['port']) ? (int)$_GET['port'] : random_int(1000, 65000))); define('DUMMY_PEER', pack('Nn', \TorrentPier\Helpers\IPHelper::ip2long($_SERVER['REMOTE_ADDR']), !empty($_GET['port']) ? (int)$_GET['port'] : random_int(1000, 65000)));
define('PEER_HASH_EXPIRE', round($bb_cfg['announce_interval'] * (0.85 * $bb_cfg['tracker']['expire_factor']))); define('PEER_HASH_EXPIRE', round(config()->get('announce_interval') * (0.85 * config()->get('tracker.expire_factor'))));
define('PEERS_LIST_EXPIRE', round($bb_cfg['announce_interval'] * 0.7)); define('PEERS_LIST_EXPIRE', round(config()->get('announce_interval') * 0.7));
define('SCRAPE_LIST_EXPIRE', round($bb_cfg['scrape_interval'] * 0.7)); define('SCRAPE_LIST_EXPIRE', round(config()->get('scrape_interval') * 0.7));
define('PEER_HASH_PREFIX', 'peer_'); define('PEER_HASH_PREFIX', 'peer_');
define('PEERS_LIST_PREFIX', 'peers_list_'); define('PEERS_LIST_PREFIX', 'peers_list_');

View file

@ -46,51 +46,57 @@
"forum": "https://torrentpier.com" "forum": "https://torrentpier.com"
}, },
"require": { "require": {
"php": "^8.1 | ^8.2 | ^8.3 | ^8.4", "php": ">=8.2",
"arokettu/random-polyfill": "1.0.2",
"arokettu/bencode": "^4.1.0", "arokettu/bencode": "^4.1.0",
"arokettu/monsterid": "dev-master", "arokettu/monsterid": "^4.1.0",
"arokettu/random-polyfill": "1.0.2",
"arokettu/torrent-file": "^5.2.1", "arokettu/torrent-file": "^5.2.1",
"belomaxorka/captcha": "1.*",
"bugsnag/bugsnag": "^v3.29.1", "bugsnag/bugsnag": "^v3.29.1",
"claviska/simpleimage": "^4.0", "claviska/simpleimage": "^4.0",
"egulias/email-validator": "^4.0.1", "egulias/email-validator": "^4.0.1",
"filp/whoops": "^2.15", "filp/whoops": "^2.15",
"z4kn4fein/php-semver": "^v3.0.0", "gemorroj/m3u-parser": "^6.0.1",
"nemorize/indexnow": "^0.0.1",
"gigablah/sphinxphp": "2.0.8", "gigablah/sphinxphp": "2.0.8",
"google/recaptcha": "^1.3", "google/recaptcha": "^1.3",
"jacklul/monolog-telegram": "^3.1", "jacklul/monolog-telegram": "^3.1",
"josantonius/cookie": "^2.0", "josantonius/cookie": "^2.0",
"gemorroj/m3u-parser": "dev-master",
"php-curl-class/php-curl-class": "^11.0.0",
"league/flysystem": "^3.28", "league/flysystem": "^3.28",
"longman/ip-tools": "1.2.1", "longman/ip-tools": "1.2.1",
"matthiasmullie/scrapbook": "^1.5.4",
"monolog/monolog": "^3.4", "monolog/monolog": "^3.4",
"nette/caching": "^3.3",
"nette/database": "^3.2",
"php-curl-class/php-curl-class": "^12.0.0",
"robmorgan/phinx": "^0.16.9",
"samdark/sitemap": "2.4.1", "samdark/sitemap": "2.4.1",
"symfony/finder": "^6.4", "symfony/mailer": "^7.3",
"symfony/filesystem": "^6.4", "symfony/polyfill": "v1.32.0",
"symfony/event-dispatcher": "^6.4", "vlucas/phpdotenv": "^5.5",
"symfony/mime": "^6.4", "z4kn4fein/php-semver": "^v3.0.0"
"symfony/mailer": "^6.4",
"symfony/polyfill": "v1.31.0",
"vlucas/phpdotenv": "^5.5"
}, },
"require-dev": { "require-dev": {
"symfony/var-dumper": "^6.4" "mockery/mockery": "^1.6",
"pestphp/pest": "^3.8",
"symfony/var-dumper": "^7.3"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"TorrentPier\\": "src/" "TorrentPier\\": "src/"
} }
}, },
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"config": { "config": {
"sort-packages": true, "sort-packages": true,
"optimize-autoloader": true, "optimize-autoloader": true,
"allow-plugins": { "allow-plugins": {
"pestphp/pest-plugin": true,
"php-http/discovery": true "php-http/discovery": true
} }
}, },
"minimum-stability": "dev", "minimum-stability": "stable",
"prefer-stable": true "prefer-stable": true
} }

4710
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,3 +0,0 @@
php_flag engine off
RemoveHandler .php .php5 .php4 .php3 .phtml .pl .asp
AddType text/plain .php .php .htm .html .phtml .pl .asp

6
dl.php
View file

@ -25,7 +25,7 @@ $m3u = isset($_GET['m3u']) && $_GET['m3u'];
// Send file to browser // Send file to browser
function send_file_to_browser($attachment, $upload_dir) function send_file_to_browser($attachment, $upload_dir)
{ {
global $bb_cfg, $lang; global $lang;
$filename = $upload_dir . '/' . $attachment['physical_filename']; $filename = $upload_dir . '/' . $attachment['physical_filename'];
$gotit = false; $gotit = false;
@ -170,7 +170,7 @@ if (!IS_AM && ($attachment['mimetype'] === TORRENT_MIMETYPE)) {
$row = DB()->sql_fetchrow($result); $row = DB()->sql_fetchrow($result);
if (isset($bb_cfg['tor_frozen'][$row['tor_status']]) && !(isset($bb_cfg['tor_frozen_author_download'][$row['tor_status']]) && $userdata['user_id'] === $row['poster_id'])) { if (isset(config()->get('tor_frozen')[$row['tor_status']]) && !(isset(config()->get('tor_frozen_author_download')[$row['tor_status']]) && $userdata['user_id'] === $row['poster_id'])) {
bb_die($lang['TOR_STATUS_FORBIDDEN'] . $lang['TOR_STATUS_NAME'][$row['tor_status']]); bb_die($lang['TOR_STATUS_FORBIDDEN'] . $lang['TOR_STATUS_NAME'][$row['tor_status']]);
} }
@ -219,7 +219,7 @@ switch ($download_mode) {
header('Location: ' . $url); header('Location: ' . $url);
exit; exit;
case INLINE_LINK: case INLINE_LINK:
if (IS_GUEST && !$bb_cfg['captcha']['disabled'] && !bb_captcha('check')) { if (IS_GUEST && !config()->get('captcha.disabled') && !bb_captcha('check')) {
global $template; global $template;
$redirect_url = $_POST['redirect_url'] ?? $_SERVER['HTTP_REFERER'] ?? '/'; $redirect_url = $_POST['redirect_url'] ?? $_SERVER['HTTP_REFERER'] ?? '/';

View file

@ -34,11 +34,11 @@ if ($mode === 'get_feed_url' && ($type === 'f' || $type === 'u') && $id >= 0) {
bb_simple_die($lang['ATOM_ERROR'] . ' #1'); bb_simple_die($lang['ATOM_ERROR'] . ' #1');
} }
} }
if (is_file($bb_cfg['atom']['path'] . '/f/' . $id . '.atom') && filemtime($bb_cfg['atom']['path'] . '/f/' . $id . '.atom') > $timecheck) { if (is_file(config()->get('atom.path') . '/f/' . $id . '.atom') && filemtime(config()->get('atom.path') . '/f/' . $id . '.atom') > $timecheck) {
redirect($bb_cfg['atom']['url'] . '/f/' . $id . '.atom'); redirect(config()->get('atom.url') . '/f/' . $id . '.atom');
} else { } else {
if (\TorrentPier\Legacy\Atom::update_forum_feed($id, $forum_data)) { if (\TorrentPier\Legacy\Atom::update_forum_feed($id, $forum_data)) {
redirect($bb_cfg['atom']['url'] . '/f/' . $id . '.atom'); redirect(config()->get('atom.url') . '/f/' . $id . '.atom');
} else { } else {
bb_simple_die($lang['ATOM_NO_FORUM']); bb_simple_die($lang['ATOM_NO_FORUM']);
} }
@ -52,11 +52,11 @@ if ($mode === 'get_feed_url' && ($type === 'f' || $type === 'u') && $id >= 0) {
if (!$username = get_username($id)) { if (!$username = get_username($id)) {
bb_simple_die($lang['ATOM_ERROR'] . ' #3'); bb_simple_die($lang['ATOM_ERROR'] . ' #3');
} }
if (is_file($bb_cfg['atom']['path'] . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom') && filemtime($bb_cfg['atom']['path'] . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom') > $timecheck) { if (is_file(config()->get('atom.path') . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom') && filemtime(config()->get('atom.path') . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom') > $timecheck) {
redirect($bb_cfg['atom']['url'] . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom'); redirect(config()->get('atom.url') . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom');
} else { } else {
if (\TorrentPier\Legacy\Atom::update_user_feed($id, $username)) { if (\TorrentPier\Legacy\Atom::update_user_feed($id, $username)) {
redirect($bb_cfg['atom']['url'] . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom'); redirect(config()->get('atom.url') . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom');
} else { } else {
bb_simple_die($lang['ATOM_NO_USER']); bb_simple_die($lang['ATOM_NO_USER']);
} }

View file

@ -14,7 +14,7 @@ require __DIR__ . '/common.php';
// Start session management // Start session management
$user->session_start(); $user->session_start();
if ($bb_cfg['bt_disable_dht'] && IS_GUEST) { if (config()->get('bt_disable_dht') && IS_GUEST) {
bb_die($lang['BT_PRIVATE_TRACKER'], 403); bb_die($lang['BT_PRIVATE_TRACKER'], 403);
} }
@ -23,7 +23,7 @@ if (!$topic_id) {
bb_die($lang['INVALID_TOPIC_ID'], 404); bb_die($lang['INVALID_TOPIC_ID'], 404);
} }
$sql = 'SELECT t.attach_id, t.info_hash, t.info_hash_v2, t.size, ad.physical_filename $sql = 'SELECT t.forum_id, t.attach_id, t.info_hash, t.info_hash_v2, t.size, ad.physical_filename
FROM ' . BB_BT_TORRENTS . ' t FROM ' . BB_BT_TORRENTS . ' t
LEFT JOIN ' . BB_ATTACHMENTS_DESC . ' ad LEFT JOIN ' . BB_ATTACHMENTS_DESC . ' ad
ON t.attach_id = ad.attach_id ON t.attach_id = ad.attach_id
@ -34,6 +34,12 @@ if (!$row = DB()->fetch_row($sql)) {
bb_die($lang['INVALID_TOPIC_ID_DB'], 404); bb_die($lang['INVALID_TOPIC_ID_DB'], 404);
} }
// Check rights
$is_auth = auth(AUTH_ALL, $row['forum_id'], $userdata);
if (!$is_auth['auth_view']) {
bb_die($lang['SORRY_AUTH_VIEW_ATTACH'], 403);
}
// Protocol meta // Protocol meta
$meta_v1 = !empty($row['info_hash']); $meta_v1 = !empty($row['info_hash']);
$meta_v2 = !empty($row['info_hash_v2']); $meta_v2 = !empty($row['info_hash_v2']);
@ -49,7 +55,7 @@ if (!is_file($file_path)) {
} }
$file_contents = file_get_contents($file_path); $file_contents = file_get_contents($file_path);
if ($bb_cfg['flist_max_files']) { if (config()->get('flist_max_files')) {
$filetree_pos = $meta_v2 ? strpos($file_contents, '9:file tree') : false; $filetree_pos = $meta_v2 ? strpos($file_contents, '9:file tree') : false;
$files_pos = $meta_v1 ? strpos($file_contents, '5:files', $filetree_pos) : false; $files_pos = $meta_v1 ? strpos($file_contents, '5:files', $filetree_pos) : false;
@ -59,8 +65,8 @@ if ($bb_cfg['flist_max_files']) {
$file_count = substr_count($file_contents, '6:length', $files_pos); $file_count = substr_count($file_contents, '6:length', $files_pos);
} }
if ($file_count > $bb_cfg['flist_max_files']) { if ($file_count > config()->get('flist_max_files')) {
bb_die(sprintf($lang['BT_FLIST_LIMIT'], $bb_cfg['flist_max_files'], $file_count), 410); bb_die(sprintf($lang['BT_FLIST_LIMIT'], config()->get('flist_max_files'), $file_count), 410);
} }
} }
@ -76,7 +82,7 @@ if (IS_GUEST && $torrent->isPrivate()) {
// Get torrent files // Get torrent files
$files = $torrent->$t_version_field()->$t_files_field(); $files = $torrent->$t_version_field()->$t_files_field();
if ($meta_v1 && $meta_v2) { if ($meta_v2) {
$files = new \RecursiveIteratorIterator($files); // Flatten the list $files = new \RecursiveIteratorIterator($files); // Flatten the list
} }
@ -96,19 +102,6 @@ foreach ($files as $file) {
$torrent_name = !empty($t_name = $torrent->getName()) ? str_short(htmlCHR($t_name), 200) : $lang['UNKNOWN']; $torrent_name = !empty($t_name = $torrent->getName()) ? str_short(htmlCHR($t_name), 200) : $lang['UNKNOWN'];
$torrent_size = humn_size($row['size'], 2); $torrent_size = humn_size($row['size'], 2);
// Get announcers list
$announcers_list = $torrent->getAnnounceList()->toArray();
$announcers_count = 0;
foreach ($announcers_list as $announcer) {
$announcers_count++;
$row_class = ($announcers_count % 2) ? 'row1' : 'row2';
$template->assign_block_vars('announcers', [
'ROW_NUMBER' => $announcers_count,
'ROW_CLASS' => $row_class,
'ANNOUNCER' => $announcer[0]
]);
}
// Output page // Output page
$template->assign_vars([ $template->assign_vars([
'PAGE_TITLE' => "$torrent_name (" . $torrent_size . ")", 'PAGE_TITLE' => "$torrent_name (" . $torrent_size . ")",

View file

@ -24,7 +24,7 @@ set_die_append_msg();
$group_id = isset($_REQUEST[POST_GROUPS_URL]) ? (int)$_REQUEST[POST_GROUPS_URL] : null; $group_id = isset($_REQUEST[POST_GROUPS_URL]) ? (int)$_REQUEST[POST_GROUPS_URL] : null;
$start = isset($_REQUEST['start']) ? abs((int)$_REQUEST['start']) : 0; $start = isset($_REQUEST['start']) ? abs((int)$_REQUEST['start']) : 0;
$per_page = $bb_cfg['group_members_per_page']; $per_page = config()->get('group_members_per_page');
$view_mode = isset($_REQUEST['view']) ? (string)$_REQUEST['view'] : null; $view_mode = isset($_REQUEST['view']) ? (string)$_REQUEST['view'] : null;
$rel_limit = 50; $rel_limit = 50;
@ -168,7 +168,7 @@ if (!$group_id) {
\TorrentPier\Legacy\Group::add_user_into_group($group_id, $userdata['user_id'], 1, TIMENOW); \TorrentPier\Legacy\Group::add_user_into_group($group_id, $userdata['user_id'], 1, TIMENOW);
if ($bb_cfg['group_send_email']) { if (config()->get('group_send_email')) {
// Sending email // Sending email
$emailer = new TorrentPier\Emailer(); $emailer = new TorrentPier\Emailer();
@ -224,7 +224,7 @@ if (!$group_id) {
\TorrentPier\Legacy\Group::add_user_into_group($group_id, $row['user_id']); \TorrentPier\Legacy\Group::add_user_into_group($group_id, $row['user_id']);
if ($bb_cfg['group_send_email']) { if (config()->get('group_send_email')) {
// Sending email // Sending email
$emailer = new TorrentPier\Emailer(); $emailer = new TorrentPier\Emailer();
@ -273,10 +273,10 @@ if (!$group_id) {
} }
} }
// Email users when they are approved // Email users when they are approved
if (!empty($_POST['approve']) && $bb_cfg['group_send_email']) { if (!empty($_POST['approve']) && config()->get('group_send_email')) {
$sql_select = "SELECT username, user_email, user_lang $sql_select = "SELECT username, user_email, user_lang
FROM " . BB_USERS . " FROM " . BB_USERS . "
WHERE user_id IN($sql_in)"; WHERE user_id IN($sql_in)";
if (!$result = DB()->sql_query($sql_select)) { if (!$result = DB()->sql_query($sql_select)) {
bb_die('Could not get user email information'); bb_die('Could not get user email information');
@ -573,7 +573,7 @@ if (!$group_id) {
$template->assign_block_vars('pending', [ $template->assign_block_vars('pending', [
'ROW_CLASS' => $row_class, 'ROW_CLASS' => $row_class,
'AVATAR_IMG' => $pending_info['avatar'], 'AVATAR_IMG' => $pending_info['avatar'],
'USER' => profile_url($pending_info), 'USER' => profile_url($member),
'FROM' => $pending_info['from'], 'FROM' => $pending_info['from'],
'JOINED' => $pending_info['joined'], 'JOINED' => $pending_info['joined'],
'JOINED_RAW' => $pending_info['joined_raw'], 'JOINED_RAW' => $pending_info['joined_raw'],

View file

@ -35,10 +35,10 @@ if ($group_id) {
if ($is_moderator) { if ($is_moderator) {
// Avatar // Avatar
if ($submit) { if ($submit) {
if (!empty($_FILES['avatar']['name']) && $bb_cfg['group_avatars']['up_allowed']) { if (!empty($_FILES['avatar']['name']) && config()->get('group_avatars.up_allowed')) {
$upload = new TorrentPier\Legacy\Common\Upload(); $upload = new TorrentPier\Legacy\Common\Upload();
if ($upload->init($bb_cfg['group_avatars'], $_FILES['avatar']) and $upload->store('avatar', ['user_id' => GROUP_AVATAR_MASK . $group_id, 'avatar_ext_id' => $group_info['avatar_ext_id']])) { if ($upload->init(config()->get('group_avatars'), $_FILES['avatar']) and $upload->store('avatar', ['user_id' => GROUP_AVATAR_MASK . $group_id, 'avatar_ext_id' => $group_info['avatar_ext_id']])) {
$avatar_ext_id = (int)$upload->file_ext_id; $avatar_ext_id = (int)$upload->file_ext_id;
DB()->query("UPDATE " . BB_GROUPS . " SET avatar_ext_id = $avatar_ext_id WHERE group_id = $group_id LIMIT 1"); DB()->query("UPDATE " . BB_GROUPS . " SET avatar_ext_id = $avatar_ext_id WHERE group_id = $group_id LIMIT 1");
} else { } else {
@ -76,7 +76,7 @@ if ($is_moderator) {
'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_HIDDEN_FIELDS' => $s_hidden_fields,
'S_GROUP_CONFIG_ACTION' => "group_edit.php?" . POST_GROUPS_URL . "=$group_id", 'S_GROUP_CONFIG_ACTION' => "group_edit.php?" . POST_GROUPS_URL . "=$group_id",
'AVATAR_EXPLAIN' => sprintf($lang['AVATAR_EXPLAIN'], $bb_cfg['group_avatars']['max_width'], $bb_cfg['group_avatars']['max_height'], humn_size($bb_cfg['group_avatars']['max_size'])), 'AVATAR_EXPLAIN' => sprintf($lang['AVATAR_EXPLAIN'], config()->get('group_avatars.max_width'), config()->get('group_avatars.max_height'), humn_size(config()->get('group_avatars.max_size'))),
'AVATAR_IMG' => get_avatar(GROUP_AVATAR_MASK . $group_id, $group_info['avatar_ext_id']), 'AVATAR_IMG' => get_avatar(GROUP_AVATAR_MASK . $group_id, $group_info['avatar_ext_id']),
]); ]);

View file

@ -31,12 +31,12 @@ $datastore->enqueue([
'cat_forums' 'cat_forums'
]); ]);
if ($bb_cfg['show_latest_news']) { if (config()->get('show_latest_news')) {
$datastore->enqueue([ $datastore->enqueue([
'latest_news' 'latest_news'
]); ]);
} }
if ($bb_cfg['show_network_news']) { if (config()->get('show_network_news')) {
$datastore->enqueue([ $datastore->enqueue([
'network_news' 'network_news'
]); ]);
@ -45,8 +45,11 @@ if ($bb_cfg['show_network_news']) {
// Init userdata // Init userdata
$user->session_start(); $user->session_start();
// Set meta description
$page_cfg['meta_description'] = config()->get('site_desc');
// Init main vars // Init main vars
$viewcat = isset($_GET['c']) ? (int)$_GET['c'] : 0; $viewcat = isset($_GET[POST_CAT_URL]) ? (int)$_GET[POST_CAT_URL] : 0;
$lastvisit = IS_GUEST ? TIMENOW : $userdata['user_lastvisit']; $lastvisit = IS_GUEST ? TIMENOW : $userdata['user_lastvisit'];
// Caching output // Caching output
@ -54,7 +57,7 @@ $req_page = 'index_page';
$req_page .= $viewcat ? "_c{$viewcat}" : ''; $req_page .= $viewcat ? "_c{$viewcat}" : '';
define('REQUESTED_PAGE', $req_page); define('REQUESTED_PAGE', $req_page);
caching_output(IS_GUEST, 'send', REQUESTED_PAGE . '_guest_' . $bb_cfg['default_lang']); caching_output(IS_GUEST, 'send', REQUESTED_PAGE . '_guest_' . config()->get('default_lang'));
$hide_cat_opt = isset($user->opt_js['h_cat']) ? (string)$user->opt_js['h_cat'] : 0; $hide_cat_opt = isset($user->opt_js['h_cat']) ? (string)$user->opt_js['h_cat'] : 0;
$hide_cat_user = array_flip(explode('-', $hide_cat_opt)); $hide_cat_user = array_flip(explode('-', $hide_cat_opt));
@ -65,13 +68,15 @@ $tracking_topics = get_tracks('topic');
$tracking_forums = get_tracks('forum'); $tracking_forums = get_tracks('forum');
// Statistics // Statistics
if (!$stats = $datastore->get('stats')) { $stats = $datastore->get('stats');
if ($stats === false) {
$datastore->update('stats'); $datastore->update('stats');
$stats = $datastore->get('stats'); $stats = $datastore->get('stats');
} }
// Forums data // Forums data
if (!$forums = $datastore->get('cat_forums')) { $forums = $datastore->get('cat_forums');
if ($forums === false) {
$datastore->update('cat_forums'); $datastore->update('cat_forums');
$forums = $datastore->get('cat_forums'); $forums = $datastore->get('cat_forums');
} }
@ -80,6 +85,7 @@ $forum_name_html = $forums['forum_name_html'];
$anon = GUEST_UID; $anon = GUEST_UID;
$excluded_forums_csv = $user->get_excluded_forums(AUTH_VIEW); $excluded_forums_csv = $user->get_excluded_forums(AUTH_VIEW);
$excluded_forums_array = $excluded_forums_csv ? explode(',', $excluded_forums_csv) : [];
$only_new = $user->opt_js['only_new']; $only_new = $user->opt_js['only_new'];
// Validate requested category id // Validate requested category id
@ -173,7 +179,8 @@ if (!$cat_forums = CACHE('bb_cache')->get($cache_name)) {
// Obtain list of moderators // Obtain list of moderators
$moderators = []; $moderators = [];
if (!$mod = $datastore->get('moderators')) { $mod = $datastore->get('moderators');
if ($mod === false) {
$datastore->update('moderators'); $datastore->update('moderators');
$mod = $datastore->get('moderators'); $mod = $datastore->get('moderators');
} }
@ -255,7 +262,7 @@ foreach ($cat_forums as $cid => $c) {
'LAST_TOPIC_ID' => $f['last_topic_id'], 'LAST_TOPIC_ID' => $f['last_topic_id'],
'LAST_TOPIC_TIP' => $f['last_topic_title'], 'LAST_TOPIC_TIP' => $f['last_topic_title'],
'LAST_TOPIC_TITLE' => str_short($f['last_topic_title'], $last_topic_max_len), 'LAST_TOPIC_TITLE' => str_short($f['last_topic_title'], $last_topic_max_len),
'LAST_POST_TIME' => bb_date($f['last_post_time'], $bb_cfg['last_post_date_format']), 'LAST_POST_TIME' => bb_date($f['last_post_time'], config()->get('last_post_date_format')),
'LAST_POST_USER' => profile_url(['username' => str_short($f['last_post_username'], 15), 'user_id' => $f['last_post_user_id'], 'user_rank' => $f['last_post_user_rank']]), 'LAST_POST_USER' => profile_url(['username' => str_short($f['last_post_username'], 15), 'user_id' => $f['last_post_user_id'], 'user_rank' => $f['last_post_user_rank']]),
]); ]);
} }
@ -271,7 +278,7 @@ $template->assign_vars([
'TOTAL_TOPICS' => sprintf($lang['POSTED_TOPICS_TOTAL'], $stats['topiccount']), 'TOTAL_TOPICS' => sprintf($lang['POSTED_TOPICS_TOTAL'], $stats['topiccount']),
'TOTAL_POSTS' => sprintf($lang['POSTED_ARTICLES_TOTAL'], $stats['postcount']), 'TOTAL_POSTS' => sprintf($lang['POSTED_ARTICLES_TOTAL'], $stats['postcount']),
'TOTAL_USERS' => sprintf($lang['REGISTERED_USERS_TOTAL'], $stats['usercount']), 'TOTAL_USERS' => sprintf($lang['REGISTERED_USERS_TOTAL'], $stats['usercount']),
'TOTAL_GENDER' => $bb_cfg['gender'] ? sprintf( 'TOTAL_GENDER' => config()->get('gender') ? sprintf(
$lang['USERS_TOTAL_GENDER'], $lang['USERS_TOTAL_GENDER'],
$stats['male'], $stats['male'],
$stats['female'], $stats['female'],
@ -280,22 +287,22 @@ $template->assign_vars([
'NEWEST_USER' => sprintf($lang['NEWEST_USER'], profile_url($stats['newestuser'])), 'NEWEST_USER' => sprintf($lang['NEWEST_USER'], profile_url($stats['newestuser'])),
// Tracker stats // Tracker stats
'TORRENTS_STAT' => $bb_cfg['tor_stats'] ? sprintf( 'TORRENTS_STAT' => config()->get('tor_stats') ? sprintf(
$lang['TORRENTS_STAT'], $lang['TORRENTS_STAT'],
$stats['torrentcount'], $stats['torrentcount'],
humn_size($stats['size']) humn_size($stats['size'])
) : '', ) : '',
'PEERS_STAT' => $bb_cfg['tor_stats'] ? sprintf( 'PEERS_STAT' => config()->get('tor_stats') ? sprintf(
$lang['PEERS_STAT'], $lang['PEERS_STAT'],
$stats['peers'], $stats['peers'],
$stats['seeders'], $stats['seeders'],
$stats['leechers'] $stats['leechers']
) : '', ) : '',
'SPEED_STAT' => $bb_cfg['tor_stats'] ? sprintf( 'SPEED_STAT' => config()->get('tor_stats') ? sprintf(
$lang['SPEED_STAT'], $lang['SPEED_STAT'],
humn_size($stats['speed']) . '/s' humn_size($stats['speed']) . '/s'
) : '', ) : '',
'SHOW_MOD_INDEX' => $bb_cfg['show_mod_index'], 'SHOW_MOD_INDEX' => config()->get('show_mod_index'),
'FORUM_IMG' => $images['forum'], 'FORUM_IMG' => $images['forum'],
'FORUM_NEW_IMG' => $images['forum_new'], 'FORUM_NEW_IMG' => $images['forum_new'],
'FORUM_LOCKED_IMG' => $images['forum_locked'], 'FORUM_LOCKED_IMG' => $images['forum_locked'],
@ -308,20 +315,21 @@ $template->assign_vars([
'U_SEARCH_SELF_BY_MY' => "search.php?uid={$userdata['user_id']}&amp;o=1", 'U_SEARCH_SELF_BY_MY' => "search.php?uid={$userdata['user_id']}&amp;o=1",
'U_SEARCH_LATEST' => 'search.php?search_id=latest', 'U_SEARCH_LATEST' => 'search.php?search_id=latest',
'U_SEARCH_UNANSWERED' => 'search.php?search_id=unanswered', 'U_SEARCH_UNANSWERED' => 'search.php?search_id=unanswered',
'U_ATOM_FEED' => is_file($bb_cfg['atom']['path'] . '/f/0.atom') ? make_url($bb_cfg['atom']['url'] . '/f/0.atom') : false, 'U_ATOM_FEED' => is_file(config()->get('atom.path') . '/f/0.atom') ? make_url(config()->get('atom.url') . '/f/0.atom') : false,
'SHOW_LAST_TOPIC' => $show_last_topic, 'SHOW_LAST_TOPIC' => $show_last_topic,
'BOARD_START' => $bb_cfg['show_board_start_index'] ? ($lang['BOARD_STARTED'] . ':&nbsp;' . '<b>' . bb_date($bb_cfg['board_startdate']) . '</b>') : false, 'BOARD_START' => config()->get('show_board_start_index') ? ($lang['BOARD_STARTED'] . ':&nbsp;' . '<b>' . bb_date(config()->get('board_startdate')) . '</b>') : false,
]); ]);
// Set tpl vars for bt_userdata // Set tpl vars for bt_userdata
if ($bb_cfg['bt_show_dl_stat_on_index'] && !IS_GUEST) { if (config()->get('bt_show_dl_stat_on_index') && !IS_GUEST) {
show_bt_userdata($userdata['user_id']); show_bt_userdata($userdata['user_id']);
} }
// Latest news // Latest news
if ($bb_cfg['show_latest_news']) { if (config()->get('show_latest_news')) {
if (!$latest_news = $datastore->get('latest_news')) { $latest_news = $datastore->get('latest_news');
if ($latest_news === false) {
$datastore->update('latest_news'); $datastore->update('latest_news');
$latest_news = $datastore->get('latest_news'); $latest_news = $datastore->get('latest_news');
} }
@ -329,9 +337,13 @@ if ($bb_cfg['show_latest_news']) {
$template->assign_vars(['SHOW_LATEST_NEWS' => true]); $template->assign_vars(['SHOW_LATEST_NEWS' => true]);
foreach ($latest_news as $news) { foreach ($latest_news as $news) {
if (in_array($news['forum_id'], $excluded_forums_array)) {
continue;
}
$template->assign_block_vars('news', [ $template->assign_block_vars('news', [
'NEWS_TOPIC_ID' => $news['topic_id'], 'NEWS_TOPIC_ID' => $news['topic_id'],
'NEWS_TITLE' => str_short($wordCensor->censorString($news['topic_title']), $bb_cfg['max_news_title']), 'NEWS_TITLE' => str_short(censor()->censorString($news['topic_title']), config()->get('max_news_title')),
'NEWS_TIME' => bb_date($news['topic_time'], 'd-M', false), 'NEWS_TIME' => bb_date($news['topic_time'], 'd-M', false),
'NEWS_IS_NEW' => is_unread($news['topic_time'], $news['topic_id'], $news['forum_id']), 'NEWS_IS_NEW' => is_unread($news['topic_time'], $news['topic_id'], $news['forum_id']),
]); ]);
@ -339,8 +351,9 @@ if ($bb_cfg['show_latest_news']) {
} }
// Network news // Network news
if ($bb_cfg['show_network_news']) { if (config()->get('show_network_news')) {
if (!$network_news = $datastore->get('network_news')) { $network_news = $datastore->get('network_news');
if ($network_news === false) {
$datastore->update('network_news'); $datastore->update('network_news');
$network_news = $datastore->get('network_news'); $network_news = $datastore->get('network_news');
} }
@ -348,16 +361,20 @@ if ($bb_cfg['show_network_news']) {
$template->assign_vars(['SHOW_NETWORK_NEWS' => true]); $template->assign_vars(['SHOW_NETWORK_NEWS' => true]);
foreach ($network_news as $net) { foreach ($network_news as $net) {
if (in_array($net['forum_id'], $excluded_forums_array)) {
continue;
}
$template->assign_block_vars('net', [ $template->assign_block_vars('net', [
'NEWS_TOPIC_ID' => $net['topic_id'], 'NEWS_TOPIC_ID' => $net['topic_id'],
'NEWS_TITLE' => str_short($wordCensor->censorString($net['topic_title']), $bb_cfg['max_net_title']), 'NEWS_TITLE' => str_short(censor()->censorString($net['topic_title']), config()->get('max_net_title')),
'NEWS_TIME' => bb_date($net['topic_time'], 'd-M', false), 'NEWS_TIME' => bb_date($net['topic_time'], 'd-M', false),
'NEWS_IS_NEW' => is_unread($net['topic_time'], $net['topic_id'], $net['forum_id']), 'NEWS_IS_NEW' => is_unread($net['topic_time'], $net['topic_id'], $net['forum_id']),
]); ]);
} }
} }
if ($bb_cfg['birthday_check_day'] && $bb_cfg['birthday_enabled']) { if (config()->get('birthday_check_day') && config()->get('birthday_enabled')) {
$week_list = $today_list = []; $week_list = $today_list = [];
$week_all = $today_all = false; $week_all = $today_all = false;
@ -371,9 +388,9 @@ if ($bb_cfg['birthday_check_day'] && $bb_cfg['birthday_enabled']) {
$week_list[] = profile_url($week) . ' <span class="small">(' . birthday_age(date('Y-m-d', strtotime('-1 year', strtotime($week['user_birthday'])))) . ')</span>'; $week_list[] = profile_url($week) . ' <span class="small">(' . birthday_age(date('Y-m-d', strtotime('-1 year', strtotime($week['user_birthday'])))) . ')</span>';
} }
$week_all = $week_all ? '&nbsp;<a class="txtb" href="#" onclick="ajax.exec({action: \'index_data\', mode: \'birthday_week\'}); return false;" title="' . $lang['ALL'] . '">...</a>' : ''; $week_all = $week_all ? '&nbsp;<a class="txtb" href="#" onclick="ajax.exec({action: \'index_data\', mode: \'birthday_week\'}); return false;" title="' . $lang['ALL'] . '">...</a>' : '';
$week_list = sprintf($lang['BIRTHDAY_WEEK'], $bb_cfg['birthday_check_day'], implode(', ', $week_list)) . $week_all; $week_list = sprintf($lang['BIRTHDAY_WEEK'], config()->get('birthday_check_day'), implode(', ', $week_list)) . $week_all;
} else { } else {
$week_list = sprintf($lang['NOBIRTHDAY_WEEK'], $bb_cfg['birthday_check_day']); $week_list = sprintf($lang['NOBIRTHDAY_WEEK'], config()->get('birthday_check_day'));
} }
if (!empty($stats['birthday_today_list'])) { if (!empty($stats['birthday_today_list'])) {

View file

@ -16,8 +16,9 @@ $user->session_start();
$info = []; $info = [];
$htmlDir = LANG_DIR . 'html/'; $htmlDir = LANG_DIR . 'html/';
$show = isset($_REQUEST['show']) ? (string)$_REQUEST['show'] : '';
switch ((string)$_REQUEST['show'] ?? 'not_found') { switch ($show) {
case 'advert': case 'advert':
$info['title'] = $lang['ADVERT']; $info['title'] = $lang['ADVERT'];
$info['src'] = 'advert.html'; $info['src'] = 'advert.html';

View file

@ -7,18 +7,25 @@
* @license https://github.com/torrentpier/torrentpier/blob/master/LICENSE MIT License * @license https://github.com/torrentpier/torrentpier/blob/master/LICENSE MIT License
*/ */
define('BB_ROOT', __DIR__ . '/'); define('BB_ROOT', __DIR__ . DIRECTORY_SEPARATOR);
define('BB_PATH', BB_ROOT);
// Check CLI mode // Check CLI mode
if (php_sapi_name() !== 'cli') { if (PHP_SAPI != 'cli') {
die('Please run <code style="background:#222;color:#00e01f;padding:2px 6px;border-radius:3px;">php ' . basename(__FILE__) . '</code> in CLI mode'); die('Please run <code style="background:#222;color:#00e01f;padding:2px 6px;border-radius:3px;">php ' . basename(__FILE__) . '</code> in CLI mode');
} }
// Get all constants
require_once BB_ROOT . 'library/defines.php';
// Include CLI functions
require INC_DIR . '/functions_cli.php';
/** /**
* System requirements * System requirements
*/ */
define('CHECK_REQUIREMENTS', [ const CHECK_REQUIREMENTS = [
'php_min_version' => '8.1.0', 'php_min_version' => '8.2.0',
'ext_list' => [ 'ext_list' => [
'json', 'json',
'curl', 'curl',
@ -32,126 +39,7 @@ define('CHECK_REQUIREMENTS', [
'zip', 'zip',
'gd' 'gd'
], ],
]); ];
/**
* Colored console output
*
* @param string $str
* @param string $type
* @return void
*/
function out(string $str, string $type = ''): void
{
echo match ($type) {
'error' => "\033[31m$str \033[0m\n",
'success' => "\033[32m$str \033[0m\n",
'warning' => "\033[33m$str \033[0m\n",
'info' => "\033[36m$str \033[0m\n",
'debug' => "\033[90m$str \033[0m\n",
default => "$str\n",
};
}
/**
* Run process with realtime output
*
* @param string $cmd
* @param string|null $input
* @return void
*/
function runProcess(string $cmd, string $input = null): void
{
$descriptorSpec = [
0 => ['pipe', 'r'],
1 => ['pipe', 'w'],
2 => ['pipe', 'w'],
];
$process = proc_open($cmd, $descriptorSpec, $pipes);
if (!is_resource($process)) {
out('- Could not start subprocess', 'error');
return;
}
// Write input if provided
if ($input !== null) {
fwrite($pipes[0], $input);
fclose($pipes[0]);
}
// Read and print output in real-time
while (!feof($pipes[1])) {
echo stream_get_contents($pipes[1], 1);
flush(); // Flush output buffer for immediate display
}
// Read and print error output
while (!feof($pipes[2])) {
echo stream_get_contents($pipes[2], 1);
flush();
}
fclose($pipes[1]);
fclose($pipes[2]);
proc_close($process);
}
/**
* Remove directory recursively
*
* @param string $dir
* @return void
*/
function rmdir_rec(string $dir): void
{
$it = new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS);
$files = new RecursiveIteratorIterator($it,
RecursiveIteratorIterator::CHILD_FIRST);
foreach ($files as $file) {
if ($file->isDir()) {
rmdir($file->getPathname());
} else {
unlink($file->getPathname());
}
}
rmdir($dir);
}
/**
* Setting permissions recursively
*
* @param string $dir
* @param int $dirPermissions
* @param int $filePermissions
* @return void
*/
function chmod_r(string $dir, int $dirPermissions, int $filePermissions): void
{
$dp = opendir($dir);
while ($file = readdir($dp)) {
if (($file == '.') || ($file == '..')) {
continue;
}
$fullPath = realpath($dir . '/' . $file);
if (is_dir($fullPath)) {
out("- Directory: $fullPath");
chmod($fullPath, $dirPermissions);
chmod_r($fullPath, $dirPermissions, $filePermissions);
} elseif (is_file($fullPath)) {
// out("- File: $fullPath");
chmod($fullPath, $filePermissions);
} else {
out("- Cannot find target path: $fullPath", 'error');
return;
}
}
closedir($dp);
}
// Welcoming message // Welcoming message
out("--- TorrentPier Installer ---\n", 'info'); out("--- TorrentPier Installer ---\n", 'info');
@ -185,7 +73,7 @@ if (!defined('EXTENSIONS_NOT_INSTALLED')) {
if (is_file(BB_ROOT . '.env')) { if (is_file(BB_ROOT . '.env')) {
out('- TorrentPier already installed', 'warning'); out('- TorrentPier already installed', 'warning');
echo 'Are you sure want to re-install TorrentPier? [y/N]: '; echo 'Are you sure want to re-install TorrentPier? [y/N]: ';
if (str_starts_with(mb_strtolower(readline()), 'y')) { if (str_starts_with(mb_strtolower(trim(readline())), 'y')) {
out("\n- Re-install process started...", 'info'); out("\n- Re-install process started...", 'info');
// environment // environment
if (is_file(BB_ROOT . '.env')) { if (is_file(BB_ROOT . '.env')) {
@ -207,7 +95,7 @@ if (is_file(BB_ROOT . '.env')) {
} }
// composer dir // composer dir
if (is_dir(BB_ROOT . 'vendor')) { if (is_dir(BB_ROOT . 'vendor')) {
rmdir_rec(BB_ROOT . 'vendor'); removeDir(BB_ROOT . 'vendor', true);
if (!is_dir(BB_ROOT . 'vendor')) { if (!is_dir(BB_ROOT . 'vendor')) {
out("- Composer directory successfully removed!"); out("- Composer directory successfully removed!");
} else { } else {
@ -257,6 +145,7 @@ if (!is_file(BB_ROOT . 'vendor/autoload.php')) {
// Installing dependencies // Installing dependencies
if (is_file(BB_ROOT . 'composer.phar')) { if (is_file(BB_ROOT . 'composer.phar')) {
out('- Installing dependencies...', 'info'); out('- Installing dependencies...', 'info');
runProcess('php ' . BB_ROOT . 'composer.phar install --no-interaction --no-ansi'); runProcess('php ' . BB_ROOT . 'composer.phar install --no-interaction --no-ansi');
define('COMPOSER_COMPLETED', true); define('COMPOSER_COMPLETED', true);
} else { } else {
@ -288,7 +177,7 @@ if (is_file(BB_ROOT . '.env.example') && !is_file(BB_ROOT . '.env')) {
} }
// Editing ENV file // Editing ENV file
$DB_HOST = ''; $DB_HOST = 'localhost';
$DB_PORT = 3306; $DB_PORT = 3306;
$DB_DATABASE = ''; $DB_DATABASE = '';
$DB_USERNAME = ''; $DB_USERNAME = '';
@ -309,20 +198,23 @@ if (is_file(BB_ROOT . '.env')) {
if (trim($line) !== '' && !str_starts_with($line, '#')) { if (trim($line) !== '' && !str_starts_with($line, '#')) {
$parts = explode('=', $line, 2); $parts = explode('=', $line, 2);
$key = trim($parts[0]); $key = trim($parts[0]);
$value = (isset($parts[1]) && $key !== 'DB_PASSWORD') ? trim($parts[1]) : ''; $value = (!empty($parts[1]) && $key !== 'DB_PASSWORD') ? trim($parts[1]) : '';
// Database default values
if (in_array($key, ['DB_HOST', 'DB_PORT', 'DB_DATABASE', 'DB_USERNAME', 'DB_PASSWORD'])) {
$$key = $value;
}
out("\nCurrent value of $key: $value", 'debug'); out("\nCurrent value of $key: $value", 'debug');
echo "Enter a new value for $key (or leave empty to not change): "; echo "Enter a new value for $key (or leave empty to not change): ";
$newValue = readline(); $newValue = trim(readline());
if (!empty($newValue) || $key === 'DB_PASSWORD') { if (!empty($newValue) || $key === 'DB_PASSWORD') {
if ($key === 'TP_HOST') {
if (!preg_match('/^https?:\/\//', $newValue)) {
$newValue = 'https://' . $newValue;
}
$newValue = parse_url($newValue, PHP_URL_HOST);
}
$line = "$key=$newValue"; $line = "$key=$newValue";
$$key = $newValue; $$key = $newValue;
} else {
$$key = $value;
} }
} }
@ -372,35 +264,34 @@ if (!empty($DB_HOST) && !empty($DB_DATABASE) && !empty($DB_USERNAME)) {
} }
$conn->select_db($DB_DATABASE); $conn->select_db($DB_DATABASE);
// Checking SQL dump // Close database connection - migrations will handle their own connections
$dumpPath = BB_ROOT . 'install/sql/mysql.sql'; $conn->close();
if (is_file($dumpPath) && is_readable($dumpPath)) {
out('- SQL dump file found and readable!', 'success'); // Run database migrations
} else { out('- Setting up database using migrations...', 'info');
out('- SQL dump file not found / not readable', 'error');
// Check if phinx.php exists
if (!is_file(BB_ROOT . 'phinx.php')) {
out('- Migration configuration (phinx.php) not found', 'error');
exit; exit;
} }
// Inserting SQL dump // Run migrations
out('- Start importing SQL dump...', 'info'); $migrationResult = runProcess('php vendor/bin/phinx migrate --configuration=' . BB_ROOT . 'phinx.php');
$tempLine = ''; if ($migrationResult !== 0) {
foreach (file($dumpPath) as $line) { out('- Database migration failed', 'error');
if (str_starts_with($line, '--') || $line == '') { exit;
continue;
}
$tempLine .= $line;
if (str_ends_with(trim($line), ';')) {
if (!$conn->query($tempLine)) {
out("- Error performing query: $tempLine", 'error');
exit;
}
$tempLine = '';
}
} }
$conn->close(); out("- Database setup completed!\n", 'success');
out("- Importing SQL dump completed!\n", 'success');
// Autofill host in robots.txt
$robots_txt_file = BB_ROOT . 'robots.txt';
if (isset($TP_HOST) && is_file($robots_txt_file)) {
$content = file_get_contents($robots_txt_file);
$content = str_replace('example.com', $TP_HOST, $content);
file_put_contents($robots_txt_file, $content);
}
if (isset($APP_ENV) && $APP_ENV === 'local') { if (isset($APP_ENV) && $APP_ENV === 'local') {
if (!is_file(BB_ROOT . 'library/config.local.php')) { if (!is_file(BB_ROOT . 'library/config.local.php')) {
@ -418,5 +309,23 @@ if (!empty($DB_HOST) && !empty($DB_DATABASE) && !empty($DB_USERNAME)) {
} }
} }
// Cleanup...
if (is_file(BB_ROOT . '_cleanup.php')) {
out("\n--- Finishing installation (Cleanup) ---\n", 'info');
out('The cleanup process will remove:');
out('- Development documentation (README, CHANGELOG)', 'debug');
out('- Git configuration files', 'debug');
out('- CI/CD pipelines and code analysis tools', 'debug');
out('- Translation and contribution guidelines', 'debug');
echo 'Do you want to delete these files permanently? [y/N]: ';
if (str_starts_with(mb_strtolower(trim(readline())), 'y')) {
out("\n- Cleanup...", 'info');
require_once BB_ROOT . '_cleanup.php';
unlink(BB_ROOT . '_cleanup.php');
} else {
out('- Skipping...', 'info');
}
}
out("\n- Voila! Good luck & have fun!", 'success'); out("\n- Voila! Good luck & have fun!", 'success');
} }

View file

@ -1 +0,0 @@
Require all denied

27
install/Caddyfile Normal file
View file

@ -0,0 +1,27 @@
# Example Caddy configuration for TorrentPier
example.com {
root * /path/to/root
encode gzip zstd
php_fastcgi unix//run/php/php-fpm.sock
try_files {path} {path}/ /index.php?{query}
file_server
@blocked {
path /install/* /internal_data/* /library/*
path /.ht* /.en*
path /.git/*
path *.sql *.tpl *.db *.inc *.log *.md
}
respond @blocked 404
redir /sitemap.xml /sitemap/sitemap.xml
@html_css_js {
path *.html *.css *.js *.json *.xml *.txt
}
header @html_css_js Content-Type "{mime}; charset=utf-8"
}
# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile

39
install/nginx.conf Normal file
View file

@ -0,0 +1,39 @@
# Example nginx configuration for TorrentPier
server {
listen 80; # port
server_name example.com; # your domain
root /path/to/root; # folder with TorrentPier installed
index index.php;
charset utf-8;
location / {
try_files \$uri \$uri/ /index.php?\$args;
}
location ~ \/(install|internal_data|library)\/ {
return 404;
}
location ~ /\.(ht|en) {
return 404;
}
location ~ /\.git {
return 404;
}
location ~ \.(.*sql|tpl|db|inc|log|md)$ {
return 404;
}
rewrite ^/sitemap.xml$ /sitemap/sitemap.xml;
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/run/php/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
include fastcgi_params;
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,156 +0,0 @@
// Changes from v2.2.0 to 2.4.5
// 2.2.0
UPDATE `bb_config` SET `config_value` = 'http://whatismyipaddress.com/ip/' WHERE `config_name` = 'whois_info';
DELETE FROM `bb_smilies` WHERE `code` = ':ad:';
INSERT INTO `bb_smilies` (`code`, `smile_url`, `emoticon`) VALUES (':сd:', 'сd.gif', 'сd');
DROP TABLE IF EXISTS `bb_ads`;
DELETE FROM `bb_config` WHERE `config_name` = 'active_ads';
ALTER TABLE `bb_log` DROP COLUMN `log_username`;
DELETE FROM `bb_config` WHERE `config_name` = 'new_tpls';
UPDATE `bb_posts` SET `poster_ip` = '0';
ALTER TABLE `bb_posts` CHANGE `poster_ip` `poster_ip` varchar(42) NOT NULL DEFAULT '0';
UPDATE `bb_bt_tracker` SET `ip` = '0';
ALTER TABLE `bb_bt_tracker` CHANGE `ip` `ip` varchar(42) NOT NULL DEFAULT '0';
UPDATE `bb_users` SET `user_last_ip` = '0';
ALTER TABLE `bb_users` CHANGE `user_last_ip` `user_last_ip` varchar(42) NOT NULL DEFAULT '0';
UPDATE `bb_users` SET `user_reg_ip` = '0';
ALTER TABLE `bb_users` CHANGE `user_reg_ip` `user_reg_ip` varchar(42) NOT NULL DEFAULT '0';
UPDATE `bb_log` SET `log_user_ip` = '0';
ALTER TABLE `bb_log` CHANGE `log_user_ip` `log_user_ip` varchar(42) NOT NULL DEFAULT '0';
UPDATE `bb_poll_users` SET `vote_ip` = '0';
ALTER TABLE `bb_poll_users` CHANGE `vote_ip` `vote_ip` varchar(42) NOT NULL DEFAULT '0';
UPDATE `bb_privmsgs` SET `privmsgs_ip` = '0';
ALTER TABLE `bb_privmsgs` CHANGE `privmsgs_ip` `privmsgs_ip` varchar(42) NOT NULL DEFAULT '0';
UPDATE `bb_sessions` SET `session_ip` = '0';
ALTER TABLE `bb_sessions` CHANGE `session_ip` `session_ip` varchar(42) NOT NULL DEFAULT '0';
UPDATE `bb_banlist` SET `ban_ip` = '0';
ALTER TABLE `bb_banlist` CHANGE `ban_ip` `ban_ip` varchar(42) NOT NULL DEFAULT '0';
// 2.2.2
ALTER TABLE `bb_ranks` DROP `rank_min`;
ALTER TABLE `bb_ranks` DROP `rank_special`;
// 2.3.0
ALTER TABLE `bb_cron` CHANGE `last_run` `last_run` DATETIME NOT NULL DEFAULT '1900-01-01 00:00:00';
ALTER TABLE `bb_cron` CHANGE `next_run` `next_run` DATETIME NOT NULL DEFAULT '1900-01-01 00:00:00';
ALTER TABLE `bb_users` CHANGE `user_birthday` `user_birthday` DATE NOT NULL DEFAULT '1900-01-01';
ALTER TABLE `bb_posts` CHANGE `mc_comment` `mc_comment` TEXT NOT NULL DEFAULT '';
// 2.3.0.2
ALTER TABLE `bb_users` CHANGE `user_sig` `user_sig` TEXT NOT NULL DEFAULT '';
ALTER TABLE `bb_groups` CHANGE `group_signature` `group_signature` TEXT NOT NULL DEFAULT '';
ALTER TABLE `bb_groups` CHANGE `group_description` `group_description` TEXT NOT NULL DEFAULT '';
UPDATE `bb_smilies` SET `code` = ':cd:', `smile_url` = 'cd.gif', `emoticon` = 'cd' WHERE `code` = ':сd:' AND `smile_url` = 'сd.gif' AND `emoticon` = 'сd';
// 2.3.1
ALTER TABLE `bb_search_results` CHANGE `search_id` `search_id` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '';
ALTER TABLE `bb_users` CHANGE `autologin_id` `autologin_id` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '';
DELETE FROM `bb_config` WHERE `config_name` = 'cron_enabled';
// 2.4.0-alpha1
ALTER TABLE `bb_search_results` CHANGE `session_id` `session_id` CHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '';
ALTER TABLE `bb_sessions` CHANGE `session_id` `session_id` CHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '';
ALTER TABLE `bb_users` CHANGE `username` `username` VARCHAR(255) NOT NULL DEFAULT '';
ALTER TABLE `bb_users` CHANGE `user_password` `user_password` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '';
ALTER TABLE `bb_users` CHANGE `user_actkey` `user_actkey` VARCHAR(255) NOT NULL DEFAULT '';
ALTER TABLE `bb_users` CHANGE `user_newpasswd` `user_newpasswd` VARCHAR(255) NOT NULL DEFAULT '';
// 2.4.0-alpha3
INSERT INTO bb_config VALUES ('show_board_start_index', '1');
// 2.4.0-beta2
INSERT INTO `bb_cron` (`cron_active`, `cron_title`, `cron_script`, `schedule`, `run_day`, `run_time`, `run_order`,
`last_run`, `next_run`, `run_interval`, `log_enabled`, `log_file`, `log_sql_queries`,
`disable_board`, `run_counter`) VALUES ('1', 'PM cleanup', 'clean_pm.php', 'daily', '', '05:00:00', '70', '', '', '', '1', '', '0', '1', '0');
ALTER TABLE `bb_posts_text` CHANGE `post_text` `post_text` MEDIUMTEXT NOT NULL;
ALTER TABLE `bb_privmsgs_text` CHANGE `privmsgs_text` `privmsgs_text` MEDIUMTEXT NOT NULL;
ALTER TABLE `bb_bt_torrents` ADD COLUMN `info_hash_v2` VARBINARY(32) NOT NULL DEFAULT '';
ALTER TABLE `bb_bt_tracker_snap` ADD COLUMN `completed` INT(10) NOT NULL DEFAULT '0';
ALTER TABLE `bb_bt_tracker` CHANGE `complete` `complete` TINYINT(1) NOT NULL DEFAULT '0';
// 2.4.0-beta3
INSERT INTO `bb_extensions` (`group_id`, `extension`, `comment`) VALUES ('1', 'webp', '');
INSERT INTO `bb_extensions` (`group_id`, `extension`, `comment`) VALUES ('2', '7z', '');
INSERT INTO `bb_extensions` (`group_id`, `extension`, `comment`) VALUES ('1', 'bmp', '');
ALTER TABLE `bb_bt_tracker` CHANGE `speed_up` `speed_up` INT(11) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `bb_bt_tracker` CHANGE `speed_down` `speed_down` INT(11) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `bb_bt_tracker_snap` CHANGE `speed_up` `speed_up` INT(11) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `bb_bt_tracker_snap` CHANGE `speed_down` `speed_down` INT(11) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `bb_bt_torrents` ADD COLUMN `last_seeder_id` MEDIUMINT(8) NOT NULL DEFAULT '0';
ALTER TABLE `buf_last_seeder` ADD COLUMN `user_id` MEDIUMINT(8) NOT NULL DEFAULT '0';
ALTER TABLE `bb_bt_tracker` CHANGE `ip` `ip` VARCHAR(42) DEFAULT NULL;
ALTER TABLE `bb_bt_tracker` CHANGE `ipv6` `ipv6` VARCHAR(42) DEFAULT NULL;
ALTER TABLE `bb_bt_users` CHANGE `auth_key` `auth_key` CHAR(20) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '';
// 2.4.0-beta4
DELETE FROM `bb_extensions` WHERE `extension` = 'tif';
INSERT INTO `bb_extensions` (`group_id`, `extension`, `comment`) VALUES ('4', 'tif', '');
INSERT INTO `bb_extensions` (`group_id`, `extension`, `comment`) VALUES ('4', 'tiff', '');
DELETE FROM `bb_extensions` WHERE `extension` = 'tga';
INSERT INTO `bb_extensions` (`group_id`, `extension`, `comment`) VALUES ('4', 'tga', '');
// 2.4.0-rc1
ALTER TABLE `bb_bt_tracker` DROP COLUMN `client`;
DROP TABLE IF EXISTS `bb_thx`;
CREATE TABLE IF NOT EXISTS `bb_thx`
(
`topic_id` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0',
`user_id` MEDIUMINT(8) NOT NULL DEFAULT '0',
`time` INT(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`topic_id`, `user_id`)
)
ENGINE = MyISAM
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci;
// 2.4.0
UPDATE `bb_attachments_config` SET `config_value` = 'data/uploads' WHERE `config_name` = 'upload_dir';
UPDATE `bb_attachments_config` SET `config_value` = '12000' WHERE `config_name` = 'img_min_thumb_filesize';
DELETE FROM `bb_attachments_config` WHERE config_name = 'attach_version';
DELETE FROM `bb_attachments_config` WHERE config_name = 'img_min_thumb_filesize';
DELETE FROM `bb_attachments_config` WHERE config_name = 'img_imagick';
DELETE FROM `bb_attachments_config` WHERE config_name = 'use_gd2';
DELETE FROM `bb_attachments_config` WHERE config_name = 'wma_autoplay';
DELETE FROM `bb_attachments_config` WHERE config_name = 'flash_autoplay';
DELETE FROM `bb_extensions` WHERE extension = 'tif';
DELETE FROM `bb_extensions` WHERE extension = 'tiff';
DELETE FROM `bb_extensions` WHERE extension = 'tga';
DROP TABLE IF EXISTS `bb_banlist`;
CREATE TABLE IF NOT EXISTS `bb_banlist`
(
`ban_id` MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`ban_userid` MEDIUMINT(8) NOT NULL DEFAULT '0',
`ban_reason` VARCHAR(255) NOT NULL DEFAULT '',
PRIMARY KEY (`ban_id`, `ban_userid`)
)
ENGINE = MyISAM
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci;
// 2.4.1
UPDATE `bb_config` SET `config_value` = '' WHERE `config_name` = 'bt_announce_url';
// 2.4.2
INSERT INTO `bb_cron` (`cron_active`, `cron_title`, `cron_script`, `schedule`, `run_day`, `run_time`, `run_order`,
`last_run`, `next_run`, `run_interval`, `log_enabled`, `log_file`, `log_sql_queries`,
`disable_board`, `run_counter`) VALUES ('1', 'Demo mode', 'demo_mode.php', 'daily', '', '05:00:00', '255', '', '', '', '1', 'demo_mode_cron', '1', '1', '0');
// 2.4.3
UPDATE `bb_config` SET `config_value` = 'https://localhost/bt/announce.php' WHERE `config_name` = 'bt_announce_url';
// 2.4.4
ALTER TABLE `bb_poll_users` CHANGE `user_id` `user_id` MEDIUMINT(8) NOT NULL;
ALTER TABLE `bb_bt_users` ADD COLUMN `ratio_nulled` TINYINT(1) NOT NULL DEFAULT '0';
DELETE FROM `bb_cron` WHERE `cron_script` = 'cache_gc.php';
UPDATE `bb_cron` SET `run_interval` = '00:10:00' WHERE `cron_script` = 'tr_seed_bonus.php';
// 2.4.5-rc.1
INSERT INTO `bb_extensions` (`group_id`, `extension`, `comment`) VALUES ('1', 'avif', ''), ('3', 'm3u', '');
ALTER TABLE `bb_topics` ADD COLUMN `topic_allow_robots` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0';
// 2.4.5-rc.2
INSERT INTO `bb_config` VALUES ('magnet_links_for_guests', '0');
INSERT INTO `bb_config` VALUES ('tp_instance_hash', '');
// 2.4.5

View file

@ -1 +0,0 @@
Require all denied

0
internal_data/cache/.keep vendored Normal file
View file

File diff suppressed because it is too large Load diff

View file

@ -1 +0,0 @@
Require all denied

0
internal_data/log/.keep Normal file
View file

View file

@ -1 +0,0 @@
Require all denied

View file

@ -11,7 +11,7 @@ if (!defined('IN_AJAX')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
global $bb_cfg, $lang, $user; global $lang, $user;
if (!$mode = (string)$this->request['mode']) { if (!$mode = (string)$this->request['mode']) {
$this->ajax_die('invalid mode (empty)'); $this->ajax_die('invalid mode (empty)');

View file

@ -11,9 +11,9 @@ if (!defined('IN_AJAX')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
global $bb_cfg, $userdata, $lang; global $userdata, $lang;
if (!$bb_cfg['callseed']) { if (!config()->get('callseed')) {
$this->ajax_die($lang['MODULE_OFF']); $this->ajax_die($lang['MODULE_OFF']);
} }
@ -32,7 +32,7 @@ if ($t_data['seeders'] >= 3) {
} elseif ($t_data['call_seed_time'] >= (TIMENOW - 86400)) { } elseif ($t_data['call_seed_time'] >= (TIMENOW - 86400)) {
$time_left = delta_time($t_data['call_seed_time'] + 86400, TIMENOW, 'days'); $time_left = delta_time($t_data['call_seed_time'] + 86400, TIMENOW, 'days');
$this->ajax_die(sprintf($lang['CALLSEED_MSG_SPAM'], $time_left)); $this->ajax_die(sprintf($lang['CALLSEED_MSG_SPAM'], $time_left));
} elseif (isset($bb_cfg['tor_no_tor_act'][$t_data['tor_status']])) { } elseif (isset(config()->get('tor_no_tor_act')[$t_data['tor_status']])) {
$this->ajax_die($lang['NOT_AVAILABLE']); $this->ajax_die($lang['NOT_AVAILABLE']);
} }

View file

@ -11,7 +11,7 @@ if (!defined('IN_AJAX')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
global $userdata, $bb_cfg, $lang, $log_action; global $userdata, $lang, $log_action;
if (!$attach_id = (int)$this->request['attach_id']) { if (!$attach_id = (int)$this->request['attach_id']) {
$this->ajax_die($lang['EMPTY_ATTACH_ID']); $this->ajax_die($lang['EMPTY_ATTACH_ID']);
@ -22,7 +22,7 @@ if (!$mode = (string)$this->request['mode']) {
} }
$comment = false; $comment = false;
if ($bb_cfg['tor_comment']) { if (config()->get('tor_comment')) {
$comment = (string)$this->request['comment']; $comment = (string)$this->request['comment'];
} }
@ -88,7 +88,7 @@ switch ($mode) {
\TorrentPier\Legacy\Torrent::change_tor_status($attach_id, $new_status); \TorrentPier\Legacy\Torrent::change_tor_status($attach_id, $new_status);
// Log action // Log action
$log_msg = sprintf($lang['TOR_STATUS_LOG_ACTION'], $bb_cfg['tor_icons'][$new_status] . ' <b> ' . $lang['TOR_STATUS_NAME'][$new_status] . '</b>', $bb_cfg['tor_icons'][$tor['tor_status']] . ' <b> ' . $lang['TOR_STATUS_NAME'][$tor['tor_status']] . '</b>'); $log_msg = sprintf($lang['TOR_STATUS_LOG_ACTION'], config()->get('tor_icons')[$new_status] . ' <b> ' . $lang['TOR_STATUS_NAME'][$new_status] . '</b>', config()->get('tor_icons')[$tor['tor_status']] . ' <b> ' . $lang['TOR_STATUS_NAME'][$tor['tor_status']] . '</b>');
if ($comment && $comment != $lang['COMMENT']) { if ($comment && $comment != $lang['COMMENT']) {
$log_msg .= "<br/>{$lang['COMMENT']}: <b>$comment</b>."; $log_msg .= "<br/>{$lang['COMMENT']}: <b>$comment</b>.";
} }
@ -99,12 +99,12 @@ switch ($mode) {
'log_msg' => $log_msg . '<br/>-------------', 'log_msg' => $log_msg . '<br/>-------------',
]); ]);
$this->response['status'] = $bb_cfg['tor_icons'][$new_status] . ' <b> ' . $lang['TOR_STATUS_NAME'][$new_status] . '</b> &middot; ' . profile_url($userdata) . ' &middot; <i>' . delta_time(TIMENOW) . $lang['TOR_BACK'] . '</i>'; $this->response['status'] = config()->get('tor_icons')[$new_status] . ' <b> ' . $lang['TOR_STATUS_NAME'][$new_status] . '</b> &middot; ' . profile_url($userdata) . ' &middot; <i>' . delta_time(TIMENOW) . $lang['TOR_BACK'] . '</i>';
if ($bb_cfg['tor_comment'] && (($comment && $comment != $lang['COMMENT']) || in_array($new_status, $bb_cfg['tor_reply']))) { if (config()->get('tor_comment') && (($comment && $comment != $lang['COMMENT']) || in_array($new_status, config()->get('tor_reply')))) {
if ($tor['poster_id'] > 0) { if ($tor['poster_id'] > 0) {
$subject = sprintf($lang['TOR_MOD_TITLE'], $tor['topic_title']); $subject = sprintf($lang['TOR_MOD_TITLE'], $tor['topic_title']);
$message = sprintf($lang['TOR_MOD_MSG'], get_username($tor['poster_id']), make_url(TOPIC_URL . $tor['topic_id']), $bb_cfg['tor_icons'][$new_status] . ' ' . $lang['TOR_STATUS_NAME'][$new_status]); $message = sprintf($lang['TOR_MOD_MSG'], get_username($tor['poster_id']), make_url(TOPIC_URL . $tor['topic_id']), config()->get('tor_icons')[$new_status] . ' ' . $lang['TOR_STATUS_NAME'][$new_status]);
if ($comment && $comment != $lang['COMMENT']) { if ($comment && $comment != $lang['COMMENT']) {
$message .= "\n\n[b]" . $lang['COMMENT'] . '[/b]: ' . $comment; $message .= "\n\n[b]" . $lang['COMMENT'] . '[/b]: ' . $comment;
@ -117,7 +117,7 @@ switch ($mode) {
break; break;
case 'status_reply': case 'status_reply':
if (!$bb_cfg['tor_comment']) { if (!config()->get('tor_comment')) {
$this->ajax_die($lang['MODULE_OFF']); $this->ajax_die($lang['MODULE_OFF']);
} }

View file

@ -11,7 +11,7 @@ if (!defined('IN_AJAX')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
global $userdata, $bb_cfg, $lang, $log_action; global $userdata, $lang, $log_action;
if (!isset($this->request['attach_id'])) { if (!isset($this->request['attach_id'])) {
$this->ajax_die($lang['EMPTY_ATTACH_ID']); $this->ajax_die($lang['EMPTY_ATTACH_ID']);

View file

@ -11,7 +11,7 @@ if (!defined('IN_AJAX')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
global $bb_cfg, $userdata, $lang; global $userdata, $lang;
if (!$group_id = (int)$this->request['group_id'] or !$group_info = \TorrentPier\Legacy\Group::get_group_data($group_id)) { if (!$group_id = (int)$this->request['group_id'] or !$group_info = \TorrentPier\Legacy\Group::get_group_data($group_id)) {
$this->ajax_die($lang['NO_GROUP_ID_SPECIFIED']); $this->ajax_die($lang['NO_GROUP_ID_SPECIFIED']);

View file

@ -11,7 +11,7 @@ if (!defined('IN_AJAX')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
global $bb_cfg, $lang; global $lang;
if (!$user_id = (int)$this->request['user_id'] or !$profiledata = get_userdata($user_id)) { if (!$user_id = (int)$this->request['user_id'] or !$profiledata = get_userdata($user_id)) {
$this->ajax_die($lang['NO_USER_ID_SPECIFIED']); $this->ajax_die($lang['NO_USER_ID_SPECIFIED']);
@ -55,7 +55,7 @@ switch ($field) {
break; break;
case 'user_gender': case 'user_gender':
if (!$bb_cfg['gender']) { if (!config()->get('gender')) {
$this->ajax_die($lang['MODULE_OFF']); $this->ajax_die($lang['MODULE_OFF']);
} }
if (!isset($lang['GENDER_SELECT'][$value])) { if (!isset($lang['GENDER_SELECT'][$value])) {
@ -65,7 +65,7 @@ switch ($field) {
break; break;
case 'user_birthday': case 'user_birthday':
if (!$bb_cfg['birthday_enabled']) { if (!config()->get('birthday_enabled')) {
$this->ajax_die($lang['MODULE_OFF']); $this->ajax_die($lang['MODULE_OFF']);
} }
$birthday_date = date_parse($value); $birthday_date = date_parse($value);
@ -73,10 +73,10 @@ switch ($field) {
if (!empty($birthday_date['year'])) { if (!empty($birthday_date['year'])) {
if (strtotime($value) >= TIMENOW) { if (strtotime($value) >= TIMENOW) {
$this->ajax_die($lang['WRONG_BIRTHDAY_FORMAT']); $this->ajax_die($lang['WRONG_BIRTHDAY_FORMAT']);
} elseif (bb_date(TIMENOW, 'Y', false) - $birthday_date['year'] > $bb_cfg['birthday_max_age']) { } elseif (bb_date(TIMENOW, 'Y', false) - $birthday_date['year'] > config()->get('birthday_max_age')) {
$this->ajax_die(sprintf($lang['BIRTHDAY_TO_HIGH'], $bb_cfg['birthday_max_age'])); $this->ajax_die(sprintf($lang['BIRTHDAY_TO_HIGH'], config()->get('birthday_max_age')));
} elseif (bb_date(TIMENOW, 'Y', false) - $birthday_date['year'] < $bb_cfg['birthday_min_age']) { } elseif (bb_date(TIMENOW, 'Y', false) - $birthday_date['year'] < config()->get('birthday_min_age')) {
$this->ajax_die(sprintf($lang['BIRTHDAY_TO_LOW'], $bb_cfg['birthday_min_age'])); $this->ajax_die(sprintf($lang['BIRTHDAY_TO_LOW'], config()->get('birthday_min_age')));
} }
} }

View file

@ -11,13 +11,13 @@ if (!defined('IN_AJAX')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
global $bb_cfg, $lang; global $lang;
if (!$bb_cfg['torr_server']['enabled']) { if (!config()->get('torr_server.enabled')) {
$this->ajax_die($lang['MODULE_OFF']); $this->ajax_die($lang['MODULE_OFF']);
} }
if ($bb_cfg['torr_server']['disable_for_guest'] && IS_GUEST) { if (config()->get('torr_server.disable_for_guest') && IS_GUEST) {
$this->ajax_die($lang['NEED_TO_LOGIN_FIRST']); $this->ajax_die($lang['NEED_TO_LOGIN_FIRST']);
} }

View file

@ -11,7 +11,7 @@ if (!defined('IN_AJAX')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
global $bb_cfg, $lang, $userdata, $datastore; global $lang, $userdata, $datastore;
if (!$mode = (string)$this->request['mode']) { if (!$mode = (string)$this->request['mode']) {
$this->ajax_die('invalid mode (empty)'); $this->ajax_die('invalid mode (empty)');
@ -20,10 +20,10 @@ if (!$mode = (string)$this->request['mode']) {
$html = ''; $html = '';
switch ($mode) { switch ($mode) {
case 'birthday_week': case 'birthday_week':
$stats = $datastore->get('stats');
$datastore->enqueue([ $datastore->enqueue([
'stats' 'stats'
]); ]);
$stats = $datastore->get('stats');
$users = []; $users = [];
@ -31,17 +31,17 @@ switch ($mode) {
foreach ($stats['birthday_week_list'] as $week) { foreach ($stats['birthday_week_list'] as $week) {
$users[] = profile_url($week) . ' <span class="small">(' . birthday_age(date('Y-m-d', strtotime('-1 year', strtotime($week['user_birthday'])))) . ')</span>'; $users[] = profile_url($week) . ' <span class="small">(' . birthday_age(date('Y-m-d', strtotime('-1 year', strtotime($week['user_birthday'])))) . ')</span>';
} }
$html = sprintf($lang['BIRTHDAY_WEEK'], $bb_cfg['birthday_check_day'], implode(', ', $users)); $html = sprintf($lang['BIRTHDAY_WEEK'], config()->get('birthday_check_day'), implode(', ', $users));
} else { } else {
$html = sprintf($lang['NOBIRTHDAY_WEEK'], $bb_cfg['birthday_check_day']); $html = sprintf($lang['NOBIRTHDAY_WEEK'], config()->get('birthday_check_day'));
} }
break; break;
case 'birthday_today': case 'birthday_today':
$stats = $datastore->get('stats');
$datastore->enqueue([ $datastore->enqueue([
'stats' 'stats'
]); ]);
$stats = $datastore->get('stats');
$users = []; $users = [];
@ -59,8 +59,7 @@ switch ($mode) {
$forum_id = (int)$this->request['forum_id']; $forum_id = (int)$this->request['forum_id'];
$datastore->enqueue([ $datastore->enqueue([
'moderators', 'moderators'
'cat_forums'
]); ]);
$moderators = []; $moderators = [];
@ -85,7 +84,7 @@ switch ($mode) {
break; break;
case 'null_ratio': case 'null_ratio':
if (!$bb_cfg['ratio_null_enabled'] || !RATIO_ENABLED) { if (!config()->get('ratio_null_enabled') || !RATIO_ENABLED) {
$this->ajax_die($lang['MODULE_OFF']); $this->ajax_die($lang['MODULE_OFF']);
} }
if (empty($this->request['confirmed'])) { if (empty($this->request['confirmed'])) {
@ -107,8 +106,8 @@ switch ($mode) {
if ($ratio_nulled && !IS_ADMIN) { if ($ratio_nulled && !IS_ADMIN) {
$this->ajax_die($lang['BT_NULL_RATIO_AGAIN']); $this->ajax_die($lang['BT_NULL_RATIO_AGAIN']);
} }
if (($user_ratio >= $bb_cfg['ratio_to_null']) && !IS_ADMIN) { if (($user_ratio >= config()->get('ratio_to_null')) && !IS_ADMIN) {
$this->ajax_die(sprintf($lang['BT_NULL_RATIO_NOT_NEEDED'], $bb_cfg['ratio_to_null'])); $this->ajax_die(sprintf($lang['BT_NULL_RATIO_NOT_NEEDED'], config()->get('ratio_to_null')));
} }
$ratio_nulled_sql = !IS_ADMIN ? ', ratio_nulled = 1' : ''; $ratio_nulled_sql = !IS_ADMIN ? ', ratio_nulled = 1' : '';
@ -173,7 +172,7 @@ switch ($mode) {
<th>' . $lang['UPLOADED'] . '</th> <th>' . $lang['UPLOADED'] . '</th>
<th>' . $lang['RELEASED'] . '</th> <th>' . $lang['RELEASED'] . '</th>
<th>' . $lang['BONUS'] . '</th>'; <th>' . $lang['BONUS'] . '</th>';
$html .= $bb_cfg['seed_bonus_enabled'] ? '<th>' . $lang['SEED_BONUS'] . '</th>' : ''; $html .= config()->get('seed_bonus_enabled') ? '<th>' . $lang['SEED_BONUS'] . '</th>' : '';
$html .= '</tr> $html .= '</tr>
<tr class="row1"> <tr class="row1">
<td>' . $lang['TOTAL_TRAF'] . '</td> <td>' . $lang['TOTAL_TRAF'] . '</td>
@ -181,17 +180,17 @@ switch ($mode) {
<td id="u_up_total"><span class="editable bold seedmed">' . humn_size($btu['u_up_total']) . '</span></td> <td id="u_up_total"><span class="editable bold seedmed">' . humn_size($btu['u_up_total']) . '</span></td>
<td id="u_up_release"><span class="editable bold seedmed">' . humn_size($btu['u_up_release']) . '</span></td> <td id="u_up_release"><span class="editable bold seedmed">' . humn_size($btu['u_up_release']) . '</span></td>
<td id="u_up_bonus"><span class="editable bold seedmed">' . humn_size($btu['u_up_bonus']) . '</span></td>'; <td id="u_up_bonus"><span class="editable bold seedmed">' . humn_size($btu['u_up_bonus']) . '</span></td>';
$html .= $bb_cfg['seed_bonus_enabled'] ? '<td id="user_points"><span class="editable bold points">' . $profiledata['user_points'] . '</b></td>' : ''; $html .= config()->get('seed_bonus_enabled') ? '<td id="user_points"><span class="editable bold points">' . $profiledata['user_points'] . '</b></td>' : '';
$html .= '</tr> $html .= '</tr>
<tr class="row5"> <tr class="row5">
<td colspan="1">' . $lang['MAX_SPEED'] . '</td> <td colspan="1">' . $lang['MAX_SPEED'] . '</td>
<td colspan="2">' . $lang['DL_DL_SPEED'] . ': ' . $speed_down . '</span></td> <td colspan="2">' . $lang['DL_DL_SPEED'] . ': ' . $speed_down . '</span></td>
<td colspan="2">' . $lang['DL_UL_SPEED'] . ': ' . $speed_up . '</span></td>'; <td colspan="2">' . $lang['DL_UL_SPEED'] . ': ' . $speed_up . '</span></td>';
$html .= $bb_cfg['seed_bonus_enabled'] ? '<td colspan="1"></td>' : ''; $html .= config()->get('seed_bonus_enabled') ? '<td colspan="1"></td>' : '';
$html .= '</tr>'; $html .= '</tr>';
$this->response['user_ratio'] = ' $this->response['user_ratio'] = '
<th><a href="' . $bb_cfg['ratio_url_help'] . '" class="bold">' . $lang['USER_RATIO'] . '</a>:</th> <th><a href="' . config()->get('ratio_url_help') . '" class="bold">' . $lang['USER_RATIO'] . '</a>:</th>
<td>' . $user_ratio . '</td> <td>' . $user_ratio . '</td>
'; ';
break; break;

View file

@ -11,7 +11,7 @@ if (!defined('IN_AJAX')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
global $userdata, $lang, $bb_cfg; global $userdata, $lang;
if (!$mode = (string)$this->request['mode']) { if (!$mode = (string)$this->request['mode']) {
$this->ajax_die('invalid mode (empty)'); $this->ajax_die('invalid mode (empty)');
@ -19,7 +19,7 @@ if (!$mode = (string)$this->request['mode']) {
switch ($mode) { switch ($mode) {
case 'clear_cache': case 'clear_cache':
foreach ($bb_cfg['cache']['engines'] as $cache_name => $cache_val) { foreach (config()->get('cache.engines') as $cache_name => $cache_val) {
CACHE($cache_name)->rm(); CACHE($cache_name)->rm();
} }
@ -48,20 +48,20 @@ switch ($mode) {
$this->response['template_cache_html'] = '<span class="seed bold">' . $lang['ALL_TEMPLATE_CLEARED'] . '</span>'; $this->response['template_cache_html'] = '<span class="seed bold">' . $lang['ALL_TEMPLATE_CLEARED'] . '</span>';
break; break;
case 'indexer': case 'indexer':
exec("indexer --config {$bb_cfg['sphinx_config_path']} --all --rotate", $result); exec("indexer --config " . config()->get('sphinx_config_path') . " --all --rotate", $result);
if (!is_file($bb_cfg['sphinx_config_path'] . ".log")) { if (!is_file(config()->get('sphinx_config_path') . ".log")) {
file_put_contents($bb_cfg['sphinx_config_path'] . ".log", "##############################" . date("H:i:s", TIMENOW) . "##############################\r\n\r\n\r\n\r\n", FILE_APPEND); file_put_contents(config()->get('sphinx_config_path') . ".log", "##############################" . date("H:i:s", TIMENOW) . "##############################\r\n\r\n\r\n\r\n", FILE_APPEND);
} }
file_put_contents($bb_cfg['sphinx_config_path'] . ".log", "##############################" . date("H:i:s", TIMENOW) . "##############################\r\n", FILE_APPEND); file_put_contents(config()->get('sphinx_config_path') . ".log", "##############################" . date("H:i:s", TIMENOW) . "##############################\r\n", FILE_APPEND);
foreach ($result as $row) { foreach ($result as $row) {
file_put_contents($bb_cfg['sphinx_config_path'] . ".log", $row . "\r\n", FILE_APPEND); file_put_contents(config()->get('sphinx_config_path') . ".log", $row . "\r\n", FILE_APPEND);
} }
file_put_contents($bb_cfg['sphinx_config_path'] . ".log", "\r\n", FILE_APPEND); file_put_contents(config()->get('sphinx_config_path') . ".log", "\r\n", FILE_APPEND);
file_put_contents($bb_cfg['sphinx_config_path'] . ".log", "\r\n", FILE_APPEND); file_put_contents(config()->get('sphinx_config_path') . ".log", "\r\n", FILE_APPEND);
$this->response['indexer_html'] = '<span class="seed bold">' . $lang['INDEXER'] . '</span>'; $this->response['indexer_html'] = '<span class="seed bold">' . $lang['INDEXER'] . '</span>';
break; break;
@ -82,10 +82,6 @@ switch ($mode) {
\TorrentPier\Helpers\CronHelper::enableBoard(); \TorrentPier\Helpers\CronHelper::enableBoard();
$this->response['unlock_cron_html'] = '<span class="seed bold">' . $lang['ADMIN_UNLOCKED'] . '</span>'; $this->response['unlock_cron_html'] = '<span class="seed bold">' . $lang['ADMIN_UNLOCKED'] . '</span>';
break; break;
case 'restore_corrupt_files':
file_write('', RESTORE_CORRUPT_CONFIRM_FILE, replace_content: true);
$this->response['restore_corrupt_files_html'] = '<span class="seed bold">' . $lang['INTEGRITY_RESTORE_CONFIRM_OK'] . '</span>';
break;
default: default:
$this->ajax_die('Invalid mode: ' . $mode); $this->ajax_die('Invalid mode: ' . $mode);
} }

View file

@ -11,7 +11,7 @@ if (!defined('IN_AJAX')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
global $userdata, $lang, $bb_cfg; global $userdata, $lang;
if (!$mode = (string)$this->request['mode']) { if (!$mode = (string)$this->request['mode']) {
$this->ajax_die('invalid mode (empty)'); $this->ajax_die('invalid mode (empty)');

View file

@ -11,7 +11,7 @@ if (!defined('IN_AJAX')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
global $userdata, $bb_cfg, $lang, $datastore, $log_action; global $userdata, $lang, $datastore, $log_action;
if (!$mode = (string)$this->request['mode']) { if (!$mode = (string)$this->request['mode']) {
$this->ajax_die('invalid mode (empty)'); $this->ajax_die('invalid mode (empty)');
@ -44,7 +44,7 @@ switch ($mode) {
\TorrentPier\Legacy\Torrent::change_tor_status($attach_id, $status); \TorrentPier\Legacy\Torrent::change_tor_status($attach_id, $status);
// Log action // Log action
$log_msg = sprintf($lang['TOR_STATUS_LOG_ACTION'], $bb_cfg['tor_icons'][$status] . ' <b> ' . $lang['TOR_STATUS_NAME'][$status] . '</b>', $bb_cfg['tor_icons'][$tor['tor_status']] . ' <b> ' . $lang['TOR_STATUS_NAME'][$tor['tor_status']] . '</b>'); $log_msg = sprintf($lang['TOR_STATUS_LOG_ACTION'], config()->get('tor_icons')[$status] . ' <b> ' . $lang['TOR_STATUS_NAME'][$status] . '</b>', config()->get('tor_icons')[$tor['tor_status']] . ' <b> ' . $lang['TOR_STATUS_NAME'][$tor['tor_status']] . '</b>');
$log_action->mod('mod_topic_change_tor_status', [ $log_action->mod('mod_topic_change_tor_status', [
'forum_id' => $tor['forum_id'], 'forum_id' => $tor['forum_id'],
'topic_id' => $tor['topic_id'], 'topic_id' => $tor['topic_id'],
@ -52,7 +52,7 @@ switch ($mode) {
'log_msg' => $log_msg . '<br/>-------------', 'log_msg' => $log_msg . '<br/>-------------',
]); ]);
} }
$this->response['status'] = $bb_cfg['tor_icons'][$status]; $this->response['status'] = config()->get('tor_icons')[$status];
$this->response['topics'] = explode(',', $topics); $this->response['topics'] = explode(',', $topics);
break; break;
@ -78,16 +78,16 @@ switch ($mode) {
DB()->query("UPDATE " . BB_TOPICS . " SET topic_title = '$topic_title_sql' WHERE topic_id = $topic_id LIMIT 1"); DB()->query("UPDATE " . BB_TOPICS . " SET topic_title = '$topic_title_sql' WHERE topic_id = $topic_id LIMIT 1");
// Update the news cache on the index page // Update the news cache on the index page
$news_forums = array_flip(explode(',', $bb_cfg['latest_news_forum_id'])); $news_forums = array_flip(explode(',', config()->get('latest_news_forum_id')));
if (isset($news_forums[$t_data['forum_id']]) && $bb_cfg['show_latest_news']) { if (isset($news_forums[$t_data['forum_id']]) && config()->get('show_latest_news')) {
$datastore->enqueue([ $datastore->enqueue([
'latest_news' 'latest_news'
]); ]);
$datastore->update('latest_news'); $datastore->update('latest_news');
} }
$net_forums = array_flip(explode(',', $bb_cfg['network_news_forum_id'])); $net_forums = array_flip(explode(',', config()->get('network_news_forum_id')));
if (isset($net_forums[$t_data['forum_id']]) && $bb_cfg['show_network_news']) { if (isset($net_forums[$t_data['forum_id']]) && config()->get('show_network_news')) {
$datastore->enqueue([ $datastore->enqueue([
'network_news' 'network_news'
]); ]);
@ -151,8 +151,8 @@ switch ($mode) {
} else { } else {
$user_reg_ip = \TorrentPier\Helpers\IPHelper::long2ip_extended($profiledata['user_reg_ip']); $user_reg_ip = \TorrentPier\Helpers\IPHelper::long2ip_extended($profiledata['user_reg_ip']);
$user_last_ip = \TorrentPier\Helpers\IPHelper::long2ip_extended($profiledata['user_last_ip']); $user_last_ip = \TorrentPier\Helpers\IPHelper::long2ip_extended($profiledata['user_last_ip']);
$reg_ip = '<a href="' . $bb_cfg['whois_info'] . $user_reg_ip . '" class="gen" target="_blank">' . $user_reg_ip . '</a>'; $reg_ip = '<a href="' . config()->get('whois_info') . $user_reg_ip . '" class="gen" target="_blank">' . $user_reg_ip . '</a>';
$last_ip = '<a href="' . $bb_cfg['whois_info'] . $user_last_ip . '" class="gen" target="_blank">' . $user_last_ip . '</a>'; $last_ip = '<a href="' . config()->get('whois_info') . $user_last_ip . '" class="gen" target="_blank">' . $user_last_ip . '</a>';
} }
$this->response['ip_list_html'] = ' $this->response['ip_list_html'] = '

View file

@ -11,7 +11,7 @@ if (!defined('IN_AJAX')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
global $lang, $bb_cfg, $userdata, $wordCensor; global $lang, $userdata;
if (!isset($this->request['type'])) { if (!isset($this->request['type'])) {
$this->ajax_die('empty type'); $this->ajax_die('empty type');
@ -76,11 +76,11 @@ switch ($this->request['type']) {
$message = "[quote=\"" . $quote_username . "\"][qpost=" . $post['post_id'] . "]" . $post['post_text'] . "[/quote]\r"; $message = "[quote=\"" . $quote_username . "\"][qpost=" . $post['post_id'] . "]" . $post['post_text'] . "[/quote]\r";
// hide user passkey // hide user passkey
$message = preg_replace('#(?<=[\?&;]' . $bb_cfg['passkey_key'] . '=)[a-zA-Z0-9]#', 'passkey', $message); $message = preg_replace('#(?<=[\?&;]' . config()->get('passkey_key') . '=)[a-zA-Z0-9]#', 'passkey', $message);
// hide sid // hide sid
$message = preg_replace('#(?<=[\?&;]sid=)[a-zA-Z0-9]#', 'sid', $message); $message = preg_replace('#(?<=[\?&;]sid=)[a-zA-Z0-9]#', 'sid', $message);
$message = $wordCensor->censorString($message); $message = censor()->censorString($message);
if ($post['post_id'] == $post['topic_first_post_id']) { if ($post['post_id'] == $post['topic_first_post_id']) {
$message = "[quote]" . $post['topic_title'] . "[/quote]\r"; $message = "[quote]" . $post['topic_title'] . "[/quote]\r";
@ -120,10 +120,10 @@ switch ($this->request['type']) {
if (mb_strlen($text) > 2) { if (mb_strlen($text) > 2) {
if ($text != $post['post_text']) { if ($text != $post['post_text']) {
if ($bb_cfg['max_smilies']) { if (config()->get('max_smilies')) {
$count_smilies = substr_count(bbcode2html($text), '<img class="smile" src="' . $bb_cfg['smilies_path']); $count_smilies = substr_count(bbcode2html($text), '<img class="smile" src="' . config()->get('smilies_path'));
if ($count_smilies > $bb_cfg['max_smilies']) { if ($count_smilies > config()->get('max_smilies')) {
$this->ajax_die(sprintf($lang['MAX_SMILIES_PER_POST'], $bb_cfg['max_smilies'])); $this->ajax_die(sprintf($lang['MAX_SMILIES_PER_POST'], config()->get('max_smilies')));
} }
} }
DB()->query("UPDATE " . BB_POSTS_TEXT . " SET post_text = '" . DB()->escape($text) . "' WHERE post_id = $post_id LIMIT 1"); DB()->query("UPDATE " . BB_POSTS_TEXT . " SET post_text = '" . DB()->escape($text) . "' WHERE post_id = $post_id LIMIT 1");
@ -225,7 +225,7 @@ switch ($this->request['type']) {
$sql = "SELECT MAX(p.post_time) AS last_post_time FROM " . BB_POSTS . " p WHERE $where_sql"; $sql = "SELECT MAX(p.post_time) AS last_post_time FROM " . BB_POSTS . " p WHERE $where_sql";
if ($row = DB()->fetch_row($sql) and $row['last_post_time']) { if ($row = DB()->fetch_row($sql) and $row['last_post_time']) {
if ($userdata['user_level'] == USER) { if ($userdata['user_level'] == USER) {
if ((TIMENOW - $row['last_post_time']) < $bb_cfg['flood_interval']) { if ((TIMENOW - $row['last_post_time']) < config()->get('flood_interval')) {
$this->ajax_die($lang['FLOOD_ERROR']); $this->ajax_die($lang['FLOOD_ERROR']);
} }
} }
@ -251,10 +251,10 @@ switch ($this->request['type']) {
} }
} }
if ($bb_cfg['max_smilies']) { if (config()->get('max_smilies')) {
$count_smilies = substr_count(bbcode2html($message), '<img class="smile" src="' . $bb_cfg['smilies_path']); $count_smilies = substr_count(bbcode2html($message), '<img class="smile" src="' . config()->get('smilies_path'));
if ($count_smilies > $bb_cfg['max_smilies']) { if ($count_smilies > config()->get('max_smilies')) {
$this->ajax_die(sprintf($lang['MAX_SMILIES_PER_POST'], $bb_cfg['max_smilies'])); $this->ajax_die(sprintf($lang['MAX_SMILIES_PER_POST'], config()->get('max_smilies')));
} }
} }
@ -272,7 +272,7 @@ switch ($this->request['type']) {
'post_text' => $message 'post_text' => $message
]); ]);
if ($bb_cfg['topic_notify_enabled']) { if (config()->get('topic_notify_enabled')) {
$notify = !empty($this->request['notify']); $notify = !empty($this->request['notify']);
\TorrentPier\Legacy\Post::user_notification('reply', $post, $post['topic_title'], $post['forum_id'], $topic_id, $notify); \TorrentPier\Legacy\Post::user_notification('reply', $post, $post['topic_title'], $post['forum_id'], $topic_id, $notify);
} }

View file

@ -11,7 +11,7 @@ if (!defined('IN_AJAX')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
global $bb_cfg, $lang; global $lang;
if (!$mode = (string)$this->request['mode']) { if (!$mode = (string)$this->request['mode']) {
$this->ajax_die('invalid mode (empty)'); $this->ajax_die('invalid mode (empty)');
@ -24,7 +24,7 @@ switch ($mode) {
case 'create': case 'create':
$map->createSitemap(); $map->createSitemap();
if (is_file(SITEMAP_DIR . '/sitemap.xml')) { if (is_file(SITEMAP_DIR . '/sitemap.xml')) {
$html .= $lang['SITEMAP_CREATED'] . ': <b>' . bb_date(TIMENOW, $bb_cfg['post_date_format']) . '</b> ' . $lang['SITEMAP_AVAILABLE'] . ': <a href="' . make_url('sitemap/sitemap.xml') . '" target="_blank">' . make_url('sitemap/sitemap.xml') . '</a>'; $html .= $lang['SITEMAP_CREATED'] . ': <b>' . bb_date(TIMENOW, config()->get('post_date_format')) . '</b> ' . $lang['SITEMAP_AVAILABLE'] . ': <a href="' . make_url('sitemap/sitemap.xml') . '" target="_blank">' . make_url('sitemap/sitemap.xml') . '</a>';
} else { } else {
$html .= $lang['SITEMAP_NOT_CREATED']; $html .= $lang['SITEMAP_NOT_CREATED'];
} }

View file

@ -11,9 +11,9 @@ if (!defined('IN_AJAX')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
global $bb_cfg, $lang, $userdata; global $lang, $userdata;
if (!$bb_cfg['tor_thank']) { if (!config()->get('tor_thank')) {
$this->ajax_die($lang['MODULE_OFF']); $this->ajax_die($lang['MODULE_OFF']);
} }
@ -49,12 +49,12 @@ switch ($mode) {
// Limit voters per topic // Limit voters per topic
$thanks_count = DB()->fetch_row('SELECT COUNT(*) as thx FROM ' . BB_THX . " WHERE topic_id = $topic_id")['thx']; $thanks_count = DB()->fetch_row('SELECT COUNT(*) as thx FROM ' . BB_THX . " WHERE topic_id = $topic_id")['thx'];
if ($thanks_count > (int)$bb_cfg['tor_thank_limit_per_topic']) { if ($thanks_count > (int)config()->get('tor_thank_limit_per_topic')) {
DB()->query('DELETE FROM ' . BB_THX . " WHERE topic_id = $topic_id ORDER BY time ASC LIMIT 1"); DB()->query('DELETE FROM ' . BB_THX . " WHERE topic_id = $topic_id ORDER BY time ASC LIMIT 1");
} }
break; break;
case 'get': case 'get':
if (IS_GUEST && !$bb_cfg['tor_thanks_list_guests']) { if (IS_GUEST && !config()->get('tor_thanks_list_guests')) {
$this->ajax_die($lang['NEED_TO_LOGIN_FIRST']); $this->ajax_die($lang['NEED_TO_LOGIN_FIRST']);
} }

View file

@ -11,7 +11,7 @@ if (!defined('IN_AJAX')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
global $bb_cfg, $lang, $userdata; global $lang, $userdata;
if (!$mode = (string)$this->request['mode']) { if (!$mode = (string)$this->request['mode']) {
$this->ajax_die('invalid mode (empty)'); $this->ajax_die('invalid mode (empty)');

View file

@ -11,11 +11,11 @@ if (!defined('IN_AJAX')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
global $user, $lang, $bb_cfg; global $user, $lang;
$post_id = isset($this->request['post_id']) ? (int)$this->request['post_id'] : null; $post_id = isset($this->request['post_id']) ? (int)$this->request['post_id'] : null;
$topic_id = isset($this->request['topic_id']) ? (int)$this->request['topic_id'] : null; $topic_id = isset($this->request['topic_id']) ? (int)$this->request['topic_id'] : null;
$return_text = $bb_cfg['show_post_bbcode_button'] && isset($this->request['return_text']) && (bool)$this->request['return_text']; $return_text = config()->get('show_post_bbcode_button.enabled') && isset($this->request['return_text']) && (bool)$this->request['return_text'];
if (is_null($post_id)) { if (is_null($post_id)) {
$post_id = DB()->fetch_row("SELECT topic_first_post_id FROM " . BB_TOPICS . " WHERE topic_id = $topic_id", 'topic_first_post_id'); $post_id = DB()->fetch_row("SELECT topic_first_post_id FROM " . BB_TOPICS . " WHERE topic_id = $topic_id", 'topic_first_post_id');

View file

@ -1 +0,0 @@
Require all denied

View file

@ -25,11 +25,11 @@ if (defined('ATTACH_INSTALL')) {
*/ */
function attach_mod_get_lang($language_file) function attach_mod_get_lang($language_file)
{ {
global $attach_config, $bb_cfg; global $attach_config;
$file = LANG_ROOT_DIR . '/' . $bb_cfg['default_lang'] . '/' . $language_file . '.php'; $file = LANG_ROOT_DIR . '/' . config()->get('default_lang') . '/' . $language_file . '.php';
if (file_exists($file)) { if (file_exists($file)) {
return $bb_cfg['default_lang']; return config()->get('default_lang');
} }
$file = LANG_ROOT_DIR . '/' . $attach_config['board_lang'] . '/' . $language_file . '.php'; $file = LANG_ROOT_DIR . '/' . $attach_config['board_lang'] . '/' . $language_file . '.php';
@ -45,8 +45,6 @@ function attach_mod_get_lang($language_file)
*/ */
function get_config() function get_config()
{ {
global $bb_cfg;
$attach_config = []; $attach_config = [];
$sql = 'SELECT * FROM ' . BB_ATTACH_CONFIG; $sql = 'SELECT * FROM ' . BB_ATTACH_CONFIG;
@ -60,7 +58,7 @@ function get_config()
} }
// We assign the original default board language here, because it gets overwritten later with the users default language // We assign the original default board language here, because it gets overwritten later with the users default language
$attach_config['board_lang'] = trim($bb_cfg['default_lang']); $attach_config['board_lang'] = trim(config()->get('default_lang'));
return $attach_config; return $attach_config;
} }

View file

@ -11,7 +11,7 @@ if (!defined('BB_ROOT')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
global $bb_cfg, $t_data, $poster_id, $is_auth, $dl_link_css, $dl_status_css, $lang, $images; global $t_data, $poster_id, $is_auth, $dl_link_css, $dl_status_css, $lang, $images;
$tor_status_by_for_all = true; $tor_status_by_for_all = true;
$change_peers_bgr_over = true; $change_peers_bgr_over = true;
@ -40,7 +40,7 @@ $template->assign_vars([
]); ]);
// Define show peers mode (count only || user names with complete % || full details) // Define show peers mode (count only || user names with complete % || full details)
$cfg_sp_mode = $bb_cfg['bt_show_peers_mode']; $cfg_sp_mode = config()->get('bt_show_peers_mode');
$get_sp_mode = $_GET['spmode'] ?? ''; $get_sp_mode = $_GET['spmode'] ?? '';
$s_mode = 'count'; $s_mode = 'count';
@ -51,7 +51,7 @@ if ($cfg_sp_mode == SHOW_PEERS_NAMES) {
$s_mode = 'full'; $s_mode = 'full';
} }
if ($bb_cfg['bt_allow_spmode_change']) { if (config()->get('bt_allow_spmode_change')) {
if ($get_sp_mode == 'names') { if ($get_sp_mode == 'names') {
$s_mode = 'names'; $s_mode = 'names';
} elseif ($get_sp_mode == 'full') { } elseif ($get_sp_mode == 'full') {
@ -68,7 +68,7 @@ $tor_file_size = humn_size($attachments['_' . $post_id][$i]['filesize']);
$tor_file_time = bb_date($attachments['_' . $post_id][$i]['filetime']); $tor_file_time = bb_date($attachments['_' . $post_id][$i]['filetime']);
$tor_reged = (bool)$tracker_status; $tor_reged = (bool)$tracker_status;
$show_peers = (bool)$bb_cfg['bt_show_peers']; $show_peers = (bool)config()->get('bt_show_peers');
$locked = ($t_data['forum_status'] == FORUM_LOCKED || $t_data['topic_status'] == TOPIC_LOCKED); $locked = ($t_data['forum_status'] == FORUM_LOCKED || $t_data['topic_status'] == TOPIC_LOCKED);
$tor_auth = ($bt_user_id != GUEST_UID && (($bt_user_id == $poster_id && !$locked) || $is_auth['auth_mod'])); $tor_auth = ($bt_user_id != GUEST_UID && (($bt_user_id == $poster_id && !$locked) || $is_auth['auth_mod']));
@ -88,10 +88,10 @@ if ($tor_auth_reg || $tor_auth_del) {
$tracker_link = ($tor_reged) ? $unreg_tor_url : $reg_tor_url; $tracker_link = ($tor_reged) ? $unreg_tor_url : $reg_tor_url;
} }
if ($bb_cfg['tracker']['use_old_torrent_name_format']) { if (config()->get('tracker.use_old_torrent_name_format')) {
$display_name = '[' . $bb_cfg['server_name'] . '].t' . $bt_topic_id . '.' . TORRENT_EXT; $display_name = '[' . config()->get('server_name') . '].t' . $bt_topic_id . '.' . TORRENT_EXT;
} else { } else {
$display_name = $t_data['topic_title'] . ' [' . $bb_cfg['server_name'] . '-' . $bt_topic_id . ']' . '.' . TORRENT_EXT; $display_name = $t_data['topic_title'] . ' [' . config()->get('server_name') . '-' . $bt_topic_id . ']' . '.' . TORRENT_EXT;
} }
if (!$tor_reged) { if (!$tor_reged) {
@ -149,11 +149,11 @@ if ($tor_reged && $tor_info) {
// Magnet link // Magnet link
$user_passkey = \TorrentPier\Legacy\Torrent::getPasskey($bt_user_id); $user_passkey = \TorrentPier\Legacy\Torrent::getPasskey($bt_user_id);
$tor_magnet = create_magnet($tor_info['info_hash'], $tor_info['info_hash_v2'], $user_passkey, html_ent_decode($t_data['topic_title'])); $tor_magnet = create_magnet($tor_info['info_hash'], $tor_info['info_hash_v2'], $user_passkey, html_ent_decode($t_data['topic_title']), $tor_size);
// ratio limits // ratio limits
$min_ratio_dl = $bb_cfg['bt_min_ratio_allow_dl_tor']; $min_ratio_dl = config()->get('bt_min_ratio_allow_dl_tor');
$min_ratio_warn = $bb_cfg['bt_min_ratio_warning']; $min_ratio_warn = config()->get('bt_min_ratio_warning');
$dl_allowed = true; $dl_allowed = true;
$user_ratio = 0; $user_ratio = 0;
@ -182,7 +182,7 @@ if ($tor_reged && $tor_info) {
if ((isset($user_ratio, $min_ratio_warn) && $user_ratio < $min_ratio_warn && TR_RATING_LIMITS) || ($bt_userdata['u_down_total'] < MIN_DL_FOR_RATIO)) { if ((isset($user_ratio, $min_ratio_warn) && $user_ratio < $min_ratio_warn && TR_RATING_LIMITS) || ($bt_userdata['u_down_total'] < MIN_DL_FOR_RATIO)) {
$template->assign_vars([ $template->assign_vars([
'SHOW_RATIO_WARN' => true, 'SHOW_RATIO_WARN' => true,
'RATIO_WARN_MSG' => sprintf($lang['BT_RATIO_WARNING_MSG'], $min_ratio_dl, $bb_cfg['ratio_url_help']), 'RATIO_WARN_MSG' => sprintf($lang['BT_RATIO_WARNING_MSG'], $min_ratio_dl, config()->get('ratio_url_help')),
]); ]);
} }
} }
@ -202,12 +202,12 @@ if ($tor_reged && $tor_info) {
'TOR_TYPE' => is_gold($tor_type), 'TOR_TYPE' => is_gold($tor_type),
// torrent status mod // torrent status mod
'TOR_FROZEN' => !IS_AM ? (isset($bb_cfg['tor_frozen'][$tor_info['tor_status']]) && !(isset($bb_cfg['tor_frozen_author_download'][$tor_info['tor_status']]) && $userdata['user_id'] == $tor_info['poster_id'])) ? true : '' : '', 'TOR_FROZEN' => !IS_AM ? (isset(config()->get('tor_frozen')[$tor_info['tor_status']]) && !(isset(config()->get('tor_frozen_author_download')[$tor_info['tor_status']]) && $userdata['user_id'] == $tor_info['poster_id'])) ? true : '' : '',
'TOR_STATUS_TEXT' => $lang['TOR_STATUS_NAME'][$tor_info['tor_status']], 'TOR_STATUS_TEXT' => $lang['TOR_STATUS_NAME'][$tor_info['tor_status']],
'TOR_STATUS_ICON' => $bb_cfg['tor_icons'][$tor_info['tor_status']], 'TOR_STATUS_ICON' => config()->get('tor_icons')[$tor_info['tor_status']],
'TOR_STATUS_BY' => ($tor_info['checked_user_id'] && ($is_auth['auth_mod'] || $tor_status_by_for_all)) ? ('<span title="' . bb_date($tor_info['checked_time']) . '"> &middot; ' . profile_url($tor_info) . ' &middot; <i>' . delta_time($tor_info['checked_time']) . $lang['TOR_BACK'] . '</i></span>') : '', 'TOR_STATUS_BY' => ($tor_info['checked_user_id'] && ($is_auth['auth_mod'] || $tor_status_by_for_all)) ? ('<span title="' . bb_date($tor_info['checked_time']) . '"> &middot; ' . profile_url($tor_info) . ' &middot; <i>' . delta_time($tor_info['checked_time']) . $lang['TOR_BACK'] . '</i></span>') : '',
'TOR_STATUS_SELECT' => build_select('sel_status', array_flip($lang['TOR_STATUS_NAME']), TOR_APPROVED), 'TOR_STATUS_SELECT' => build_select('sel_status', array_flip($lang['TOR_STATUS_NAME']), TOR_APPROVED),
'TOR_STATUS_REPLY' => $bb_cfg['tor_comment'] && !IS_GUEST && in_array($tor_info['tor_status'], $bb_cfg['tor_reply']) && $userdata['user_id'] == $tor_info['poster_id'] && $t_data['topic_status'] != TOPIC_LOCKED, 'TOR_STATUS_REPLY' => config()->get('tor_comment') && !IS_GUEST && in_array($tor_info['tor_status'], config()->get('tor_reply')) && $userdata['user_id'] == $tor_info['poster_id'] && $t_data['topic_status'] != TOPIC_LOCKED,
//end torrent status mod //end torrent status mod
'S_UPLOAD_IMAGE' => $upload_image, 'S_UPLOAD_IMAGE' => $upload_image,
@ -219,7 +219,6 @@ if ($tor_reged && $tor_info) {
'HASH' => !empty($tor_info['info_hash']) ? strtoupper(bin2hex($tor_info['info_hash'])) : false, 'HASH' => !empty($tor_info['info_hash']) ? strtoupper(bin2hex($tor_info['info_hash'])) : false,
'HASH_V2' => !empty($tor_info['info_hash_v2']) ? strtoupper(bin2hex($tor_info['info_hash_v2'])) : false, 'HASH_V2' => !empty($tor_info['info_hash_v2']) ? strtoupper(bin2hex($tor_info['info_hash_v2'])) : false,
'FILELIST_ICON' => $images['icon_tor_filelist'], 'FILELIST_ICON' => $images['icon_tor_filelist'],
'FILELIST_LINK' => FILELIST_URL . $tor_info['topic_id'],
'REGED_TIME' => bb_date($tor_info['reg_time']), 'REGED_TIME' => bb_date($tor_info['reg_time']),
'REGED_DELTA' => delta_time($tor_info['reg_time']), 'REGED_DELTA' => delta_time($tor_info['reg_time']),
'TORRENT_SIZE' => humn_size($tor_size, 2), 'TORRENT_SIZE' => humn_size($tor_size, 2),
@ -228,7 +227,7 @@ if ($tor_reged && $tor_info) {
]); ]);
// TorrServer integration // TorrServer integration
if ($bb_cfg['torr_server']['enabled'] && (!IS_GUEST || !$bb_cfg['torr_server']['disable_for_guest']) && (new \TorrentPier\TorrServerAPI())->getM3UPath($attach_id)) { if (config()->get('torr_server.enabled') && (!IS_GUEST || !config()->get('torr_server.disable_for_guest')) && (new \TorrentPier\TorrServerAPI())->getM3UPath($attach_id)) {
$template->assign_block_vars('postrow.attach.tor_reged.tor_server', [ $template->assign_block_vars('postrow.attach.tor_reged.tor_server', [
'TORR_SERVER_M3U_LINK' => PLAYBACK_M3U_URL . $bt_topic_id, 'TORR_SERVER_M3U_LINK' => PLAYBACK_M3U_URL . $bt_topic_id,
'TORR_SERVER_M3U_ICON' => $images['icon_tor_m3u_icon'], 'TORR_SERVER_M3U_ICON' => $images['icon_tor_m3u_icon'],
@ -240,12 +239,12 @@ if ($tor_reged && $tor_info) {
} }
} }
if ($bb_cfg['show_tor_info_in_dl_list']) { if (config()->get('show_tor_info_in_dl_list')) {
$template->assign_vars([ $template->assign_vars([
'SHOW_DL_LIST' => true, 'SHOW_DL_LIST' => true,
'SHOW_DL_LIST_TOR_INFO' => true, 'SHOW_DL_LIST_TOR_INFO' => true,
'TOR_SIZE' => humn_size($tor_size, 1), 'TOR_SIZE' => humn_size($tor_size, 2),
'TOR_LONGEVITY' => delta_time($tor_info['reg_time']), 'TOR_LONGEVITY' => delta_time($tor_info['reg_time']),
'TOR_DOWNLOAD_COUNT' => $download_count, 'TOR_DOWNLOAD_COUNT' => $download_count,
'TOR_COMPLETED' => $tor_completed_count, 'TOR_COMPLETED' => $tor_completed_count,
@ -302,7 +301,7 @@ if ($tor_reged && $tor_info) {
$sql = "SELECT $sql = "SELECT
tr.user_id, tr.ip, tr.ipv6, tr.port, tr.peer_id, tr.uploaded, tr.downloaded, tr.remain, tr.user_id, tr.ip, tr.ipv6, tr.port, tr.peer_id, tr.uploaded, tr.downloaded, tr.remain,
tr.seeder, tr.releaser, tr.speed_up, tr.speed_down, tr.update_time, tr.seeder, tr.releaser, tr.speed_up, tr.speed_down, tr.update_time,
tr.complete_percent, u.username, u.user_rank tr.complete_percent, u.username, u.user_rank, u.user_opt
FROM " . BB_BT_TRACKER . " tr FROM " . BB_BT_TRACKER . " tr
LEFT JOIN " . BB_USERS . " u ON u.user_id = tr.user_id LEFT JOIN " . BB_USERS . " u ON u.user_id = tr.user_id
WHERE tr.topic_id = $tor_id WHERE tr.topic_id = $tor_id
@ -373,8 +372,8 @@ if ($tor_reged && $tor_info) {
$peers = $tmp; $peers = $tmp;
$template->assign_vars([ $template->assign_vars([
'TOR_SPEED_UP' => ($tor_speed_up) ? humn_size($tor_speed_up, 0, 'KB') . '/s' : '0 KB/s', 'TOR_SPEED_UP' => ($tor_speed_up) ? humn_size($tor_speed_up, min: 'KB') . '/s' : '0 KB/s',
'TOR_SPEED_DOWN' => ($tor_speed_down) ? humn_size($tor_speed_down, 0, 'KB') . '/s' : '0 KB/s' 'TOR_SPEED_DOWN' => ($tor_speed_down) ? humn_size($tor_speed_down, min: 'KB') . '/s' : '0 KB/s'
]); ]);
} }
@ -384,7 +383,9 @@ if ($tor_reged && $tor_info) {
// Full details mode // Full details mode
if ($s_mode == 'full') { if ($s_mode == 'full') {
if (!empty($peer['ip']) && !empty($peer['ipv6'])) { if (!empty($peer['ip']) && !empty($peer['ipv6'])) {
$ip = bt_show_ip($peer['ipv6']) . ' (' . bt_show_ip($peer['ip']) . ')'; if ($ip = bt_show_ip($peer['ipv6'])) {
$ip .= ' (' . bt_show_ip($peer['ip']) . ')';
}
} else { } else {
$ip = bt_show_ip(!empty($peer['ipv6']) ? $peer['ipv6'] : $peer['ip']); $ip = bt_show_ip(!empty($peer['ipv6']) ? $peer['ipv6'] : $peer['ip']);
} }
@ -407,7 +408,7 @@ if ($tor_reged && $tor_info) {
$template->assign_block_vars((string)$x_full, [ $template->assign_block_vars((string)$x_full, [
'SEED_ORD_ACT' => $seed_order_action, 'SEED_ORD_ACT' => $seed_order_action,
'SEEDERS_UP_TOT' => humn_size($sp_up_tot[$x], 0, 'KB') . '/s' 'SEEDERS_UP_TOT' => humn_size($sp_up_tot[$x], min: 'KB') . '/s'
]); ]);
if ($ip) { if ($ip) {
@ -429,8 +430,8 @@ if ($tor_reged && $tor_info) {
$template->assign_block_vars((string)$x_full, [ $template->assign_block_vars((string)$x_full, [
'LEECH_ORD_ACT' => $leech_order_action, 'LEECH_ORD_ACT' => $leech_order_action,
'LEECHERS_UP_TOT' => humn_size($sp_up_tot[$x], 0, 'KB') . '/s', 'LEECHERS_UP_TOT' => humn_size($sp_up_tot[$x], min: 'KB') . '/s',
'LEECHERS_DOWN_TOT' => humn_size($sp_down_tot[$x], 0, 'KB') . '/s' 'LEECHERS_DOWN_TOT' => humn_size($sp_down_tot[$x], min: 'KB') . '/s'
]); ]);
if ($ip) { if ($ip) {
@ -444,23 +445,48 @@ if ($tor_reged && $tor_info) {
$compl_perc = ($compl_size) ? floor($compl_size * 100 / $tor_size) : 0; $compl_perc = ($compl_size) ? floor($compl_size * 100 / $tor_size) : 0;
} }
$rel_sign = (!$guest && $peer['releaser']) ? '&nbsp;<b><sup>&reg;</sup></b>' : '';
$name = profile_url($peer) . $rel_sign;
$up_tot = ($p_max_up) ? humn_size($p_max_up) : '-'; $up_tot = ($p_max_up) ? humn_size($p_max_up) : '-';
$down_tot = ($p_max_down) ? humn_size($p_max_down) : '-'; $down_tot = ($p_max_down) ? humn_size($p_max_down) : '-';
$up_ratio = ($p_max_down) ? round(($p_max_up / $p_max_down), 2) : ''; $up_ratio = ($p_max_down) ? round(($p_max_up / $p_max_down), 2) : '';
$sp_up = ($peer['speed_up']) ? humn_size($peer['speed_up'], 0, 'KB') . '/s' : '-'; $sp_up = ($peer['speed_up']) ? humn_size($peer['speed_up'], min: 'KB') . '/s' : '-';
$sp_down = ($peer['speed_down']) ? humn_size($peer['speed_down'], 0, 'KB') . '/s' : '-'; $sp_down = ($peer['speed_down']) ? humn_size($peer['speed_down'], min: 'KB') . '/s' : '-';
$bgr_class = (!($tr[$x] % 2)) ? $bgr_class_1 : $bgr_class_2; $bgr_class = (!($tr[$x] % 2)) ? $bgr_class_1 : $bgr_class_2;
$row_bgr = ($change_peers_bgr_over) ? " class=\"$bgr_class\" onmouseover=\"this.className='$bgr_class_over';\" onmouseout=\"this.className='$bgr_class';\"" : ''; $row_bgr = ($change_peers_bgr_over) ? " class=\"$bgr_class\" onmouseover=\"this.className='$bgr_class_over';\" onmouseout=\"this.className='$bgr_class';\"" : '';
$tr[$x]++; $tr[$x]++;
$peerUsername = $lang['HIDDEN_USER'];
if (IS_AM || $peer['user_id'] == $userdata['user_id'] || !bf($peer['user_opt'], 'user_opt', 'user_hide_peer_username')) {
$releaserSign = (!$guest && $peer['releaser']) ? '&nbsp;<b><sup>&reg;</sup></b>' : '';
$peerUsername = profile_url($peer) . $releaserSign;
$peerUsername = $peer['update_time'] ? $peerUsername : "<s>$peerUsername</s>";
}
$peerTorrentClient = $lang['HIDDEN_USER'];
if (IS_AM || $peer['user_id'] == $userdata['user_id'] || !bf($peer['user_opt'], 'user_opt', 'user_hide_torrent_client')) {
if (isset($peer['peer_id'])) {
$peerTorrentClient = get_user_torrent_client($peer['peer_id']);
}
}
$peerCountry = $lang['HIDDEN_USER'];
if (config()->get('ip2country_settings.enabled')) {
if (IS_AM || $peer['user_id'] == $userdata['user_id'] || !bf($peer['user_opt'], 'user_opt', 'user_hide_peer_country')) {
if ($infoByIP = infoByIP((!empty($peer['ipv6']) ? $peer['ipv6'] : $peer['ip']), $peer['port'])) {
if (!empty($infoByIP['countryCode'])) {
$peerCountry = render_flag($infoByIP['countryCode'], false);
} else {
$peerCountry = $lang['NOT_AVAILABLE'];
}
}
}
}
$template->assign_block_vars("$x_full.$x_row", [ $template->assign_block_vars("$x_full.$x_row", [
'ROW_BGR' => $row_bgr, 'ROW_BGR' => $row_bgr,
'NAME' => ($peer['update_time']) ? $name : "<s>$name</s>", 'NAME' => $peerUsername,
'PEER_ID' => isset($peer['peer_id']) ? get_user_torrent_client($peer['peer_id']) : $lang['UNKNOWN'], 'PEER_ID' => $peerTorrentClient,
'COUNTRY' => render_flag(infoByIP((!empty($peer['ipv6']) ? $peer['ipv6'] : $peer['ip']), $peer['port'])['countryCode'], false), 'COUNTRY' => $peerCountry,
'COMPL_PRC' => $compl_perc, 'COMPL_PRC' => $compl_perc,
'UP_TOTAL' => ($max_up_id[$x] == $pid) ? "<b>$up_tot</b>" : $up_tot, 'UP_TOTAL' => ($max_up_id[$x] == $pid) ? "<b>$up_tot</b>" : $up_tot,
'DOWN_TOTAL' => ($max_down_id[$x] == $pid) ? "<b>$down_tot</b>" : $down_tot, 'DOWN_TOTAL' => ($max_down_id[$x] == $pid) ? "<b>$down_tot</b>" : $down_tot,
@ -470,12 +496,15 @@ if ($tor_reged && $tor_info) {
'DOWN_TOTAL_RAW' => $peer['downloaded'], 'DOWN_TOTAL_RAW' => $peer['downloaded'],
'SPEED_UP_RAW' => $peer['speed_up'], 'SPEED_UP_RAW' => $peer['speed_up'],
'SPEED_DOWN_RAW' => $peer['speed_down'], 'SPEED_DOWN_RAW' => $peer['speed_down'],
'UPD_EXP_TIME' => ($peer['update_time']) ? $lang['DL_UPD'] . bb_date($peer['update_time'], 'd-M-y H:i') . ' &middot; ' . delta_time($peer['update_time']) . $lang['TOR_BACK'] : $lang['DL_STOPPED'], 'UPD_EXP_TIME' => $peer['update_time'] ? $lang['DL_UPD'] . bb_date($peer['update_time'], 'd-M-y H:i') . ' &middot; ' . delta_time($peer['update_time']) . $lang['TOR_BACK'] : $lang['DL_STOPPED'],
'TOR_RATIO' => ($up_ratio) ? $lang['USER_RATIO'] . "UL/DL: $up_ratio" : '' 'TOR_RATIO' => $up_ratio ? $lang['USER_RATIO'] . "UL/DL: $up_ratio" : ''
]); ]);
if ($ip) { if ($ip) {
$template->assign_block_vars("$x_full.$x_row.ip", ['IP' => $ip]); $template->assign_block_vars("$x_full.$x_row.ip", [
'U_WHOIS_IP' => config()->get('whois_info') . $ip,
'IP' => $ip
]);
} }
if ($port !== false) { if ($port !== false) {
$template->assign_block_vars("$x_full.$x_row.port", ['PORT' => $port]); $template->assign_block_vars("$x_full.$x_row.port", ['PORT' => $port]);
@ -536,7 +565,7 @@ if ($tor_reged && $tor_info) {
} }
} }
if ($bb_cfg['bt_allow_spmode_change'] && $s_mode != 'full') { if (config()->get('bt_allow_spmode_change') && $s_mode != 'full') {
$template->assign_vars([ $template->assign_vars([
'PEERS_FULL_LINK' => true, 'PEERS_FULL_LINK' => true,
'SPMODE_FULL_HREF' => TOPIC_URL . "$bt_topic_id&amp;spmode=full#seeders" 'SPMODE_FULL_HREF' => TOPIC_URL . "$bt_topic_id&amp;spmode=full#seeders"
@ -544,14 +573,14 @@ if ($bb_cfg['bt_allow_spmode_change'] && $s_mode != 'full') {
} }
$template->assign_vars([ $template->assign_vars([
'SHOW_DL_LIST_LINK' => (($bb_cfg['bt_show_dl_list'] || $bb_cfg['allow_dl_list_names_mode']) && $t_data['topic_dl_type'] == TOPIC_DL_TYPE_DL), 'SHOW_DL_LIST_LINK' => ((config()->get('bt_show_dl_list') || config()->get('allow_dl_list_names_mode')) && $t_data['topic_dl_type'] == TOPIC_DL_TYPE_DL),
'SHOW_TOR_ACT' => ($tor_reged && $show_peers && (!isset($bb_cfg['tor_no_tor_act'][$tor_info['tor_status']]) || IS_AM)), 'SHOW_TOR_ACT' => ($tor_reged && $show_peers && (!isset(config()->get('tor_no_tor_act')[$tor_info['tor_status']]) || IS_AM)),
'S_MODE_COUNT' => ($s_mode == 'count'), 'S_MODE_COUNT' => ($s_mode == 'count'),
'S_MODE_NAMES' => ($s_mode == 'names'), 'S_MODE_NAMES' => ($s_mode == 'names'),
'S_MODE_FULL' => ($s_mode == 'full'), 'S_MODE_FULL' => ($s_mode == 'full'),
'PEER_EXIST' => ($seeders || $leechers || defined('SEEDER_EXIST') || defined('LEECHER_EXIST')), 'PEER_EXIST' => ($seeders || $leechers || defined('SEEDER_EXIST') || defined('LEECHER_EXIST')),
'SEED_EXIST' => ($seeders || defined('SEEDER_EXIST')), 'SEED_EXIST' => ($seeders || defined('SEEDER_EXIST')),
'LEECH_EXIST' => ($leechers || defined('LEECHER_EXIST')), 'LEECH_EXIST' => ($leechers || defined('LEECHER_EXIST')),
'TOR_HELP_LINKS' => $bb_cfg['tor_help_links'], 'TOR_HELP_LINKS' => config()->get('tor_help_links'),
'CALL_SEED' => (!IS_GUEST && $bb_cfg['callseed'] && $tor_reged && !isset($bb_cfg['tor_no_tor_act'][$tor_info['tor_status']]) && $seed_count < 3 && $tor_info['call_seed_time'] < (TIMENOW - 86400)), 'CALL_SEED' => (!IS_GUEST && config()->get('callseed') && $tor_reged && !isset(config()->get('tor_no_tor_act')[$tor_info['tor_status']]) && $seed_count < 3 && $tor_info['call_seed_time'] < (TIMENOW - 86400)),
]); ]);

View file

@ -342,7 +342,7 @@ function _set_var(&$result, $var, $type, $multibyte = false)
* @param $var_name * @param $var_name
* @param $default * @param $default
* @param bool $multibyte * @param bool $multibyte
* @return array * @return array|string
*/ */
function get_var($var_name, $default, $multibyte = false) function get_var($var_name, $default, $multibyte = false)
{ {

View file

@ -16,7 +16,7 @@
*/ */
function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0, $user_id = 0) function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0, $user_id = 0)
{ {
global $lang, $bb_cfg; global $lang;
// Generate Array, if it's not an array // Generate Array, if it's not an array
if ($post_id_array === 0 && $attach_id_array === 0 && $page === 0) { if ($post_id_array === 0 && $attach_id_array === 0 && $page === 0) {
@ -215,7 +215,7 @@ function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0,
} }
// TorrServer integration // TorrServer integration
if ($bb_cfg['torr_server']['enabled']) { if (config()->get('torr_server.enabled')) {
$torrServer = new \TorrentPier\TorrServerAPI(); $torrServer = new \TorrentPier\TorrServerAPI();
$torrServer->removeM3U($attachments[$j]['attach_id']); $torrServer->removeM3U($attachments[$j]['attach_id']);
} }

View file

@ -18,8 +18,8 @@ $reserved_port = env('TP_PORT', 80);
$bb_cfg = []; $bb_cfg = [];
// Version info // Version info
$bb_cfg['tp_version'] = 'v2.4.5'; $bb_cfg['tp_version'] = 'v2.8.3';
$bb_cfg['tp_release_date'] = '06-02-2025'; $bb_cfg['tp_release_date'] = '03-07-2025';
$bb_cfg['tp_release_codename'] = 'Cattle'; $bb_cfg['tp_release_codename'] = 'Cattle';
// Increase version number after changing JS or CSS // Increase version number after changing JS or CSS
@ -60,27 +60,22 @@ $bb_cfg['cache'] = [
'host' => '127.0.0.1', 'host' => '127.0.0.1',
'port' => 11211, 'port' => 11211,
], ],
'redis' => [ // Available cache types: file, sqlite, memory, memcached (file by default)
'host' => '127.0.0.1',
'port' => 6379,
'pconnect' => !PHP_ZTS, // Redis pconnect supported only for non-thread safe compilations of PHP
],
// Available cache types: filecache, memcached, sqlite, redis, apcu (filecache by default)
'engines' => [ 'engines' => [
'bb_cache' => ['filecache'], 'bb_cache' => ['file'],
'bb_config' => ['filecache'], 'bb_config' => ['file'],
'tr_cache' => ['filecache'], 'tr_cache' => ['file'],
'session_cache' => ['filecache'], 'session_cache' => ['file'],
'bb_cap_sid' => ['filecache'], 'bb_cap_sid' => ['file'],
'bb_login_err' => ['filecache'], 'bb_login_err' => ['file'],
'bb_poll_data' => ['filecache'], 'bb_poll_data' => ['file'],
'bb_ip2countries' => ['filecache'], 'bb_ip2countries' => ['file'],
], ],
]; ];
// Datastore // Datastore
// Available datastore types: filecache, memcached, sqlite, redis, apcu (filecache by default) // Available datastore types: file, sqlite, memory, memcache (file by default)
$bb_cfg['datastore_type'] = 'filecache'; $bb_cfg['datastore_type'] = 'file';
// Server // Server
$bb_cfg['server_name'] = $domain_name = !empty($_SERVER['SERVER_NAME']) ? idn_to_utf8($_SERVER['SERVER_NAME']) : $reserved_name; $bb_cfg['server_name'] = $domain_name = !empty($_SERVER['SERVER_NAME']) ? idn_to_utf8($_SERVER['SERVER_NAME']) : $reserved_name;
@ -144,10 +139,12 @@ $bb_cfg['torr_server'] = [
'disable_for_guest' => true 'disable_for_guest' => true
]; ];
// IndexNow settings // FreeIPAPI settings
$bb_cfg['indexnow_settings'] = [ $bb_cfg['ip2country_settings'] = [
'enabled' => false, // Documentation: https://docs.freeipapi.com/
'host' => 'bing', // Available: yandex, bing, seznam, naver 'enabled' => true,
'endpoint' => 'https://freeipapi.com/api/json/',
'api_token' => '', // not required for basic usage
]; ];
// FAQ url help link // FAQ url help link
@ -193,6 +190,7 @@ $bb_cfg['posting_url'] = 'posting.php'; # "http://{$domain_name}/posting.php"
$bb_cfg['pm_url'] = 'privmsg.php'; # "http://{$domain_name}/privmsg.php" $bb_cfg['pm_url'] = 'privmsg.php'; # "http://{$domain_name}/privmsg.php"
// Language // Language
$bb_cfg['auto_language_detection'] = true; // Use browser language (auto-detect) as default language for guests
$bb_cfg['lang'] = [ $bb_cfg['lang'] = [
// Languages available for selecting // Languages available for selecting
'af' => [ 'af' => [
@ -206,6 +204,7 @@ $bb_cfg['lang'] = [
'ar' => [ 'ar' => [
'name' => 'Arabic', 'name' => 'Arabic',
'locale' => 'ar_SA.UTF-8', 'locale' => 'ar_SA.UTF-8',
'rtl' => true,
], ],
'hy' => [ 'hy' => [
'name' => 'Armenian', 'name' => 'Armenian',
@ -282,6 +281,7 @@ $bb_cfg['lang'] = [
'he' => [ 'he' => [
'name' => 'Hebrew', 'name' => 'Hebrew',
'locale' => 'he_IL.UTF-8', 'locale' => 'he_IL.UTF-8',
'rtl' => true,
], ],
'hi' => [ 'hi' => [
'name' => 'Hindi', 'name' => 'Hindi',
@ -425,7 +425,7 @@ $bb_cfg['invites_system'] = [
// Syntax: 'invite_code' => 'validity_period' // Syntax: 'invite_code' => 'validity_period'
// The 'validity_period' value is based on strtotime() function: https://www.php.net/manual/en/function.strtotime.php // The 'validity_period' value is based on strtotime() function: https://www.php.net/manual/en/function.strtotime.php
// You can also create a permanent invite, set 'permanent' value for 'validity_period' // You can also create a permanent invite, set 'permanent' value for 'validity_period'
// Invite link example: site_url/profile.php?mode=register&invite=new_year // Invite link example: site_url/profile.php?mode=register&invite=new_year2023
'new_year2023' => '2022-12-31 00:00:01', 'new_year2023' => '2022-12-31 00:00:01',
'340c4bb6ea2d284c13e085b60b990a8a' => '12 April 1961', '340c4bb6ea2d284c13e085b60b990a8a' => '12 April 1961',
'tp_birthday' => '2005-04-04', 'tp_birthday' => '2005-04-04',
@ -434,22 +434,23 @@ $bb_cfg['invites_system'] = [
]; ];
$bb_cfg['password_symbols'] = [ $bb_cfg['password_symbols'] = [
// What symbols should be required in the password // What symbols should be required in the password
'nums' => true, // Numeric 'nums' => true,
'spec_symbols' => false, // Special symbols 'spec_symbols' => false,
'letters' => [ // Letters 'letters' => [
'uppercase' => true, // Uppercase letters 'uppercase' => false,
'lowercase' => true // Lowercase letters 'lowercase' => true
] ]
]; ];
$bb_cfg['password_hash_options'] = [ $bb_cfg['password_hash_options'] = [
// https://www.php.net/manual/ru/password.constants.php // https://www.php.net/manual/ru/password.constants.php
'algo' => PASSWORD_BCRYPT, 'algo' => PASSWORD_BCRYPT,
'options' => [] 'options' => ['cost' => 12]
]; ];
// Email // Email
$bb_cfg['emailer'] = [ $bb_cfg['emailer'] = [
'enabled' => true, 'enabled' => true,
'sendmail_command' => '/usr/sbin/sendmail -bs',
'smtp' => [ 'smtp' => [
'enabled' => false, // send email via external SMTP server 'enabled' => false, // send email via external SMTP server
'host' => 'localhost', // SMTP server host 'host' => 'localhost', // SMTP server host
@ -521,7 +522,10 @@ $bb_cfg['sf_on_first_page_only'] = true; // Show subforums only on the first pag
$bb_cfg['allowed_topics_per_page'] = [50, 100, 150, 200, 250, 300]; // Allowed number of topics per page $bb_cfg['allowed_topics_per_page'] = [50, 100, 150, 200, 250, 300]; // Allowed number of topics per page
// Topics // Topics
$bb_cfg['show_post_bbcode_button'] = true; // Show "Code" button in topic to display BBCode of topic $bb_cfg['show_post_bbcode_button'] = [ // Show "Code" button in topic to display BBCode of topic
'enabled' => true,
'only_for_first_post' => true,
];
$bb_cfg['show_quick_reply'] = true; // Show quick reply forim $bb_cfg['show_quick_reply'] = true; // Show quick reply forim
$bb_cfg['show_rank_text'] = false; // Show user rank name in topics $bb_cfg['show_rank_text'] = false; // Show user rank name in topics
$bb_cfg['show_rank_image'] = true; // Show user rank image in topics $bb_cfg['show_rank_image'] = true; // Show user rank image in topics
@ -602,7 +606,6 @@ $bb_cfg['flist_max_files'] = 0; // Max allowed number of files to process for gi
$bb_cfg['last_visit_date_format'] = 'd-M H:i'; $bb_cfg['last_visit_date_format'] = 'd-M H:i';
$bb_cfg['last_post_date_format'] = 'd-M-y H:i'; $bb_cfg['last_post_date_format'] = 'd-M-y H:i';
$bb_cfg['poll_max_days'] = 180; // How many days will the poll be active $bb_cfg['poll_max_days'] = 180; // How many days will the poll be active
$bb_cfg['integrity_check'] = true; // TorrentPier files integrity check
$bb_cfg['allow_change'] = [ $bb_cfg['allow_change'] = [
'language' => true, // Allow user to change language 'language' => true, // Allow user to change language
@ -672,7 +675,7 @@ $bb_cfg['group_avatars'] = [
// Captcha // Captcha
$bb_cfg['captcha'] = [ $bb_cfg['captcha'] = [
'disabled' => true, 'disabled' => true,
'service' => 'googleV3', // Available services: googleV2, googleV3, hCaptcha, yandex, cloudflare 'service' => 'googleV3', // Available services: text, googleV2, googleV3, hCaptcha, yandex, cloudflare
'public_key' => '', 'public_key' => '',
'secret_key' => '', 'secret_key' => '',
'theme' => 'light', // theming (available: light, dark) (working only if supported by captcha service) 'theme' => 'light', // theming (available: light, dark) (working only if supported by captcha service)

View file

@ -20,7 +20,6 @@ define('LOG_DIR', BB_PATH . '/internal_data/log');
define('TRIGGERS_DIR', BB_PATH . '/internal_data/triggers'); define('TRIGGERS_DIR', BB_PATH . '/internal_data/triggers');
define('AJAX_DIR', BB_PATH . '/library/ajax'); define('AJAX_DIR', BB_PATH . '/library/ajax');
define('ATTACH_DIR', BB_PATH . '/library/attach_mod'); define('ATTACH_DIR', BB_PATH . '/library/attach_mod');
define('CFG_DIR', BB_PATH . '/library/config');
define('INC_DIR', BB_PATH . '/library/includes'); define('INC_DIR', BB_PATH . '/library/includes');
define('UCP_DIR', BB_PATH . '/library/includes/ucp'); define('UCP_DIR', BB_PATH . '/library/includes/ucp');
define('LANG_ROOT_DIR', BB_PATH . '/library/language'); define('LANG_ROOT_DIR', BB_PATH . '/library/language');
@ -33,13 +32,8 @@ define('APP_NAME', 'TorrentPier');
define('DEFAULT_CHARSET', 'UTF-8'); define('DEFAULT_CHARSET', 'UTF-8');
define('UPDATER_URL', 'https://api.github.com/repos/torrentpier/torrentpier/releases'); define('UPDATER_URL', 'https://api.github.com/repos/torrentpier/torrentpier/releases');
define('UPDATER_FILE', INT_DATA_DIR . '/updater.json'); define('UPDATER_FILE', INT_DATA_DIR . '/updater.json');
define('CHECKSUMS_FILE', INT_DATA_DIR . '/checksums.md5');
define('RESTORE_CORRUPT_CONFIRM_FILE', INT_DATA_DIR . '/rescorrupt.integrity');
define('COOKIE_DBG', 'bb_dbg'); define('COOKIE_DBG', 'bb_dbg');
// TODO: Move in another section
define('API_IP_URL', 'https://freeipapi.com/api/json/');
// Templates // Templates
define('ADMIN_TPL_DIR', TEMPLATES_DIR . '/admin/'); define('ADMIN_TPL_DIR', TEMPLATES_DIR . '/admin/');
define('XS_USE_ISSET', '1'); define('XS_USE_ISSET', '1');
@ -89,11 +83,15 @@ define('CRON_RUNNING', TRIGGERS_DIR . '/cron_running');
define('GZIP_OUTPUT_ALLOWED', extension_loaded('zlib') && !ini_get('zlib.output_compression')); define('GZIP_OUTPUT_ALLOWED', extension_loaded('zlib') && !ini_get('zlib.output_compression'));
define('UA_GZIP_SUPPORTED', isset($_SERVER['HTTP_ACCEPT_ENCODING']) && str_contains($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')); define('UA_GZIP_SUPPORTED', isset($_SERVER['HTTP_ACCEPT_ENCODING']) && str_contains($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'));
// Migrations table
define('BB_MIGRATIONS', 'bb_migrations');
// Tracker shared constants // Tracker shared constants
define('BB_BT_TORRENTS', 'bb_bt_torrents'); define('BB_BT_TORRENTS', 'bb_bt_torrents');
define('BB_BT_TRACKER', 'bb_bt_tracker'); define('BB_BT_TRACKER', 'bb_bt_tracker');
define('BB_BT_TRACKER_SNAP', 'bb_bt_tracker_snap'); define('BB_BT_TRACKER_SNAP', 'bb_bt_tracker_snap');
define('BB_BT_USERS', 'bb_bt_users'); define('BB_BT_USERS', 'bb_bt_users');
define('BB_USERS', 'bb_users');
define('BT_AUTH_KEY_LENGTH', 20); // Passkey length define('BT_AUTH_KEY_LENGTH', 20); // Passkey length
// Torrents (reserved: -1) // Torrents (reserved: -1)
@ -139,6 +137,15 @@ define('ONLY_NEW_TOPICS', 2);
define('GUEST_UID', -1); define('GUEST_UID', -1);
define('BOT_UID', -746); define('BOT_UID', -746);
// User Levels
define('DELETED', -1);
define('USER', 0);
define('ADMIN', 1);
define('MOD', 2);
define('GROUP_MEMBER', 20);
define('CP_HOLDER', 25);
define('EXCLUDED_USERS', implode(',', [GUEST_UID, BOT_UID]));
// Ratio limits // Ratio limits
define('TR_RATING_LIMITS', true); // ON/OFF define('TR_RATING_LIMITS', true); // ON/OFF
define('MIN_DL_FOR_RATIO', 10737418240); // 10 GB in bytes, 0 - disable define('MIN_DL_FOR_RATIO', 10737418240); // 10 GB in bytes, 0 - disable

View file

@ -1 +0,0 @@
Require all denied

View file

@ -83,6 +83,23 @@ HTML;
<span class="post-hr">-</span> <span class="post-hr">-</span>
HTML; HTML;
// Box
$bbcode_tpl['box_open'] = <<<HTML
<div class="post-box-default"><div class="post-box">
HTML;
$bbcode_tpl['box_open_color'] = <<<HTML
<div class="post-box-default"><div class="post-box" style="border-color: $1; background-color: $2;">
HTML;
$bbcode_tpl['box_open_color_single'] = <<<HTML
<div class="post-box-default"><div class="post-box" style="border-color: $1;">
HTML;
$bbcode_tpl['box_close'] = <<<HTML
</div></div>
HTML;
array_deep($bbcode_tpl, 'bbcode_tpl_compact'); array_deep($bbcode_tpl, 'bbcode_tpl_compact');
return $bbcode_tpl; return $bbcode_tpl;
} }
@ -106,7 +123,7 @@ function prepare_message($message)
// Either in a window or inline // Either in a window or inline
function generate_smilies($mode) function generate_smilies($mode)
{ {
global $bb_cfg, $template, $lang, $user, $datastore; global $template, $lang, $user, $datastore;
$inline_columns = 4; $inline_columns = 4;
$inline_rows = 7; $inline_rows = 7;
@ -118,7 +135,7 @@ function generate_smilies($mode)
$data = $datastore->get('smile_replacements'); $data = $datastore->get('smile_replacements');
if ($sql = $data['smile']) { if (isset($data['smile']) && $sql = $data['smile']) {
$num_smilies = 0; $num_smilies = 0;
$rowset = []; $rowset = [];
foreach ($sql as $row) { foreach ($sql as $row) {
@ -143,7 +160,7 @@ function generate_smilies($mode)
$template->assign_block_vars('smilies_row.smilies_col', [ $template->assign_block_vars('smilies_row.smilies_col', [
'SMILEY_CODE' => $data['code'], 'SMILEY_CODE' => $data['code'],
'SMILEY_IMG' => $bb_cfg['smilies_path'] . '/' . $smile_url, 'SMILEY_IMG' => config()->get('smilies_path') . '/' . $smile_url,
'SMILEY_DESC' => $data['emoticon'], 'SMILEY_DESC' => $data['emoticon'],
]); ]);
@ -324,11 +341,9 @@ function strip_bbcode($message, $stripquotes = true, $fast_and_dirty = false, $s
function extract_search_words($text) function extract_search_words($text)
{ {
global $bb_cfg; $max_words_count = config()->get('max_search_words_per_post');
$min_word_len = max(2, config()->get('search_min_word_len') - 1);
$max_words_count = $bb_cfg['max_search_words_per_post']; $max_word_len = config()->get('search_max_word_len');
$min_word_len = max(2, $bb_cfg['search_min_word_len'] - 1);
$max_word_len = $bb_cfg['search_max_word_len'];
$text = ' ' . str_compact(strip_tags(mb_strtolower($text))) . ' '; $text = ' ' . str_compact(strip_tags(mb_strtolower($text))) . ' ';
$text = str_replace(['&#91;', '&#93;'], ['[', ']'], $text); $text = str_replace(['&#91;', '&#93;'], ['[', ']'], $text);
@ -365,12 +380,10 @@ function extract_search_words($text)
function add_search_words($post_id, $post_message, $topic_title = '', $only_return_words = false) function add_search_words($post_id, $post_message, $topic_title = '', $only_return_words = false)
{ {
global $bb_cfg;
$text = $topic_title . ' ' . $post_message; $text = $topic_title . ' ' . $post_message;
$words = ($text) ? extract_search_words($text) : []; $words = ($text) ? extract_search_words($text) : [];
if ($only_return_words || $bb_cfg['search_engine_type'] == 'sphinx') { if ($only_return_words || config()->get('search_engine_type') == 'sphinx') {
return implode("\n", $words); return implode("\n", $words);
} }
@ -388,12 +401,12 @@ function add_search_words($post_id, $post_message, $topic_title = '', $only_retu
function bbcode2html($text) function bbcode2html($text)
{ {
global $bbcode, $wordCensor; global $bbcode;
if (!isset($bbcode)) { if (!isset($bbcode)) {
$bbcode = new TorrentPier\Legacy\BBCode(); $bbcode = new TorrentPier\Legacy\BBCode();
} }
$text = $wordCensor->censorString($text); $text = censor()->censorString($text);
return $bbcode->bbcode2html($text); return $bbcode->bbcode2html($text);
} }
@ -408,22 +421,19 @@ function get_words_rate($text)
function hide_passkey($str) function hide_passkey($str)
{ {
global $bb_cfg; return preg_replace("#\?{config()->get('passkey_key')}=[a-zA-Z0-9]{" . BT_AUTH_KEY_LENGTH . "}#", "?{config()->get('passkey_key')}=passkey", $str);
return preg_replace("#\?{$bb_cfg['passkey_key']}=[a-zA-Z0-9]{" . BT_AUTH_KEY_LENGTH . "}#", "?{$bb_cfg['passkey_key']}=passkey", $str);
} }
function get_parsed_post($postrow, $mode = 'full', $return_chars = 600) function get_parsed_post($postrow, $mode = 'full', $return_chars = 600)
{ {
global $bb_cfg; if (config()->get('use_posts_cache') && !empty($postrow['post_html'])) {
if ($bb_cfg['use_posts_cache'] && !empty($postrow['post_html'])) {
return $postrow['post_html']; return $postrow['post_html'];
} }
$message = bbcode2html($postrow['post_text']); $message = bbcode2html($postrow['post_text']);
// Posts cache // Posts cache
if ($bb_cfg['use_posts_cache']) { if (config()->get('use_posts_cache')) {
DB()->shutdown['post_html'][] = [ DB()->shutdown['post_html'][] = [
'post_id' => (int)$postrow['post_id'], 'post_id' => (int)$postrow['post_id'],
'post_html' => (string)$message 'post_html' => (string)$message

View file

@ -13,11 +13,10 @@ if (!defined('BB_ROOT')) {
define('IN_CRON', true); define('IN_CRON', true);
// Set SESSION vars // Set SESSION vars (optimized for InnoDB)
DB()->query(" DB()->query("
SET SESSION SET SESSION
myisam_sort_buffer_size = 16*1024*1024 bulk_insert_buffer_size = 8*1024*1024
, bulk_insert_buffer_size = 8*1024*1024
, join_buffer_size = 4*1024*1024 , join_buffer_size = 4*1024*1024
, read_buffer_size = 4*1024*1024 , read_buffer_size = 4*1024*1024
, read_rnd_buffer_size = 8*1024*1024 , read_rnd_buffer_size = 8*1024*1024
@ -29,8 +28,7 @@ DB()->query("
// Restore vars at shutdown // Restore vars at shutdown
DB()->add_shutdown_query(" DB()->add_shutdown_query("
SET SESSION SET SESSION
myisam_sort_buffer_size = DEFAULT bulk_insert_buffer_size = DEFAULT
, bulk_insert_buffer_size = DEFAULT
, join_buffer_size = DEFAULT , join_buffer_size = DEFAULT
, read_buffer_size = DEFAULT , read_buffer_size = DEFAULT
, read_rnd_buffer_size = DEFAULT , read_rnd_buffer_size = DEFAULT

View file

@ -26,9 +26,9 @@ $posts_without_attach = $topics_without_attach = [];
DB()->query(" DB()->query("
CREATE TEMPORARY TABLE $tmp_attach_tbl ( CREATE TEMPORARY TABLE $tmp_attach_tbl (
physical_filename VARCHAR(255) NOT NULL default '', physical_filename VARCHAR(255) NOT NULL default '' COLLATE utf8mb4_unicode_ci,
KEY physical_filename (physical_filename(20)) KEY physical_filename (physical_filename(20))
) ENGINE = MyISAM DEFAULT CHARSET = utf8 ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci
"); ");
DB()->add_shutdown_query("DROP TEMPORARY TABLE IF EXISTS $tmp_attach_tbl"); DB()->add_shutdown_query("DROP TEMPORARY TABLE IF EXISTS $tmp_attach_tbl");
@ -144,7 +144,7 @@ if ($check_attachments) {
$orphan_db_attach[] = $row['attach_id']; $orphan_db_attach[] = $row['attach_id'];
} }
// Delete all orphan attachments // Delete all orphan attachments
if ($bb_cfg['torr_server']['enabled'] && $fix_errors) { if (config()->get('torr_server.enabled') && $fix_errors) {
foreach ($orphan_db_attach as $attach_id) { foreach ($orphan_db_attach as $attach_id) {
// TorrServer integration // TorrServer integration
$torrServer = new \TorrentPier\TorrServerAPI(); $torrServer = new \TorrentPier\TorrServerAPI();

View file

@ -17,7 +17,7 @@ if (!defined('BB_ROOT')) {
\TorrentPier\Legacy\Admin\Common::sync_all_forums(); \TorrentPier\Legacy\Admin\Common::sync_all_forums();
// Cleaning bb_poll_users // Cleaning bb_poll_users
if ($poll_max_days = (int)$bb_cfg['poll_max_days']) { if ($poll_max_days = (int)config()->get('poll_max_days')) {
$per_cycle = 20000; $per_cycle = 20000;
$row = DB()->fetch_row("SELECT MIN(topic_id) AS start_id, MAX(topic_id) AS finish_id FROM " . BB_POLL_USERS); $row = DB()->fetch_row("SELECT MIN(topic_id) AS start_id, MAX(topic_id) AS finish_id FROM " . BB_POLL_USERS);
$start_id = (int)$row['start_id']; $start_id = (int)$row['start_id'];
@ -45,12 +45,12 @@ if ($poll_max_days = (int)$bb_cfg['poll_max_days']) {
DB()->query("UPDATE " . BB_USERS . " SET user_newpasswd = '' WHERE user_lastvisit < " . (TIMENOW - 7 * 86400)); DB()->query("UPDATE " . BB_USERS . " SET user_newpasswd = '' WHERE user_lastvisit < " . (TIMENOW - 7 * 86400));
// Cleaning post cache // Cleaning post cache
if ($posts_days = (int)$bb_cfg['posts_cache_days_keep']) { if ($posts_days = (int)config()->get('posts_cache_days_keep')) {
DB()->query("DELETE FROM " . BB_POSTS_HTML . " WHERE post_html_time < DATE_SUB(NOW(), INTERVAL $posts_days DAY)"); DB()->query("DELETE FROM " . BB_POSTS_HTML . " WHERE post_html_time < DATE_SUB(NOW(), INTERVAL $posts_days DAY)");
} }
// Autofill announcer url // Autofill announcer url
if (empty($bb_cfg['bt_announce_url']) || ($bb_cfg['bt_announce_url'] === 'https://localhost/bt/announce.php')) { if (empty(config()->get('bt_announce_url')) || (config()->get('bt_announce_url') === 'https://localhost/bt/announce.php')) {
bb_update_config(['bt_announce_url' => FULL_URL . 'bt/announce.php']); bb_update_config(['bt_announce_url' => FULL_URL . 'bt/announce.php']);
} }
@ -59,22 +59,5 @@ if (IN_DEMO_MODE) {
DB()->query("UPDATE " . BB_FORUMS . " SET allow_reg_tracker = 1 WHERE allow_reg_tracker = 0 AND forum_id = 1 LIMIT 1"); DB()->query("UPDATE " . BB_FORUMS . " SET allow_reg_tracker = 1 WHERE allow_reg_tracker = 0 AND forum_id = 1 LIMIT 1");
} }
// Create unique TorrentPier instance hash
if (empty($bb_cfg['tp_instance_hash']) || ($bb_cfg['tp_instance_hash'] !== hash('xxh128', FULL_URL))) {
bb_update_config(['tp_instance_hash' => hash('xxh128', FULL_URL)]);
}
// Generate IndexNow key
if ($bb_cfg['indexnow_settings']['enabled'] && !is_file(BB_ROOT . $bb_cfg['indexnow_key'] . \TorrentPier\IndexNow::$keyFileExtension)) {
$randomIndexNowKey = empty($bb_cfg['indexnow_key']) ? make_rand_str(rand(64, 128)) : $bb_cfg['indexnow_key'];
if ($bb_cfg['indexnow_key'] !== $randomIndexNowKey) {
bb_update_config(['indexnow_key' => $randomIndexNowKey]);
}
file_write($randomIndexNowKey, (BB_ROOT . $randomIndexNowKey . \TorrentPier\IndexNow::$keyFileExtension));
}
// Check for updates // Check for updates
$datastore->update('check_updates'); $datastore->update('check_updates');
// Integrity check
$datastore->update('files_integrity');

View file

@ -13,10 +13,10 @@ if (!defined('BB_ROOT')) {
// Delete staled dl-status records // Delete staled dl-status records
$keeping_dlstat = [ $keeping_dlstat = [
DL_STATUS_WILL => (int)$bb_cfg['dl_will_days_keep'], DL_STATUS_WILL => (int)config()->get('dl_will_days_keep'),
DL_STATUS_DOWN => (int)$bb_cfg['dl_down_days_keep'], DL_STATUS_DOWN => (int)config()->get('dl_down_days_keep'),
DL_STATUS_COMPLETE => (int)$bb_cfg['dl_complete_days_keep'], DL_STATUS_COMPLETE => (int)config()->get('dl_complete_days_keep'),
DL_STATUS_CANCEL => (int)$bb_cfg['dl_cancel_days_keep'] DL_STATUS_CANCEL => (int)config()->get('dl_cancel_days_keep')
]; ];
$delete_dlstat_sql = []; $delete_dlstat_sql = [];
@ -51,7 +51,7 @@ DB()->query("
"); ");
// Tor-Stats cleanup // Tor-Stats cleanup
if ($torstat_days_keep = (int)$bb_cfg['torstat_days_keep']) { if ($torstat_days_keep = (int)config()->get('torstat_days_keep')) {
DB()->query("DELETE QUICK FROM " . BB_BT_TORSTAT . " WHERE last_modified_torstat < DATE_SUB(NOW(), INTERVAL $torstat_days_keep DAY)"); DB()->query("DELETE QUICK FROM " . BB_BT_TORSTAT . " WHERE last_modified_torstat < DATE_SUB(NOW(), INTERVAL $torstat_days_keep DAY)");
} }

View file

@ -11,7 +11,7 @@ if (!defined('BB_ROOT')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
$log_days_keep = (int)$bb_cfg['log_days_keep']; $log_days_keep = (int)config()->get('log_days_keep');
if ($log_days_keep !== 0) { if ($log_days_keep !== 0) {
DB()->query("DELETE FROM " . BB_LOG . " WHERE log_time < " . (TIMENOW - 86400 * $log_days_keep)); DB()->query("DELETE FROM " . BB_LOG . " WHERE log_time < " . (TIMENOW - 86400 * $log_days_keep));

View file

@ -11,7 +11,7 @@ if (!defined('BB_ROOT')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
$pm_days_keep = (int)$bb_cfg['pm_days_keep']; $pm_days_keep = (int)config()->get('pm_days_keep');
if ($pm_days_keep !== 0) { if ($pm_days_keep !== 0) {
$per_cycle = 20000; $per_cycle = 20000;

View file

@ -1,44 +0,0 @@
<?php
/**
* TorrentPier Bull-powered BitTorrent tracker engine
*
* @copyright Copyright (c) 2005-2025 TorrentPier (https://torrentpier.com)
* @link https://github.com/torrentpier/torrentpier for the canonical source repository
* @license https://github.com/torrentpier/torrentpier/blob/master/LICENSE MIT License
*/
if (!defined('BB_ROOT')) {
die(basename(__FILE__));
}
set_time_limit(600);
global $cron_runtime_log;
$dump_path = BB_ROOT . 'install/sql/mysql.sql';
if (!IN_DEMO_MODE || !is_file($dump_path) || !is_readable($dump_path)) {
return;
}
// Clean cache & datastore
$datastore->clean();
foreach ($bb_cfg['cache']['engines'] as $cache_name => $cache_val) {
CACHE($cache_name)->rm();
}
// Drop tables & Insert sql dump
$temp_line = '';
foreach (file($dump_path) as $line) {
if (str_starts_with($line, '--') || $line == '') {
continue;
}
$temp_line .= $line;
if (str_ends_with(trim($line), ';')) {
if (!DB()->query($temp_line)) {
$cron_runtime_log[] = date('Y-m-d H:i:s') . " -- Error performing query: " . $temp_line . " | " . DB()->sql_error()['message'];
}
$temp_line = '';
}
}

View file

@ -11,7 +11,7 @@ if (!defined('BB_ROOT')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
if ($bb_cfg['prune_enable']) { if (config()->get('prune_enable')) {
$sql = "SELECT forum_id, prune_days FROM " . BB_FORUMS . " WHERE prune_days != 0"; $sql = "SELECT forum_id, prune_days FROM " . BB_FORUMS . " WHERE prune_days != 0";
foreach (DB()->fetch_rowset($sql) as $row) { foreach (DB()->fetch_rowset($sql) as $row) {

View file

@ -17,7 +17,7 @@ while (true) {
set_time_limit(600); set_time_limit(600);
$prune_users = $not_activated_users = $not_active_users = []; $prune_users = $not_activated_users = $not_active_users = [];
if ($not_activated_days = (int)$bb_cfg['user_not_activated_days_keep']) { if ($not_activated_days = (int)config()->get('user_not_activated_days_keep')) {
$sql = DB()->fetch_rowset("SELECT user_id FROM " . BB_USERS . " $sql = DB()->fetch_rowset("SELECT user_id FROM " . BB_USERS . "
WHERE user_level = 0 WHERE user_level = 0
AND user_lastvisit = 0 AND user_lastvisit = 0
@ -31,7 +31,7 @@ while (true) {
} }
} }
if ($not_active_days = (int)$bb_cfg['user_not_active_days_keep']) { if ($not_active_days = (int)config()->get('user_not_active_days_keep')) {
$sql = DB()->fetch_rowset("SELECT user_id FROM " . BB_USERS . " $sql = DB()->fetch_rowset("SELECT user_id FROM " . BB_USERS . "
WHERE user_level = 0 WHERE user_level = 0
AND user_posts = 0 AND user_posts = 0

View file

@ -11,8 +11,8 @@ if (!defined('BB_ROOT')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
if ($bb_cfg['topic_moved_days_keep']) { if (config()->get('topic_moved_days_keep')) {
$prune_time = TIMENOW - 86400 * $bb_cfg['topic_moved_days_keep']; $prune_time = TIMENOW - 86400 * config()->get('topic_moved_days_keep');
DB()->query(" DB()->query("
DELETE FROM " . BB_TOPICS . " DELETE FROM " . BB_TOPICS . "

View file

@ -11,10 +11,10 @@ if (!defined('BB_ROOT')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
$user_session_expire_time = TIMENOW - (int)$bb_cfg['user_session_duration']; $user_session_expire_time = TIMENOW - (int)config()->get('user_session_duration');
$admin_session_expire_time = TIMENOW - (int)$bb_cfg['admin_session_duration']; $admin_session_expire_time = TIMENOW - (int)config()->get('admin_session_duration');
$user_session_gc_time = $user_session_expire_time - (int)$bb_cfg['user_session_gc_ttl']; $user_session_gc_time = $user_session_expire_time - (int)config()->get('user_session_gc_ttl');
$admin_session_gc_time = $admin_session_expire_time; $admin_session_gc_time = $admin_session_expire_time;
// ############################ Tables LOCKED ################################ // ############################ Tables LOCKED ################################

View file

@ -27,7 +27,7 @@ DB()->query("CREATE TABLE " . NEW_BB_BT_LAST_USERSTAT . " LIKE " . BB_BT_LAST_US
DB()->expect_slow_query(600); DB()->expect_slow_query(600);
// Update dlstat (part 1) // Update dlstat (part 1)
if ($bb_cfg['tracker']['update_dlstat']) { if (config()->get('tracker.update_dlstat')) {
// ############################ Tables LOCKED ################################ // ############################ Tables LOCKED ################################
DB()->lock([ DB()->lock([
BB_BT_TRACKER, BB_BT_TRACKER,
@ -39,7 +39,7 @@ if ($bb_cfg['tracker']['update_dlstat']) {
INSERT INTO " . NEW_BB_BT_LAST_TORSTAT . " INSERT INTO " . NEW_BB_BT_LAST_TORSTAT . "
(topic_id, user_id, dl_status, up_add, down_add, release_add, speed_up, speed_down) (topic_id, user_id, dl_status, up_add, down_add, release_add, speed_up, speed_down)
SELECT SELECT
topic_id, user_id, IF(releaser, $releaser, seeder), SUM(up_add), SUM(down_add), IF(releaser, SUM(up_add), 0), SUM(speed_up), SUM(speed_down) topic_id, user_id, IF(MAX(releaser), $releaser, MAX(seeder)), SUM(up_add), SUM(down_add), IF(MAX(releaser), SUM(up_add), 0), SUM(speed_up), SUM(speed_down)
FROM " . BB_BT_TRACKER . " FROM " . BB_BT_TRACKER . "
WHERE (up_add != 0 OR down_add != 0) WHERE (up_add != 0 OR down_add != 0)
GROUP BY topic_id, user_id GROUP BY topic_id, user_id
@ -61,20 +61,19 @@ DB()->query("
FROM " . BB_BT_TRACKER . " FROM " . BB_BT_TRACKER . "
WHERE seeder = 1 WHERE seeder = 1
GROUP BY topic_id, user_id GROUP BY topic_id, user_id
ORDER BY update_time DESC
"); ");
// Clean peers table // Clean peers table
if ($bb_cfg['tracker']['autoclean']) { if (config()->get('tracker.autoclean')) {
$announce_interval = max((int)$bb_cfg['announce_interval'], 60); $announce_interval = max((int)config()->get('announce_interval'), 60);
$expire_factor = max((float)$bb_cfg['tracker']['expire_factor'], 1); $expire_factor = max((float)config()->get('tracker.expire_factor'), 1);
$peer_expire_time = TIMENOW - floor($announce_interval * $expire_factor); $peer_expire_time = TIMENOW - floor($announce_interval * $expire_factor);
DB()->query("DELETE FROM " . BB_BT_TRACKER . " WHERE update_time < $peer_expire_time"); DB()->query("DELETE FROM " . BB_BT_TRACKER . " WHERE update_time < $peer_expire_time");
} }
// Update dlstat (part 2) // Update dlstat (part 2)
if ($bb_cfg['tracker']['update_dlstat']) { if (config()->get('tracker.update_dlstat')) {
// Set "only 1 seeder" bonus // Set "only 1 seeder" bonus
DB()->query(" DB()->query("
UPDATE UPDATE

View file

@ -11,12 +11,12 @@ if (!defined('BB_ROOT')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
if (empty($bb_cfg['seeder_last_seen_days_keep']) || empty($bb_cfg['seeder_never_seen_days_keep'])) { if (empty(config()->get('seeder_last_seen_days_keep')) || empty(config()->get('seeder_never_seen_days_keep'))) {
return; return;
} }
$last_seen_time = TIMENOW - 86400 * $bb_cfg['seeder_last_seen_days_keep']; $last_seen_time = TIMENOW - 86400 * config()->get('seeder_last_seen_days_keep');
$never_seen_time = TIMENOW - 86400 * $bb_cfg['seeder_never_seen_days_keep']; $never_seen_time = TIMENOW - 86400 * config()->get('seeder_never_seen_days_keep');
$limit_sql = 3000; $limit_sql = 3000;
$topics_sql = $attach_sql = []; $topics_sql = $attach_sql = [];

View file

@ -11,8 +11,6 @@ if (!defined('BB_ROOT')) {
die(basename(__FILE__)); die(basename(__FILE__));
} }
global $bb_cfg;
DB()->expect_slow_query(600); DB()->expect_slow_query(600);
// //
@ -81,7 +79,7 @@ DB()->query("DROP TABLE IF EXISTS " . NEW_BB_BT_DLSTATUS_SNAP . ", " . OLD_BB_BT
DB()->query("CREATE TABLE " . NEW_BB_BT_DLSTATUS_SNAP . " LIKE " . BB_BT_DLSTATUS_SNAP); DB()->query("CREATE TABLE " . NEW_BB_BT_DLSTATUS_SNAP . " LIKE " . BB_BT_DLSTATUS_SNAP);
if ($bb_cfg['bt_show_dl_list'] && $bb_cfg['bt_dl_list_only_count']) { if (config()->get('bt_show_dl_list') && config()->get('bt_dl_list_only_count')) {
DB()->query(" DB()->query("
INSERT INTO " . NEW_BB_BT_DLSTATUS_SNAP . " INSERT INTO " . NEW_BB_BT_DLSTATUS_SNAP . "
(topic_id, dl_status, users_count) (topic_id, dl_status, users_count)
@ -104,7 +102,7 @@ DB()->query("DROP TABLE IF EXISTS " . NEW_BB_BT_DLSTATUS_SNAP . ", " . OLD_BB_BT
// //
// TORHELP // TORHELP
// //
if ($bb_cfg['torhelp_enabled']) { if (config()->get('torhelp_enabled')) {
$tor_min_seeders = 0; // "<=" $tor_min_seeders = 0; // "<="
$tor_min_leechers = 2; // ">=" $tor_min_leechers = 2; // ">="
$tor_min_completed = 10; // ">=" $tor_min_completed = 10; // ">="
@ -147,7 +145,7 @@ if ($bb_cfg['torhelp_enabled']) {
WHERE WHERE
trsn.seeders <= $tor_min_seeders trsn.seeders <= $tor_min_seeders
AND trsn.leechers >= $tor_min_leechers AND trsn.leechers >= $tor_min_leechers
AND tor.forum_id != " . (int)$bb_cfg['trash_forum_id'] . " AND tor.forum_id != " . (int)config()->get('trash_forum_id') . "
AND tor.complete_count >= $tor_min_completed AND tor.complete_count >= $tor_min_completed
AND tor.seeder_last_seen <= (UNIX_TIMESTAMP() - $tor_seed_last_seen_days*86400) AND tor.seeder_last_seen <= (UNIX_TIMESTAMP() - $tor_seed_last_seen_days*86400)
AND dl.user_id IN($online_users_csv) AND dl.user_id IN($online_users_csv)

Some files were not shown because too many files have changed in this diff Show more