Just another url shortener http://shikiryu.alwaysdata.net/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.php 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <?
  2. /**
  3. *
  4. * Main file : style incorporated since it's a unique page
  5. * A form and a bookmarklet
  6. */
  7. session_start();
  8. include 'class/ShortURL.php';
  9. $url = new ShortURL();
  10. ?>
  11. <!doctype html>
  12. <html>
  13. <head>
  14. <link href='http://fonts.googleapis.com/css?family=Geo' rel='stylesheet' type='text/css'>
  15. <style>
  16. html {margin:0;padding:0;border:0;font-size:100.01%;}
  17. body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, dialog, figure, footer, header, hgroup, nav, section {margin:0;padding:0;border:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline; font-family:'Geo', Arial, sans-serif;}
  18. body {line-height:1.5;background:white;}
  19. h1 {font-size:3em;line-height:1;margin-bottom:0.5em;font-weight:normal;color:#FFF;}
  20. hr {visibility:hidden;clear:both;float:none;width:100%;height:1px;border:none;}
  21. label {font-weight:bold; width:98px;margin-top:11px;}
  22. input[type=text], input[type=password], input.text, input.title, textarea {background-color:#fff;border:1px solid #bbb;margin:0.5em 0;}
  23. input[type=text]:focus, input[type=password]:focus, input.text:focus, input.title:focus, textarea:focus {border-color:#666;}
  24. input.text, input.title {width:300px;padding:5px;}
  25. input.title {font-size:1.5em;}
  26. body{background:#1E1E1A; color:#FFF;}
  27. .container{background:#0C0C0A;border-radius:5px;}
  28. input[type=text], input[type=search], input[type=email], input[type=password]{width:300px;height:23px;}
  29. input[type=text], input[type=search], input[type=email], input[type=password], textarea{
  30. background:#EEE;
  31. float:left;
  32. margin: 0.7em 0.5em;
  33. border:1px solid #CCC;
  34. padding: 2px 7px;
  35. font-family:Georgia, serif;
  36. }
  37. input[type=text]:hover, input[type=search]:hover, input[type=email]:hover, input[type=password]:hover, textarea:hover{
  38. border:1px solid #000;
  39. }
  40. h1 { font-family: 'Geo', arial, serif; }
  41. h1 a, label, a {color:#FF9900;}
  42. label{float:left;}
  43. input[type=submit] {
  44. display:block;
  45. float:left;
  46. margin-left:105px;
  47. padding:5px 10px 5px 7px; /* Links */
  48. border:1px solid #dedede;
  49. border-top:1px solid #eee;
  50. border-left:1px solid #eee;
  51. background-color:#f5f5f5;
  52. font-family:"Geo", Tahoma, Arial, Verdana, sans-serif;
  53. font-size:100%;
  54. line-height:130%;
  55. text-decoration:none;
  56. font-weight:bold;
  57. color:#565656;
  58. cursor:pointer;
  59. }
  60. button, input[type=submit] {
  61. width:auto;
  62. overflow:visible;
  63. padding:4px 10px 3px 7px; /* IE6 */
  64. }
  65. button[type], input[type=submit] {
  66. padding:4px 10px 4px 7px; /* Firefox */
  67. line-height:17px; /* Safari */
  68. }
  69. *:first-child+html button[type] {
  70. padding:4px 10px 3px 7px; /* IE7 */
  71. }
  72. button img, a.button img, input[type=submit] img{
  73. margin:0 3px -3px 0 !important;
  74. padding:0;
  75. border:none;
  76. width:16px;
  77. height:16px;
  78. float:none;
  79. }
  80. /* Button colors
  81. -------------------------------------------------------------- */
  82. /* Standard */
  83. button:hover, a.button:hover, input[type=submit]:hover{
  84. background-color:#dff4ff;
  85. border:1px solid #c2e1ef;
  86. color:#336699;
  87. }
  88. .bookmarklet{ text-decoration: none; background: #FF9900; color: white; padding: 8px 20px; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px; border: 1px solid #fff; margin-left:105px;}
  89. #footer{clear:both; margin: 200px 0 0 30px;}
  90. #footer img{vertical-align:text-bottom}
  91. .myLink{padding-left:14px; background:url('http://shikiryu.com/favicon12.png') left center no-repeat;}
  92. </style>
  93. </head>
  94. <body>
  95. <h1>Yet Another URL Shortener</h1>
  96. <form action="short.php" method="post">
  97. <label for="url">URL : </label><input type="text" name="url" /><hr class="space" />
  98. <label for="shortName">Shortcut : </label><input type="text" name="shortName" /><hr class="space" />
  99. <input type="submit" value="Save">
  100. </form>
  101. <br/><br/><?
  102. if(isset($_SESSION['msg'])){
  103. echo $_SESSION['msg'];
  104. unset($_SESSION['msg']);
  105. }
  106. ?><br/><br/><br/>
  107. <a href="javascript:var%20saisie=prompt('Shortcut%20name:','');if(saisie==null){alert('Shortcut%20cannot%20be%20empty')}else{var%20d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,t=d.title,f='http://nu.x10.bz/add.php',l=d.location,e=encodeURIComponent,p='?v=1&u='+e(l.href)%20+'&t='+e(t)%20+'&s='+saisie,u=f+p;var%20newScript%20=%20document.createElement('script');newScript.type='text/javascript';newScript.src=u;document.body.appendChild(newScript);}void(0)" class="bookmarklet">Short this!</a> <span style="font-size: 14px;">&lt; drag to your bookmarks bar</span>
  108. <?
  109. if(isset($_SESSION['msg'])){
  110. echo $_SESSION['msg'];
  111. unset($_SESSION['msg']);
  112. }
  113. ?>
  114. <div id="footer"><a href="https://www.assembla.com/code/shorturl/subversion/nodes">Sources</a> | Powered by <a href="http://shikiryu.com/" class="myLink">Shikiryu</a> | <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.0/fr/"><img alt="Contrat Creative Commons" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-sa/2.0/fr/80x15.png" /></a></div>
  115. </body>
  116. </html>