]> CyberLeo.Net >> Repos - Github/YOURLS.git/blob - admin/tools.php
Logic change: include "load-yourls.php" instead of "config.php" to start engine
[Github/YOURLS.git] / admin / tools.php
1 <?php\r
2 // Require Files\r
3 require_once( dirname(dirname(__FILE__)).'/includes/load-yourls.php' );\r
4 yourls_maybe_require_auth();\r
5 \r
6 yourls_html_head( 'tools' );\r
7 ?>\r
8         <h1>\r
9                 <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
10                 <img src="<?php echo YOURLS_SITE; ?>/images/yourls-logo.png" alt="YOURLS" title="YOURLS" style="border: 0px;" /></a>\r
11         </h1>\r
12         <?php if ( yourls_is_private() ) { ?>\r
13         <p>Your are logged in as: <strong><?php echo YOURLS_USER; ?></strong>. <a href="?mode=logout" title="Logout">Logout</a></p>\r
14         <?php } ?>\r
15 \r
16         <div id="tools_desc">\r
17 \r
18                 <h2>Bookmarklet</h2>\r
19                 \r
20                 <p>YOURLS comes with two handy <span>bookmarklets</span> for easier link shortening.</p>\r
21                 <ul>\r
22                         <li>The simple one generates a short URL from the page you are currently viewing.</li>\r
23                         <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
24                 </ul>\r
25                 \r
26                 <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
27                 \r
28                 <p>There is also a <span>Quick Share</span> tool box to make posting to Twitter, Facebook or Friendfeed a snap.</p>\r
29                 \r
30                 <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
31                 \r
32                 <h3>Simple bookmarklet</h3>\r
33                 \r
34                 <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
35                 \r
36                 <h3>Advanced bookmarklet (custom keyword)</h3>\r
37                 \r
38                 <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
39                 \r
40         </div>\r
41 \r
42 <?php yourls_html_footer(); ?>