Skip to content

Instantly share code, notes, and snippets.

🤓
Working on a cool new project

Josh kbrmedia

🤓
Working on a cool new project
Block or report user

Report or block kbrmedia

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kbrmedia
kbrmedia / qr.code.md
Last active Mar 4, 2019
QR Code Blocked in Some Countries
View qr.code.md

Open the file includes/Short.class.php and go to line 1061 to find the code below

$api_url = "http://chart.apis.google.com/chart?chs=$size&chld=L|0&choe=UTF-8&cht=qr&chl=".urlencode((!empty($url->domain) ? $url->domain : $this->config["url"])."/{$this->action}?source=qr");	

Right after that line add

header("Location: $api_url");
exit;

That is it

@kbrmedia
kbrmedia / user.list.php
Last active Jan 31, 2019
User List for Premium URL Shortener
View user.list.php
<?php
// Get users list who have their profile set to public
$users = $this->db->get("user", ["public" => "1"], ["limit"=>(($this->page-1)*$this->limit).", {$this->limit}","count"=>TRUE]);
// Generate Pagination
if(($this->db->rowCount%$this->limit)<>0) {
$max=floor($this->db->rowCount/$this->limit)+1;
} else {
$max=floor($this->db->rowCount/$this->limit);
}
@kbrmedia
kbrmedia / users.txt
Created Nov 13, 2018
All of your Short URLs
View users.txt
GET http://yourwebsite.com/api/urls
@kbrmedia
kbrmedia / stats.txt
Created Nov 13, 2018
Statistics data for a short URL
View stats.txt
GET http://yourwebsite.com/api/details
@kbrmedia
kbrmedia / Shortener.API.Function.php
Last active Dec 5, 2018
Sample shortener API Function
View Shortener.API.Function.php
<?php
define("SHORTENER_URL", "http://yoursite.com");
define("SHORTENER_KEY", "123456789");
/**** Sample PHP Function ***/
function shorten($url, $custom = "", $format = "json") {
$api_url = SHORTENER_URL."/api/?key=".SHORTENER_KEY;
$api_url .= "&url=".urlencode(filter_var($url, FILTER_SANITIZE_URL));
if(!empty($custom)){
You can’t perform that action at this time.