The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Bytes conversion
Is there already a functions or class that can be used to convert bytes to whatever it should be such as KB, MB, GB, etc?
I have been trying to find a conversion method to include with my mod but every one of the method's I have found don't work, either I can't seem to get them to match vB or something. Here is one I found: PHP Code:
PHP Code:
|
#2
|
||||
|
||||
PHP Code:
|
#3
|
|||
|
|||
Ok now how do I implement that into my file?
Do I use this: Code:
$query = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "download AS download LEFT JOIN " . TABLE_PREFIX . "download_screenshots AS screenshots ON (screenshots.file_id = download.id)"); while ($dl = $db->fetch_array($query)) { $id = $dl['id']; $version = $dl['version']; $name = $dl['name']; $size = $dl['size']; $description = $dl['description']; $username = $dl['username']; $userid = $dl['userid']; $sid = $dl['sid']; $screenshot = $dl['sdata']; $this->vbmksize($size); eval('$display_shots .= "' . fetch_template('bfc_download_screenshot_display') . '";'); eval('$display_bit .= "' . fetch_template('bfc_download_bit') . '";'); } |
#4
|
||||
|
||||
This should work:
PHP Code:
|
#5
|
|||
|
|||
thank you, gonna give that a try now.
--------------- Added [DATE]1238995567[/DATE] at [TIME]1238995567[/TIME] --------------- Worked like a charm, tyvm. --------------- Added [DATE]1238995605[/DATE] at [TIME]1238995605[/TIME] --------------- BTW, what file is vbmksize() function located in? I had to create my own file but would rather include a vb file if it already exists in one. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|