vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Major Additions - DownloadsII (https://vborg.vbsupport.ru/showthread.php?t=120122)

RS_Jelle 05-03-2007 04:42 AM

Quote:

Originally Posted by MotMann (Post 1239153)
How must look the code, if the thumbs displayes side by side with the Text under the Thumb?

Some fast written code:

Open downloads.php

Find
PHP Code:

            while ($image $db->fetch_array($result))
            {
                if ((
$permissions['ecdownloadpermissions'] & $vbulletin->bf_ugp['ecdownloadpermissions']['caneditallfiles']) OR
                   ((
$permissions['ecdownloadpermissions'] & $vbulletin->bf_ugp['ecdownloadpermissions']['caneditownfiles']) AND
                    ((
$image['uploaderid'] == $vbulletin->userinfo['userid']) AND ($file['uploaderid'] == $vbulletin->userinfo['userid']))))
                    
$edit '[<a href="./downloads.php?do=file&amp;id='.$file['id'].'&amp;act=delimg&amp;img='.$image['id'].'" onclick="return delete_it()">'.$vbphrase['delete'].'</a>]';
                {
                    if (
file_exists($dl->url.$image['thumb']))
                    {
                        
$dimages .= '<a href="'.$dl->url.$image['name'].'"><img src="'.$dl->url.$image['thumb'].'" alt="'.$file['name'].'" title="'.$file['name'].'" border="0" /></a> by <a href="./member.php?u='.$image['uploaderid'].'">'.$image['uploader'].'</a> on '.vbdate($vbulletin->options['dateformat'], $image['date'], true).' '.$edit.'<br />';
                    }
                    else
                    {
                        
$dimages .= '<a href="'.$dl->url.$image['name'].'">'.$image['name'].'</a> by <a href="./member.php?u='.$image['uploaderid'].'">'.$image['uploader'].'</a> on '.vbdate($vbulletin->options['dateformat'], $image['date'], true).' '.$edit.'<br />';
                    }
                }
            } 

Change to
PHP Code:

            $dimages .= '<table cellpadding="0" cellspacing="2" border="0"><tr>';
            while (
$image $db->fetch_array($result))
            {
                if (
file_exists($dl->url.$image['thumb']))
                {
                    
$dimages .= '<td><a href="'.$dl->url.$image['name'].'"><img src="'.$dl->url.$image['thumb'].'" alt="'.$file['name'].'" title="'.$file['name'].'" border="0" /></a></td>';
                }
                else
                {
                    
$dimages .= '<td><a href="'.$dl->url.$image['name'].'">'.$image['name'].'</a></td>';
                }
            }
            
$dimages .= '</tr><tr>';
            while (
$image $db->fetch_array($result))
            {
                if ((
$permissions['ecdownloadpermissions'] & $vbulletin->bf_ugp['ecdownloadpermissions']['caneditallfiles']) OR
                   ((
$permissions['ecdownloadpermissions'] & $vbulletin->bf_ugp['ecdownloadpermissions']['caneditownfiles']) AND
                    ((
$image['uploaderid'] == $vbulletin->userinfo['userid']) AND ($file['uploaderid'] == $vbulletin->userinfo['userid']))))
                {
                    
$edit '<span class="smallfont"><a href="./downloads.php?do=file&amp;id='.$file['id'].'&amp;act=delimg&amp;img='.$image['id'].'" onclick="return delete_it()">'.$vbphrase['delete'].'</a></span>';
                }

                if (
file_exists($dl->url.$image['thumb']))
                {
                    
$dimages .= '<td>by <a href="./member.php?u='.$image['uploaderid'].'">'.$image['uploader'].'</a> on '.vbdate($vbulletin->options['dateformat'], $image['date'], true).' '.$edit.'</td>';
                }
                else
                {
                    
$dimages .= '<td>by <a href="./member.php?u='.$image['uploaderid'].'">'.$image['uploader'].'</a> on '.vbdate($vbulletin->options['dateformat'], $image['date'], true).' '.$edit.'</td>';
                }
            }
            
$dimages .= '</tr></table>'

As I said, it's rough code. It's just written to work, but that's all :D

rickyreter 05-03-2007 07:28 AM

Strange, but this isn't a DownloadsII problem -I think-. It works fine for me. Maybe it's a very big PDF and your running over your PHP upload limit? So try a very small PDF to be sure if this is the case.
[/QUOTE]

Well yes i suppose its a large file,its not often i use pdf for site but was impressed with mod and its simplicity the file is 7.9mb ...not checked the php limit...but not really bothered as just ftp to site then gave a url to file instead as only got the 1 file and most are zip.

Excellent mod and very happy

Thanks Peter

TotalTorque.net 05-03-2007 08:40 AM

Works fine for me although I find the upload error process annoying. It waits, seemingly, for the file upload to complete and then tells you if the file format is incorrect (or similar).

Still, an excellent modification.

MotMann 05-03-2007 01:22 PM

Quote:

Originally Posted by RS_Jelle (Post 1240358)
As I said, it's rough code. It's just written to work, but that's all :D

OK..

Parse error: syntax error, unexpected T_ELSE in /www/htdocs/xxxxxxxx/Board/Forum/downloads.php on line 1022

:D

RS_Jelle 05-03-2007 01:29 PM

Quote:

Originally Posted by rickyreter (Post 1240422)
Well yes i suppose its a large file,its not often i use pdf for site but was impressed with mod and its simplicity the file is 7.9mb ...not checked the php limit...but not really bothered as just ftp to site then gave a url to file instead as only got the 1 file and most are zip.

Excellent mod and very happy

Thanks Peter

7.9MB isn't very small, a lot of hosts are setting smaller values as the PHP upload limit. But you can change this easily with a .htaccess (have a search in the thread for this).

Quote:

Originally Posted by TotalTorque.net (Post 1240450)
Works fine for me although I find the upload error process annoying. It waits, seemingly, for the file upload to complete and then tells you if the file format is incorrect (or similar).

Still, an excellent modification.

And is it really incorrect, or not?

TotalTorque.net 05-03-2007 02:36 PM

Yes, but the point is...if it checked the file type before commencing the full upload, it'd save a lot of time.

RS_Jelle 05-03-2007 04:28 PM

Quote:

Originally Posted by TotalTorque.net (Post 1240645)
Yes, but the point is...if it checked the file type before commencing the full upload, it'd save a lot of time.

That's a bit difficult, just because the PHP routine: it's a post method form, so when you click the submit button the first it does is uploading it totally before processing the php work.

So the same "problem" also exist for the vBulletin attachement manager for forum posts. At the moment there's no real fix possible.

BozzaJos 05-03-2007 06:24 PM

Hi CyberRanger and Jelle,

I just love this mod.. and my member do to!

I'm planning on upgrading my board from 3.5 to 3.6 soon and I was wondering how the developments of the new version are going? Perhaps you could give us a little update, would be sweet!

Anyway, keep up the great job!

logofreax 05-03-2007 06:56 PM

Thank you RS_Jelle's

Now my Downloads are sortet right. But now my Categories are sortet from Z to A. How can I fix this Problem now?

cu
logofreax

wolfe 05-03-2007 10:32 PM

is it possible to make the download page an index infront of the forums example

http://www.site.com/index.php (downloads.php)


All times are GMT. The time now is 11:47 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.05453 seconds
  • Memory Usage 1,797KB
  • 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_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (6)pagenav_pagelinkrel
  • (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