]> CyberLeo.Net >> Repos - Github/YOURLS.git/blob - admin/tools.php
1.3 RC1 massive commit
[Github/YOURLS.git] / admin / tools.php
1 <?php\r
2 // Require Files\r
3 require_once( dirname(dirname(__FILE__)).'/includes/config.php' );\r
4 if (defined('YOURLS_PRIVATE') && YOURLS_PRIVATE == true)\r
5         require_once( dirname(dirname(__FILE__)).'/includes/auth.php' );\r
6 \r
7 yourls_html_head( 'tools' );\r
8 ?>\r
9         <h1>\r
10                 <a href="<?php echo YOURLS_SITE; ?>/admin/index.php" title="YOURLS"><span>YOURLS</span>: <span>Y</span>our <span>O</span>wn <span>URL</span> <span>S</span>hortener<br/>\r
11                 <img src="<?php echo YOURLS_SITE; ?>/images/yourls-logo.png" alt="YOURLS" title="YOURLS" style="border: 0px;" /></a>\r
12         </h1>\r
13         <?php if ( defined('YOURLS_PRIVATE') && YOURLS_PRIVATE == true ) { ?>\r
14         <p>Your are logged in as: <strong><?php echo YOURLS_USER; ?></strong>. <a href="?mode=logout" title="Logout">Logout</a></p>\r
15         <?php } ?>\r
16 \r
17         <div id="tools_desc">\r
18 \r
19                 <h2>Tools</h2>\r
20                 \r
21                 <p>YOURLS comes with two handy <span>bookmarklets</span> for easier link shortening.</p>\r
22                 <ul>\r
23                         <li>The simple one generates a short URL from the page you are currently viewing.</li>\r
24                         <li>The second one does the same but first asks for a <span>custom URL keyword</span> &ndash; if you enter none a random one will be picked.</li>\r
25                 </ul>\r
26                 \r
27                 <p>The bookmarklets will take you to a page where you can easily <span>edit</span> or <span>delete</span> your brand new short URL.</p>\r
28                 \r
29                 <p>There is also a <span>Quick Share</span> tool box to make posting to Twitter, Facebook or Friendfeed a snap.</p>\r
30                 \r
31                 <p>If you want to share a description along with the link you're shortening, simply <span>select text</span> on the page you're viewing before clicking on your bookmarklet link</p>\r
32                 \r
33                 <h3>Simple bookmarklet</h3>\r
34                 \r
35                 <p>Click and drag the link to your toolbar: <a href="javascript:var%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 YOURLS_SITE; ?>/admin/index.php',l=d.location,p='?u='+enc(l.href)+'&t='+enc(d.title)+'&s='+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);" class="bookmarklet" onclick="alert('Drag to your toolbar!');return false;">Shorten</a> </p>\r
36                 \r
37                 <h3>Advanced bookmarklet (custom keyword)</h3>\r
38                 \r
39                 <p>Click and drag the link to your toolbar: <a href="javascript:var%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:('%22'+enc(s)+'%22')),f='<?php echo YOURLS_SITE; ?>/admin/index.php',l=d.location,k=prompt(%22Custom%20URL%22),k2=(k?'&k='+k:%22%22),p='?u='+enc(l.href)+'&t='+enc(d.title)+''+s2+k2,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)" class="bookmarklet" onclick="alert('Drag to your toolbar!');return false;">Custom shorten</a> </p>\r
40         \r
41         </div>\r
42 \r
43 <?php yourls_html_footer(); ?>\r
44         \r
45