aboutsummaryrefslogtreecommitdiffstats
path: root/core
AgeCommit message (Collapse)AuthorFilesLines
2021-07-22Add LIMIT and OFFSET parameters for search methodThomas Lange1-3/+7
2021-07-22Merge GET parameters into pagination URLThomas Lange1-1/+4
2021-07-22Add demo category and update other demo entitiesThomas Lange1-4/+6
2021-07-22Do not redefine properties of Entity classThomas Lange4-12/+0
Do not redefine properties that are already defined in the Entity class.
2021-07-22Rename: Append "Repository" to repository classesThomas Lange6-22/+19
Rename the repository classes and append the name with "Repository" to prevent naming confusions with the entity classes.
2021-07-20Implement new *content functions* feature (readme)Thomas Lange3-1/+159
This commit implements a new feature called *content functions* that is similar but much more powerful than the already existing *content tags* which you may have already used (`{POST[1]}`, for example). You now can also add your own *content functions* to do some interesting things like embedding a YouTube video or other things to prevent typing repetitive lines of text or code in your entities content. Read the corresponding wiki page to learn more about this: https://github.com/Nerdmind/Blog/wiki/Content-functions
2021-07-20Rename and reorganize several "get count" methodsThomas Lange7-43/+49
2021-07-19Add and use new parser/transformer classesThomas Lange5-83/+171
Classes: * Parsers\ArgumentParser * Parsers\EmoticonParser * Parsers\MarkdownParser Interfaces: * Parsers\ParserInterface
2021-07-19Replace option $ITEM.EMOTICONS with WRAP_EMOTICONSThomas Lange2-23/+2
This commit adds the configuration option "WRAP_EMOTICONS" to supersede the configuration options "(CATEGORY|PAGE|POST|USER).EMOTICONS". If the value of "WRAP_EMOTICONS" evaluates to TRUE, the emoticons found in the content of an item will be wrapped into a "<span>" element which gives the user a description of the emoticon in the "title" attribute.
2021-07-17Reduce the redundant mapping logic in repositoriesThomas Lange2-49/+33
Reduce the redundant mapping logic in the repository classes by using the new methods "fetchEntity" and "fetchEntities".
2021-07-16Improve performance of parseUnicodeEmoticonsThomas Lange1-8/+10
Make the function parseUnicodeEmoticons significantly faster by using a single regex operation to match and process all unicode emoticons.
2021-07-16Drop support for parsing ASCII emoticonsThomas Lange1-39/+0
This commit drops support for parsing plain text ASCII emoticons like ":)" or ":P" to its unicode equivalent. Please use unicode emoticons directly (like those already proposed in the admin form templates).
2021-07-11Modify parameter list for getAll methodThomas Lange2-4/+5
2021-07-11Add template function to get data from a categoryThomas Lange1-3/+16
2021-07-11Remove wrapper function for strip_tagsThomas Lange1-9/+2
2021-07-11Reuse prepared statement in update methodThomas Lange1-4/+0
Reuse the already defined prepared statement in the update method of the Category repository instead of creating a new one.
2021-07-10Bugfix: Include correct variable in function scopeThomas Lange1-1/+1
Fix a bug which was introduced with the commit mentioned below that prevented the "$ITEM['BODY']['TEXT']()" function from returning the pre-parsed body of the item, because the variable was not in scope. See: bf57f3dcba5864b63882c273d25403c28637eeab
2021-07-10Remove pages from the RSS feed (readme)Thomas Lange5-60/+24
This commit removes the pages from the RSS feed. I decided so because a page is a "timeless" object intended for things like the imprint, about page, privacy policy and similar stuff. It also makes things easier. The new primary feed URL is "/feed/" and shows only posts. The page feed ("/feed/page/") has been removed and will throw a 404 Not Found error. The visitors who already subscribed to the old post feed ("/feed/post/") are automatically 301-redirected to the new location ("/feed/"). The following system language variables have been removed: * feed_name_items * feed_name_pages * feed_name_posts The following configuration options have been removed: * PAGE.FEED_SIZE * PAGE.FEED_SORT * PAGE.FEED_GUID Furthermore, the template file "feed/item_post.php" has been renamed to "feed/item.php" since there is now only one type of feed item. If the system cannot find the "feed/item.php", it tries "feed/item_post.php" instead (for backward compatibility with older themes).
2021-07-02Clarify comment in determineFallbackSchemaVersionThomas Lange1-1/+1
If the migration table does not yet exist, the user sits *either* at 0, 1, 2, 3 or 4; not *between* 0 and 4 (which would be 1, 2 or 3).
2021-07-02Include category timestamp in ETag response headerThomas Lange1-12/+13
This commit adds the timestamp of the last modified category to the HTTP ETag response header. Additionally, the code has been optimized.
2021-07-02Add generic function to create pagination templateThomas Lange7-64/+27
This commit adds and uses the new function createPaginationTemplate to create the generic pagination template for various entity lists. This function replaces the many old confusing functions: * generateNaviTemplate * generatePageNaviTemplate * generatePostNaviTemplate * generateUserNaviTemplate * generateCategoryNaviTemplate * generateCategoryPostNaviTemplate
2021-07-01Add option CATEGORY.LIST_SORT to application.phpThomas Lange2-2/+1
The option CATEGORY.LIST_SORT is currently only used for sorting the children categories of a category, not for sorting the categories on the category overview page. This is because the sorting of the categories in the category overview is handelnd internally with a virtual table column "_depth" which sorts the categories by name *and* its sub categories (like a tree). Thus, there is currently no user option to sort the category overview.
2021-07-01Bugfix: Use empty check instead of issetThomas Lange1-1/+1
If no category tree was found, the array is empty but isset evaluates to true. This fixes the mistake and uses an empty check instead.
2021-07-01Add function generateCategoryPostNaviTemplateThomas Lange2-1/+19
Add and use the function generateCategoryPostNaviTemplate to build the pagination template for posts in a category. This fixes a mistake. TODO: Get rid of that confusing function mess!
2021-07-01Add category system to categorize posts (readme)Thomas Lange10-7/+471
This commit implements a new category system to categorize posts. Each category can have an unlimited number of nested children categories. A single post don't necessarily need to be in a category, but it can. Each category can have a full content body like posts or pages, so you have enough space to describe the content of your categories. Please note that you need to have at least the following MySQL/MariaDB versions to use the category system, because it uses "WITH RECURSIVE" database queries, the so-called "Common-Table-Expressions (CTE)". MariaDB: 10.2.2 MySQL: 8.0 See: https://mariadb.com/kb/en/with/ See: https://dev.mysql.com/doc/refman/8.0/en/with.html
2021-07-01Update database schema for coming category systemThomas Lange3-2/+51
This commit updates the database schema and adds a new migration for the upcoming category system. Please note that you need to have at least the following MySQL/MariaDB versions to use the category system later: MariaDB: 10.2.2 MySQL: 8.0
2021-07-01Bugfix: Explicitly check for FALSE in MigratorThomas Lange1-1/+2
Explicitly check for boolean FALSE because the result can be string "0" when directly upgrading from release v1.0 which has schema version "0".
2021-07-01Add translations for upcoming category systemThomas Lange2-0/+22
2021-07-01Update database schema: Make id columns unsignedThomas Lange3-7/+20
This commit updates the database schema and adds a new migration to modify the signed integer columns to make them unsigned.
2021-07-01Add PHP version checkThomas Lange1-0/+7
2021-06-30Optimize core/db/database.sqlThomas Lange1-38/+34
2021-06-29Add WHERE filter option to getCount methodThomas Lange1-4/+23
2021-06-28Bugfix: Remove explicit parameter type intThomas Lange1-3/+3
2021-06-27Allow NULL value comparison in WHERE clauseThomas Lange1-2/+6
2021-06-25Fix wrong property name in Repository classThomas Lange1-2/+2
2021-06-25Reorganize namespacesThomas Lange13-38/+57
2021-06-24Add configuration option MIGRATOR.ENABLEDThomas Lange1-1/+4
2021-06-24Return NULL instead of config string if unsetThomas Lange1-1/+1
2021-06-24Implement database schema MigratorThomas Lange4-0/+244
This commit implements the new database schema Migrator which keeps track of the on-disk schema and the schema used by the codebase. It tries to makes future database schema upgrades user-friendlier.
2021-06-24Remove migration for migration table (readme)Thomas Lange2-4/+1
This commit removes the migration number 5 which created the migration table. The initialization of the migration table will be implemented in the upcoming migration script by itself. Sorry! If you recently installed the application with a fresh database which contained the migration table, please manually set the schema_version to 4. It is recommended to only install a specific tag instead of the latest master branch unless you are a developer or know what you do. UPDATE migration SET schema_version = 4
2021-06-24Set Database attribute in Application classThomas Lange2-14/+13
2021-06-22Add missing static keywords and fix typosThomas Lange2-4/+4
2021-06-22Implement new Repository and Entity classesThomas Lange37-707/+822
This commit adds new Repository and Entity classes which are better abstracted from the rest of the application. They dont know anymore about configuration options or how to parse to HTML because this is not the job for the ORM but for other parts of the application. The previous commits were a preparation for this big change. An entity now represents just a single record from a specific table of the database – nothing more. The repositories job is it to fetch or update records of the database and instantiate the entities. Another problem that was solved is the high amount of database queries that was needed before. For example, on the blogs home page first were all 10 latest post IDs fetched from the database and then another query was executed with "WHERE id = :id" for *each* single post?! ... This problem is solved with the new repository classes; they now use a single query to fetch and build the entities of the 10 latest posts. This change also solves the problem with database queries spread across the application and limits the exzessive use of try/catch blocks which were used before. The new classes make the whole code much cleaner. :)
2021-06-21Remove unnecessary $ItemTemplate variablesThomas Lange5-16/+4
2021-06-21Rename some template variablesThomas Lange6-14/+14
2021-06-21Rename "attr" method of Item class to "get"Thomas Lange10-16/+16
2021-06-21Remove getArguments method from Item classThomas Lange1-20/+0
2021-06-21Use function parseArgumentsThomas Lange1-1/+1
2021-06-21Add function parseArgumentsThomas Lange1-0/+20
2021-06-21Remove unused methods from Item classThomas Lange1-50/+0