vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Admin CP UserTools and ServerStats (https://vborg.vbsupport.ru/showthread.php?t=43232)

TECK 09-07-2002 09:45 PM

you wont be able to see it becasue is not stored in the database the information. you should remove the line for attachments in stats.

Chris M 09-07-2002 09:51 PM

Ok...

I removed one of the lines...

This one :
PHP Code:

$attach $DB_site->query_first("SELECT SUM(LENGTH(hash)) AS size FROM attachment"); 

Satan

Chris M 09-07-2002 09:53 PM

Ah...And this line too for those who need to or want to :

PHP Code:

makelabelcode('Attachment Usage:'kbtomb($attach['size'])); 

Satan

TECK 09-07-2002 10:12 PM

i use a different approach me to eliminate completly the lines that have 0 values.
for example, if my specific line it has either "0.0 MB" or "0", i use a line like that:
Code:

if (kbtomb($attach['size']) != '0.0 MB') {
  makelabelcode('Attachment Usage:', kbtomb($attach['size']));
}

or
Code:

if ($newusers['count'] != '0') {
  makelabelcode('New Users Today:', $newusers['count']);
}

i added this condition to all functions that might give me 0 values. just a tip for those who want to have it more compact the information.

Chris M 09-07-2002 10:22 PM

Cool...:)

Satan

Buddha 09-08-2002 12:25 AM

*clicks install*

thank you.
excellent resource.
love it.

keep 'em coming.

wooolF[RM] 09-08-2002 08:12 AM

]:D :D :D :D :D :D

TECK 09-08-2002 08:43 PM

Quote:

Originally posted by hellsatan
Cool...:)

Satan

cool?? no, you are cool... :)
people you should see hell's no. of installed hacks in profile:
[high]# Of Hacks hellsatan Installed: 517[/high]

wow. all the respect for installing a record no. of hacks and also even greater respect for taking the effort to click the button install. wich not alot of people do.

call it laziness, not other thing. if you install a hack, at least give credit to the hacker.
one more time, thanks satan your all.

floren.

Mutt 09-08-2002 09:50 PM

modified it to work with attachments af files


replace this
PHP Code:

$attach $DB_site->query_first("SELECT SUM(LENGTH(filedata)) AS size FROM attachment"); 

with this
PHP Code:

function dirsize($dir) {
$dh opendir($dir);
$size 0;
while ((
$file readdir($dh)) !== false)
if (
$file != "." and $file != "..") {
$path $dir."/".$file;
if (
is_dir($path))
$size += dirsize($path);
elseif (
is_file($path))
$size += filesize($path);
}
closedir($dh);
$mgs_size sprintf('%.2f',$size/1048576) . ' MB';
return 
$mgs_size;


then replace this
PHP Code:

makelabelcode('Attachment Usage:'kbtomb($attach['size'])); 

with this
PHP Code:

makelabelcode('Attachment Usage:'dirsize($attachpath)); 

thats it! this new function will handle any totaling up all of the file sizes in that dir and will check for any sub directories.

I used the same function to total up uploaded profile pics and sig images.

TECK 09-09-2002 02:06 AM

very nice Mutt... i learn from everyone something, every day.
chris?? you wanna try it in your board since you request it? :)
let us know if it worked great, as i assume... so other users will use the code to.

ok, i added a link in the first post. :)


All times are GMT. The time now is 05:28 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01239 seconds
  • Memory Usage 1,751KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (6)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete