diff --git a/.gitignore b/.gitignore index 943444f..a565b17 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -Website/loader*.htm -Website/testarr.php +Website/loader*.htm +Website/testarr.php Website/modal.loader.test.htm \ No newline at end of file diff --git a/README.MD b/README.MD index fd80b50..00170c0 100644 --- a/README.MD +++ b/README.MD @@ -1,26 +1,26 @@ -lob.li - Objective Link Shortener -================================== - - This is a link shortener, more structured and refined from the UnPS shortener (found https://github.com/UPSolutions/unps.us-Shortener) - - With more focus towards stability and ease of use. - -Core code will be based off of Short version 4-2.9 and versions will be determined as follows: - - - First period: Major release version - - Second Period: Minor release version - - Third Period: Current Stable version - - Fourth Period: Current Testing version - - Fifth Period: Current Dev version - - Sixth Period: Current commit version (incremented every commit by 1) - - - So if the version is 1.5.3.6.2.20, it should be read as: - - Version 1.5 Third Stable release - live at http://lob.li - - Version 1.5.3 Sixth Testing (Beta) release - live at http://dev.lob.li - - Version 1.5.3.6 Second Developing (Unstable or broken) release - Not live - - Number of commits since last developing version - -This project will consist of three branches: - - unstable (dev) - - beta - - stable (master) - +lob.li - Objective Link Shortener +================================== + - This is a link shortener, more structured and refined from the UnPS shortener (found https://github.com/UPSolutions/unps.us-Shortener) + - With more focus towards stability and ease of use. + +Core code will be based off of Short version 4-2.9 and versions will be determined as follows: + + - First period: Major release version + - Second Period: Minor release version + - Third Period: Current Stable version + - Fourth Period: Current Testing version + - Fifth Period: Current Dev version + - Sixth Period: Current commit version (incremented every commit by 1) + + - So if the version is 1.5.3.6.2.20, it should be read as: + - Version 1.5 Third Stable release - live at http://lob.li + - Version 1.5.3 Sixth Testing (Beta) release - live at http://dev.lob.li + - Version 1.5.3.6 Second Developing (Unstable or broken) release - Not live + - Number of commits since last developing version + +This project will consist of three branches: + - unstable (dev) + - beta + - stable (master) + Please only run the stable or beta in live environments, unstable might have bugs or might not even work at all \ No newline at end of file diff --git a/Website/Include/PHP/db.php b/Website/Include/PHP/db.php index fb6fed9..886ca19 100644 --- a/Website/Include/PHP/db.php +++ b/Website/Include/PHP/db.php @@ -1,4 +1,4 @@ -connect_errno > 0) die('Unable to connect to database [' . $shortdb->connect_error . '] - Check dbsettings.php'); +connect_errno > 0) die('Unable to connect to database [' . $shortdb->connect_error . '] - Check dbsettings.php'); ?> \ No newline at end of file diff --git a/Website/about.php b/Website/about.php index c2272b1..497a319 100644 --- a/Website/about.php +++ b/Website/about.php @@ -1,66 +1,66 @@ - - - - - - - lob.li - Objective Links | About Us - - - - - - - - - - -
- - - -
-
-
-

About Lob.li

-
- Lob.li is a link shortener. That's the easiest way to describe what this service does and is about. - Hi, I'm c0de. I developed this website with many hours of work and lots of distractions. - This site is very JavaScript and CSS heavy and unfortunatly breaks on text-only browsers and browsers with JavaScript disabled. - -

A little background on this site...

- The domain lob.li was pretty much an attempt to make a pronounceable and memorable domain - A lot of the backend code is from my older link shortener, UnPS. - The base code has gone through many iterations, but only versions 2 through 4-2 are supported. - -

Terms of Service...

-
    -
  • No already shortened links (bit.li, ad.fly, etc)
  • -
  • No Illegal actions, or websites promoting illegal actions
  • -
  • No Spam. Nobody likes it, don't use my service to distribute spam
  • -
  • No Linking to viruses and other malware
  • -
  • Anything that I feel would cause harm to this service
  • -
- NOTE: I clean up the database from time to time and manually inspect links for anything that violates these rules. - They will be removed without notice. -
-
-
-
-
- - - - - - - - - + + + + + + + lob.li - Objective Links | About Us + + + + + + + + + + +
+ + + +
+
+
+

About Lob.li

+
+ Lob.li is a link shortener. That's the easiest way to describe what this service does and is about. + Hi, I'm c0de. I developed this website with many hours of work and lots of distractions. + This site is very JavaScript and CSS heavy and unfortunatly breaks on text-only browsers and browsers with JavaScript disabled. + +

A little background on this site...

+ The domain lob.li was pretty much an attempt to make a pronounceable and memorable domain + A lot of the backend code is from my older link shortener, UnPS. + The base code has gone through many iterations, but only versions 2 through 4-2 are supported. + +

Terms of Service...

+
    +
  • No already shortened links (bit.li, ad.fly, etc)
  • +
  • No Illegal actions, or websites promoting illegal actions
  • +
  • No Spam. Nobody likes it, don't use my service to distribute spam
  • +
  • No Linking to viruses and other malware
  • +
  • Anything that I feel would cause harm to this service
  • +
+ NOTE: I clean up the database from time to time and manually inspect links for anything that violates these rules. + They will be removed without notice. +
+
+
+
+
+ + + + + + + + + diff --git a/Website/index.php b/Website/index.php index 003a466..66b9f6d 100644 --- a/Website/index.php +++ b/Website/index.php @@ -1,162 +1,172 @@ -real_escape_string(strtolower(stripslashes(strip_tags($_GET['l'])))); - $link = str_replace('/', '', $link); - $sql = "SELECT * FROM `links` WHERE `shortlink` = '$link' LIMIT 1;"; - if($result = $shortdb->query($sql)){ - if($row = $result->fetch_assoc()){ - tracking($sdb, $link); - - $link = $row['link']; - header("location:$link"); - exit(5); // Stop script execution to save on resources - } - } - } - - // New way to check for valid short links, two characters shorter than the if statement above - if(!empty($_GET)){ - $key = key($_GET); - - if($key == "stats"){ header("location:http://s.lob.li"); exit(11); } - if($key == "resolv"){ header("location:http://r.lob.li"); exit(12); } - if($key == "about"){ header("location:http://a.lob.li"); exit(13); } - - $link = $shortdb->real_escape_string(strtolower(stripslashes(strip_tags($key)))); - $link = str_replace('/', '', $link); - $sql = "SELECT * FROM `links` WHERE `shortlink` = '$link' LIMIT 1;"; - if($result = $shortdb->query($sql)){ - if($row = $result->fetch_assoc()){ - tracking($sdb, $link); - - $link = $row['link']; - header("location:$link"); - exit(5); // Stop script execution to save on resources - } - } - } -?> - - - - - - - lob.li - Objective Links - - - - - - - - - - -
- - - -
-
-
-

Please give me a link to shorten...

-
-
- - - - - -
-
-
-
-
-
- loading.... - Please Wait -
-
-
-
- -
-
-
-
- - - - - - - - - - - - +real_escape_string(strtolower(stripslashes(strip_tags($link)))); + $link = str_replace('/', '', $link); + + $sql = "SELECT * FROM `tracking` WHERE `id` = '$link' LIMIT 1;"; // Testing to see if the link has been visited before + if($result = $shortdb->query($sql)){ + if($row = $result->fetch_assoc()){ + $sql = "UPDATE `tracking` SET `clicks` = `clicks` + 1 WHERE `id` = '$link'"; // Yes it has, increment clicks by 1 + if($result = $shortdb->query($sql)){ + if($result->num_rows == 0){ + die ($shortdb->error); + } + } + } + }else{ + $sql = "INSERT INTO `tracking` (id, clicks) VALUES ('$link', 1)"; // No it hasn't, add 1 click to the table + if($result = $shortdb->query($sql)){ + if($result->num_rows == 0){ + die ($shortdb->error); + } + } + } + + $sql = "SELECT * FROM `links` WHERE `shortlink` = '$link' LIMIT 1;"; + if($result = $shortdb->query($sql)){ + if($row = $result->fetch_assoc()){ + $link = $row['link']; + //header("location:$link"); + exit(5); // Stop script execution to save on resources + } + } + } + + // exit codes: + /* + exit 0 - Good script + exit 5 - Link redirection + + 10x exit codes + exit 11 - Shortener Stats redirection + exit 12 - Shortener Resolver redirection + exit 13 - Shortener About redirection + */ + + // This has been depreciated. Still here for backwards compatibility with existing links + if(!empty($_GET['l'])){ + followLink($shortdb, $_GET['l']); + } + + // New way to check for valid short links, two characters shorter than the if statement above + if(!empty($_GET)){ + $key = key($_GET); + + if($key == "stats"){ header("location:http://s.lob.li"); exit(11); } + if($key == "resolv"){ header("location:http://r.lob.li"); exit(12); } + if($key == "about"){ header("location:http://a.lob.li"); exit(13); } + + followLink($shortdb, $key); + } +?> + + + + + + + lob.li - Objective Links + + + + + + + + + + +
+ + + +
+
+
+

Please give me a link to shorten...

+
+
+ + + + + +
+
+
+
+
+
+ loading.... + Please Wait +
+
+
+
+ +
+
+
+
+ + + + + + + + + + + + diff --git a/Website/resolve.php b/Website/resolve.php index dddadb7..4a637ac 100644 --- a/Website/resolve.php +++ b/Website/resolve.php @@ -1,116 +1,116 @@ - - - - - - - lob.li - Objective Links | Link Resolver - - - - - - - - - - -
- - - -
-
-
-

Enter lob.li link to resolve below

-
-
- http://lob.li/ - - - - - -
-
-
-
-
-
- loading.... - Please Wait -
-
-
-
-
-
-
-
- - - - - - - - - - - - + + + + + + + lob.li - Objective Links | Link Resolver + + + + + + + + + + +
+ + + +
+
+
+

Enter lob.li link to resolve below

+
+
+ http://lob.li/ + + + + + +
+
+
+
+
+
+ loading.... + Please Wait +
+
+
+
+
+
+
+
+ + + + + + + + + + + + diff --git a/Website/stats.php b/Website/stats.php index 6c488af..c832aaf 100644 --- a/Website/stats.php +++ b/Website/stats.php @@ -1,121 +1,121 @@ - - - - - - - lob.li - Objective Links | Link Statistics - - - - - - - - - - -
- - - -
-
-
-

Lob.li Link Statistics

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LinkIDResolved LinkTotal ClicksDate Added
-
-
-
- loading.... - Please Wait -
-
-
1Lorem ipsum dolor sit amet, consectetuer adipiscing elit4444400/00/0000
6Lorem ipsum dolor sit amet, consectetuer adipiscing elit4444400/00/0000
236Lorem ipsum dolor sit amet, consectetuer adipiscing elit4444400/00/0000
f42Lorem ipsum dolor sit amet, consectetuer adipiscing elit4444400/00/0000
tg54Lorem ipsum dolor sit amet, consectetuer adipiscing elit4444400/00/0000
-
-
-
-
- - - - - - - - - - - + + + + + + + lob.li - Objective Links | Link Statistics + + + + + + + + + + +
+ + + +
+
+
+

Lob.li Link Statistics

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LinkIDResolved LinkTotal ClicksDate Added
+
+
+
+ loading.... + Please Wait +
+
+
1Lorem ipsum dolor sit amet, consectetuer adipiscing elit4444400/00/0000
6Lorem ipsum dolor sit amet, consectetuer adipiscing elit4444400/00/0000
236Lorem ipsum dolor sit amet, consectetuer adipiscing elit4444400/00/0000
f42Lorem ipsum dolor sit amet, consectetuer adipiscing elit4444400/00/0000
tg54Lorem ipsum dolor sit amet, consectetuer adipiscing elit4444400/00/0000
+
+
+
+
+ + + + + + + + + + + diff --git a/Website/wpi.php b/Website/wpi.php index 4cfada2..c2ac274 100644 --- a/Website/wpi.php +++ b/Website/wpi.php @@ -1,54 +1,54 @@ - - - - - - - lob.li - Objective Links | WPI - - - - - - - - - - -
- - - -
-
-
-

Lob.li Web Programming Interface

-
- -
-
-
-
-
- - - - - - - - - - - + + + + + + + lob.li - Objective Links | WPI + + + + + + + + + + +
+ + + +
+
+
+

Lob.li Web Programming Interface

+
+ +
+
+
+
+
+ + + + + + + + + + +