Commit graph

32 commits

Author SHA1 Message Date
tadhgboyle
07d1e05229
Create and implement Cache#fetch (#3662)
* Create and implement `Cache#fetch`

* convert more

* fix

* wip

* wip

* Apply fixes from StyleCI (#3663)

Co-authored-by: StyleCI Bot <bot@styleci.io>

* wip, more conversions

* clear widget cache on setting update

* fix

* convert

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2025-05-20 18:37:24 -07:00
tadhgboyle
86bdaad50d
Remove redundant try/catch blocks (#3647) 2025-05-10 17:43:44 -07:00
Sam
db647d9b4e
Add Smarty and Twig template engines (#3452)
* Add Smarty and Twig template engines

* Update composer.json

* Convert Widgets class to template engine and PHPStan fixes

* Fix widget initialisation

* Fix panel widget initialisation

* chore: remove debug return

* feat: convert 403/404 pages to new template system and general tidy

* chore: style fixes

* feat: update latest pages to new template engine

* feat: template base should not be nullable in onPageLoad

* feat: set template base directory upon initialisation and allow custom smarty security directories

* chore: fix style
2025-02-24 18:44:29 +00:00
Tadhg Boyle
b13c29e5e4
Reactions revamp & profile widgets (#3272)
* Initial work on reactions revamp and profile widgets

* Remove unneeded changes

* Remove unneeded change

* fix style

* Render emojis in reaction list StaffCP

* wip minecraft account profile widget, sticky widgets on profile page

* Add server name and IP to last seen

* remove

* rename to reaction score to match member list

* align reactions table contents center

* fix

* wip - nicer abstraction, widgets never query db, skin 3d viewer (undecided)

* wip - make reaction modals ajax, copy new reaction bar to profile posts

* wip reaction modals

* wip proper sorting

* wip modals

* wip get reaction submission working on profile wall posts

* add back helpful and creative default reactions

* reduce query amount on view topic

* remove debug statement

* wip

* wip

* simplify ProfileWidget pages

* Revert forum dropdown

* fix css syntax

* fix emoji title and alt being strange

* add back order input

* sort widgets by order in list

* fix settings link always showing

* phpdoc

* add widget name to exception

* insert default widget data if not found

* missing end if

* properly cache forum news per-group

* fix

* fix cache key, news permission check

* fix styling

* wip

* respect reaction ordering

* wip

* wip

* support custom reaction scores, update member list to properly calculate

* don't hardcode words

* wip

* allow multiple reactions

* redirect to post

* code style

* phpstan

* wip

* remove hardcoded terms + fix copy

* use npm for skinview3d

* create ReactionContext and refactor

* fix cache

* docblocks

* fix spelling

* pr amendments
2023-06-21 18:19:46 +01:00
Sam
125965d374
Various performance improvements (#3119)
* Various performance improvements

* Remove debug

* Remove more debug

* Improve StaffCP total users widget
2022-11-18 19:16:24 +00:00
Robin
67ee4bd17b Remove more queries usage 2022-06-01 11:09:17 +02:00
Robin
c2a1d934ff Deprecate redundant method in queries class 2022-05-28 14:10:01 +02:00
PadowYT2
f01f8b3dbe Resolve conversation & from #2757 2022-05-27 11:54:24 +03:00
Tadhg Boyle
3d635fd512 Fix various undefined issues which were bloating logs 2022-05-22 18:20:49 -06:00
Tadhg Boyle
f261f09471 Pass Language instance instead of array to StatsWidget 2022-05-22 18:11:40 -06:00
Tadhg Boyle
eb8841149d Remove unneeded = in where clauses 2022-05-01 23:22:19 -07:00
Tadhg Boyle
40ef677c25 Init 2022-05-01 23:16:22 -07:00
Robin
6936126fc1 Rename getGroupClass to getGroupStyle
without breaking backwards compatibility
2022-04-21 22:35:56 +02:00
Tadhg Boyle
fb452ca1b0 Remove unused $user variable 2022-04-13 18:17:20 -07:00
Tadhg Boyle
374cc22384 Remove redundant queries during widget init, fix Discord widget when no guild ID is set 2022-04-13 17:05:42 -07:00
Tadhg
e0133a5cd5 Get PHP-CS to pass! 2021-12-07 22:14:12 -08:00
samerton
746c658988 Merge from v2 2021-10-31 15:41:14 +00:00
samerton
06b97b7b86 Move cookie notice to new module
Also default night_mode to null in user table
2021-10-31 15:11:50 +00:00
Tadhg
0070143417 Add types to Core module widgets 2021-10-30 16:44:05 -07:00
Tadhg
6e3fe3db8a misc code style fixes 2021-10-29 22:09:38 -07:00
Tadhg
a9c678e4d4 convert all array(...) syntax to [...] 2021-10-29 22:00:05 -07:00
Tadhg
b9b8b21309 rename DB::query() and DB_Custom::query() to selectQuery() [keeps + deprecates old query() method] 2021-10-25 15:42:39 -07:00
Tadhg Boyle
5a6e1528cb
Error handling revamp (#2194)
* initial work

* more work

* more work

* further work

* unbreak isset() call

* fix height of code preview

* dont hardcode highlighted line #

* unbreak endpoint

* change highlight colour + more

* fix start line if file is shorter than line buffer

* ignore empty/invalid/unknown frames

* move main catch to init file

its not viable to try/catch whole index.php (class preloading, config globals etc).

* use set_exception_handler rather than jank try/catch

* error page style update

* remove "ignored frames" and just show "cannot read file"

* add auto "fatal" logging + let catchException() be called manually from catchError()

* formatting + fix count() for frame number

* create parseFrame function, remove ? from assets

* update + clean prismjs files, fix spacings

* re-add shutdown function catcher

* rename variables + add docs

* fix meta tag location

* remove try/catch which immediately die()

this will cause all exceptions to be handled by new handler + logged with detail.
2021-03-19 00:39:52 -07:00
Derkades
2405ba039b Style fixes 2020-12-19 19:25:59 +01:00
Tadhg
32d2dca911 fix #1961 2020-12-14 14:20:28 -08:00
Partydragen
a82bbebb5e Eliminate 9 queries 2020-12-13 14:38:38 +01:00
Partydragen
442501132d Update Widgets to new system 2020-11-03 21:30:55 +01:00
Tadhg
f62b0b0216 Add Widget setting for being on Left or Right 2020-09-11 22:45:46 -07:00
Tadhg Boyle
0560fd907b
Discord Integration! Sync your roles between your NamelessMC site and your Discord Guild. (#1764)
* Initial commit, big additions. Linking/verifying discord id is complete

* Update admin.php

* Better validation errors + language updating

* Apply role change on user edit page - still some things to flush out though

* flush out some edge cases

* Add role in discord upon account validation & more

* Add api endpoint (need to test) & a lot of TODOs

* fix announcements a bit on Default template

* define bot url for easier move to self-hosting

* Add discord->website (adding) sync & lots of the TODOs

* Add discord role removal api endpoint

* Add logging od discord role add/remove & fix log table

* Add api_url to discord request for extra security & add todo's for error handling

* More API error handling for discord bot

* Add boilerplate error handling if bot throws error

* Add error messages for all discord linking

* If they have a role on the site, give it to them when they verify their id

* Resolve Sam's review

* Add info msgs so people know where to get discord IDs

* Add all language translations and update NMC version strings
2020-07-25 21:00:41 -07:00
samerton
5129bca612 Add check to prevent online guests query before upgrade script is run 2020-01-05 18:01:51 +00:00
samerton
963c1b4c1b Add more variables to Statistics widget 2020-01-04 17:26:45 +00:00
Xemah
024eab113c
Add Statistics Widget 2019-01-27 22:28:19 +05:00