diff --git a/index.php b/index.php index a3522aa..afc0e75 100644 --- a/index.php +++ b/index.php @@ -6,15 +6,24 @@ require_once( dirname(__FILE__).'/includes/load-yourls.php' ); kwl.me - - - + - - - + + + + + + + + @@ -34,28 +43,6 @@ require_once( dirname(__FILE__).'/includes/load-yourls.php' ); $url = yourls_sanitize_url( $_REQUEST['url'] ); $keyword = isset( $_REQUEST['keyword'] ) ? yourls_sanitize_keyword( $_REQUEST['keyword'] ): '' ; $title = isset( $_REQUEST['title'] ) ? yourls_sanitize_title( $_REQUEST['title'] ) : '' ; - -// Mr. Tech- URL Sanitizing -function valid_url($str) { - return ( ! preg_match('/^(http|https|ftp):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/i', $str)) -? FALSE : TRUE; -} - -$url = yourls_sanitize_url($_REQUEST['url']); - -if (!valid_url($url)) { - die( 'Invalid url, go back and try again' ); -} - -// Mr. Tech- Bans -$url = $_REQUEST['url']; - -foreach ($yourls_banned_URL as $banned_url) { - if (stristr($url, $banned_url)) { - die( 'Banned site' ); - } -} - $return = yourls_add_new_link( $url, $keyword, $title ); $shorturl = isset( $return['shorturl'] ) ? $return['shorturl'] : ''; @@ -63,14 +50,19 @@ foreach ($yourls_banned_URL as $banned_url) { $title = isset( $return['title'] ) ? $return['title'] : ''; echo <<URL has been shortened -

Original URL: $url

-

Short URL: $shorturl

-

$message

+

Your URL has been shortened

+

$message

+
+

Original URL: $url

+

Short URL: $shorturl

+

Stats: $shorturl+

+
+ +

Share

+

Share your short URL

+ Tweet + RESULT; - - // Include the Copy box and the Quick Share box - yourls_share_box( $url, $shorturl, $title ); // Part to be executed when no form has been submitted } else { @@ -79,12 +71,13 @@ RESULT; echo <<Enter a new URL to shorten +

Hover over the labels to see more information

-

-

-

+

+

+

-
+ HTML; } @@ -97,7 +90,7 @@ HTML;

Custom Keyword Shorten

diff --git a/public/CHANGELOG b/public/CHANGELOG new file mode 100644 index 0000000..01998fe --- /dev/null +++ b/public/CHANGELOG @@ -0,0 +1,22 @@ +∞² for YOURLS +CHANGELOG +======================================================================= +======================================================================= +Version 1.0 +----------------------------------------------------------------------- +Initial release +======================================================================= +Version 1.1 +----------------------------------------------------------------------- +Added a "for" attribute to the shortening form +Added tooltips for revealing more information about inputs +Removed input=text content (replaced by tooltips) +Changed file theme structure (files now located in /public) +New README and CHANGELOG files +Updated formalize +The theme is now showing links on it's own +Added a new sharing system using native buttons +Got rid of yourls_share_box +Updated footer with new credits and a github repo link +Cleaned up CSS +======================================================================= diff --git a/public/README b/public/README new file mode 100644 index 0000000..f8ba0d2 --- /dev/null +++ b/public/README @@ -0,0 +1,9 @@ +A port of the beautiful ∞² theme for WordPress, by Tom Slominski (http://tomslominski.net/) + +To activate, just upload the included files to your main YOURLS directory. + +qTip 2 is dual licensed under MIT or GPLv2 licenses +http://en.wikipedia.org/wiki/MIT_License +http://en.wikipedia.org/wiki/GNU_General_Public_License + +Formalize and the theme itself are also licenced on GPLv2. diff --git a/public/formalize.css b/public/formalize.css new file mode 100644 index 0000000..f7c04b7 --- /dev/null +++ b/public/formalize.css @@ -0,0 +1,302 @@ +/* `Widths +----------------------------------------------------------------------------------------------------*/ + +.input_tiny { + width: 50px; +} + +.input_small { + width: 100px; +} + +.input_medium { + width: 150px; +} + +.input_large { + width: 200px; +} + +.input_xlarge { + width: 250px; +} + +.input_xxlarge { + width: 300px; +} + +.input_full { + width: 100%; +} + +/* + Added via JS to