Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class ModCenter{
- var $file_id;
- var $file_name;
- var $file_description;
- var $file_size;
- var $file_author;
- var $file_date;
- var $file_type;
- var $file_ss1;
- var $file_ss2;
- var $file_ss3;
- var $file_ss4;
- var $file_game;
- var $file_downloads;
- var $file_addedby;
- var $file_lastdownload;
- var $file_web;
- var $id;
- var $file_array;
- var $file_row;
- private $types_sin;
- private $types_mul;
- private $date;
- private $tags;
- private $result;
- /*_________________________________________________________________________________*/
- public function __construct($id){
- $file_array = mysql_fetch_row(mysql_query("SELECT * FROM skins WHERE id='$id'"));
- $this->file_array = $file_array;
- }// end __construct();
- public function formatBytes($b,$p = null) {
- $units = array("B","kB","MB","GB","TB","PB","EB","ZB","YB");
- $c=0;
- if(!$p && $p !== 0) {
- foreach($units as $k => $u) {
- if(($b / pow(1024,$k)) >= 1) {
- $r["bytes"] = $b / pow(1024,$k);
- $r["units"] = $u;
- $c++;
- }
- }
- return number_format($r["bytes"],2) . " " . $r["units"];
- } else {
- return number_format($b / pow(1024,$p)) . " " . $units[$p];
- }
- } // end formatBytes();
- private function make_date($date){
- $this->date = $date;
- return date("F j, Y, g:i a",$this->date);
- } // end make_date();
- public function getFileTitle(){
- $this->file_name = $this->file_array[3];
- return $this->file_name;
- } // end getFileTitle();
- public function getFileDescription(){
- $this->file_description = $this->file_array[4];
- return $this->file_description;
- } // end getFileDescription()
- public function getFileSize(){
- $this->file_size = $this->file_array[7];
- return $this->formatBytes($this->file_size);
- } // end getFileSize();
- public function getFileSizeBytes(){
- $this->file_size = $this->file_array[7];
- return $this->file_size;
- } // end getFileSize();
- public function getFileAuthor(){
- $this->file_author = $this->file_array[13];
- return $this->file_author;
- } // end getFileAuthor();
- public function getFileDate(){
- $this->file_date = $this->file_array[5];
- return $this->make_date($this->file_date);
- } // end getFileDate();
- public function getFileTypeSingular(){
- $this->types_sin = array(
- 1 => 'M16A4',
- 2 => 'AK-47',
- 3 => 'G3',
- 4 => 'G36C',
- 5 => 'M4',
- 6 => 'M14',
- 7 => 'MP44',
- 8 => 'MP5',
- 9 => 'Skorpion',
- 10 => 'Uzi',
- 11 => 'Ak-74u',
- 12 => 'P90',
- 13 => 'W1200',
- 14 => 'M1014',
- 15 => 'M40A3',
- 16 => 'R700',
- 17 => 'M9',
- 18 => 'USP',
- 19 => 'M1911',
- 20 => 'Deagle',
- 21 => 'Other / Misc',
- 22 => 'Scope Overlay',
- 23 => 'Gloves',
- 24 => 'Camouflage',
- 25 => 'Menu background',
- 26 => 'Sky',
- 27 => 'Map',
- 28 => 'Wall Texture',
- 29 => 'Movie config',
- 30 => 'FX Runner',
- 31 => 'Prefab',
- 32 => 'Custom Model',
- 33 => 'Trash (this is bad skin)'
- );
- return $this->types_sin[$this->file_array[6]];
- } // end getFileTypeSingular();
- public function getFileTypePlural(){
- $this->types_mul = array(
- 1 => 'M16A4',
- 2 => 'AK-47',
- 3 => 'G3',
- 4 => 'G36C',
- 5 => 'M4',
- 6 => 'M14',
- 7 => 'MP44',
- 8 => 'MP5',
- 9 => 'Skorpion',
- 10 => 'Uzi',
- 11 => 'Ak-74u',
- 12 => 'P90',
- 13 => 'W1200',
- 14 => 'M1014',
- 15 => 'M40A3',
- 16 => 'R700',
- 17 => 'M9',
- 18 => 'USP',
- 19 => 'M1911',
- 20 => 'Deagle',
- 21 => 'Other / Misc',
- 22 => 'Scope Overlays',
- 23 => 'Gloves',
- 24 => 'Camouflages',
- 25 => 'Menu backgrounds',
- 26 => 'Skies',
- 27 => 'Maps',
- 28 => 'Wall Textures',
- 29 => 'Movie configs',
- 30 => 'FX Runners',
- 31 => 'Prefabs',
- 32 => 'Custom Models',
- 33 => 'Trash (All bad skins are going here)'
- );
- return $this->types_mul[$this->file_array[6]];
- } // end getFileTypePlural();
- public function getFileDownloads(){
- $this->file_downloads = $this->file_array[14];
- return $this->file_downloads;
- } // end getFileDownloads();
- public function getFileUploader(){
- $this->file_addedby = $this->file_array[16];
- return $this->file_addedby;
- } // end getFileUploader();
- public function getLastFileDownload(){
- return $this->make_date($this->file_array[18]);
- } // end getLastDownload();
- public function getFileGame(){
- $this->file_game = $this->file_array[15];
- return $this->file_game;
- } // end getFileGame();
- public function makeFileTags(){
- $this->tags = "cod " . $this->getFileGame() . "" . "," . $this->getFileTitle() . "" . $this->getFileAuthor() . "," . $this->getFileTypeSingular() . ",call of duty " . $this->getFileGame();
- return strtolower($this->tags);
- } // end makeFileTags();
- public function makeFileTraffic(){
- return $this->formatBytes($this->getFileSizeBytes() * $this->getFileDownloads());
- } // end makeFileTraffic();
- public function genFileURL(){
- }
- public function getFileScreenshots(){
- $this->screens = "<a rel='lightbox[roadtrip]' href=''><img style='border: 1px solid black;' alt='" . $this->makeFileTags() . "' style='padding: 1px;' width='780' border='0' src=''></a><br/>";
- $this->screens .= "";
- $this->screens .= "";
- $this->screens .= "";
- }
- /*_________________________________________________________________________________*/
- } // end ModCenter
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement