vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   My Downloads v1.2 - A Download Manager for VBulletin (https://vborg.vbsupport.ru/showthread.php?t=73311)

Onkel_Tom 01-18-2005 01:48 AM

For those people who wants to have formated filesizes:

find:
Code:

// Check if the file is OFFLINE
if ($runrootonce){
  if (file_exists($dir . $filename)) {
  $filesize= (filesize($dir . $filename));
  }
  else{
  $filesize='OFFLINE';
  $offline=true;
  }
 }
 else{
  if (file_exists($dir . $catname . '/' . $filename)) {
  $filesize= (filesize($dir . $catname . '/' . $filename));
  }
  else{
  $filesize='OFFLINE';
  $offline=true;

and replace it with:
Code:

// Check if the file is OFFLINE
if ($runrootonce){
  if (file_exists($dir . $filename)) {
  $filesiz= (filesize($dir . $filename));
          if ($filesiz < 1024) {
                          $filesize= $filesiz.' b';
                  }
  elseif ($filesiz < 1048576) {
                  $filesize= vb_number_format($filesiz / 1024 ,0).' kb';
    }
  elseif ($filesiz > 1048576) {
                  $filesize= vb_number_format($filesiz / 1048576 ,2).' mb';
                }
  }
  else{
  $filesize='OFFLINE';
  $offline=true;
  }
 }
 else{
  if (file_exists($dir . $catname . '/' . $filename)) {
  $filesiz= (filesize($dir . $catname . '/' . $filename));
  if ($filesiz < 1024) {
                          $filesize= $filesiz.' b';
                  }
  elseif ($filesiz < 1048576) {
                  $filesize= vb_number_format($filesiz / 1024 ,0).' kb';
    }
  elseif ($filesiz > 1048576) {
                  $filesize= vb_number_format($filesiz / 1048576 ,2).' mb';
                  }
  }
  else{
  $filesize='OFFLINE';
  $offline=true;

It's only quick and dirty but it works ;)

Onkel_Tom 01-18-2005 02:04 AM

Okay, some more bugfixes:

In Template mydownloads find at the end:
Code:

$footer
add after:
Code:

</body>
</html>

Find in file download.php:
Code:

eval('$dlnavbar = "' . fetch_template('navbar') . '";');
add before:
Code:

$navbits = array();
$navbits[$parent] = 'Downloads';

$navbits = construct_navbits($navbits);

But my "exploded" tablesize is not gone :(
horizontal size is toooo long for my display..
I will look for that tomorrow ;)

ipas2 01-18-2005 08:03 AM

It looks a version 1.3 is needed :) Uncle Tom, I will look at your fixes soon.
I have to familliar myself more with those templates I guess.

I found a bug myself. In the template replace the phrase $error to $errormsg
This are messages when a non-logged-in user tries to download a file.

Grtz,
Ipas

Onkel_Tom 01-18-2005 02:00 PM

I get the following db error on the screen while downloading a file from downloads root directory. But the download will happen ! It's only an error on the screen.
Code:

Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 18 in /download.php on line 80
I changes line 80 to the original line of your version ipas2
I think this happen because there is no catid entry for the root download dir in the database...

ipas2 01-18-2005 08:06 PM

You're right. Will be fixed in 1.3
For now:
Replace line 80,81,82

PHP Code:

   $cat="SELECT * FROM mydl_category WHERE catid=$dlcat";
   
$catresult=mysql_query($cat);  
   
$dldir=mysql_result($catresult,0,"directory"); 

To:

PHP Code:

   if ($dlcat!=0){
   
$cat="SELECT * FROM mydl_category WHERE catid=$dlcat";
   
$catresult=mysql_query($cat);  
   
$dldir=mysql_result($catresult,0,"directory");
   } 

Grtz
Ipas

ipas2 01-19-2005 06:06 AM

[QUOTE=Onkel_Tom]For those people who wants to have formated filesizes:

Thnx Oncle_Tom.. :) added !

yoyoyoyo 01-19-2005 06:59 AM

excellent hack, but how about adding the ability to count the downloads and display the top 5, 10, 20 (or however many the admin wants) most popular downloads?

ipas2 01-19-2005 08:06 AM

Quote:

Originally Posted by yoyoyoyo
excellent hack, but how about adding the ability to count the downloads and display the top 5, 10, 20 (or however many the admin wants) most popular downloads?

That should not be a problem. I thought about this myself. Version 1.3 I guess

yoyoyoyo 01-19-2005 08:38 AM

Quote:

Originally Posted by ipas2
That should not be a problem. I thought about this myself. Version 1.3 I guess

cool. Would a password protected download be a problem? maybe each file could have a password that the admin specifies in the control panel? or only certain user ID #s are allowed to d/l certain files?

gigaenvy 01-20-2005 10:15 PM

Quote:

Originally Posted by Onkel_Tom
Hi all,
I installed this hack on my testboard. Great Idea !
But there are so many wishes for the new release:
  • include in vB database and get the dbname etc. from includes/config.php
  • vB Style
  • transparent background in images
  • phrasen version to translate in other languages
  • installation script for phrases from a .xml file
  • vbformating for date, filesize etc.
  • last download also add the date
  • if somebody uses a link like "http://www.yourdomain.tld/forums/download.php?download=18" don't show the content of the download page
I'm waiting for the next release ;)
thanks in advance


along with anti-leeching support such as specifying 1 download for each ip address.


All times are GMT. The time now is 10:49 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.01038 seconds
  • Memory Usage 1,754KB
  • 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
  • (7)bbcode_code_printable
  • (2)bbcode_php_printable
  • (3)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