BestNa.me Labs [Tue, 22 Mar 2016 19:09:38 +0000 (20:09 +0100)]
Re-enable actions only if edit-save succeeded
Fixes a flaw in `edit_link_save()` in insert.js:
On exit, `edit_link_save()` re-enables all buttons of the action column, regardless of the value of `status` as returned by the ajax call (`action=edit_save`), i.e. also if the `status` is `fail` which means that the edit row remains visible. Because of that, it is then possible to open another edit row for the same keyword/long URL row. It is even possible to repeat this, introducing an arbitrary number of open edit rows with the same content.
BestNa.me Labs [Mon, 21 Mar 2016 20:00:04 +0000 (21:00 +0100)]
Re-enable cancel on exiting edit_link_save()
Fixes a flaw in `edit_link_save()` in insert.js:
On exit, `edit_link_save()` correctly ends the loading state of the cancel button (i.e. the element with id `edit-close-y...`), but leaves the element disabled. This gets evident if and only if the ajax call (`action=edit_save`) returns with a `status` of `fail`, since only then the edit row with the disabled cancel button will not be faded out.
BestNa.me Labs [Thu, 10 Mar 2016 20:58:58 +0000 (21:58 +0100)]
Added `decrease_total_clicks( id )` + call
Added a function `decrease_total_clicks( id )` in js/insert.js which decreases the element containing the number of total clicks on the admin page by the value contained in the element `$('#clicks-' + id)` (i.e. by the value picked from the 'Clicks' column of the respective deleted row). Now called this method at the appropriate place in function `remove_link(id)`, thereby passing on `id` as parameter.
BestNa.me Labs [Thu, 10 Mar 2016 20:51:57 +0000 (21:51 +0100)]
Additional id for tag containing $total_clicks
Granted the `<strong>` tag containing the number of total clicks its own id (in admin/index.php) (the element should be prominent enough to deserve it).
BestNa.me Labs [Wed, 9 Mar 2016 21:24:48 +0000 (22:24 +0100)]
Go to First Page -> Go to Last Page
Fixes a minor glitch in yourls_html_tfooter() in functions-html.php:
In the pagination section of the URL table, the 'Go to Last Page'-link has a `title` attribute 'Go to First Page' (one can notice that by hovering it). Should of course be titled 'Go to Last Page'.
BestNa.me Labs [Sat, 5 Mar 2016 17:42:11 +0000 (18:42 +0100)]
Fixing markup and comment
Minor fixes in yourls-infos.php:
1. Removes an unclosed and superfluous <strong> tag in the line reading e.g. '43 hits on January 1, 1970'. This caused wrong HTML and therefore most browsers rendered *all* dates in the list appearing on click of 'Click for more details' with bold font-weight (i.e., not only those of the best year / month / day as intended).
2. Took the liberty of also changing a closing comment token from '/**/' to the more common '**/' (in the comment titled 'I can haz debug data'). While this was perfectly valid code, it confused the syntax highlighter of github (all past the '/**/' appeared in a frightening red).
BestNa.me Labs [Fri, 4 Mar 2016 21:01:56 +0000 (22:01 +0100)]
Fix f. missing chart bar add (+all) icon
Fixes the following bug:
When allowing for multiple short URLs for a same long URL (bitly behavior [behaviour]), the chart bar adding symbol linking to YOURLS_SITE/keyword+all does not show up on infos pages.
ozh [Fri, 22 May 2015 20:07:13 +0000 (22:07 +0200)]
Less if(function_exists())
Because
- it hinders unit tests
- it makes code less readable
- it's easier to have compat functions and eventually deprecate them when no longer needed
I found a problem in Yourls. It's not necessarily a problem with the code, but a problem none the less.
In functions.php, the timestamp is being written to the yourls_log and yourls_url db's differently, and depending on how the server is set up, it can cause a problem.
function yourls_log_redirect() writes the time with MySQL's NOW() keyword, while function yourls_insert_link_in_db() writes it with PHP's date('Y-m-d H:i:s'). On the webhost that I'm using, MySQL is using the server's time, not UTC, so it's 4 hours different than PHP's time, since PHP is being set with date_default_timezone_set( 'UTC' );
This drove me nuts for quite awhile until I realized what was going on. Once I switched from NOW() to date('Y-m-d H:i:s') the problem went away and all my times are now the same. I believe both functions should use the same system for time so as to avoid this scenario.
BTW, great script! I know I probably shouldn't ask ;) but... any idea when the next version will be released? I read something about version 2.0 awhile back, but haven't heard anything since.
In config, readmes, editable files: the generic YOURLS install will be http://your-own-domain-here.com/ so that noob users get an obvious warning when they misconfigure something
In source comments, presumably read by hackers who have a clue, the generic YOURLS install will be http://sho.rt/. The generic long URL can be http://example.com/something-whatever
Fredl [Sat, 28 Feb 2015 16:33:21 +0000 (17:33 +0100)]
Update functions-l10n.php
´yourls_load_custom_textdomain´ can't read *.po files when ´$path´ is an absolute path on the server and the leading slash is removed. (´trim´ removes on both ends)