Sample Public Front Page
Sample Public Front Page
php
/*
* This is an example file for a public interface and a bookmarklet. It
* is provided so you can build from it and customize to suit your needs.
* It's not really part of the project. Don't submit feature requests
* about this file. It's _your_ job to make it what you need it to be :)
*
* Rename to .php
*
*/
// Change this to match the URL of your public interface. Something like:
http://your-own-domain-here.com/index.php
$page = YOURLS_SITE . '/sample-public-front-page.php' ;
die();
}
}
// Display title
echo "<h1>YOURLS - Your Own URL Shortener</h1>\n";
$site = YOURLS_SITE;
?>
<h2>Bookmarklets</h2>
<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">Default</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">Custom</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
%20occurred:%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">Popup</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
%20occurred:%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">Custom Popup</a>
</p>
<h2>Please note</h2>
<p>Be aware that a public interface <strong>will</strong> attract spammers. You are
strongly advised to install anti spam plugins and any appropriate counter measure
to deal with this issue.</p>
<?php