From 278a61e1c3cbe4b8336ef70261aea5f4c3c6f270 Mon Sep 17 00:00:00 2001 From: lesterchan Date: Tue, 12 May 2009 14:15:54 +0000 Subject: [PATCH] - Renamed insert.php to admin.php - Renamed insert_ajax.php to admin_ajax.php - Added readme.html - Added more description in config-sample.php git-svn-id: http://yourls.googlecode.com/svn/trunk@6 12232710-3e20-11de-b438-597f59cd7555 --- insert.php => admin.php | 4 +- insert_ajax.php => admin_ajax.php | 0 includes/config-sample.php | 61 +++-- includes/functions.php | 2 +- js/insert.js | 10 +- readme.html | 357 ++++++++++++++++++++++++++++++ 6 files changed, 406 insertions(+), 28 deletions(-) rename insert.php => admin.php (97%) rename insert_ajax.php => admin_ajax.php (100%) create mode 100644 readme.html diff --git a/insert.php b/admin.php similarity index 97% rename from insert.php rename to admin.php index 51c499f..94d48af 100644 --- a/insert.php +++ b/admin.php @@ -29,7 +29,7 @@ } else { $link_filter = ''; } -$base_page = 'insert.php'; +$base_page = 'admin.php'; ### Searching if(!empty($search) && !empty($_GET['s_in'])) { @@ -172,7 +172,7 @@
  - +
Search for  diff --git a/insert_ajax.php b/admin_ajax.php similarity index 100% rename from insert_ajax.php rename to admin_ajax.php diff --git a/includes/config-sample.php b/includes/config-sample.php index 01ce662..519b070 100644 --- a/includes/config-sample.php +++ b/includes/config-sample.php @@ -1,41 +1,62 @@ 'mypass', - 'toto' => '123' - ); // array of login/password to access the site (can be just one 'key'=>'value') - -// URL shortening method: 36 or 62. -// 36: generates case insentitive lowercase keywords (ie: 13jkm) -// 64: generate case sensitive keywords (ie: 13jKm or 13JKm) -// Stick to one setting, don't change after you've created links as it will change all your short URLs! -// Base 36 should be picked. Use 62 only if you understand what it implies. -// Using base 62 means you *need* PHP extension BCCOMP + 'username' => 'password', + 'username2' => 'password2' + ); + +/** +* URL shortening method: 36 or 62. +* +* 36: generates case insentitive lowercase keywords (ie: 13jkm) +* 64: generate case sensitive keywords (ie: 13jKm or 13JKm) +* Stick to one setting, don't change after you've created links as it will change all your short URLs! +* Base 36 should be picked. Use 62 only if you understand what it implies. +* Using base 62 means you *need* PHP extension BCCOMP +*/ define('YOURLS_URL_CONVERT', 36); -// Reserved keywords (so that generated URLs won't match them) -// Define here negative, unwanted or potentially misleading keywords +/** +* Reserved keywords (so that generated URLs won't match them) +* Define here negative, unwanted or potentially misleading keywords. +*/ $yourls_reserved_URL = array( 'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', 'gay', ); + /******************** DO NOT EDIT ANYTHING ELSE ********************/ // Include everything except auth functions require_once 'functions.php'; require_once 'functions-baseconvert.php'; -require_once 'class-mysql.php'; - +require_once 'class-mysql.php'; \ No newline at end of file diff --git a/includes/functions.php b/includes/functions.php index a8473a4..03e6092 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -38,7 +38,7 @@ function yourls_http_digest_parse($txt) { function yourls_auth_headers($realm = '') { header('HTTP/1.1 401 Unauthorized'); header('WWW-Authenticate: Digest realm="'.$realm.'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"'); - die('Sorry! Retry.'); + die('Sorry! Retry.'); } // Make sure a link id (site.com/1fv) is valid. diff --git a/js/insert.js b/js/insert.js index a3d8bb4..086fd0f 100644 --- a/js/insert.js +++ b/js/insert.js @@ -22,7 +22,7 @@ function add() { var keyword = $("#add-keyword").val(); add_loading("#add-button"); $.getJSON( - "insert_ajax.php", + "admin_ajax.php", {mode:'add', url: newurl, keyword: keyword}, function(data){ if(data.status == 'success') { @@ -44,7 +44,7 @@ function edit(id) { add_loading("#edit-button-" + id); add_loading("#delete-button-" + id); $.getJSON( - "insert_ajax.php", + "admin_ajax.php", { mode: "edit_display", id: id }, function(data){ $("#id-" + id).after( data.html ); @@ -61,7 +61,7 @@ function remove(id) { return; } $.getJSON( - "insert_ajax.php", + "admin_ajax.php", { mode: "delete", id: id }, function(data){ if (data.success == 1) { @@ -87,7 +87,7 @@ function edit_save(id) { var newurl = $("#edit-url-" + id).val(); var newid = $("#edit-id-" + id).val(); $.getJSON( - "insert_ajax.php", + "admin_ajax.php", {mode:'edit_save', url: newurl, id: id, newid: newid }, function(data){ if(data.status == 'success') { @@ -112,7 +112,7 @@ function edit_save(id) { function logout() { $.ajax({ type: "POST", - url: "insert_ajax.php", + url: "admin_ajax.php", data: {mode:'logout'}, success: function() { window.parent.location.href = window.parent.location.href; diff --git a/readme.html b/readme.html new file mode 100644 index 0000000..0bf700b --- /dev/null +++ b/readme.html @@ -0,0 +1,357 @@ + + + + + YOURLS: Your Own URL Shortener Readme + + + + +
+ +
YOURLS: Your Own URL Shortener   Readme
+ + + + + +
+ +
+
» Index
+
Plugin Information
+

+ Author:
+ » Richard Ozh, Lester Chan +

+

+ Website:
» http://planetozh.com/, http://lesterchan.net/ +

+

+ Features:
+ » YOURLS is a PHP script that will allow you to run your own URL shortener, a la TinyURL. You can make it private or public, and a WordPress plugin makes integration with your WordPress blog a snap. +

+

+ Download:
+ » YOURLS 1.0.0 Beta 1
+

+

+ Demo:
» yourls.org, lc.sg, ozh.in +

+

+ Development:
+ » http://code.google.com/p/yourls/ +

+

+ Bugs Reporting:
+ » http://code.google.com/p/yourls/issues/list +

+

+ Credits:
+ » Blah Blah +

+

+ Note:
+ » The Changelog, Installation, Upgrade, Usage Tab at the top of the page. +

+
+ + + + + + + + + + + + +
+
+ + + \ No newline at end of file -- 2.45.0