-
-
Save sylae/cdb9d6ff99d7b47fb83f to your computer and use it in GitHub Desktop.
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
RewriteEngine On | |
RewriteBase /swav | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ index.php [L] |
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 | |
preg_match('/\/swav\/[\D.]+(\d*).+/', $_SERVER['REQUEST_URI'], $matches); | |
$pic = $matches[1] % 207; | |
$pics = array(); | |
foreach (glob("/var/www/calref-new/chat/emoticon-packs/ponicons/*.png") as $filename) { | |
// the above path should point to the proper directory in calref/cadence | |
$pics[] = $filename; | |
} | |
header("Content-Type: image/png"); | |
// 5482 sy | |
// 2001 aran | |
if ($matches[1] == 5482) { | |
echo file_get_contents("/var/www/calref-new/chat/emoticon-packs/ponicons/sybeam.png"); | |
} elseif ($matches[1] == 2001) { | |
echo file_get_contents("/var/www/calref-new/chat/emoticon-packs/ponicons/aran.png"); | |
} else { | |
echo file_get_contents($pics[$pic]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment