diff --git a/index.php b/index.php index ac449f1..625d10c 100644 --- a/index.php +++ b/index.php @@ -1,13 +1,59 @@ + Share on Facebook"; } +if (!empty(ISQ::$social['twitter'])) { $ISQtwitter = "Tweet"; } +if (!empty(ISQ::$social['plus'])) { $ISQplus = "Share on Google+"; } +if (!empty(ISQ::$social['linkedin'])) { $ISQlinkedin = ""; } +if (!empty(ISQ::$general['qr'])) { $ISQqr = "

QR code

\n

Share your code with external devices

\nQR code"; } +$ISQtitle = ISQ::$general['name']; +$ISQname_1= ISQ::$links['name_1']; +$ISQname_1= ISQ::$links['url_1']; +$ISQname_2= ISQ::$links['name_2']; +$ISQname_2= ISQ::$links['url_2']; +$ISQname_3= ISQ::$links['name_3']; +$ISQname_3= ISQ::$links['url_3']; +$ISQname_4= ISQ::$links['name_4']; +$ISQname_4= ISQ::$links['url_4']; +$ISQname_5= ISQ::$links['name_5']; +$ISQname_5= ISQ::$links['url_5']; +$ISQname_6= ISQ::$links['name_6']; +$ISQname_6= ISQ::$links['url_6']; +$ISQname_7= ISQ::$links['name_7']; +$ISQname_7= ISQ::$links['url_7']; +$ISQname_8= ISQ::$links['name_8']; +$ISQname_8= ISQ::$links['url_8']; +$ISQname_9= ISQ::$links['name_9']; +$ISQname_9= ISQ::$links['url_9']; +$ISQname_10= ISQ::$links['name_10']; +$ISQname_10= ISQ::$links['url_10']; + +// Error definitions +if ( $message = $url. "added to database") { + $error = "

URL shortened successfully

\n

View the details of your short URL below.

"; + } elseif ( $message = $url. "already exists in database") { + $error = "

An error has occured :(

\n

This URL already exists in this database. This website does not allow a single URL to have multiple short links.

"; + } elseif ( $message = "Short URL" .$url. "already exists in database or is reserved") { + $error = "

An error has occured :(

\n

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.

"; + } elseif ( $message = "Missing URL input") { + $error = "

An error has occured :(

\n

You did not enter the URL you want to shorten or the server lost it. Please try again.

"; + } elseif ( $message = "URL is a short URL") { + $error = "

An error has occured :(

\n

You cannot shorten a short URL!

"; + } ?> + -kwl.me +<?php echo $ISQtitle; ?> + @@ -18,8 +64,8 @@ include( dirname(__FILE__).'/public/config.php' ); @@ -27,18 +73,18 @@ $(document).ready(function()
-

+

Your URL has been shortened -

$message

+ $error

Original URL: $url

Short URL: $shorturl

Stats: $shorturl+

+ $ISQqr +

Share

Share your short URL

- Tweet - Share on Facebook + $ISQfacebook + $ISQtwitter + $ISQplus + $ISQlinkedin RESULT; // Part to be executed when no form has been submitted diff --git a/public/README b/public/README index 08e8d53..f2c4b44 100644 --- a/public/README +++ b/public/README @@ -1,4 +1,4 @@ -Infinity Squared, a beautiful theme for YOURLS, by Tom Slominski (http://tomslominski.net/) +Infinity Squared, a beautiful theme for YOURLS, by Tom Slominski (http://tomslominski.net/infinity-squared/) See the project's Wiki pages at GitHub for the latest installation instructions https://github.com/tomslominski/infinity-squared diff --git a/public/config.php b/public/config.php index 5fc2338..faed3a6 100644 --- a/public/config.php +++ b/public/config.php @@ -1,27 +1,42 @@ 'Edit public/config.php to set up ∞²', // The name of your URL shortener + 'qr' => 1 // Do you want to display a QR code? +); -// Menu- The width of ∞² menu allows you to have about 10 links, however, -// you don't need to use all of them -define( 'ISQ_LINK1_NAME', '' ); -define( 'ISQ_LINK1_URL', '' ); -define( 'ISQ_LINK2_NAME', '' ); -define( 'ISQ_LINK2_URL', '' ); -define( 'ISQ_LINK3_NAME', '' ); -define( 'ISQ_LINK3_URL', '' ); -define( 'ISQ_LINK4_NAME', '' ); -define( 'ISQ_LINK4_URL', '' ); -define( 'ISQ_LINK5_NAME', '' ); -define( 'ISQ_LINK5_URL', '' ); -define( 'ISQ_LINK6_NAME', '' ); -define( 'ISQ_LINK6_URL', '' ); -define( 'ISQ_LINK7_NAME', '' ); -define( 'ISQ_LINK7_URL', '' ); -define( 'ISQ_LINK8_NAME', '' ); -define( 'ISQ_LINK8_URL', '' ); -define( 'ISQ_LINK9_NAME', '' ); -define( 'ISQ_LINK9_URL', '' ); -define( 'ISQ_LINK10_NAME', '' ); -define( 'ISQ_LINK10_URL', '' ); +// Menu- The width of ∞² menu allows you to have about 10 links +// Leave empty to disable +ISQ::$links = array( + 'name_1' => '', + 'url_1' => '', + 'name_2' => '', + 'url_2' => '', + 'name_3' => '', + 'url_3' => '', + 'name_4' => '', + 'url_4' => '', + 'name_5' => '', + 'url_5' => '', + 'name_6' => '', + 'url_6' => '', + 'name_7' => '', + 'url_7' => '', + 'name_8' => '', + 'url_8' => '', + 'name_9' => '', + 'url_9' => '', + 'name_10' => '', + 'url_10' => '' +); + +// Social sharing +// 1 to enable, 0 to disable +ISQ::$social = array( + 'facebook' => 1, + 'twitter' => 1, + 'plus' => 1, + 'linkedin' => 1 +); ?> diff --git a/public/img/plus.png b/public/img/plus.png new file mode 100644 index 0000000..34e86ea Binary files /dev/null and b/public/img/plus.png differ diff --git a/public/public.css b/public/public.css index 5b28ed8..1fdf965 100644 --- a/public/public.css +++ b/public/public.css @@ -154,3 +154,6 @@ div#sharebox { width:600px; margin-top: 20px } +.error { + color:red; +}