vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Add-On Releases - BFC-Download (https://vborg.vbsupport.ru/showthread.php?t=212379)

Excalibur82 09-08-2009 05:12 PM

Quote:

Originally Posted by New Joe (Post 1881096)
Another question, if you want to store the files not in the data base what do you actually put into these folders?

Look you have posted almost 2 hours apart, I have a life. I will get the errors fixed when I have time. I go to school and I work a full time job, I have a family with 3 kids. I don't have all the time in the world so gain some patience.

NTMID8 09-27-2009 11:22 PM

Quote:

Originally Posted by Excalibur82 (Post 1881694)
Look you have posted almost 2 hours apart, I have a life. I will get the errors fixed when I have time. I go to school and I work a full time job, I have a family with 3 kids. I don't have all the time in the world so gain some patience.

Just checking in to see how things are going with this. Thanks!

DaMani 10-05-2009 08:08 AM

We are currently performing maintenance of BFC-Download Area.

???

Trek 10-07-2009 04:41 PM

Installing this now... I can see many uses for this, thank you for writing it!

Trek 10-07-2009 05:06 PM

Ok, installed, but have a couple of issues/questions. =)

First, I'm getting this error:

Quote:

Invalid SQL:
SELECT COUNT(sid) AS number FROM download_screenshots WHERE file_id = '1';

MySQL Error : Table 'trekkan_dhvforums.download_screenshots' doesn't exist
Obviously the table wasn't created, I have file store selected and created the folders and changed the perms.

Second, the questions.

Can I set specific categories so that only specified usergroups can access them? I see you have usergroups setup on the files themselves, but it'd be nice to limit by category as well.

Having members enter usergroups can get confusing (especially when you use a lot of secondary usergroups like I do). First suggestion would be a multi-select box of usergroups (defined in the admin for this mod, which appear). If that is too much work, then I'd suggest... usergroup groups.

Basically where I as an admin would define a group by name, say "Mods and Admins", then I'd assign a value to this name of the usergroups I want it to contain like "6,7". this will allow me to add in whatever I wanted and eliminate the members from having to remember usergroup values. Then a dropdown would list all of these by description or better, a list of checkboxes and select which groups that way.

I'm not sure of the best way to go about that, but... I hope you get the idea. =)

Anyway, good stuff and can't wait to have it available to my members!

Trek 10-07-2009 05:31 PM

Ok, sorry for the multiple posts, but I'm digging at this trying to figure out the problem.

The tables were in fact created correctly, using my prefix as defined:

$config['Database']['tableprefix'] = 'dhv_';

However, as you can see by the error in the above post, this prefix is not being used in select statement. I took a look at download.php and found some queries that were missing the prefix.

Lines 343 and 344 are missing it, I fixed those in my version of download.php and took a look at all of the other DB calls in that file and couldn't find any more that were missing.

Another question is, I have it set to use the file system and not the database, but that doesn't appear to be working. I checked the file folders and there's nothing in ifiles for example (I assume this is where the files should be dumped?). However, the downloads do work, so the files are somewhere (another assumption is the database?).

Trek 10-07-2009 06:16 PM

When editing categories, after clicking save, this error appears during the save.

Warning: unlink(./icat/) [function.unlink]: Is a directory in [path]/admincp/download.php on line 192

But the changes I made to the category description appear to save, so that part works.

Trek 10-07-2009 06:43 PM

I took a look to see if I could figure out why saving into the file system wasn't working and it appears... there's no code to do it.

The setting is: bfc_download_storage

But that's not used in the \download.php file or templates, etc. When looking at the \download.php file, the only code there is for saving to the database, no checks at all if it should save into the file system and nothing that would do it if there were (that I can find).

However, the \admincp\download.php does appear to have code for the file system and this option. This would explain why myself and others who have gotten the unlink error get that error. We're set to file system, but there's nothing in the file system to remove, because all uploads are going into the database instead.

Since the download record is being deleted, the database record is actually being deleted anyway, so the good news is this isn't leaving unused data in the database.

There's a lot of code in the \admincp\download.php that pertains to the file system saving and having only looked at this code for a short amount of time, I could be wrong on all of this. So... no offense meant towards the author at all, this is good stuff, I'm just trying to debug the issues I'm having. =)

Trek 10-07-2009 07:17 PM

At the top of the \downloads.php file where access permissions are set, it looks like a copy/paste problem with permissions.

All of the permissions are set to to the "canaddfiles" permission. So if someone can add files, they can do anything, delete, etc, view, etc.

To fix:

Open \downloads.php

Find:

Code:

$canaddfiles = $permissions['bfc_download'] & $vbulletin->bf_ugp['bfc_download']['canaddfiles'];
$candeletefiles = $permissions['bfc_download'] & $vbulletin->bf_ugp['bfc_download']['canaddfiles'];
$caneditfiles = $permissions['bfc_download'] & $vbulletin->bf_ugp['bfc_download']['canaddfiles'];
$canaddimages = $permissions['bfc_download'] & $vbulletin->bf_ugp['bfc_download']['canaddfiles'];
$canviewfiles = $permissions['bfc_download'] & $vbulletin->bf_ugp['bfc_download']['canaddfiles'];
$canviewimages = $permissions['bfc_download'] & $vbulletin->bf_ugp['bfc_download']['canaddfiles'];

Replace with:

Code:

$canaddfiles = $permissions['bfc_download'] & $vbulletin->bf_ugp['bfc_download']['canaddfiles'];
$candeletefiles = $permissions['bfc_download'] & $vbulletin->bf_ugp['bfc_download']['candeletefiles'];
$caneditfiles = $permissions['bfc_download'] & $vbulletin->bf_ugp['bfc_download']['caneditfiles'];
$canaddimages = $permissions['bfc_download'] & $vbulletin->bf_ugp['bfc_download']['canaddimages'];
$canviewfiles = $permissions['bfc_download'] & $vbulletin->bf_ugp['bfc_download']['canviewfiles'];
$canviewimages = $permissions['bfc_download'] & $vbulletin->bf_ugp['bfc_download']['canviewimages'];


Trek 10-07-2009 08:55 PM

There's one change in each cat.php, screen.php and screenshot.php that needs to be made.

You need to include the database prefix in those as well.


All times are GMT. The time now is 03:28 PM.

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.03105 seconds
  • Memory Usage 1,752KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)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