This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $top = (@$_GET["top"]) ? $_GET["top"] : ""; $bottom = (@$_GET["bottom"]) ? $_GET["bottom"] : ""; ?> | |
<!DOCTYPE html> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8" /> | |
<link rel="stylesheet" type="text/css" media="all" href="http://smarterfish.com/assets/css/basic.css"/> | |
<title>Business Cat Cached</title> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* DEMO ---------------------------------------------------------------------------------------------------------------------- */ | |
/* This file is a working example, so with a few edits to this file and server.properties and a file or two created (with accurate permissions) on your server, you can be up and running in no time. | |
You will need to edit server.properties to enable a remote connection in your Minecraft server: 'enable-query=true' amd set a port for querying your server: 'query.port=25565'. You shouldn't use the default port number. | |
Edit this file just below (the first block of code): YOURSERVER.COM & YOURPORTNUMBER to the URL for your Minecraft server and the port number you specified in server.properties (not your server-port; this one needs to be query.port). | |
This script needs one file to store the player names in temporarily, and a folder to store their skins, we store player names for 5 seconds by default and skins for 24 hours. We do this to stop overloading your server, and http://mi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// error.php | |
/* $code would be set when included in another file, otherwise we assume apache is calling us, and look for $_GET["code"] */ | |
$code = (empty($code)) ? $_GET["code"] : $code; | |
/* we messed something up, fake it and issue a 500 */ | |
if (empty($code)) { $code = "500"; } | |
/* obviously, you can add more */ | |
if ($code == "400") { | |
$status = "HTTP/1.1 400 Bad Request"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Memo { | |
// we're going to set the message to something, could be nothing (meaning we want the message cleared), or something to else. | |
function set($message = '') { | |
if (setcookie('memo', $message, time() + 60, '/')) { | |
return false; | |
} else { | |
return true; | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function debug(&$var, $r = NULL) { | |
// if $var is an empty string, we're being called recursively | |
// this is an extreme guess, and might cause problems | |
// now we determine the variable name | |
$old = $var; | |
// var = $new = "unique".rand()."value"; | |
$new = $var; | |
$var = "unique".rand()."value"; | |
$new = $var; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function excerpt($text, $phrase, $radius = 50, $ending = "...", $offset = 0) { | |
// excerpt('SuperLongStringThatMightNotFitInTheSpaceAllowed', 'That', 10) | |
// will return | |
// rLongStringThatMightNotFi... | |
$phraseLen = strlen($phrase); | |
if ($radius < $phraseLen) { | |
$radius = $phraseLen; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function snipper($string, $length) { | |
// snipper('SuperLongStringThatMightNotFitInTheSpaceAllowed', 10) | |
// will return | |
// SuperLongS...aceAllowed | |
if (strlen($string) > $length) { | |
$string = substr($string, 0, $length). "...".substr($string, strlen($string) - $length, $length); | |
} | |
return $string; |