1.5
129
index.php
Normal file → Executable file
@@ -1,5 +1,4 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
<!DOCTYPE html>
|
||||
<?php
|
||||
// Start YOURLS engine
|
||||
require_once( dirname(__FILE__).'/includes/load-yourls.php' );
|
||||
@@ -8,6 +7,13 @@ require_once( dirname(__FILE__).'/includes/load-yourls.php' );
|
||||
require_once( dirname(__FILE__).'/public/config.php' );
|
||||
class ISQ { public static $general = array(), $links = array(), $social = array(); }
|
||||
|
||||
// Translations stuff
|
||||
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'];
|
||||
@@ -32,41 +38,46 @@ $ISQname_10= ISQ::$links['name_10'];
|
||||
$ISQurl_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>";
|
||||
|
||||
$genericerror = '<h2 class="error">' . yourls__( 'An error has occured :(', 'isq_translation') . '</h2>';
|
||||
|
||||
if ( $message = $url. yourls__( 'added to database', 'isq_translation') ) {
|
||||
$error = '<h2>' . yourls__( 'URL shortened successfully', 'isq_translation') . '</h2><p>' . yourls__( 'View the details of your short URL below.', 'isq_translation') . '</p>';
|
||||
} elseif ( $message = $url. yourls__( 'already exists in database', 'isq_translation') ) {
|
||||
$error = $genericerror . '<p class="error">' . yourls__( 'This URL already exists in this database. This website does not allow a single URL to have multiple short links.', 'isq_translation') . '</p>';
|
||||
} elseif ( $message = yourls__( 'Short URL', 'isq_translation') . $url . yourls__( 'already exists in database or is reserved', 'isq_translation') ) {
|
||||
$error = $genericerror . '<p class="error">' . 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') . '</p>';
|
||||
} elseif ( $message = yourls__( 'Missing URL input', 'isq_translation') ) {
|
||||
$error = $genericerror . '<p class="error">' . yourls__( 'You did not enter the URL you want to shorten or the server lost it. Please try again.', 'isq_translation') . '</p>';
|
||||
} elseif ( $message = yourls__( 'This URL is a short URL', 'isq_translation') ) {
|
||||
$error = $genericerror . '<p class="error">' . yourls__( 'You cannot shorten a short URL!', 'isq_translation') . '</p>';
|
||||
}
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<?php if (!empty(ISQ::$general['mobile'])) { echo "<script type='text/javascript'>if (screen.width <= 720) { document.location = 'mobile.php'; }</script>"; } ?> <!-- Redirect to mobile if screen narrower than 720px -->
|
||||
<title><?php echo $ISQtitle; ?></title> <!-- Site title defined in theme settings -->
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
|
||||
<script src="<?php echo YOURLS_SITE; ?>/js/jquery-1.9.1.min.js" type="text/javascript"></script> <!-- jQuery -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
|
||||
<link rel="stylesheet" href="<?php echo YOURLS_SITE; ?>/public/formalize.css" /> <!-- Formalize CSS -->
|
||||
<script src="<?php echo YOURLS_SITE; ?>/public/js/jquery.formalize.min.js" type="text/javascript"></script><!-- Formalize JS -->
|
||||
<link href="http://fonts.googleapis.com/css?family=Ubuntu:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css"><!-- Ubuntu from Google Web Fonts -->
|
||||
<link rel="stylesheet" href="<?php echo YOURLS_SITE; ?>/public/jquery.qtip.min.css" /><!-- qTip CSS -->
|
||||
<script src="<?php echo YOURLS_SITE; ?>/public/js/jquery.qtip.min.js" type="text/javascript"></script><!-- qTip JS -->
|
||||
<link rel="stylesheet" href="<?php echo YOURLS_SITE; ?>/public/normal.css" type="text/css" /><!-- Theme CSS -->
|
||||
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/qtip2/2.1.1/basic/jquery.qtip.min.css" /><!-- qTip CSS -->
|
||||
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Ubuntu:regular,italic,bold,bolditalic"><!-- Ubuntu from Google Web Fonts -->
|
||||
<link rel="stylesheet" href="<?php echo YOURLS_SITE; ?>/public/style.css" /><!-- Theme CSS -->
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <!-- jQuery -->
|
||||
<script src="<?php echo YOURLS_SITE; ?>/public/js/jquery.formalize.min.js"></script><!-- Formalize JS -->
|
||||
<script src="http://cdnjs.cloudflare.com/ajax/libs/qtip2/2.1.1/basic/jquery.qtip.min.js"></script><!-- qTip JS -->
|
||||
<?php if (!empty(ISQ::$social['plus'])) { ?>
|
||||
<script type="text/javascript" src="https://apis.google.com/js/plusone.js">
|
||||
{lang: "en-GB"}
|
||||
</script>
|
||||
<?php } ?>
|
||||
<script>
|
||||
$(document).ready(function()
|
||||
{
|
||||
// Match all labels with a title tag and use it as the content
|
||||
$('label[title]').qtip();
|
||||
// Match all bookmarklet links and use their title as content
|
||||
$('a.bookmarklet[title]').qtip();
|
||||
$('a.bookmarklet').qtip({
|
||||
});
|
||||
$('label').qtip({
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
@@ -74,7 +85,7 @@ $(document).ready(function()
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
<div class="header">
|
||||
<header>
|
||||
<h1><a href="<?php echo YOURLS_SITE; ?>"><?php echo $ISQtitle; ?></a></h1>
|
||||
<ul class="menu">
|
||||
<li><a href="<?php echo $ISQurl_1; ?>"><?php echo $ISQname_1; ?></a></li>
|
||||
@@ -88,7 +99,7 @@ $(document).ready(function()
|
||||
<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>
|
||||
</div>
|
||||
</header>
|
||||
<div class="paragraph">
|
||||
<?php
|
||||
|
||||
@@ -104,24 +115,33 @@ $(document).ready(function()
|
||||
$message = isset( $return['message'] ) ? $return['message'] : '';
|
||||
$title = isset( $return['title'] ) ? $return['title'] : '';
|
||||
|
||||
if (!empty(ISQ::$social['facebook'])) { $ISQfacebook = "<a href='http://facebook.com/sharer.php?u=$shorturl' class='share-button' target='_blank'><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='$title' data-count='vertical'>Tweet</a><script type='text/javascript' src='http://platform.twitter.com/widgets.js'></script>"; }
|
||||
if (!empty(ISQ::$social['plus'])) { $ISQplus = "<div class='g-plus' data-action='share' data-annotation='vertical-bubble' data-height='62' data-href='$shorturl'></div>"; }
|
||||
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' />"; }
|
||||
if (!empty(ISQ::$social['facebook'])) { $ISQfacebook = '<a href="http://facebook.com/sharer.php?u=$shorturl" class="share-button" target="_blank"><img src="public/img/facebook.png" alt="Facebook" width="55px" height="62px" /></a>'; }
|
||||
if (!empty(ISQ::$social['twitter'])) { $ISQtwitter = '<a href="http://twitter.com/share" class="twitter-share-button" data-url="$shorturl" data-text="$title" data-count="vertical">Tweet</a><script src="http://platform.twitter.com/widgets.js"></script>'; }
|
||||
if (!empty(ISQ::$social['plus'])) { $ISQplus = '<div class="g-plus" data-action="share" data-annotation="vertical-bubble" data-height="62" data-href="$shorturl"></div>'; }
|
||||
if (!empty(ISQ::$social['linkedin'])) { $ISQlinkedin = '<script src="http://platform.linkedin.com/in.js"></script><script type="IN/Share" data-url="$shorturl" data-counter="top"></script>'; }
|
||||
if (!empty(ISQ::$general['qr'])) { $ISQqr = '<h2>' . yourls__( 'QR code', 'isq-translation' ) . '</h2><p>' . yourls__( 'Share your code with external devices', 'isq-translation' ) . '</p><img class="qr" src="https://chart.googleapis.com/chart?cht=qr&chs=250x250&chl=$shorturl&chld=L|0" alt="QR" width="250px" height="250px" />'; }
|
||||
|
||||
$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 <<<RESULT
|
||||
$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>
|
||||
<p><label>$output_original</label> <input type="text" name="shorturl" onclick="this.select();" onload="this.select();" value="$url"></p>
|
||||
<p><label>$output_short</label> <input type="text" name="shorturl" onclick="this.select();" onload="this.select();" value="$shorturl"></p>
|
||||
<p><label>$output_stats</label> <input type="text" name="shorturl" onclick="this.select();" onload="this.select();" value="$shorturl+"></p>
|
||||
<p class="desktop-only">$output_copy</p>
|
||||
</div>
|
||||
|
||||
$ISQqr
|
||||
|
||||
<h2>Share</h2>
|
||||
<p>Share your short URL</p>
|
||||
<h2>$output_share_h2</h2>
|
||||
<p>$output_share_p</p>
|
||||
$ISQfacebook
|
||||
$ISQtwitter
|
||||
$ISQplus
|
||||
@@ -133,14 +153,24 @@ RESULT;
|
||||
|
||||
$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 <<<HTML
|
||||
<h2>Enter a new URL to shorten</h2>
|
||||
<h3>Hover over the labels to see more information</h3>
|
||||
<h2>$site_enter</h2>
|
||||
<h3>$site_hover</h3>
|
||||
<form method="post" action="">
|
||||
<p><label for="url" title="Paste the long URL here">Long URL (required):</label> <input type="text" id="url" class="right" name="url" /></p>
|
||||
<p><label for="keyword" title="A keyword replaces the default short string">Custom keyword:</label> <input type="text" id="keyword" class="right" name="keyword" /></p>
|
||||
<p><label for="title" title="Optional title used when sharing a link from YOURLS">Optional title:</label> <input type="text" id="title" class="right" name="title" /></p>
|
||||
<p><input type="submit" value="Shorten" /></p>
|
||||
<p><label for="url" title="$site_long_hover">$site_long</label> <input type="text" id="url" class="right" name="url" /></p>
|
||||
<p><label for="keyword" title="$site_keyword_hover">$site_keyword</label> <input type="text" id="keyword" class="right" name="keyword" /></p>
|
||||
<p><label for="title" title="$site_title_hover">$site_title</label> <input type="text" id="title" class="right" name="title" /></p>
|
||||
<p><input type="submit" value="$site_submit" /></p>
|
||||
</form>
|
||||
HTML;
|
||||
|
||||
@@ -148,17 +178,18 @@ HTML;
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="paragraph">
|
||||
<h2>The bookmarklets</h2>
|
||||
<p>To use the bookmarklets drag them to your bookmark bar or simply right click on them and select the appropriate option. </p>
|
||||
<a href="javascript:(function()%7Bvar%20d=document,w=window,enc=encodeURIComponent,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),s2=((s.toString()=='')?s:enc(s)),f='<?php echo $page; ?>',l=d.location,p='?url='+enc(l.href)+'&title='+enc(d.title)+'&text='+s2,u=f+p;try%7Bthrow('ozhismygod');%7Dcatch(z)%7Ba=function()%7Bif(!w.open(u))l.href=u;%7D;if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();%7Dvoid(0);%7D)()" class="bookmarklet" title="Shortens the URL of the current site and opens a new tab with the details of the shortened URL.">Simple Shorten</a>
|
||||
<a href="javascript:(function()%7Bvar%20d=document,s=d.createElement('script');window.yourls_callback=function(r)%7Bif(r.short_url)%7Bprompt(r.message,r.short_url);%7Delse%7Balert('An%20error%20occured:%20'+r.message);%7D%7D;s.src='<?php echo $page; ?>?url='+encodeURIComponent(d.location.href)+'&jsonp=yourls';void(d.body.appendChild(s));%7D)();" class="bookmarklet">Instant Shorten</a>
|
||||
<a href="javascript:(function()%7Bvar%20d=document,w=window,enc=encodeURIComponent,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),s2=((s.toString()=='')?s:enc(s)),f='<?php echo $page; ?>',l=d.location,k=prompt(%22Custom%20URL%22),k2=(k?'&keyword='+k:%22%22),p='?url='+enc(l.href)+'&title='+enc(d.title)+'&text='+s2+k2,u=f+p;if(k!=null)%7Btry%7Bthrow('ozhismygod');%7Dcatch(z)%7Ba=function()%7Bif(!w.open(u))l.href=u;%7D;if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();%7Dvoid(0)%7D%7D)()" class="bookmarklet" title="Opens a popup which asks for the URL you want to shorten and opens a new tab with the details of the shortened URL.">Custom Shorten</a>
|
||||
<a href="javascript:(function()%7Bvar%20d=document,k=prompt('Custom%20URL'),s=d.createElement('script');if(k!=null){window.yourls_callback=function(r)%7Bif(r.short_url)%7Bprompt(r.message,r.short_url);%7Delse%7Balert('An%20error%20occured:%20'+r.message);%7D%7D;s.src='<?php echo $page; ?>?url='+encodeURIComponent(d.location.href)+'&keyword='+k+'&jsonp=yourls';void(d.body.appendChild(s));%7D%7D)();" class="bookmarklet">Instant Custom Shorten</a>
|
||||
<div class="paragraph desktop-only">
|
||||
<h2><?php yourls_e( 'The bookmarklets', 'isq_translation') ?></h2>
|
||||
<p><?php yourls_e( 'To use the bookmarklets drag them to your bookmark bar or simply right click on them and select the appropriate option.', 'isq_translation') ?></p>
|
||||
|
||||
<a href="javascript:(function()%7Bvar%20d=document,w=window,enc=encodeURIComponent,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),s2=((s.toString()=='')?s:enc(s)),f='<?php echo $page; ?>',l=d.location,p='?url='+enc(l.href)+'&title='+enc(d.title)+'&text='+s2,u=f+p;try%7Bthrow('ozhismygod');%7Dcatch(z)%7Ba=function()%7Bif(!w.open(u))l.href=u;%7D;if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();%7Dvoid(0);%7D)()" title="<?php yourls_e( 'Shortens the URL of the current site and opens a new tab with the details of the shortened URL.', 'isq_translation') ?>" class="bookmarklet"><?php yourls_e( 'Simple Shorten', 'isq_translation') ?></a>
|
||||
<a href="javascript:(function()%7Bvar%20d=document,s=d.createElement('script');window.yourls_callback=function(r)%7Bif(r.short_url)%7Bprompt(r.message,r.short_url);%7Delse%7Balert('An%20error%20occured:%20'+r.message);%7D%7D;s.src='<?php echo $page; ?>?url='+encodeURIComponent(d.location.href)+'&jsonp=yourls';void(d.body.appendChild(s));%7D)();" title="<?php yourls_e( 'Opens a pop up with the short URL for the current page.', 'isq_translation') ?>" class="bookmarklet"><?php yourls_e( 'Instant Shorten', 'isq_translation') ?></a>
|
||||
<a href="javascript:(function()%7Bvar%20d=document,w=window,enc=encodeURIComponent,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),s2=((s.toString()=='')?s:enc(s)),f='<?php echo $page; ?>',l=d.location,k=prompt(%22Custom%20URL%22),k2=(k?'&keyword='+k:%22%22),p='?url='+enc(l.href)+'&title='+enc(d.title)+'&text='+s2+k2,u=f+p;if(k!=null)%7Btry%7Bthrow('ozhismygod');%7Dcatch(z)%7Ba=function()%7Bif(!w.open(u))l.href=u;%7D;if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();%7Dvoid(0)%7D%7D)()" title="<?php yourls_e( 'Opens a popup which asks for the keyword for the current URL and opens a new tab with the details of the shortened URL.', 'isq_translation') ?>" class="bookmarklet" ><?php yourls_e( 'Custom Shorten', 'isq_translation') ?></a>
|
||||
<a href="javascript:(function()%7Bvar%20d=document,k=prompt('Custom%20URL'),s=d.createElement('script');if(k!=null){window.yourls_callback=function(r)%7Bif(r.short_url)%7Bprompt(r.message,r.short_url);%7Delse%7Balert('An%20error%20occured:%20'+r.message);%7D%7D;s.src='<?php echo $page; ?>?url='+encodeURIComponent(d.location.href)+'&keyword='+k+'&jsonp=yourls';void(d.body.appendChild(s));%7D%7D)();" title="<?php yourls_e( 'This prompts you for the keyword for the current page and then opens a pop up with the short URL of the current page.', 'isq_translation') ?>" class="bookmarklet"><?php yourls_e( 'Instant Custom Shorten', 'isq_translation') ?></a>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<p>Powered by <a href="http://yourls.org/" title="YOURLS">YOURLS</a>. Design by <a href="http://tomslominski.net/">Tom Slominski</a>. Also used: <a href="http://formalize.me/">Formalize</a> and <a href="http://craigsworks.com/projects/qtip2/">qTip²</a>. Find this theme on <a href="https://github.com/tomslominski/infinity-squared">GitHub</a>.</p>
|
||||
<p><?php yourls_e( 'Powered by <a href="http://yourls.org/">YOURLS</a>. Design by <a href="http://tomslominski.net/">Tom Slominski</a>. Also used: <a href="http://formalize.me/">Formalize</a> and <a href="http://qtip2.com/">qTip²</a>. Find this theme on <a href="https://github.com/tomslominski/infinity-squared">GitHub</a>.', 'isq_translation') ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
142
mobile.php
@@ -1,142 +0,0 @@
|
||||
<!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
|
||||
require_once( dirname(__FILE__).'/public/config.php' );
|
||||
class ISQ { public static $general = array(), $links = array(), $social = array(); }
|
||||
|
||||
// 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
|
||||
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><?php echo $ISQtitle; ?></title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"/>
|
||||
<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>
|
||||
<link href='http://fonts.googleapis.com/css?family=Ubuntu:regular,italic,bold,bolditalic' rel='stylesheet' type='text/css'>
|
||||
<link rel="stylesheet" href="<?php echo YOURLS_SITE; ?>/public/mobile.css" type="text/css" />
|
||||
<script type="text/javascript" src="https://apis.google.com/js/plusone.js">
|
||||
{lang: "en-GB"}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="header">
|
||||
<h1><a href="<?php echo YOURLS_SITE; ?>"><?php echo $ISQtitle; ?></a></h1>
|
||||
<ul class="menu">
|
||||
<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>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<?php
|
||||
|
||||
// Part to be executed if FORM has been submitted
|
||||
if ( isset($_REQUEST['url']) ) {
|
||||
|
||||
$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 = "<a href='http://facebook.com/sharer.php?u=$shorturl' class='share-button' target='_blank'><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='$title' data-count='vertical'>Tweet</a><script type='text/javascript' src='http://platform.twitter.com/widgets.js'></script>"; }
|
||||
if (!empty(ISQ::$social['plus'])) { $ISQplus = "<div class='g-plus' data-action='share' data-annotation='vertical-bubble' data-height='62' data-href='$shorturl'></div>"; }
|
||||
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' />"; }
|
||||
|
||||
echo <<<RESULT
|
||||
$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>
|
||||
|
||||
<h2>Share</h2>
|
||||
<p>Share your short URL</p>
|
||||
$ISQfacebook
|
||||
$ISQtwitter
|
||||
$ISQplus
|
||||
$ISQlinkedin
|
||||
RESULT;
|
||||
|
||||
// Part to be executed when no form has been submitted
|
||||
} else {
|
||||
|
||||
$site = YOURLS_SITE;
|
||||
|
||||
echo <<<HTML
|
||||
<h2>Enter a new URL to shorten</h2>
|
||||
<form method="post" action="">
|
||||
<p><label for="url" title="Paste the long URL here">Long URL (required):</label></p>
|
||||
<p><input type="text" id="url" class="right" name="url" /></p>
|
||||
<p><label for="keyword" title="A keyword replaces the default short string">Custom keyword:</label></p>
|
||||
<p><input type="text" id="keyword" class="right" name="keyword" /></p>
|
||||
<p><label for="title" title="Optional title used when sharing a link from YOURLS">Optional title:</label></p>
|
||||
<p><input type="text" id="title" class="right" name="title" /></p>
|
||||
<p><input type="submit" value="Shorten" /></p>
|
||||
</form>
|
||||
HTML;
|
||||
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</body>
|
||||
<footer>
|
||||
<p>Powered by <a href="http://yourls.org/" title="YOURLS">YOURLS</a> and <a href="http://formalize.me/">Formalize</a>. Design by <a href="http://tomslominski.net/">Tom Slominski</a>. Find this theme on <a href="https://github.com/tomslominski/infinity-squared">GitHub</a>.</p>
|
||||
</footer>
|
||||
</html>
|
||||
16
public/CHANGELOG.md
Normal file → Executable file
@@ -1,6 +1,22 @@
|
||||
Infinity-Squared CHANGELOG
|
||||
==========================
|
||||
|
||||
1.5 (August 2013)
|
||||
-----------------
|
||||
Big changes:
|
||||
* Internationalisation! See Wiki for instructions on how to use Infinity Squared in your language and translate it for other people to use.
|
||||
* A proper CSS mobile interface. When I tried to add internationalisation, it quickly became apparent that having two code bases was stupid.
|
||||
|
||||
Bug fixes:
|
||||
* HTML5 doctype
|
||||
* Upgraded to qTip2
|
||||
* Including jQuery and qTip from CDN
|
||||
* No longer loading G+ code if it's not enabled
|
||||
* Parallel loading of scripts thanks to Chrome's audits
|
||||
* Rearranged the CSS so that it's more readable
|
||||
|
||||
Many thanks to [Ozh](http://ozh.org) for help with internationalisation
|
||||
|
||||
1.4 (February 2013)
|
||||
-------------------
|
||||
* Bookmarklets updated to the code relevant to YOURLS 1.6
|
||||
|
||||
2
public/config.php
Normal file → Executable file
@@ -4,7 +4,7 @@
|
||||
ISQ::$general = array(
|
||||
'name' => 'kwl.me', // The name of your URL shortener
|
||||
'qr' => 1, // Do you want to display a QR code?
|
||||
'mobile' => 1 // Do you want to enable the mobile version?
|
||||
'mobile' => 0 // Do you want to enable the mobile version?
|
||||
);
|
||||
|
||||
// Menu- The width of ∞² menu allows you to have about 10 links
|
||||
|
||||
0
public/formalize.css
Normal file → Executable file
0
public/img/button.png
Normal file → Executable file
|
Before Width: | Height: | Size: 85 B After Width: | Height: | Size: 85 B |
0
public/img/facebook.png
Normal file → Executable file
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
0
public/img/noise.png
Normal file → Executable file
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
0
public/img/select_arrow.gif
Normal file → Executable file
|
Before Width: | Height: | Size: 52 B After Width: | Height: | Size: 52 B |
1
public/jquery.qtip.min.css
vendored
0
public/js/jquery.formalize.min.js
vendored
Normal file → Executable file
2
public/js/jquery.qtip.min.js
vendored
BIN
public/languages/isq_translation-pl_PL.mo
Normal file
@@ -1,79 +0,0 @@
|
||||
body {
|
||||
background:white;
|
||||
color:#000;
|
||||
font-family:'Ubuntu', sans-serif, Helvetica, Arial;
|
||||
font-size: 62.5%;
|
||||
width:100%;
|
||||
margin:0;
|
||||
}
|
||||
a {
|
||||
color:#013F6D;
|
||||
text-decoration:none;
|
||||
}
|
||||
a:visited {
|
||||
color:#013F6D;
|
||||
text-decoration:none;
|
||||
}
|
||||
p {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
h1 {
|
||||
background: url(img/noise.png) #013F6D;
|
||||
width:100%;
|
||||
text-align:center;
|
||||
color:white;
|
||||
font-size:7em;
|
||||
border-top:4px #000 solid;
|
||||
margin:0;
|
||||
top:0
|
||||
}
|
||||
h1 a, h1 a:visited {
|
||||
color:white;
|
||||
}
|
||||
/* Menu */
|
||||
.menu {
|
||||
background: #000000; /* Old browsers */
|
||||
background: -moz-linear-gradient(top, #000000 0%, #141414 100%); /* FF3.6+ */
|
||||
background: -webkit-linear-gradient(top, #000000 0%,#141414 100%); /* Chrome10+,Safari5.1+ */
|
||||
background: -o-linear-gradient(top, #000000 0%,#141414 100%); /* Opera 11.10+ */
|
||||
background: -ms-linear-gradient(top, #000000 0%,#141414 100%); /* IE10+ */
|
||||
background: linear-gradient(to bottom, #000000 0%,#141414 100%); /* W3C */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#000000', endColorstr='#141414',GradientType=0 ); /* IE6-9 */
|
||||
display: block;
|
||||
float: left;
|
||||
margin:0;
|
||||
padding:0;
|
||||
width:100%;
|
||||
color:#FFF;
|
||||
font-size:1.2em;
|
||||
border-bottom:1px grey solid;
|
||||
margin-bottom:4%;
|
||||
}
|
||||
.menu a {
|
||||
color: #FFF;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
}
|
||||
.menu li {
|
||||
list-style: none;
|
||||
float: left;
|
||||
line-height:38px;
|
||||
padding: 1% 3%;
|
||||
}
|
||||
|
||||
/* Getting down to business */
|
||||
.paragraph {
|
||||
padding-left: 2%;
|
||||
}
|
||||
input {
|
||||
width:98%;
|
||||
margin-top:-10px;
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
footer {
|
||||
padding-left: 2%;
|
||||
line-height:150%;
|
||||
margin-bottom:0;
|
||||
text-align:center;
|
||||
}
|
||||
179
public/normal.css → public/style.css
Normal file → Executable file
@@ -1,77 +1,96 @@
|
||||
/* Main */
|
||||
body {
|
||||
background:#F1F1F1;
|
||||
color:#000;
|
||||
font-family:'Ubuntu', sans-serif, Helvetica, Arial;
|
||||
font-size: 62.5%;
|
||||
}
|
||||
/*
|
||||
Infinity Squared CSS
|
||||
https://github.com/tomslominski/infinity-squared
|
||||
*/
|
||||
|
||||
/* General */
|
||||
::selection {
|
||||
background: #013F6D; /* Safari */
|
||||
background: rgba(1,63,109,0.7);
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
input::selection {
|
||||
background: rgba(1,63,109,0.7);
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
::-moz-selection {
|
||||
background: #013F6D; /* Firefox */
|
||||
background: rgba(1,63,109,0.7);
|
||||
color: #FFF;
|
||||
}
|
||||
h2 {
|
||||
color:#000;
|
||||
margin-bottom:-8px;
|
||||
|
||||
input::-moz-selection {
|
||||
background: rgba(1,63,109,0.7);
|
||||
color: #FFF;
|
||||
}
|
||||
a {
|
||||
color:#013F6D;
|
||||
text-decoration:none;
|
||||
}
|
||||
a:visited {
|
||||
|
||||
a, a:visited, .footer a, .footer a:visited {
|
||||
color: #013F6D;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
/* Structure */
|
||||
body {
|
||||
background: #F1F1F1;
|
||||
color: black;
|
||||
font-family: 'Ubuntu', sans-serif, Helvetica, Arial;
|
||||
font-size: 62.5%;
|
||||
}
|
||||
|
||||
#container {
|
||||
width: 60%;
|
||||
min-width: 720px;
|
||||
margin: 0 auto;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
/* Header */
|
||||
.header {
|
||||
header {
|
||||
width: 95%;
|
||||
padding: 2.5%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
h1 {
|
||||
background: url(img/noise.png) #013F6D;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color:#FFFFFF;
|
||||
color: white;
|
||||
font-size: 7em;
|
||||
border-top: 4px #000 solid;
|
||||
margin-top:0;
|
||||
margin-bottom:0;
|
||||
margin: 0 auto;
|
||||
}
|
||||
h1 a {
|
||||
color:#FFF;
|
||||
|
||||
h1 a, h1 a:visited {
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
h1 a:hover {
|
||||
border-bottom: #FFF 1px dashed;
|
||||
}
|
||||
h1 a:visited {
|
||||
color:#FFF;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
.menu {
|
||||
background: #000000; /* Old browsers */
|
||||
background: -moz-linear-gradient(top, #000000 0%, #141414 100%); /* FF3.6+ */
|
||||
background: -webkit-linear-gradient(top, #000000 0%,#141414 100%); /* Chrome10+,Safari5.1+ */
|
||||
background: -o-linear-gradient(top, #000000 0%,#141414 100%); /* Opera 11.10+ */
|
||||
background: -ms-linear-gradient(top, #000000 0%,#141414 100%); /* IE10+ */
|
||||
background: linear-gradient(to bottom, #000000 0%,#141414 100%); /* W3C */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#000000', endColorstr='#141414',GradientType=0 ); /* IE6-9 */
|
||||
display: block;
|
||||
float: left;
|
||||
margin: 0 auto;
|
||||
width: 96%;
|
||||
color:#FFF;
|
||||
color: white;
|
||||
padding: 0 2% 0 2%;
|
||||
margin-bottom: 30px;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
.menu a {
|
||||
color: #FFF;
|
||||
text-decoration: none;
|
||||
@@ -84,6 +103,7 @@ h1 a:visited {
|
||||
-webkit-transition: background 800ms; /* Safari and Chrome */
|
||||
-o-transition: background 800ms; /* Opera */
|
||||
}
|
||||
|
||||
.menu a:hover {
|
||||
transition: background 800ms;
|
||||
-moz-transition: background 800ms; /* Firefox 4 */
|
||||
@@ -91,31 +111,29 @@ h1 a:visited {
|
||||
-o-transition: background 800ms; /* Opera */
|
||||
background: #292929;
|
||||
}
|
||||
|
||||
.menu li {
|
||||
list-style: none;
|
||||
float: left;
|
||||
line-height: 38px;
|
||||
width: auto;
|
||||
}
|
||||
/* Container */
|
||||
#container {
|
||||
width: 60%;
|
||||
min-width:720px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
background-color: #FFF;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
/* Main style */
|
||||
.paragraph {
|
||||
padding: 0 2.5% 0 2.5%;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: black;
|
||||
margin-bottom: -8px;
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 60%;
|
||||
float: right;
|
||||
}
|
||||
div.bookmarklet {
|
||||
width:20%;
|
||||
}
|
||||
|
||||
a.bookmarklet {
|
||||
border-radius: 11px;
|
||||
background: #ddd url(../img/button.png) repeat-x;
|
||||
@@ -133,70 +151,77 @@ a.bookmarklet {
|
||||
text-decoration: none;
|
||||
margin-right: 2%;
|
||||
}
|
||||
|
||||
/* Tooltips */
|
||||
.qtip-default, .qtip-default:after {
|
||||
.qtip-default {
|
||||
border-color: #013F6D;
|
||||
background-color: #013F6D;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
.ui-tooltip-titlebar,
|
||||
.ui-tooltip-content{
|
||||
border-color: #013F6D;
|
||||
background-color: #013F6D;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
.output {
|
||||
border: 3px #013F6D solid;
|
||||
padding: 4px;
|
||||
background: url(img/noise.png);
|
||||
border-radius: 10px;
|
||||
width:600px;
|
||||
.output label {
|
||||
width: 30%;
|
||||
float: left;
|
||||
}
|
||||
.output p {
|
||||
margin:2px;
|
||||
|
||||
.output input {
|
||||
width: 70%
|
||||
}
|
||||
.output a, .output a:visited {
|
||||
color:#013F6D;
|
||||
text-decoration:none;
|
||||
}
|
||||
.output a:hover {
|
||||
border-bottom: #013F6D 1px dashed;
|
||||
}
|
||||
.share-button, .twitter-share-button {
|
||||
padding-right:3px;
|
||||
|
||||
.error {
|
||||
color: red;
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
.footer {
|
||||
text-align: center;
|
||||
border-top:3px solid #000;
|
||||
border-top: 2px solid #000;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.footer p {
|
||||
padding:20px 2% 20px 2%;
|
||||
padding:20px 2% 20px 2%;
|
||||
padding: 2%;
|
||||
margin: 0 auto;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
.footer a {
|
||||
color:#013F6D;
|
||||
}
|
||||
|
||||
.footer a:hover {
|
||||
text-decoration: none;
|
||||
border-bottom: dashed 1px #013F6D;
|
||||
}
|
||||
.footer a:visited {
|
||||
color:#013F6D;
|
||||
|
||||
/* Mobile */
|
||||
@media screen and (max-width: 720px) {
|
||||
body {
|
||||
background:white;
|
||||
margin:0;
|
||||
}
|
||||
/* Other */
|
||||
div#copybox {
|
||||
width:600px;
|
||||
height:auto;
|
||||
|
||||
#container {
|
||||
min-width:0;
|
||||
width:100%;
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
div#sharebox {
|
||||
height:auto;
|
||||
width:600px;
|
||||
margin-top: 20px
|
||||
|
||||
header {
|
||||
width:100%;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.menu li {
|
||||
margin-top:0;
|
||||
}
|
||||
|
||||
.desktop-only {
|
||||
display:none;
|
||||
}
|
||||
.error {
|
||||
color:red;
|
||||
}
|
||||