Commit graph

43 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
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
Tadhg Boyle
d0fba0cbe9
Replace Util::getSetting/Util::setSetting usages (#3387) 2023-06-12 10:30:49 -06:00
Tadhg Boyle
8d09a86cb8
Misc fixes + improvements (#3270) 2023-03-23 20:01:23 -07:00
Tadhg Boyle
6cd9b134e1
Fix LatestPostsWidget bugs (#3204)
* Fix MySQL `IN` clause string interpolation in Forum `getLatestDiscussions`

* Fix $limit being applied

* Remove comments
2023-01-18 19:21:41 +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
Partydragen
c8390f0cdd Add limit setting to latest posts widget
Closes https://github.com/NamelessMC/Nameless/issues/2862
2022-10-13 20:00:41 +02:00
Tadhg Boyle
8ba42f7a83 Fix random issue with Forum::getLatestDiscussions returning an array of objects 2022-06-14 20:30:54 -06: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
eb8841149d Remove unneeded = in where clauses 2022-05-01 23:22:19 -07:00
Tadhg Boyle
2c21149a1e
Use i18n for translations (#2658)
* Dependency updates

* Start i18n conversion

* Switch to ellipsis character

* Add Dutch language json

* Remove Dutch PHP language files + fix variables

* Further variable fixes

* WIP i18n Language class conversion

* Convert Cookie Consent module to new language format

* Further progress including timeago translations

* Misc

* Replace {x}

* Replace more {x} usage

* {{time}}

this took way too long

* replace last {x}

* Remove comments

So searching for {x} produces relevant results

* forgot to save

* move to onPageLoad

* Accept both string and int

* types in doc

* Remove unused (broken?) function

* Don't convert to string first

* Last arg doesn't seem to be used anywhere

* Time `{x}` replacements

* Email `{x}` replacements

* misc `{x}` replacements

* misc `{x}` replacements

* misc `{x}` replacements

* misc `{x}` replacements

* misc `{x}` replacements

* misc `{x}` replacements

* misc `{x}` replacements

* misc `{x}` replacements

* misc `{x}` replacements

* remove comments (makes searching for "{x}" nicer)

* misc `{x}` replacements

* JS `{x}` replacements

* Cleanup language initialization

* Change language constant + add pluralForm support

* Misc language update things

* Add script to find unused terms

* Check all quote types

* Remove most english translations from non-english languages

* Also match with more args

* Missed some apparently

* Missed some (more) apparently

* Misc work

* Add script to convert *all* language files to json

* Fix language codes

* Remove a lot of unused terms

* Remove a lot more unused terms

* Convert everything to JSON, delete old files, get installer working with new system

* Fix general configuration language dropdown + email messages

* Fix page load time, fix language term `set` method

* Fix discord integration command

* Misc

* Misc

* Uncomment RTL definition

* Misc

* Convert links

* Convert links

* Convert links

* Convert links

* Misc work (bolding, fixes, etc)

* Style fix

* Fix variable

* Fix #2668

* Fix old page load timers

* Fix installer group sync injector error

* Convert integration language terms

* Fix more integration language things

* Re-add upgrade script language things

* Resolve PR comments

* Remove unnecessary date()

* Resolve some PR issues

* Fix endpoint

* Style

* Fix Semantic -> Fomantic

* Fix Semantic -> Fomantic

* Return locale short code, not language id/name

Only the short code is interesting to the API, return short code in user info endpoint just like in the website info endpoint.

Also renamed to locale because it's language + region

* Revert "warn people to not translate old language files"

This reverts commit 690b77afff.

* Fix query when there are no filters

* Update 200-pr12.php

* Update footer.php

* insert time into string using placeholder

* Fix getDisplayname case

* Clean username

* PR suggestions

* Include newly created language in converted languages (migration)

* PR suggestions

* PR suggestions

* Update init.php

* Fix default language

Co-authored-by: samerton <samerton@users.noreply.github.com>
Co-authored-by: Robin <robinslot@hotmail.nl>
Co-authored-by: Robin <robin+git@rkslot.nl>
Co-authored-by: Partydragen <adrian_kili@outlook.com>
2022-04-23 14:27:10 +01:00
Robin
6936126fc1 Rename getGroupClass to getGroupStyle
without breaking backwards compatibility
2022-04-21 22:35:56 +02: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
Robin
7eca85b6d1 Ensure data in urls is properly encoded 2022-04-02 17:43:21 +02:00
Tadhg Boyle
d99168ae82
Add support for custom universal DATE_FORMAT constant (#2656) 2022-04-01 12:49:21 -07:00
Robin
127455a83a Use Output::getClean 2022-03-31 21:56:57 +02:00
Tadhg Boyle
ff71d5e931 Use array method callable syntax for sitemap method registration 2022-03-29 15:09:21 -07:00
Tadhg
e0133a5cd5 Get PHP-CS to pass! 2021-12-07 22:14:12 -08:00
Tadhg
1566c86067 Fix some CS issues 2021-12-07 20:51:29 -08:00
Tadhg
3d03636506 Revert "Add PHP-CS to GitHub actions + fix most errors"
This reverts commit b17b292eda.
2021-12-07 20:17:45 -08:00
Tadhg
b17b292eda Add PHP-CS to GitHub actions + fix most errors 2021-12-07 20:06:10 -08:00
Tadhg
b26fbedd2a remove unneeded default parameter values 2021-11-01 10:11:53 -07: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
a9c678e4d4 convert all array(...) syntax to [...] 2021-10-29 22:00:05 -07:00
Tadhg
bdf6af33ff use 7.4 null operator 2021-10-28 13:14:57 -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
b6e759ddf6 fix references to TimeAgo in wrong case 2021-10-07 22:48:04 -07:00
Tadhg
7f7fb119c1 Add types to all classes 2021-10-07 14:02:46 -07:00
Tadhg
dd5c66a609 fix old usages of $user->getAvatar() 2021-05-09 14:59:39 -07: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
d77c130e57 Fix missing file to User Group Update 2020-12-13 14:05:59 +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
4d20eb1038 Add user popups 2018-10-01 00:13:37 +01:00
samerton
cd02999dfc Update module, template + widget systems 2018-09-10 01:14:58 +01:00
samerton
a19d4ab162 Allow ordering widgets 2018-08-28 16:15:25 +01:00
Sam
e8d2c231c5 Add module name to widget list 2017-10-06 20:22:17 +01:00
Sam
a0d0ad4c7b Add latest posts widget 2017-08-08 20:48:45 +01:00