Status
Not open for further replies.

bzcomputers

Customer
I should first say I have my vbdownloads placed in my /public_html/downloads/ on my site.
My "File Name" is set to: http://www.cruisin.me/downloads/index

I have vbdownloads.php renamed to index.php in this directory.
The only change I needed to make to this file was to add:

Code:
chdir ('../forum');

above:

Code:
require_once('./global.php');
require_once(DIR . '/dbtech/downloads/core/class_download.php');

All seems to be working well except for the redirect that occurs after selecting upload. Files upload correctly but the link the mod tries to go to after looks like this:

http://www.cruisin.me/forum/http://www.cruisin.me/downloads/index.php?do=download&fileid=89

I know why it's happening but I'm sure I'm not the only one going to install outside of the /forum directory, so this will probably be an issue for others before too long.

Is there a quick fix for this?

Possibly a permanent fix would be to recognize if there is a full url in the "File Name" setting or an option to select "Yes" I'm installing outside /forum directory and then not use the base url.

--------------------------------------------------

The link produced in "Post To Forums" also shows this issue.
 
Last edited:
There isn't a quick fix for it. David didn't design it to run outside of the forum directory so there are lots of links and redirects that point to the forum url / download file.
 
If or when you decide to officially support placing vBDownloads outside of the forum directory here is what I came across when making it work for me.

There only seems to currently be 10 places where there is reference to linking to "bburl" I removed all these references in red below:



1) dbtech/downloads/actions/doeditdownload.php line 51:
Code:
$vbulletin->url = [COLOR="#FF0000"]$vbulletin->options['bburl'] . '/' .[/COLOR] $vbulletin->options['dbtech_downloads_link'] . '.php?do=download&fileid=' . $groupid;


2) dbtech/downloads/actions/download.php line 152:
Code:
header('Location: ' [COLOR="#FF0000"]. $vbulletin->options['bburl'] . '/' [/COLOR]. $vbulletin->options['dbtech_downloads_link'] . '.php?do=password&fileid=' . $file['groupid']);


3) dbtech/downloads/actions/setpassword.php line 22:
Code:
header('Location: ' [COLOR="#FF0000"]. $vbulletin->options['bburl'] . '/' [/COLOR]. $vbulletin->options['dbtech_downloads_link'] . '.php?do=download&fileid=' . $fileid);


4) dbtech/downloads/actions/upload.php line 58:
Code:
$vbulletin->url = [COLOR="#FF0000"]$vbulletin->options['bburl'] . '/' .[/COLOR] $vbulletin->options['dbtech_downloads_link'] . '.php?do=download&fileid=' . $groupid;


5) dbtech/downloads/hooks/navigation_tabs_complete.php line:18
Code:
$dlfile = [COLOR="#FF0000"]$vbulletin->options['bburl'] . '/' .[/COLOR] $vbulletin->options['dbtech_downloads_link'] . '.php';


6) dbtech/downloads/modules/uploadmodule.php line 508:
Code:
$shout->set('message', construct_phrase($vbphrase['dbtech_downloads_vbshout_message'], [COLOR="#FF0000"]$this->registry->options['bburl'],[/COLOR] $this->registry->options['dbtech_downloads_link'], $this->groupid, $this->registry->db->escape_string($this->groupname)))


7) dbtech/downloads_pro/hooks/ajax_start.php line 109:
Code:
$shout->set('message', construct_phrase($vbphrase['dbtech_downloads_vbshout_message'], [COLOR="#FF0000"]$vbulletin->options['bburl'],[/COLOR] $vbulletin->options['dbtech_downloads_link'], $groupid, $vbulletin->db->escape_string($vbulletin->GPC['title'])))


8) dbtech/downloads_pro/hooks/dbtech_downloads_post_init.php line 18:
Code:
$notif = 'URL="http://' [COLOR="#FF0000"]. $vbulletin->options['bburl'] . '/' [/COLOR]. $vbulletin->options['dbtech_downloads_link'] . '.php?do=download&fileid=' . intval($groupid) . '"]' . $title . '[/URL]';


9) dbtech/downloads_pro/hooks/dbtech_downloads_module_download_preoutput.php line 17:
Code:
header('Location: ' [COLOR="#FF0000"]. $this->registry->options['bburl'] . '/' [/COLOR]. $vbulletin->options['dbtech_downloads_link'] . '.php?do=password&fileid=' . $group['groupid']);


10) dbtech/downloads_pro/modules/uploadmodule.php line 34:
Code:
$downloadurl    = [COLOR="#FF0000"]$this->registry->options['bburl'] . '/' . [/COLOR]$this->registry->options['dbtech_downloads_link'] . '.php?do=download&fileid=' . $this->groupid;


I've been testing for a couple days now and haven't come across any issues yet. Only thing I really couldn't test was integration with vbShout, since I don't use it.

So it looks like adding some "if conditions" at these ten places, along with the making sure there is a directory change to pick up global.php in vbdownloads.php (as referenced in the first post above) should give users a working mod outside of the forum directory.

I'll let you know if I cross any more issues, but so far so good.
 
Status
Not open for further replies.

Similar threads

Legacy vBDownloads

vBulletin 3.8.x vBulletin 4.x.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
1,714
Customer rating
0.00 star(s) 0 ratings
Top