73 Commits

Author SHA1 Message Date
slawkens
085ebbcfde All $cache->set calls should have $ttl 2025-01-12 17:13:25 +01:00
slawkens
8e501c0e9c Shorten code with Cache::remember 2025-01-09 15:50:33 +01:00
Slawomir Boczek
fe7ad61abe
phpstan support (#250)
* phpstan v1 + workflow

* Fix intend

* More fixes

* Update phpstan.neon

* phpstan level 2

* Move errors ignoring into phpstan.neon

* phpstan level 3

* Don't ignore templates folder

* Something from level 4

* Update phpstan.neon
2024-02-18 14:59:25 +01:00
slawkens
ccfd2b4f55 Rename creatures to monsters 2024-02-03 20:54:09 +01:00
slawkens
6bac02bd35 Fix links to some pages that has been renamed 2024-01-30 18:09:57 +01:00
slawkens
31f8c99745 $menu['target_blank'] 2024-01-27 23:25:03 +01:00
slawkens
1a6fb8bee2 Refactoring classes into src/ folder, so they will be auto-loaded by composer 2024-01-27 00:36:49 +01:00
slawkens
f719c02050 Feature: auto-load themes (previously templates) from plugins/*/themes/* 2024-01-25 23:06:10 +01:00
slawkens
0746708743 Reviewed some settings again, fixing many glitches 2023-08-24 17:20:32 +02:00
Gabriel Pedro
a692607c5e
feat: replace POT Query Builder to Eloquent ORM (#230)
* wip

* wip

* wip

* wip

* wip

* fix: reusing pdo connection from pot

* wip

* wip

* wip

* wip

* move files

In future, all classes will be in src/ folder

* Replace namespace name, for future

* Remove duplicated exception

* Fix towns from db

* Fix spells page

* Add default FAQ question + FAQ model

* feat: reset colors in menus

* Add confirm + save button at the top (menus)

* Do not insert duplicated FAQ on install

* Refactor install menus

* Fix changelogs showing

* Fix menu update, only with specified template name

* Fix account create -> missing compat

* Fix bans_per_page

* banned_by is player_id. type = 2 is namelock in tfs 0.3

* Add getPlayerNameById, fix getPlayerNameByAccount

* Change link name

* Order by lastlogin

* fix: query optimize

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Refactor notepad.php, class was useless

* This is showing error, if the updated rows = 0

* Fix success & error class (bootstrap)

* Uncomment require migrate.php

* Some distro have owner_id

* Update Player.php

---------

Co-authored-by: slawkens <slawkens@gmail.com>
2023-08-21 10:16:58 +02:00
Slawomir Boczek
a72d1a3c9f
Feature: settings (#216)
* New admin panel Pages: Options + Config [WIP]

* Forgot the plugin example of options

* Rename to settings.php

* Add Settings Class

* New myaac_settings table

* Add $limit parameter to $db->select method

* Add $member var annotation

* Remove useless title_separator from config

* Move $menus to menus.php

Also fix active link when menu item has subpage

* Settings [WIP]

New Settings class
New Plugins::load() method
Move config.php to settings.php
MyAAC Settings will have plugin_name = 'core'
Add compat_config.php

* Change options.php to settings.php

* Change name to settings

* Add Settings menu

* Add Sections + Add setting($key) function

Reorganisation

* Add email + password fields as type

* Update 33.php

* add settings migration

* php 8 compatibility

* add missing hook

* Add categories in tabs, move more settings, revert back getPluginSettings

Categories and sections are now not numbered
Remove example settings plugin

* fix typo

* Update .gitignore

* Add 36th migration for settings table

* Execute migrations just after db connect

* Update plugins.php

* [WIP] Some work on settings

Add hidden settings
New method: parse, to parse settings from array
Move base html to twig template
Remove vocation loading from .xml, instead use predefined voc names

* Rename

* Fix path

* [WIP] More work on settings

Move more config to settings (mainly mail_* + some other)
Remove mail_admin, wasnt used anywhere
Add return type to some functions
Add Twig settings(key) function
Possibility to save setting to db

* Add min, max, step to number field option

* Re-enable plugin if disabled and already installed

* Add Settings menu, including all plugins with settings

One change included in previous commit, due to missclick

* Nothing important

* Better boolean detection

* More detailed error message in settings

* Lets call it settings.name instead

* Add new function: only_if, to hide fields when they are not enabled [WIP]

Not fully finished yet

* guild_management: show_if

* Hide section title on show_if

* Fix: check on page load if radio button is checked

* Add: show_if - account_mail_verify

* nothing important

* Rename team_* variables + add to deprecated

* Change variable name

* Extract Settings:save function

* Add settings.callbacks.get

* Move forum config to settings

* Move status config to settings

* Remove whitespaces

* More config to settings: account_types, genders, highscores, admin

* Move signature config to settings

* Move news config to settings

* Rename variable

* Save config.php in Settings

Egg and hen problem solved :)
* Test database connection on save settings -> prevents from making website unusable if connection is wrong
* Test server_path -> same
There is no config.php anymore, just config.local.php, which can be edited manually and also from admin panel

* Remove configs from previous commit

* Fix create account, if account_create_character_create is enabled

* Add more deprecated configs

* Add more info into comment

* Update 5-database.php

* Fix menu highlighting & opening

* Update template.php

* Enable script option

* Reword email settings + move two new settings

* add last_kills_limit + move shop

* google_analytics_id

* add mail_lost_account_interval

* Create character blocked words (by @gpedro), just moved to settings

* Fix google_analytics

* create character name config moved to settings

* Fix for install warning - min/max length

* New create character checks configurable: block monsters & spells names

* fixes

* Improve character npc name check

* New setting: donate_column + move donate config to settings

* Add super fancy No Refresh saving with a toast

* Add new possibility: to deny saving setting if condition is not met

* Move database settings to separate category

* Fix default value displaying

* Add database_hash setting

* add last_kills_limit to compat config

* Move create character blocked names down

* Every setting needs to have default

* Move rest of config to settings

Remove config.php completely
Add new settings category: Game
Fix account_login_by_email
Min textarea size = 2 + adjusted automatically
2023-08-05 21:00:45 +02:00
slawkens
7300e4f1ad Cleaning unused variable 2021-06-08 07:44:16 +02:00
slawkens
523afccb51 Avoid ERR_TOO_MANY_REDIRECTS on template change 2020-06-03 20:01:26 +02:00
slawkens
df2d83b8a0 Fix updating template menus on template change 2020-03-21 05:16:12 +01:00
slawkens
2c114aa559 Fix some PHP warning 2020-02-28 20:20:56 +01:00
Evil Puncker
af1a6cf5ff Updated copyright year and SSL link
Updated year to 2019 and made all my-aac.org links go to SSL by default
2019-07-17 20:22:07 -03:00
tobi132
f5374e8ce7 Allow simultaneous loading of config.ini and config.php in templates 2019-07-16 23:52:28 +02:00
tobi132
0c207ce12d This check is useless 2019-07-16 23:36:39 +02:00
slawkens
933b25194c * cache hooks and template menus 2019-05-25 00:18:30 +02:00
slawkens
b50d0cd710 Throw an exception if template index file cannot be found 2018-10-16 01:34:48 +02:00
slawkens
45a387000d * optimize template load code (less file_exists checks) 2018-06-03 17:07:44 +02:00
slawkens
eab416c0b4 * some optimizations & fixes according to awesome PHPStorm Php Inspections plugin! 2018-03-21 13:52:41 +01:00
slawkens1
755adb0863 * forgot to add latest migration to schema.sql
* default link color can be changed for each template
2018-01-14 15:21:20 +01:00
slawkens1
ab73c602c3 * colorful dynamic menus!
* and also: blank option for menus
* NOTICE: Not all templates support that options yet
2018-01-14 14:29:53 +01:00
slawkens1
854560b2f5 * added news preview function (news, ticker, article)
* update TODO
2018-01-03 23:49:46 +01:00
slawkens1
c4a1f7df5f * check user IP on install to prevent install by random user 2017-12-25 23:03:00 +01:00
slawkens
7b84614a79 * removed @version header from files, as it was hard to maintain 2017-11-09 10:02:15 +01:00
slawkens
39fee6e57d * menus are now showed by the order they're saved into menu_categories configurable
* fixed visitors in admin panel showing, when cache is disabled
2017-11-06 08:50:06 +01:00
slawkens
9aa4e308c1 * reverted removing base href in html head
* added anonymous usage statistics reporting
* (fix) don't show templates that doesn't exist in Menus option in Admin Panel
* (fix) menu ordering by category
* (fix) showing changelog with urls in Admin Panel
* (internal) moved uninstall logic to Plugins class
2017-11-03 09:43:47 +01:00
slawkens
6c9e09ea73 * moved template menus to database, they're now dynamically loaded
* you can edit them in Admin Panel under 'Menus' option.
* you can also add custom links, like http://google.pl
* removed videos pages, as it can be easily added using custom Menus and Pages with insert Media
* removed bug_report configurable, its now enabled by default
2017-10-24 14:42:23 +02:00
slawkens1
1610a4ab91 * update to 0.6.6 2017-10-22 23:38:51 +02:00
slawkens1
2b6d65e955 * update to 0.6.5 2017-10-21 04:32:20 +02:00
slawkens1
9f946d4bc4 * update to 0.6.4 2017-10-20 22:17:54 +02:00
slawkens1
85c9a1e84d * update to 0.6.3 2017-10-20 21:18:50 +02:00
slawkens1
8ab7be9fb8 * update to 0.6.2 2017-10-20 18:16:52 +02:00
slawkens
c2678aa91f * PLEASE RELOAD YOUR ITEMS AND MONSTERS AFTER THIS UPDATE
* save monster loot in database in json format instead loading it every time from xml file
* store monster voices and immunities in json format
* removed useless monsters.gfx_name field from database
* convert item name to item id in loot in monsters.xml loader
* after changing template you will be redirected to latest viewed page
* display gallery add image form only on main gallery page
* fixed displaying monster loot when item.name in loot is used instead of item.id
* (intern) added new function getItemNameById($id)
* (intern) renamed database field monsters.hide_creature to hidden
2017-10-20 15:04:11 +02:00
slawkens1
0b693a02bd * update to 0.6.1 2017-10-17 23:18:20 +02:00
slawkens
1727df7082 * new configurable: session_prefix, to allow more websites on one machine
* must be unique for every website on your dedicated server!
2017-10-17 16:09:07 +02:00
slawkens
c914a73352 * update to 0.6.0 2017-10-16 17:18:37 +02:00
slawkens
dd572b00d0 * renamed screenshots to gallery and movies to videos 2017-10-16 09:25:26 +02:00
slawkens
e92e5d1040 * update to 0.5.1 2017-10-11 17:01:14 +02:00
slawkens
739782109e * update to 0.5.0 2017-10-10 15:50:46 +02:00
slawkens1
856e72150c * fixed adding/editing commands
* fixed undefined index in install plugin
2017-10-09 20:34:06 +02:00
slawkens
7b234ad41f * moved .htaccess rules to plain php (index.php)
Its a salut to nginx and other web server nutzer (not apache), as they can now simply redirect all requests with simple rule to index.php, and php will take care of all redirects. .htaccess just now redirects everything to index.php with simple 3 lines.
* change accountmanagement links to use friendly_urls
* fixed creating new forum thread
* some fixes in account changecomment action
* show info when account name/number or password is empty on login
* fixed showing account login errors
* added new twig function getLink that convert link taking into account config.friendly_urls
* internalLayoutLink -> getLink
2017-10-06 17:11:06 +02:00
slawkens
35b0795b51 * update to 0.4.3 2017-10-05 17:19:49 +02:00
slawkens
6527d21794 * updated version number
* updated to 0.4.2
2017-09-14 08:37:53 +02:00
slawkens
7fad722927 * update to 0.4.1 2017-09-13 16:39:09 +02:00
slawkens
ac3691dc08 * update to 0.4.0
* fixed some bugs in bugtracker
* updated database to version 9
2017-09-13 15:30:18 +02:00
slawkens
4685c7b868 * renamed twig templates to .twig, so IDE's can correctly render it
* moved news.add to twig template
* now twig templates will be loaded directly from template dir f.e. templates/kathrine/news.html.twig
2017-09-11 11:11:43 +02:00
Angel Of Death
a897b5e98c *Rework old code 2017-09-04 20:19:22 +02:00