diff --git a/public/style.css b/public/style.css index bb21df4..ae6c78c 100644 --- a/public/style.css +++ b/public/style.css @@ -228,6 +228,8 @@ input[type=submit] { transition: background 0.5s; cursor: pointer; margin: 0; + padding: 7px; + display: inline-block; } .button:hover, .zeroclipboard-is-hover { @@ -240,11 +242,17 @@ input[type=submit] { /* Output */ .error { - color: red; - font-weight: bold; text-align: center; } +.error p.message { + margin-bottom: 30px; +} + +.error p .key { + font-weight: bold; +} + .copy-button { margin-top: 2px; } @@ -308,7 +316,6 @@ svg#url-qr-code { } .bookmarklet { - padding: 7px; font-size: 1.4rem; color: black; } diff --git a/result.php b/result.php index 6063b9c..49c22eb 100644 --- a/result.php +++ b/result.php @@ -7,16 +7,36 @@ if ( ISQ::$general['clipboard'] ) { $dependencies[] = 'ZeroClipboard'; }; -function display_error($message) { - echo '

' . $message . '

'; +function display_error( $message, $action ) { + echo '
'; + echo '

' . $message . '

'; + + if( !empty( $action ) ) { + echo $action; + } else { + echo '

' . yourls__( '← Go back and try again', 'isq_translation' ) . '

'; + } + echo '
'; + include('footer.php'); die(); } if ( empty( $_REQUEST['url'] ) ) { - display_error( yourls__( 'You haven\'t entered a URL to shorten. Please go back and try again.', 'isq_translation' ) ); + display_error( yourls__( 'You haven\'t entered a URL to shorten.', 'isq_translation' ) ); }; +if ( !yourls_keyword_is_reserved( $_REQUEST['keyword'] ) ) { + display_error( sprintf( yourls__( 'The keyword %1$s is reserved.'), '' . $_REQUEST['keyword'] . '' ) ); +} + +if( function_exists( 'advanced_reserved_urls' ) ) { + if ( advanced_reserved_urls( $_REQUEST['keyword'] ) ) { + display_error( sprintf( yourls__( 'The keyword %1$s is restricted.'), '' . $_REQUEST['keyword'] . '' ) ); + } +} + + // Check what CAPTCHA method was used $antispam_method = $_REQUEST['antispam_method']; @@ -32,7 +52,7 @@ if ( $antispam_method == 'user_login' ) { // What happens when the reCAPTCHA was completed incorrectly if ( $recaptcha_json['success'] != 'true' ) { - display_error( yourls__( 'Are you a bot? Google certainly thinks you are. Please go back and try again.', 'isq_translation' ) ); + display_error( yourls__( 'Are you a bot? Google certainly thinks you are.', 'isq_translation' ) ); } } else if ( $antispam_method == 'basic' ) { @@ -40,13 +60,13 @@ if ( $antispam_method == 'user_login' ) { // Basic antispam protection fallback // What happens when it was not completed correctly if ( $_REQUEST['basic_antispam'] != "" ) { - display_error( yourls__( 'Are you a bot? The verification was not completed successfully. Please go back and try again.', 'isq_translation' ) ); + display_error( yourls__( 'Are you a bot? The verification was not completed successfully.', 'isq_translation' ) ); } } else { // No antispam protection was detected - display_error( yourls__( 'Are you a bot? No antispam protection was completed successfully. Please go back and try again.', 'isq_translation' ) ); + display_error( yourls__( 'Are you a bot? No antispam protection was completed successfully.', 'isq_translation' ) ); }