1.2
This commit is contained in:
87
index.php
87
index.php
@@ -1,13 +1,59 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
<?php
|
||||
// Start YOURLS engine
|
||||
require_once( dirname(__FILE__).'/includes/load-yourls.php' );
|
||||
|
||||
// Ask for Infinity Squared settings
|
||||
include( dirname(__FILE__).'/public/config.php' );
|
||||
require_once( dirname(__FILE__).'/public/config.php' );
|
||||
class ISQ { public static $general = array(), $links = array(), $social = array(); }
|
||||
|
||||
// Settings definitions
|
||||
if (!empty(ISQ::$social['facebook'])) { $ISQfacebook = "<a href='#' class='share-button' onClick='facebook=window.open('http://facebook.com/sharer.php?u=$shorturl&t=$title','facebook','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=626,height=436,left=0,top=0'); return false;'><img src='public/img/facebook.png' alt='Share on Facebook' /></a>"; }
|
||||
if (!empty(ISQ::$social['twitter'])) { $ISQtwitter = "<a href='http://twitter.com/share' class='twitter-share-button' data-url='$shorturl' data-text='$keyword' data-count='vertical'>Tweet</a><script type='text/javascript' src='http://platform.twitter.com/widgets.js'></script>"; }
|
||||
if (!empty(ISQ::$social['plus'])) { $ISQplus = "<a href='https://m.google.com/app/plus/x/?v=compose&content=$shorturl' target='_blank'><img src='public/img/plus.png' alt='Share on Google+' /></a>"; }
|
||||
if (!empty(ISQ::$social['linkedin'])) { $ISQlinkedin = "<script src='http://platform.linkedin.com/in.js' type='text/javascript'></script><script type='IN/Share' data-url='$shorturl' data-counter='top'></script>"; }
|
||||
if (!empty(ISQ::$general['qr'])) { $ISQqr = "<h2>QR code</h2>\n<p>Share your code with external devices</p>\n<img class='qr' src='https://chart.googleapis.com/chart?cht=qr&chs=150x150&chl=$shorturl&chld=L|0' alt='QR 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 = "<h2>URL shortened successfully</h2>\n<p>View the details of your short URL below.</p>";
|
||||
} elseif ( $message = $url. "already exists in database") {
|
||||
$error = "<h2 class='error'>An error has occured :(</h2>\n<p class='error'>This URL already exists in this database. This website does not allow a single URL to have multiple short links.</p>";
|
||||
} elseif ( $message = "Short URL" .$url. "already exists in database or is reserved") {
|
||||
$error = "<h2 class='error'>An error has occured :(</h2>\n<p class='error'>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.</p>";
|
||||
} elseif ( $message = "Missing URL input") {
|
||||
$error = "<h2 class='error'>An error has occured :(</h2>\n<p class='error'>You did not enter the URL you want to shorten or the server lost it. Please try again.</p>";
|
||||
} elseif ( $message = "URL is a short URL") {
|
||||
$error = "<h2 class='error'>An error has occured :(</h2>\n<p class='error'>You cannot shorten a short URL!</p>";
|
||||
}
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>kwl.me</title>
|
||||
<title><?php echo $ISQtitle; ?></title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
|
||||
<script src="<?php echo YOURLS_SITE; ?>/js/jquery-1.4.3.min.js" type="text/javascript"></script>
|
||||
<link rel="stylesheet" href="<?php echo YOURLS_SITE; ?>/public/formalize.css" />
|
||||
<script src="<?php echo YOURLS_SITE; ?>/public/js/jquery.formalize.min.js" type="text/javascript"></script>
|
||||
@@ -18,8 +64,8 @@ include( dirname(__FILE__).'/public/config.php' );
|
||||
<script>
|
||||
$(document).ready(function()
|
||||
{
|
||||
// Match all A links with a title tag and use it as the content (default).
|
||||
$('label[title]').qtip();
|
||||
// Match all labels with a title tag and use it as the content
|
||||
$('label[title]').qtip();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
@@ -27,18 +73,18 @@ $(document).ready(function()
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
<h1><a href="<?php echo YOURLS_SITE; ?>"><?php echo ISQ_NAME; ?></a></h1>
|
||||
<h1><a href="<?php echo YOURLS_SITE; ?>"><?php echo $ISQtitle; ?></a></h1>
|
||||
<ul class="menu">
|
||||
<li><a href="<?php echo ISQ_LINK1_URL; ?>"><?php echo ISQ_LINK1_NAME; ?></a></li>
|
||||
<li><a href="<?php echo ISQ_LINK2_URL; ?>"><?php echo ISQ_LINK2_NAME; ?></a></li>
|
||||
<li><a href="<?php echo ISQ_LINK3_URL; ?>"><?php echo ISQ_LINK3_NAME; ?></a></li>
|
||||
<li><a href="<?php echo ISQ_LINK4_URL; ?>"><?php echo ISQ_LINK4_NAME; ?></a></li>
|
||||
<li><a href="<?php echo ISQ_LINK5_URL; ?>"><?php echo ISQ_LINK5_NAME; ?></a></li>
|
||||
<li><a href="<?php echo ISQ_LINK6_URL; ?>"><?php echo ISQ_LINK6_NAME; ?></a></li>
|
||||
<li><a href="<?php echo ISQ_LINK7_URL; ?>"><?php echo ISQ_LINK7_NAME; ?></a></li>
|
||||
<li><a href="<?php echo ISQ_LINK8_URL; ?>"><?php echo ISQ_LINK8_NAME; ?></a></li>
|
||||
<li><a href="<?php echo ISQ_LINK9_URL; ?>"><?php echo ISQ_LINK9_NAME; ?></a></li>
|
||||
<li><a href="<?php echo ISQ_LINK10_URL; ?>"><?php echo ISQ_LINK10_NAME; ?></a></li>
|
||||
<li><a href="<?php echo $ISQurl_1; ?>"><?php echo $ISQname_1; ?></a></li>
|
||||
<li><a href="<?php echo $ISQurl_2; ?>"><?php echo $ISQname_2; ?></a></li>
|
||||
<li><a href="<?php echo $ISQurl_3; ?>"><?php echo $ISQname_3; ?></a></li>
|
||||
<li><a href="<?php echo $ISQurl_4; ?>"><?php echo $ISQname_4; ?></a></li>
|
||||
<li><a href="<?php echo $ISQurl_5; ?>"><?php echo $ISQname_5; ?></a></li>
|
||||
<li><a href="<?php echo $ISQurl_6; ?>"><?php echo $ISQname_6; ?></a></li>
|
||||
<li><a href="<?php echo $ISQurl_7; ?>"><?php echo $ISQname_7; ?></a></li>
|
||||
<li><a href="<?php echo $ISQurl_8; ?>"><?php echo $ISQname_8; ?></a></li>
|
||||
<li><a href="<?php echo $ISQurl_9; ?>"><?php echo $ISQname_9; ?></a></li>
|
||||
<li><a href="<?php echo $ISQurl_10; ?>"><?php echo $ISQname_10; ?></a></li>
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
@@ -56,18 +102,21 @@ $(document).ready(function()
|
||||
$title = isset( $return['title'] ) ? $return['title'] : '';
|
||||
|
||||
echo <<<RESULT
|
||||
<h2>Your URL has been shortened</h2>
|
||||
<p>$message</p>
|
||||
$error
|
||||
<div class="output">
|
||||
<p>Original URL: <a href="$url">$url</a></p>
|
||||
<p>Short URL: <a href="$shorturl">$shorturl</a></p>
|
||||
<p>Stats: <a href="$shorturl+">$shorturl+</a></p>
|
||||
</div>
|
||||
|
||||
$ISQqr
|
||||
|
||||
<h2>Share</h2>
|
||||
<p>Share your short URL</p>
|
||||
<a href="http://twitter.com/share" class="twitter-share-button" data-url="$shorturl" data-text="$keyword" data-count="vertical">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
|
||||
<a href="#" class="share-button" onClick="facebook=window.open('http://facebook.com/sharer.php?u=$shorturl&t=$title','facebook','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=626,height=436,left=0,top=0'); return false;"><img src="public/img/facebook.png" alt="Share on Facebook" /></a>
|
||||
$ISQfacebook
|
||||
$ISQtwitter
|
||||
$ISQplus
|
||||
$ISQlinkedin
|
||||
RESULT;
|
||||
|
||||
// Part to be executed when no form has been submitted
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,27 +1,42 @@
|
||||
<?php
|
||||
// Base settings
|
||||
define( 'ISQ_NAME', 'kwl.me' );
|
||||
// General settings
|
||||
// 1 to enable, 0 to disable
|
||||
ISQ::$general = array(
|
||||
'name' => '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
|
||||
);
|
||||
?>
|
||||
|
||||
BIN
public/img/plus.png
Normal file
BIN
public/img/plus.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
@@ -154,3 +154,6 @@ div#sharebox {
|
||||
width:600px;
|
||||
margin-top: 20px
|
||||
}
|
||||
.error {
|
||||
color:red;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user