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
// Sets up XenForo App | |
define('XF_ROOT', '/home/victor/Workspace/candidatovaga/public/forum'); // set this (absolute path)! | |
define('TIMENOW', time()); | |
$startTime = microtime(true); | |
define('SESSION_BYPASS', false); // if true: logged in user info and sessions are not needed | |
require_once(XF_ROOT . '/library/XenForo/Autoloader.php'); | |
XenForo_Autoloader::getInstance()->setupAutoloader(XF_ROOT . '/library'); |
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 | |
class Session { | |
#Xenforo if logged in function | |
function isOnline(){ | |
$session = new XenForo_Session(); | |
if (!$session->sessionExists()) | |
{//when user info and sessions are needed | |
XenForo_Session::startPublicSession(); |
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 ByteSize($size) | |
{ | |
static $unit = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'); | |
$size/=(pow(1024,($idx=floor(log($size)/log(1024))))); | |
return number_format($size,2).$unit[$idx]; | |
} |
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 | |
$teams=array('Alpha','Beta','Gamma','Delta','Epsilon','Zeta','Eta'); | |
define('MY_EOL','<br .>'.PHP_EOL); | |
$round=0; | |
$participants=$teams; | |
while(count($participants)>1) | |
{ | |
$round++; // Increment our round |