From 337f158812421a29e777151ffc0aa48676032f78 Mon Sep 17 00:00:00 2001 From: Tom Slominski Date: Wed, 14 Aug 2013 23:33:38 +0100 Subject: [PATCH 01/51] Correct link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5c82c9c..94cd850 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Infinity Squared ================ A beautiful theme for YOURLS, carefully crafted by [Tom Slominski](http://tomslominski.net/). -See the project's [Wiki pages](https://github.com/tomslominski/infinity-squared) at GitHub for the latest installation and upgrade instructions. +See the project's [Wiki pages](https://github.com/tomslominski/infinity-squared/wiki) at GitHub for the latest installation and upgrade instructions. qTip 2 is dual licensed under [MIT](http://en.wikipedia.org/wiki/MIT_License) or [GPLv2](http://en.wikipedia.org/wiki/GNU_General_Public_License) licenses. From a97007a8c9aa8b7f9713db5d190917eec82ac017 Mon Sep 17 00:00:00 2001 From: Tom Slominski Date: Fri, 30 Aug 2013 22:49:35 +0100 Subject: [PATCH 02/51] Adding zeroClipboard support --- .gitignore | 7 ++ README.md | 0 index.php | 270 +++++++++++++++++++++++++++++++++++++++++++++- public/config.php | 5 + public/style.css | 20 ++++ 5 files changed, 300 insertions(+), 2 deletions(-) create mode 100644 .gitignore mode change 100644 => 100755 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6277bc3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +# Ignore everything +* + +# Except Infinity Squared +!public/ +!index.php +!.gitignore diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/index.php b/index.php index 1685691..f6b5dbb 100755 --- a/index.php +++ b/index.php @@ -1,3 +1,268 @@ +<<<<<<< HEAD + +' . yourls__( 'An error has occured :(', 'isq_translation') . ''; + +if ( $message = $url. yourls__( 'added to database', 'isq_translation') ) { + $error = '

' . yourls__( 'URL shortened successfully', 'isq_translation') . '

' . yourls__( 'View the details of your short URL below.', 'isq_translation') . '

'; + } elseif ( $message = $url. yourls__( 'already exists in database', 'isq_translation') ) { + $error = $genericerror . '

' . yourls__( 'This URL already exists in this database. This website does not allow a single URL to have multiple short links.', 'isq_translation') . '

'; + } elseif ( $message = yourls__( 'Short URL', 'isq_translation') . $url . yourls__( 'already exists in database or is reserved', 'isq_translation') ) { + $error = $genericerror . '

' . yourls__( 'This short URL already exists in this database or is reserved. This website does not allow a single URL to have multiple short links. It could\'ve also been reserved by the admin.', 'isq_translation') . '

'; + } elseif ( $message = yourls__( 'Missing URL input', 'isq_translation') ) { + $error = $genericerror . '

' . yourls__( 'You did not enter the URL you want to shorten or the server lost it. Please try again.', 'isq_translation') . '

'; + } elseif ( $message = yourls__( 'This URL is a short URL', 'isq_translation') ) { + $error = $genericerror . '

' . yourls__( 'You cannot shorten a short URL!', 'isq_translation') . '

'; + } +?> + + + +<?php echo $ISQtitle; ?> + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

+ +
+
+ Facebook'; } + if (!empty(ISQ::$social['twitter'])) { $ISQtwitter = ''; } + if (!empty(ISQ::$social['plus'])) { $ISQplus = '
'; } + if (!empty(ISQ::$social['linkedin'])) { $ISQlinkedin = ''; } + if (!empty(ISQ::$general['qr'])) { $ISQqr = '

' . yourls__( 'QR code', 'isq-translation' ) . '

' . yourls__( 'Share your code with external devices', 'isq-translation' ) . '

QR'; } + if (!empty(ISQ::$general['clipboard'])) { $ISQlongcopy = ''; } + if (!empty(ISQ::$general['clipboard'])) { $ISQshortcopy = ''; } + if (!empty(ISQ::$general['clipboard'])) { $ISQstatscopy = ''; } + + $output_original = yourls__( 'Original URL:', 'isq_translation'); + $output_short = yourls__( 'Short URL:', 'isq_translation'); + /* translators: This is short for statistics */ + $output_stats = yourls__( 'Stats:', 'isq_translation'); + $output_copy = yourls__( 'Click on a link and press Ctrl+C to quickly copy it.', 'isq_translation'); + $output_share_h2 = yourls__( 'Share', 'isq_translation'); + $output_share_p = yourls__( 'Share your short URL', 'isq_translation'); + + echo << +

$ISQlongcopy

+

$ISQshortcopy

+

$ISQstatscopy

+

$output_copy

+
+ + $ISQqr + +

$output_share_h2

+

$output_share_p

+ $ISQfacebook + $ISQtwitter + $ISQplus + $ISQlinkedin +RESULT; + + // Part to be executed when no form has been submitted + } else { + + $site = YOURLS_SITE; + + $site_enter = yourls__( 'Enter a new URL to shorten', 'isq_translation'); + $site_hover = yourls__( 'Hover over the labels to see more information', 'isq_translation'); + $site_long = yourls__( 'Long URL (required):', 'isq_translation'); + $site_long_hover = yourls__( 'Paste the long URL here', 'isq_translation'); + $site_keyword = yourls__( 'Custom keyword:', 'isq_translation'); + $site_keyword_hover = yourls__( 'A keyword replaces the default short string', 'isq_translation'); + $site_title = yourls__( 'Optional title:', 'isq_translation'); + $site_title_hover = yourls__( 'Optional title used when sharing a link from YOURLS', 'isq_translation'); + $site_submit = yourls__( 'Shorten', 'isq_translation'); + + echo <<$site_enter +

$site_hover

+
+

+

+

+

+
+HTML; + + } + ?> +
+ +
+

+

+ + + + + +
+ + + + + +======= +>>>>>>> 656a0c985880d87881d8ab157da0e848527f4c49 diff --git a/public/config.php b/public/config.php index 92f39d5..47c9767 100755 --- a/public/config.php +++ b/public/config.php @@ -4,7 +4,12 @@ ISQ::$general = array( 'name' => 'kwl.me', // The name of your URL shortener 'qr' => 1, // Do you want to display a QR code? +<<<<<<< HEAD + 'mobile' => 0, // Do you want to enable the mobile version? + 'clipboard' => 1 // Do you want to enable zeroClipboard? (uses flash) +======= 'mobile' => 0 // Do you want to enable the mobile version? +>>>>>>> 656a0c985880d87881d8ab157da0e848527f4c49 ); // Menu- The width of ∞² menu allows you to have about 10 links diff --git a/public/style.css b/public/style.css index ab4911c..4bf8625 100755 --- a/public/style.css +++ b/public/style.css @@ -122,6 +122,7 @@ h1 a:hover { /* Main style */ .paragraph { padding: 0 2.5% 0 2.5%; +<<<<<<< HEAD:public/style.css } h2 { @@ -129,6 +130,15 @@ h2 { margin-bottom: -8px; } +======= +} + +h2 { + color: black; + margin-bottom: -8px; +} + +>>>>>>> 656a0c985880d87881d8ab157da0e848527f4c49:public/style.css .right { width: 60%; float: right; @@ -169,6 +179,15 @@ a.bookmarklet { /* Output */ .output label { width: 30%; +<<<<<<< HEAD:public/style.css + float:left; +} + +.output input { + width: 70% +} + +======= float: left; } @@ -176,6 +195,7 @@ a.bookmarklet { width: 70% } +>>>>>>> 656a0c985880d87881d8ab157da0e848527f4c49:public/style.css .error { color: red; } From 2dbe0d987f40f1f8533199f8b2d0bd6cf14ade16 Mon Sep 17 00:00:00 2001 From: Tom Slominski Date: Mon, 2 Sep 2013 23:02:41 +0100 Subject: [PATCH 03/51] zeroClipboard --- index.php | 201 +--------------------------------------------- public/config.php | 5 -- public/style.css | 20 ----- 3 files changed, 1 insertion(+), 225 deletions(-) diff --git a/index.php b/index.php index f6b5dbb..773c57b 100755 --- a/index.php +++ b/index.php @@ -1,4 +1,3 @@ -<<<<<<< HEAD - -======= - -' . yourls__( 'An error has occured :(', 'isq_translation') . ''; - -if ( $message = $url. yourls__( 'added to database', 'isq_translation') ) { - $error = '

' . yourls__( 'URL shortened successfully', 'isq_translation') . '

' . yourls__( 'View the details of your short URL below.', 'isq_translation') . '

'; - } elseif ( $message = $url. yourls__( 'already exists in database', 'isq_translation') ) { - $error = $genericerror . '

' . yourls__( 'This URL already exists in this database. This website does not allow a single URL to have multiple short links.', 'isq_translation') . '

'; - } elseif ( $message = yourls__( 'Short URL', 'isq_translation') . $url . yourls__( 'already exists in database or is reserved', 'isq_translation') ) { - $error = $genericerror . '

' . yourls__( 'This short URL already exists in this database or is reserved. This website does not allow a single URL to have multiple short links. It could\'ve also been reserved by the admin.', 'isq_translation') . '

'; - } elseif ( $message = yourls__( 'Missing URL input', 'isq_translation') ) { - $error = $genericerror . '

' . yourls__( 'You did not enter the URL you want to shorten or the server lost it. Please try again.', 'isq_translation') . '

'; - } elseif ( $message = yourls__( 'This URL is a short URL', 'isq_translation') ) { - $error = $genericerror . '

' . yourls__( 'You cannot shorten a short URL!', 'isq_translation') . '

'; - } -?> - - - -<?php echo $ISQtitle; ?> - - - - - - - - - - - - - - - - - -
-
-

- -
-
- Facebook'; } - if (!empty(ISQ::$social['twitter'])) { $ISQtwitter = ''; } - if (!empty(ISQ::$social['plus'])) { $ISQplus = '
'; } - if (!empty(ISQ::$social['linkedin'])) { $ISQlinkedin = ''; } - if (!empty(ISQ::$general['qr'])) { $ISQqr = '

' . yourls__( 'QR code', 'isq-translation' ) . '

' . yourls__( 'Share your code with external devices', 'isq-translation' ) . '

QR'; } - - $output_original = yourls__( 'Original URL:', 'isq_translation'); - $output_short = yourls__( 'Short URL:', 'isq_translation'); - /* translators: This is short for statistics */ - $output_stats = yourls__( 'Stats:', 'isq_translation'); - $output_copy = yourls__( 'Click on a link and press Ctrl+C to quickly copy it', 'isq_translation'); - $output_share_h2 = yourls__( 'Share', 'isq_translation'); - $output_share_p = yourls__( 'Share your short URL', 'isq_translation'); - - echo << -

-

-

-

$output_copy

-
- - $ISQqr - -

$output_share_h2

-

$output_share_p

- $ISQfacebook - $ISQtwitter - $ISQplus - $ISQlinkedin -RESULT; - - // Part to be executed when no form has been submitted - } else { - - $site = YOURLS_SITE; - - $site_enter = yourls__( 'Enter a new URL to shorten', 'isq_translation'); - $site_hover = yourls__( 'Hover over the labels to see more information', 'isq_translation'); - $site_long = yourls__( 'Long URL (required):', 'isq_translation'); - $site_long_hover = yourls__( 'Paste the long URL here', 'isq_translation'); - $site_keyword = yourls__( 'Custom keyword:', 'isq_translation'); - $site_keyword_hover = yourls__( 'A keyword replaces the default short string', 'isq_translation'); - $site_title = yourls__( 'Optional title:', 'isq_translation'); - $site_title_hover = yourls__( 'Optional title used when sharing a link from YOURLS', 'isq_translation'); - $site_submit = yourls__( 'Shorten', 'isq_translation'); - - echo <<$site_enter -

$site_hover

-
-

-

-

-

-
-HTML; - - } - ?> -
- -
-

-

- - - - - -
- - - - - ->>>>>>> 656a0c985880d87881d8ab157da0e848527f4c49 + \ No newline at end of file diff --git a/public/config.php b/public/config.php index 47c9767..d4561a6 100755 --- a/public/config.php +++ b/public/config.php @@ -4,12 +4,7 @@ ISQ::$general = array( 'name' => 'kwl.me', // The name of your URL shortener 'qr' => 1, // Do you want to display a QR code? -<<<<<<< HEAD - 'mobile' => 0, // Do you want to enable the mobile version? 'clipboard' => 1 // Do you want to enable zeroClipboard? (uses flash) -======= - 'mobile' => 0 // Do you want to enable the mobile version? ->>>>>>> 656a0c985880d87881d8ab157da0e848527f4c49 ); // Menu- The width of ∞² menu allows you to have about 10 links diff --git a/public/style.css b/public/style.css index 4bf8625..2007477 100755 --- a/public/style.css +++ b/public/style.css @@ -122,7 +122,6 @@ h1 a:hover { /* Main style */ .paragraph { padding: 0 2.5% 0 2.5%; -<<<<<<< HEAD:public/style.css } h2 { @@ -130,15 +129,6 @@ h2 { margin-bottom: -8px; } -======= -} - -h2 { - color: black; - margin-bottom: -8px; -} - ->>>>>>> 656a0c985880d87881d8ab157da0e848527f4c49:public/style.css .right { width: 60%; float: right; @@ -179,7 +169,6 @@ a.bookmarklet { /* Output */ .output label { width: 30%; -<<<<<<< HEAD:public/style.css float:left; } @@ -187,15 +176,6 @@ a.bookmarklet { width: 70% } -======= - float: left; -} - -.output input { - width: 70% -} - ->>>>>>> 656a0c985880d87881d8ab157da0e848527f4c49:public/style.css .error { color: red; } From e34de4c290a08145d84aa98c4d98f82d3cfe10f3 Mon Sep 17 00:00:00 2001 From: Tom Slominski Date: Tue, 3 Sep 2013 00:43:45 +0100 Subject: [PATCH 04/51] Simple mandatory antispam check based on Tihomir Hristov code. Thanks! --- index.php | 11 ++++++++--- public/style.css | 10 +++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index 773c57b..d1eeeba 100755 --- a/index.php +++ b/index.php @@ -170,6 +170,10 @@ $(document).ready(function() // Part to be executed if FORM has been submitted if ( isset($_REQUEST['url']) ) { + if ( isset($_POST['antispam']) && $_POST['antispam'] != user ) { + exit('

Antispam check failed!

'); + } + $url = yourls_sanitize_url( $_REQUEST['url'] ); $keyword = isset( $_REQUEST['keyword'] ) ? yourls_sanitize_keyword( $_REQUEST['keyword'] ): '' ; $title = isset( $_REQUEST['title'] ) ? yourls_sanitize_title( $_REQUEST['title'] ) : '' ; @@ -199,9 +203,9 @@ $(document).ready(function() echo << -

$ISQlongcopy

-

$ISQshortcopy

-

$ISQstatscopy

+

$ISQlongcopy

+

$ISQshortcopy

+

$ISQstatscopy

$output_copy

@@ -237,6 +241,7 @@ RESULT;

+

Bot Human

HTML; diff --git a/public/style.css b/public/style.css index 2007477..5f3afcd 100755 --- a/public/style.css +++ b/public/style.css @@ -134,6 +134,13 @@ h2 { float: right; } +.radio { + margin-right: 10%; +} +input[type="radio"] { + margin-right: 1%; +} + a.bookmarklet { border-radius: 11px; background: #ddd url(../img/button.png) repeat-x; @@ -169,7 +176,7 @@ a.bookmarklet { /* Output */ .output label { width: 30%; - float:left; + float: left; } .output input { @@ -178,6 +185,7 @@ a.bookmarklet { .error { color: red; + padding-bottom: 20px; } /* Footer */ From b507bb48cb0e9e15e318019c0780ee9f482a2695 Mon Sep 17 00:00:00 2001 From: Tom Slominski Date: Tue, 3 Sep 2013 23:36:32 +0100 Subject: [PATCH 05/51] Antispam i18n strings --- index.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index d1eeeba..8826793 100755 --- a/index.php +++ b/index.php @@ -171,7 +171,7 @@ $(document).ready(function() if ( isset($_REQUEST['url']) ) { if ( isset($_POST['antispam']) && $_POST['antispam'] != user ) { - exit('

Antispam check failed!

'); + exit('

' . yourls__( 'Antispam check failed!', 'isq_translation') . '

'); } $url = yourls_sanitize_url( $_REQUEST['url'] ); @@ -233,6 +233,10 @@ RESULT; $site_title = yourls__( 'Optional title:', 'isq_translation'); $site_title_hover = yourls__( 'Optional title used when sharing a link from YOURLS', 'isq_translation'); $site_submit = yourls__( 'Shorten', 'isq_translation'); + $antispam_title = yourls__( 'Antispam check', 'isq_translation'); + $antispam_value = yourls__( 'Are you a bot or a human?', 'isq_translation'); + $antispam_bot = yourls__( 'Bot', 'isq_translation'); + $antispam_human = yourls__( 'Human', 'isq_translation'); echo <<$site_enter @@ -241,7 +245,7 @@ RESULT;

-

Bot Human

+

$antispam_bot $antispam_human

HTML; From 250f92df69ca6f6eec1c33cebdc9cfefe3239210 Mon Sep 17 00:00:00 2001 From: Tom Slominski Date: Tue, 3 Sep 2013 23:56:22 +0100 Subject: [PATCH 06/51] Making the antispam check error more severe looking. --- public/style.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/style.css b/public/style.css index 5f3afcd..a7d26de 100755 --- a/public/style.css +++ b/public/style.css @@ -186,6 +186,9 @@ a.bookmarklet { .error { color: red; padding-bottom: 20px; + font-weight: bold; + text-align: center; + font-size: 1.2rem; } /* Footer */ From 9d59f95dccdbb99e02752c04628b54579809a46f Mon Sep 17 00:00:00 2001 From: Tom Slominski Date: Wed, 4 Sep 2013 00:16:31 +0100 Subject: [PATCH 07/51] Permission fixes: rw-r--r-- on all files and +x on directories --- index.php | 0 public/CHANGELOG.md | 0 public/config.php | 0 public/formalize.css | 0 public/img/button.png | Bin public/img/facebook.png | Bin public/img/noise.png | Bin public/img/select_arrow.gif | Bin public/js/jquery.formalize.min.js | 0 public/style.css | 0 10 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 index.php mode change 100755 => 100644 public/CHANGELOG.md mode change 100755 => 100644 public/config.php mode change 100755 => 100644 public/formalize.css mode change 100755 => 100644 public/img/button.png mode change 100755 => 100644 public/img/facebook.png mode change 100755 => 100644 public/img/noise.png mode change 100755 => 100644 public/img/select_arrow.gif mode change 100755 => 100644 public/js/jquery.formalize.min.js mode change 100755 => 100644 public/style.css diff --git a/index.php b/index.php old mode 100755 new mode 100644 diff --git a/public/CHANGELOG.md b/public/CHANGELOG.md old mode 100755 new mode 100644 diff --git a/public/config.php b/public/config.php old mode 100755 new mode 100644 diff --git a/public/formalize.css b/public/formalize.css old mode 100755 new mode 100644 diff --git a/public/img/button.png b/public/img/button.png old mode 100755 new mode 100644 diff --git a/public/img/facebook.png b/public/img/facebook.png old mode 100755 new mode 100644 diff --git a/public/img/noise.png b/public/img/noise.png old mode 100755 new mode 100644 diff --git a/public/img/select_arrow.gif b/public/img/select_arrow.gif old mode 100755 new mode 100644 diff --git a/public/js/jquery.formalize.min.js b/public/js/jquery.formalize.min.js old mode 100755 new mode 100644 diff --git a/public/style.css b/public/style.css old mode 100755 new mode 100644 From f1c7c4b8c28f2e6c3188faccae243523f22b8f0e Mon Sep 17 00:00:00 2001 From: Tom Slominski Date: Wed, 4 Sep 2013 00:37:04 +0100 Subject: [PATCH 08/51] String correction --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 8826793..6b22030 100644 --- a/index.php +++ b/index.php @@ -187,7 +187,7 @@ $(document).ready(function() if (!empty(ISQ::$social['twitter'])) { $ISQtwitter = ''; } if (!empty(ISQ::$social['plus'])) { $ISQplus = '
'; } if (!empty(ISQ::$social['linkedin'])) { $ISQlinkedin = ''; } - if (!empty(ISQ::$general['qr'])) { $ISQqr = '

' . yourls__( 'QR code', 'isq-translation' ) . '

' . yourls__( 'Share your code with external devices', 'isq-translation' ) . '

QR'; } + if (!empty(ISQ::$general['qr'])) { $ISQqr = '

' . yourls__( 'QR code', 'isq-translation' ) . '

' . yourls__( 'Share your link with external devices', 'isq-translation' ) . '

QR'; } if (!empty(ISQ::$general['clipboard'])) { $ISQlongcopy = ''; } if (!empty(ISQ::$general['clipboard'])) { $ISQshortcopy = ''; } if (!empty(ISQ::$general['clipboard'])) { $ISQstatscopy = ''; } From db1565dbe9f69c150d8649ebcef47d78a106d91d Mon Sep 17 00:00:00 2001 From: Tom Slominski Date: Fri, 1 Nov 2013 18:06:54 +0000 Subject: [PATCH 09/51] A new .gitignore to prepare for additional files on this branch --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 6277bc3..695924d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,7 @@ # Except Infinity Squared !public/ !index.php +!result.php +!header.php +!footer.php !.gitignore From 1ee65b690d3d33fcbbc128cab7f54df5f951c4ee Mon Sep 17 00:00:00 2001 From: Tom Slominski Date: Fri, 1 Nov 2013 18:15:39 +0000 Subject: [PATCH 10/51] Rudimentary basic two-file structure. This should make the code more readable and easier to edit, but we'll see how we go. It's called two file since only two files here are important. I've split the form and the results page together, and the header.php and footer.php are just additional files so we don't double the code. --- footer.php | 16 ++++ header.php | 167 ++++++++++++++++++++++++++++++++++ index.php | 259 ++--------------------------------------------------- result.php | 56 ++++++++++++ 4 files changed, 248 insertions(+), 250 deletions(-) create mode 100644 footer.php create mode 100644 header.php create mode 100644 result.php diff --git a/footer.php b/footer.php new file mode 100644 index 0000000..89af061 --- /dev/null +++ b/footer.php @@ -0,0 +1,16 @@ +
+

+

+ + + + + +
+ + + + + \ No newline at end of file diff --git a/header.php b/header.php new file mode 100644 index 0000000..4ec7ed5 --- /dev/null +++ b/header.php @@ -0,0 +1,167 @@ + +' . yourls__( 'An error has occured :(', 'isq_translation') . ''; + +if ( $message = $url. yourls__( 'added to database', 'isq_translation') ) { + $error = '

' . yourls__( 'URL shortened successfully', 'isq_translation') . '

' . yourls__( 'View the details of your short URL below.', 'isq_translation') . '

'; + } elseif ( $message = $url. yourls__( 'already exists in database', 'isq_translation') ) { + $error = $genericerror . '

' . yourls__( 'This URL already exists in this database. This website does not allow a single URL to have multiple short links.', 'isq_translation') . '

'; + } elseif ( $message = yourls__( 'Short URL', 'isq_translation') . $url . yourls__( 'already exists in database or is reserved', 'isq_translation') ) { + $error = $genericerror . '

' . yourls__( 'This short URL already exists in this database or is reserved. This website does not allow a single URL to have multiple short links. It could\'ve also been reserved by the admin.', 'isq_translation') . '

'; + } elseif ( $message = yourls__( 'Missing URL input', 'isq_translation') ) { + $error = $genericerror . '

' . yourls__( 'You did not enter the URL you want to shorten or the server lost it. Please try again.', 'isq_translation') . '

'; + } elseif ( $message = yourls__( 'This URL is a short URL', 'isq_translation') ) { + $error = $genericerror . '

' . yourls__( 'You cannot shorten a short URL!', 'isq_translation') . '

'; + } +?> + + + +<?php echo $ISQtitle; ?> + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

+ +
+
\ No newline at end of file diff --git a/index.php b/index.php index 6b22030..7d19f2a 100644 --- a/index.php +++ b/index.php @@ -1,227 +1,6 @@ - -' . yourls__( 'An error has occured :(', 'isq_translation') . ''; - -if ( $message = $url. yourls__( 'added to database', 'isq_translation') ) { - $error = '

' . yourls__( 'URL shortened successfully', 'isq_translation') . '

' . yourls__( 'View the details of your short URL below.', 'isq_translation') . '

'; - } elseif ( $message = $url. yourls__( 'already exists in database', 'isq_translation') ) { - $error = $genericerror . '

' . yourls__( 'This URL already exists in this database. This website does not allow a single URL to have multiple short links.', 'isq_translation') . '

'; - } elseif ( $message = yourls__( 'Short URL', 'isq_translation') . $url . yourls__( 'already exists in database or is reserved', 'isq_translation') ) { - $error = $genericerror . '

' . yourls__( 'This short URL already exists in this database or is reserved. This website does not allow a single URL to have multiple short links. It could\'ve also been reserved by the admin.', 'isq_translation') . '

'; - } elseif ( $message = yourls__( 'Missing URL input', 'isq_translation') ) { - $error = $genericerror . '

' . yourls__( 'You did not enter the URL you want to shorten or the server lost it. Please try again.', 'isq_translation') . '

'; - } elseif ( $message = yourls__( 'This URL is a short URL', 'isq_translation') ) { - $error = $genericerror . '

' . yourls__( 'You cannot shorten a short URL!', 'isq_translation') . '

'; - } -?> - - - -<?php echo $ISQtitle; ?> - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-

- -
-
- ' . yourls__( 'Antispam check failed!', 'isq_translation') . '

'); - } - - $url = yourls_sanitize_url( $_REQUEST['url'] ); - $keyword = isset( $_REQUEST['keyword'] ) ? yourls_sanitize_keyword( $_REQUEST['keyword'] ): '' ; - $title = isset( $_REQUEST['title'] ) ? yourls_sanitize_title( $_REQUEST['title'] ) : '' ; - $return = yourls_add_new_link( $url, $keyword, $title ); - - $shorturl = isset( $return['shorturl'] ) ? $return['shorturl'] : ''; - $message = isset( $return['message'] ) ? $return['message'] : ''; - $title = isset( $return['title'] ) ? $return['title'] : ''; - - if (!empty(ISQ::$social['facebook'])) { $ISQfacebook = ''; } - if (!empty(ISQ::$social['twitter'])) { $ISQtwitter = ''; } - if (!empty(ISQ::$social['plus'])) { $ISQplus = '
'; } - if (!empty(ISQ::$social['linkedin'])) { $ISQlinkedin = ''; } - if (!empty(ISQ::$general['qr'])) { $ISQqr = '

' . yourls__( 'QR code', 'isq-translation' ) . '

' . yourls__( 'Share your link with external devices', 'isq-translation' ) . '

QR'; } - if (!empty(ISQ::$general['clipboard'])) { $ISQlongcopy = ''; } - if (!empty(ISQ::$general['clipboard'])) { $ISQshortcopy = ''; } - if (!empty(ISQ::$general['clipboard'])) { $ISQstatscopy = ''; } - - $output_original = yourls__( 'Original URL:', 'isq_translation'); - $output_short = yourls__( 'Short URL:', 'isq_translation'); - /* translators: This is short for statistics */ - $output_stats = yourls__( 'Stats:', 'isq_translation'); - $output_copy = yourls__( 'Click on a link and press Ctrl+C to quickly copy it.', 'isq_translation'); - $output_share_h2 = yourls__( 'Share', 'isq_translation'); - $output_share_p = yourls__( 'Share your short URL', 'isq_translation'); - - echo << -

$ISQlongcopy

-

$ISQshortcopy

-

$ISQstatscopy

-

$output_copy

-
- - $ISQqr - -

$output_share_h2

-

$output_share_p

- $ISQfacebook - $ISQtwitter - $ISQplus - $ISQlinkedin -RESULT; - - // Part to be executed when no form has been submitted - } else { - $site = YOURLS_SITE; $site_enter = yourls__( 'Enter a new URL to shorten', 'isq_translation'); @@ -233,40 +12,20 @@ RESULT; $site_title = yourls__( 'Optional title:', 'isq_translation'); $site_title_hover = yourls__( 'Optional title used when sharing a link from YOURLS', 'isq_translation'); $site_submit = yourls__( 'Shorten', 'isq_translation'); - $antispam_title = yourls__( 'Antispam check', 'isq_translation'); - $antispam_value = yourls__( 'Are you a bot or a human?', 'isq_translation'); + $antispam_title = yourls__( 'This is an antispam check. Sorry, we have to do this to prevent the database being overrun by bots!', 'isq_translation'); + $antispam_value = yourls__( 'reCAPTCHA', 'isq_translation'); $antispam_bot = yourls__( 'Bot', 'isq_translation'); $antispam_human = yourls__( 'Human', 'isq_translation'); +?> - echo <<$site_enter +

$site_hover

-
+

-

$antispam_bot $antispam_human

+

$captcha

-HTML; - } - ?> -
- -
-

-

- - - - - -
- - -
- - \ No newline at end of file + \ No newline at end of file diff --git a/result.php b/result.php new file mode 100644 index 0000000..5a75d9f --- /dev/null +++ b/result.php @@ -0,0 +1,56 @@ +' . yourls__( 'Antispam check failed!', 'isq_translation') . '

'); + // } + + $url = yourls_sanitize_url( $_REQUEST['url'] ); + $keyword = isset( $_REQUEST['keyword'] ) ? yourls_sanitize_keyword( $_REQUEST['keyword'] ): '' ; + $title = isset( $_REQUEST['title'] ) ? yourls_sanitize_title( $_REQUEST['title'] ) : '' ; + $return = yourls_add_new_link( $url, $keyword, $title ); + + $shorturl = isset( $return['shorturl'] ) ? $return['shorturl'] : ''; + $message = isset( $return['message'] ) ? $return['message'] : ''; + $title = isset( $return['title'] ) ? $return['title'] : ''; + + if (!empty(ISQ::$social['facebook'])) { $ISQfacebook = ''; } + if (!empty(ISQ::$social['twitter'])) { $ISQtwitter = ''; } + if (!empty(ISQ::$social['plus'])) { $ISQplus = '
'; } + if (!empty(ISQ::$social['linkedin'])) { $ISQlinkedin = ''; } + if (!empty(ISQ::$general['qr'])) { $ISQqr = '

' . yourls__( 'QR code', 'isq-translation' ) . '

' . yourls__( 'Share your link with external devices', 'isq-translation' ) . '

QR'; } + if (!empty(ISQ::$general['clipboard'])) { $ISQlongcopy = ''; } + if (!empty(ISQ::$general['clipboard'])) { $ISQshortcopy = ''; } + if (!empty(ISQ::$general['clipboard'])) { $ISQstatscopy = ''; } + + $output_original = yourls__( 'Original URL:', 'isq_translation'); + $output_short = yourls__( 'Short URL:', 'isq_translation'); + /* translators: This is short for statistics */ + $output_stats = yourls__( 'Stats:', 'isq_translation'); + $output_copy = yourls__( 'Click on a link and press Ctrl+C to quickly copy it.', 'isq_translation'); + $output_share_h2 = yourls__( 'Share', 'isq_translation'); + $output_share_p = yourls__( 'Share your short URL', 'isq_translation'); + +?> + $error +
+

$ISQlongcopy

+

$ISQshortcopy

+

$ISQstatscopy

+

$output_copy

+
+ + $ISQqr + +

$output_share_h2

+

$output_share_p

+ $ISQfacebook + $ISQtwitter + $ISQplus + $ISQlinkedin + + \ No newline at end of file From 553a1a8743b0ff9522103f8f608e8b755038ec30 Mon Sep 17 00:00:00 2001 From: Tom Slominski Date: Fri, 1 Nov 2013 18:40:28 +0000 Subject: [PATCH 11/51] Moved the text strings from variables directly into the text. Such readability. Much wow. --- index.php | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/index.php b/index.php index 7d19f2a..1bb7146 100644 --- a/index.php +++ b/index.php @@ -1,31 +1,13 @@ - - $site = YOURLS_SITE; - - $site_enter = yourls__( 'Enter a new URL to shorten', 'isq_translation'); - $site_hover = yourls__( 'Hover over the labels to see more information', 'isq_translation'); - $site_long = yourls__( 'Long URL (required):', 'isq_translation'); - $site_long_hover = yourls__( 'Paste the long URL here', 'isq_translation'); - $site_keyword = yourls__( 'Custom keyword:', 'isq_translation'); - $site_keyword_hover = yourls__( 'A keyword replaces the default short string', 'isq_translation'); - $site_title = yourls__( 'Optional title:', 'isq_translation'); - $site_title_hover = yourls__( 'Optional title used when sharing a link from YOURLS', 'isq_translation'); - $site_submit = yourls__( 'Shorten', 'isq_translation'); - $antispam_title = yourls__( 'This is an antispam check. Sorry, we have to do this to prevent the database being overrun by bots!', 'isq_translation'); - $antispam_value = yourls__( 'reCAPTCHA', 'isq_translation'); - $antispam_bot = yourls__( 'Bot', 'isq_translation'); - $antispam_human = yourls__( 'Human', 'isq_translation'); -?> - -

-

$site_hover

+

+

-

-

-

-

$captcha

-

+

+

+

+

+

- \ No newline at end of file + From 90fbc64d0a724faa515b259c4fe05481b14f1cf1 Mon Sep 17 00:00:00 2001 From: Tom Slominski Date: Fri, 1 Nov 2013 18:45:34 +0000 Subject: [PATCH 12/51] Corrected tabs and comments --- index.php | 8 ++++---- result.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/index.php b/index.php index 1bb7146..b21981b 100644 --- a/index.php +++ b/index.php @@ -1,13 +1,13 @@ -

-

-
+

+

+

-
+ diff --git a/result.php b/result.php index 5a75d9f..c8f34b3 100644 --- a/result.php +++ b/result.php @@ -2,7 +2,7 @@ var_dump($_REQUEST); include('header.php'); - + // antispam // if ( isset($_POST['antispam']) && $_POST['antispam'] != user ) { // exit('

' . yourls__( 'Antispam check failed!', 'isq_translation') . '

'); // } From 718420690b7fddd53b9c6e15cc5b02473721148f Mon Sep 17 00:00:00 2001 From: Tom Slominski Date: Fri, 1 Nov 2013 19:19:35 +0000 Subject: [PATCH 13/51] Sorted out the results page --- result.php | 78 ++++++++++++++++++++++-------------------------------- 1 file changed, 32 insertions(+), 46 deletions(-) diff --git a/result.php b/result.php index c8f34b3..b682e25 100644 --- a/result.php +++ b/result.php @@ -1,56 +1,42 @@ ' . yourls__( 'Antispam check failed!', 'isq_translation') . '

'); - // } +// antispam +// if ( isset($_POST['antispam']) && $_POST['antispam'] != user ) { +// exit('

' . yourls__( 'Antispam check failed!', 'isq_translation') . '

'); +// } - $url = yourls_sanitize_url( $_REQUEST['url'] ); - $keyword = isset( $_REQUEST['keyword'] ) ? yourls_sanitize_keyword( $_REQUEST['keyword'] ): '' ; - $title = isset( $_REQUEST['title'] ) ? yourls_sanitize_title( $_REQUEST['title'] ) : '' ; - $return = yourls_add_new_link( $url, $keyword, $title ); +$url = yourls_sanitize_url( $_REQUEST['url'] ); +$keyword = isset( $_REQUEST['keyword'] ) ? yourls_sanitize_keyword( $_REQUEST['keyword'] ): '' ; +$title = isset( $_REQUEST['title'] ) ? yourls_sanitize_title( $_REQUEST['title'] ) : '' ; +$return = yourls_add_new_link( $url, $keyword, $title ); - $shorturl = isset( $return['shorturl'] ) ? $return['shorturl'] : ''; - $message = isset( $return['message'] ) ? $return['message'] : ''; - $title = isset( $return['title'] ) ? $return['title'] : ''; - - if (!empty(ISQ::$social['facebook'])) { $ISQfacebook = ''; } - if (!empty(ISQ::$social['twitter'])) { $ISQtwitter = ''; } - if (!empty(ISQ::$social['plus'])) { $ISQplus = '
'; } - if (!empty(ISQ::$social['linkedin'])) { $ISQlinkedin = ''; } - if (!empty(ISQ::$general['qr'])) { $ISQqr = '

' . yourls__( 'QR code', 'isq-translation' ) . '

' . yourls__( 'Share your link with external devices', 'isq-translation' ) . '

QR'; } - if (!empty(ISQ::$general['clipboard'])) { $ISQlongcopy = ''; } - if (!empty(ISQ::$general['clipboard'])) { $ISQshortcopy = ''; } - if (!empty(ISQ::$general['clipboard'])) { $ISQstatscopy = ''; } - - $output_original = yourls__( 'Original URL:', 'isq_translation'); - $output_short = yourls__( 'Short URL:', 'isq_translation'); - /* translators: This is short for statistics */ - $output_stats = yourls__( 'Stats:', 'isq_translation'); - $output_copy = yourls__( 'Click on a link and press Ctrl+C to quickly copy it.', 'isq_translation'); - $output_share_h2 = yourls__( 'Share', 'isq_translation'); - $output_share_p = yourls__( 'Share your short URL', 'isq_translation'); +$shorturl = isset( $return['shorturl'] ) ? $return['shorturl'] : ''; +$message = isset( $return['message'] ) ? $return['message'] : ''; +$title = isset( $return['title'] ) ? $return['title'] : ''; ?> - $error -
-

$ISQlongcopy

-

$ISQshortcopy

-

$ISQstatscopy

-

$output_copy

-
- $ISQqr + + -

$output_share_h2

-

$output_share_p

- $ISQfacebook - $ISQtwitter - $ISQplus - $ISQlinkedin + +
+

' . yourls__( 'Copy to Clipboard', 'isq-translation' ) . ''; } ?>

+

' . yourls__( 'Copy to Clipboard', 'isq-translation' ) . ''; } ?>

+

' . yourls__( 'Copy to Clipboard', 'isq-translation' ) . ''; } ?>

+

+
- \ No newline at end of file + +' . yourls__( 'QR code', 'isq-translation' ) . '

' . yourls__( 'Share your link with external devices', 'isq-translation' ) . '

QR'; } ?> + + +

+

+Facebook'; } ?> +Tweet'; } ?> +
'; } ?> +'; } ?> + + \ No newline at end of file From 0293dff5779d6b1146f42d3951c55ccffe8cd9e8 Mon Sep 17 00:00:00 2001 From: Tom Slominski Date: Fri, 1 Nov 2013 19:20:38 +0000 Subject: [PATCH 14/51] Less tabs --- index.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/index.php b/index.php index b21981b..e1a5e4a 100644 --- a/index.php +++ b/index.php @@ -1,13 +1,13 @@ -

-

-
-

-

-

-

-

-
+

+

+
+

+

+

+

+

+
From 679dcd09619da25e5f654d27916e0468e06f8c4e Mon Sep 17 00:00:00 2001 From: Tom Slominski Date: Fri, 1 Nov 2013 19:21:45 +0000 Subject: [PATCH 15/51] New lines at the ends of files --- footer.php | 2 +- header.php | 4 ++-- result.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/footer.php b/footer.php index 89af061..bafd00d 100644 --- a/footer.php +++ b/footer.php @@ -13,4 +13,4 @@ - \ No newline at end of file + diff --git a/header.php b/header.php index 4ec7ed5..be27880 100644 --- a/header.php +++ b/header.php @@ -1,5 +1,5 @@ - -
\ No newline at end of file +
diff --git a/result.php b/result.php index b682e25..16de094 100644 --- a/result.php +++ b/result.php @@ -39,4 +39,4 @@ $title = isset( $return['title'] ) ? $return['title'] : '';
'; } ?> '; } ?> - \ No newline at end of file + From c05a17fbabbeaddc610702e40224a63c01fd8c9b Mon Sep 17 00:00:00 2001 From: Tom Slominski Date: Fri, 1 Nov 2013 19:27:23 +0000 Subject: [PATCH 16/51] Sorted out header --- header.php | 58 ++++++++++++++++-------------------------------------- 1 file changed, 17 insertions(+), 41 deletions(-) diff --git a/header.php b/header.php index be27880..0d1372c 100644 --- a/header.php +++ b/header.php @@ -7,40 +7,15 @@ require_once( dirname(__FILE__).'/includes/load-yourls.php' ); include( dirname(__FILE__).'/public/config.php' ); class ISQ { public static $general = array(), $links = array(), $social = array(); } -// Translations stuff +// Load translations function isq_load_textdomain() { yourls_load_custom_textdomain( 'isq_translation', $site . '/public/languages' ); $site = YOURLS_SITE; } isq_load_textdomain(); -// Settings definitions -$ISQtitle = ISQ::$general['name']; -$ISQname_1= ISQ::$links['name_1']; -$ISQurl_1= ISQ::$links['url_1']; -$ISQname_2= ISQ::$links['name_2']; -$ISQurl_2= ISQ::$links['url_2']; -$ISQname_3= ISQ::$links['name_3']; -$ISQurl_3= ISQ::$links['url_3']; -$ISQname_4= ISQ::$links['name_4']; -$ISQurl_4= ISQ::$links['url_4']; -$ISQname_5= ISQ::$links['name_5']; -$ISQurl_5= ISQ::$links['url_5']; -$ISQname_6= ISQ::$links['name_6']; -$ISQurl_6= ISQ::$links['url_6']; -$ISQname_7= ISQ::$links['name_7']; -$ISQurl_7= ISQ::$links['url_7']; -$ISQname_8= ISQ::$links['name_8']; -$ISQurl_8= ISQ::$links['url_8']; -$ISQname_9= ISQ::$links['name_9']; -$ISQurl_9= ISQ::$links['url_9']; -$ISQname_10= ISQ::$links['name_10']; -$ISQurl_10= ISQ::$links['url_10']; - // Error definitions - $genericerror = '

' . yourls__( 'An error has occured :(', 'isq_translation') . '

'; - if ( $message = $url. yourls__( 'added to database', 'isq_translation') ) { $error = '

' . yourls__( 'URL shortened successfully', 'isq_translation') . '

' . yourls__( 'View the details of your short URL below.', 'isq_translation') . '

'; } elseif ( $message = $url. yourls__( 'already exists in database', 'isq_translation') ) { @@ -56,7 +31,7 @@ if ( $message = $url. yourls__( 'added to database', 'isq_translation') ) { -<?php echo $ISQtitle; ?> +<?php echo ISQ::$general['name']; ?> @@ -150,18 +125,19 @@ $(document).ready(function()
-

- +

+
-
+ +
From 2f98a2707cfc06a429750f1399e0b3338614ba84 Mon Sep 17 00:00:00 2001 From: Tom Slominski Date: Fri, 1 Nov 2013 23:59:16 +0000 Subject: [PATCH 17/51] Missed a
--- footer.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/footer.php b/footer.php index bafd00d..87452fc 100644 --- a/footer.php +++ b/footer.php @@ -1,15 +1,16 @@ +
-

-

+

+

- - - - + + + +
From cf605a9ec5f6cfc283322b58c7c71c67dfcb7cb7 Mon Sep 17 00:00:00 2001 From: Tom Slominski Date: Sat, 2 Nov 2013 00:44:41 +0000 Subject: [PATCH 18/51] I've merged some code from YOURLS, but the SATANIC bookmarklets still do not work. Ugh. --- footer.php | 8 ++++---- result.php | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/footer.php b/footer.php index 87452fc..d51f01b 100644 --- a/footer.php +++ b/footer.php @@ -3,10 +3,10 @@

- - - - + + + +
'; } ?> -'; } ?> +'; } ?> +'; } ?> +'; } ?> +'; } ?> From 78cb3ed559e9768240a4133339589cfc8816d4c7 Mon Sep 17 00:00:00 2001 From: Tom Slominski Date: Sat, 2 Nov 2013 15:17:13 +0000 Subject: [PATCH 25/51] Improvements to the look of the "Too many URLs added too fast" error page --- public/style.css | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/public/style.css b/public/style.css index 32690a6..8264a43 100644 --- a/public/style.css +++ b/public/style.css @@ -241,3 +241,19 @@ header { display:none; } } + +/* Error page */ +#wrap { + border-left: none; !important +} + +#wrap > h1 > a, +#wrap > h1, +header > h1 { + display: none; +} + +#wrap > h2, +#wrap > p { + color: red; +} \ No newline at end of file From 2c2dcb740d791497d084a44bcd55cf513b77175f Mon Sep 17 00:00:00 2001 From: Tom Slominski Date: Sat, 2 Nov 2013 15:23:12 +0000 Subject: [PATCH 26/51] Improved the error page as much as I can without affecting the actual theme --- header.php | 1 + public/style.css | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/header.php b/header.php index 0d1372c..394405c 100644 --- a/header.php +++ b/header.php @@ -127,6 +127,7 @@ $(document).ready(function()