aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/LinkDB.php
Commit message (Collapse)AuthorAgeFilesLines
* Add a button to set links as stickyArthurHoaro2018-10-061-0/+3
| | | | | | Meaning that they always appear on top of all links Fixes #186
* Tag sort - UT + comment + fix filter and visibilityArthurHoaro2018-05-291-7/+18
| | | | Before this, linksCountPerTag call without would have ignored visibility parameter
* Fix order of tags with the same number of occurrencesArthurHoaro2018-05-191-2/+4
| | | | Fixes #1142
* Merge pull request #962 from ArthurHoaro/feature/perfs2ArthurHoaro2017-10-281-9/+8
|\ | | | | Performances: reorder links when they're written instead of read
| * Performances: reorder links when they're written instead of readArthurHoaro2017-09-021-9/+8
| | | | | | | | relates to #891
* | Shaarli's translationArthurHoaro2017-10-221-10/+10
|/ | | | | | | | | * translation system and unit tests * Translations everywhere Dont use translation merge It is not available with PHP builtin gettext, so it would have lead to inconsistency.
* migrated Github wiki links to readthedocsWilli Eggeling2017-08-261-1/+1
|
* Merge pull request #887 from ArthurHoaro/hotfix/dash-tag-renameArthurHoaro2017-08-051-0/+33
|\ | | | | Make sure that the tag exists before altering/removing it
| * Move tag renaming code to LinkDB and unit test itArthurHoaro2017-08-051-0/+33
| |
* | Using only one form in linklist.html + adding untaggedonly filter - fix #885Lucas Cimon2017-07-301-3/+4
|/
* Merge pull request #841 from ArthurHoaro/feature/search-no-tagArthurHoaro2017-05-251-22/+5
|\ | | | | Empty tag search will look for not tagged links
| * Empty tag search will look for not tagged linksArthurHoaro2017-05-251-22/+5
| | | | | | | | | | | | | | | | | | | | | | Fixes #784 From now, searching for tags with an empty value will return only not tagged links, with the search bar showing `x results [not tagged]`. Note that using the api, the searchtags request parameter must be set to `false` to get the same result. - [ ] Update API doc
* | Adding ability to display subtags in tagcloudLucas Cimon2017-05-241-4/+7
| |
* | Merge pull request #764 from ArthurHoaro/feature/historyArthurHoaro2017-05-061-29/+2
|\ \ | | | | | | History mechanism
| * | Move database read/write to FileUtils class + additional unit testsArthurHoaro2017-03-211-29/+2
| |/
* / Fix offset check with link ID = 0ArthurHoaro2017-04-051-2/+2
|/
* Update LinkFilter to be able to filter only public linksArthurHoaro2017-01-161-3/+3
| | | | | | No update regarding the UI or the API for now Fixes #758
* Add a persistent 'shorturl' key to all linksArthurHoaro2016-12-121-4/+8
| | | | | | | All existing link will keep their permalinks. New links will have smallhash generated with date+id. The purpose of this is to avoid collision between links due to their creation date.
* Link ID refactoringArthurHoaro2016-12-121-43/+135
| | | | | | | | | Links now use an incremental unique numeric identifier. This ID is persistent and must never change. ArrayAccess is used to match the link ID with the array keys (see the comment in LinkDB for more details) Key 'created' added, with creation date as a DateTime object. 'updated' is now also a DateTime.
* LinkDB: explicit method visibilityVirtualTam2016-10-201-6/+6
| | | | | | Relates to https://github.com/shaarli/Shaarli/issues/95 Signed-off-by: VirtualTam <virtualtam@flibidi.net>
* LinkDB: update datastore method namesVirtualTam2016-10-201-8/+8
| | | | | | Relates to https://github.com/shaarli/Shaarli/issues/95 Signed-off-by: VirtualTam <virtualtam@flibidi.net>
* LinkDB: do not prefix privates with an underscoreVirtualTam2016-10-201-67/+67
| | | | | | Relates to #95 Signed-off-by: VirtualTam <virtualtam@flibidi.net>
* Save the update date in LinkDB and pass it to linklist templatesArthurHoaro2016-08-031-1/+2
| | | | It can be used as a timestamp by templates under the key 'updated_timestamp'.
* Better whitespace handling in tagsArthurHoaro2016-08-021-1/+1
| | | | | | Correct PR #573 to work properly with hidden tags, and add ReferenceLinkDB UT. Fixes #571 - Closes #573
* Better whitespace handling in tags. Fixes #571Chris Kuethe2016-08-021-2/+2
|
* Hashtag systemArthurHoaro2016-06-061-1/+1
| | | | | | * Hashtag are auto-linked with a filter search * Supports unicode * Compatible with markdown (excluded in code blocks)
* Merge pull request #583 from ArthurHoaro/enhance/tag-caseArthur2016-06-031-2/+9
|\ | | | | Fixes #497: ignore case difference between tags
| * Fixes #497: ignore case difference between tagsArthurHoaro2016-05-311-2/+9
| | | | | | | | | | | | | | | | While retrieving all tags, case differences will be ignored. This affects: * tag cloud * tag autocompletion
* | Fixes #480: add an option to urlencode redirector URLArthurHoaro2016-04-091-6/+29
|/ | | | | | | | * New config: `$GLOBALS['config']['REDIRECTOR_URLENCODE']` (default `true`). * Parameter added to LinkDB constructor. * Fixes a bug with urlencode and escaped url. * In `index.php`, LinkDB is now instanciate once for `importFile()` and `showDaily()`. * TU
* Refactor filter in LinkDBArthurHoaro2016-03-251-5/+59
| | | | | | | | * search type now carried by LinkDB in order to factorize code between different search sources. * LinkDB->filter split in 3 method: filterSearch, filterHash, filterDay (we know what type of filter is needed). * filterHash now throw a LinkNotFoundException if it doesn't exist: internal implementation choice, still displays a 404. * Smallhash regex has been rewritten. * Unit tests update
* Allow crossed search between terms and tagsArthurHoaro2016-02-281-2/+1
| | | | | | | * Partial fix of #449 * Current use case: search term + click on tag. * LinkFilter now returns all links if no filter is given. * Unit tests.
* cleanup: use DateTime to format datesVirtualTam2016-02-171-0/+3
| | | | | | | | | | | | | | | Closes #270 Modifications: - replace custom date parsing by DateTime calls - use proper date formatting for RSS feeds Deletions: - linkdate2timestamp() - linkdate2rfc822 - linkdate2iso8601 Signed-off-by: VirtualTam <virtualtam@flibidi.net>
* Private/Hidden tagsArthurHoaro2016-02-151-0/+7
| | | | | | | Tags starting with a dot '.' are now private. They can only be seen and searched when logged in. Fixes #315
* Add exclusion in tag searchArthurHoaro2016-02-151-1/+1
| | | | | | | | | | | * Searching '-mytag' will now exlude all shaares with 'mytag' tag. * All tags starting with a '-' are renamed without it (through the Updater). * Unit tests. Minor code changes: * LinkDB->filter() can now take no parameters (get all link depending on logged status). * tagsStrToArray() is now static and filters blank tags.
* Introduce the Updater class whichArthurHoaro2016-02-151-6/+4
| | | | | | | * contains methods designed to be run once. * is able to upgrade the datastore or the configuration. * is based on methods names, stored in a text file with ';' separator (updates.txt). * begins with existing function 'mergeDeprecatedConfigFile()' (options.php).
* Bugfix: prevent LinkFilter to work on outdated data.ArthurHoaro2016-01-201-8/+4
|
* Fixes #426 - Do not filter with blank tags.ArthurHoaro2016-01-061-1/+1
|
* Link filter refactoringArthurHoaro2016-01-061-105/+15
| | | | | | | | | | * introduce class LinkFilter to handle link filter operation (and lighten LinkDB). * handle 'private only' in filtering. * update template to prefill search fields with current search terms. * coding style. * unit test (mostly move from LinkDB to LinkFilter). PS: preparation for #358 #315 and 'AND' search.
* QRCode plugin: use url instead of real_urlArthurHoaro2015-12-221-1/+3
| | | | | | Fixes #414 and avoid usage of redirector in QRCode. Also fixed a bug with URL encoding.
* URL encode links when a redirector is set.ArthurHoaro2015-11-261-3/+17
| | | | | | | | | | | | | | | | | Fixes #328 - URL encode links when a redirector is set * WARNING - template edit - new variable available : "real_url" Contains the final real url (redirected or any other change on original URL) * Don't redirect shaares link in RSS/Atom. * Affects links shaared in description. * Move text2clickable and keepMultipleSpaces to Utils.php + unit test UPDATE: * keepMultipleSpaces renamed to space2nbsp * space2nbsp improved to handle single space at line beginning * links in text description aren't 'nofollow' anymore
* install: check file/directory permissions for Shaarli resourcesVirtualTam2015-11-241-9/+26
| | | | | | | | | | | | | | | | | | | | | | | Relates to #40 Relates to #372 Additions: - FileUtils: IOException - ApplicationUtils: - check if Shaarli resources are accessible with sufficient permissions - basic test coverage - index.php: - check access permissions and redirect to an error page if needed: - before running the first installation Modifications: - LinkDB: - factorize datastore write code - check if the datastore (exists AND is writeable) OR (doesn't exist AND its parent dir is writable) - raise an IOException if needed Signed-off-by: VirtualTam <virtualtam@flibidi.net>
* Url: introduce global helper functions for cleanup and scheme detectionGuillaume Virlet2015-09-081-0/+4
| | | | | | | | | | | | Relates to #314 & #326 Additions: - add global `cleanup_url()` and `get_url_scheme()` functions Modifications: - replace `Url` usage in `index.php` by calls to global functions - fix `Url` tests not being run: PHPUnit expects a single test class per file - move classes to separate files
* CachedPage: move to a proper file, add testsVirtualTam2015-08-131-3/+4
| | | | | | | | | | | | Modifications - rename `pageCache` to `CachedPage` - move utilities to `Cache` - do not access globals - apply coding rules - update LinkDB and test code - add test coverage Signed-off-by: VirtualTam <virtualtam@flibidi.net>
* LinkDB: prefix private members with an underscoreVirtualTam2015-07-091-62/+62
| | | | | | Relates to #95, #218 Signed-off-by: VirtualTam <virtualtam@flibidi.net>
* LinkDB::filterDay(): check input date formatVirtualTam2015-07-091-1/+4
| | | | Signed-off-by: VirtualTam <virtualtam@flibidi.net>
* Merge remote-tracking branch 'ArthurHoaro/default-links'nodiscc2015-06-261-6/+10
|\
| * Change fresh install default linkArthurHoaro2015-06-241-6/+10
| | | | | | | | | | | | Fixes #200 Let me know if you want to change anything in the description.
* | Merge remote-tracking branch 'virtualtam/linkdb/remove-globals'nodiscc2015-06-261-12/+19
|\ \
| * | LinkDB: do not access global variablesVirtualTam2015-06-241-12/+19
| |/ | | | | | | | | | | | | | | | | | | | | Relates to #218 Removes "hidden" access to the following variables: - $GLOBALS['config']['datastore'] - PHPPREFIX - PHPSUFFIX Signed-off-by: VirtualTam <virtualtam@flibidi.net>
* / Restore compatability with php 5.3Felix Bartels2015-06-261-1/+1
|/