Status
Not open for further replies.

Webbstre

Customer
Hi Dylan! It's been a while since we talked about it, but I realized I never made a formal request for this tiny feature alone. My request is simple: whenever you make a new file upload and have the option turned on to create a comments thread, I'd like a link to that comment thread to automatically appear somewhere - either in the description or in the information area for the file. Hopefully this wouldn't be too hard to manage, because I'm getting the feeling that I'm really, totally, finally, actually, going to be putting my vbDownloads on my live site in the next two months (current estimate for when the next game we support comes out). DownloadsII's Create File Thread (or whatever it was called) does this, and it seems like kind of a necessity since you already have forum thread creation enabled.

Thanks!
 
Upvote 0
This suggestion has been closed. Votes are no longer accepted.
It's going to be a little while before we update downloads again. If you just want something like a link to the thread under the file info or something I can work it out and give you directions on what to modify.
 
Yeah, I'd appreciate directions on how to manage there. There are a couple other things I'm trying to make happen too, that you might be able to help with. Would you prefer to keep it right here or go to e-mail?
 
In here is best, in case anyone else runs into the same thing, don't have to duplicate instructions. I'll work on the instructions for the thread link
 
Ok, and just so you know, this is what I'm trying to do within the next month or so:

1- Get the automatic thread linking set up.
2- Make it so the search option spits out a page instead of a one-click-then-disappears-pop-out.
3- Change the sub-category listing layout so that it can spit out basically tiled squares with the name and icon (no descriptions) instead of a vertically generated list. The list gets too long when you have a lot of categories.

Number 3 can be ignored for the time being if it's not easy, but numbers 1 and 2 are pretty important to me if it's possible. :RpS_thumbup:
 
First thing you need to do is create a field to store the thread id
in phpmyadmin or the acp if you have access to run sql queries run the following

PHP:
ALTER TABLE `dbtech_downloads_filegroup` ADD `threadid` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `mirrors`;

If you have a table prefix you need to modify it for that. So if you have a prefix of vb_ it would be
PHP:
ALTER TABLE `vb_dbtech_downloads_filegroup` ADD `threadid` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `mirrors`;

Then you need to update the code when it creates the thread to update the download record

Open
dbtech/downloads/modules/uploadModule.php
At about line 342 you will find
PHP:
                        $this->post_new_thread();
                    }
                }
            }
Replace it with
PHP:
                        $threadid = $this->post_new_thread();
                    }
                }
            }
            
            if (is_numeric($threadid))
            {
                $this->registry->db->query_write("
                    UPDATE " . TABLE_PREFIX ."dbtech_downloads_filegroup
                    SET 
                        threadid     = " . intval($threadid) . " 
                    WHERE groupid = " . intval($this->groupid)
                );
            }

Next we need to create the link for downloads that have a thread id

Open
dbtech/downloads/actions/download.php

Find
PHP:
    $vbulletin->options['allowbbimagecode'] = $bbimgcodeval;
replace with

PHP:
    $vbulletin->options['allowbbimagecode'] = $bbimgcodeval;

    if ($fileinfo['threadid'] > 0)
    {
        $thread_title = $db->query_first("
            SELECT 
                title
            FROM " . TABLE_PREFIX . "thread 
            WHERE 
                threadid = " . intval($fileinfo['threadid'])
        );

        $fileinfo['threadlink'] = '<a href="' . fetch_seo_url('thread', $fileinfo) . '">' .$thread_title['title'] . '</a>';

    }

Lastly, we need to add the code to the template to display it


ACP->Styles & Templates->Style Manager
Edit templates for your styles that you want to display the link
Open template dbtech_downloads_download

Find
PHP:
                                    <li class="downloads-fileinfo-item""><span class="downloads-fileinfo-item-subject">{vb:rawphrase dbtech_downloads_downloads}</span> <span style="float: right;">{vb:var file.downloads}</span></li>
Replace with
PHP:
                                    <li class="downloads-fileinfo-item""><span class="downloads-fileinfo-item-subject">{vb:rawphrase dbtech_downloads_downloads}</span> <span style="float: right;">{vb:var file.downloads}</span></li>

                                    <vb:if condition="$file[threadlink]">
                                    <li class="downloads-fileinfo-item""><span class="downloads-fileinfo-item-subject">Discussion Thread</span> <span style="float: right;">{vb:raw file.threadlink}</span></li>
                                    </vb:if>

That should display the link under the downloads total
threadlink.webp

Let me know if you have any problems with that
 
Thanks, I'll test it out tomorrow when I get home from work!

As for the tiled sub-category listings, I've actually figured out how to do that via template edits, and I'll share the templates here once I get them finalized.

As for the search thing, at the very least is there a way to keep the display results showing, and just have the links click open into a new tab? I'll try things on my own to find another solution, if you can't think of anything.
 
Status
Not open for further replies.

Similar threads

  • Locked
  • thread_type.dbtech_ecommerce_suggestion thread_type.dbtech_ecommerce_suggestion
Replies
16
Views
2K
  • Locked
  • thread_type.dbtech_ecommerce_suggestion thread_type.dbtech_ecommerce_suggestion
Replies
0
Views
487
  • Locked
  • thread_type.dbtech_ecommerce_suggestion thread_type.dbtech_ecommerce_suggestion
Replies
56
Views
5K
  • Locked
  • thread_type.dbtech_ecommerce_suggestion thread_type.dbtech_ecommerce_suggestion
Replies
1
Views
664
  • Locked
  • thread_type.dbtech_ecommerce_suggestion thread_type.dbtech_ecommerce_suggestion
Replies
3
Views
1K

Legacy vBDownloads

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