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)
-   -   Attachment Browser (v2.1 beta testing) (https://vborg.vbsupport.ru/showthread.php?t=66800)

CarCdr 08-03-2004 10:52 PM

It doesn't matter where the attachments are stored.

Yes, you can limit access to the mod to certain user groups.

15,000 attachments... hmmm. Would you be willing to beta test the new release:
https://vborg.vbsupport.ru/showpost.php?p=539692

PM me an e-mail address and I will send you the new script.

Cheers

CarCdr 08-04-2004 10:54 AM

I would be interested to hear from folks who run with a large number of attachments (more than 2,000) to give me some feedback on timing. Please PM me if you are willing to test the new version. Thank you.

Changes queued-up for version 2.1
  1. New Query performance improved.
    Performance for sites with many attachments is significantly improved. The
    single most time consuming aspect of the script is the MySQL query for
    'COUNT(*)' to get the number of attachments matching the selection criteria
    and access permissions. By including only those JOIN's that are required,
    depending on the columns being accessed, the ORDER BY, and the WHERE clauses,
    we improve performance of both retrievals. There is still one case where
    the row retrieval could be slow: when the user requests that the output be
    sorted by forum title.
  2. New Added usergroup access checking.
    Two variables can be used to either (a) allow access to a set of usergroup
    or (b) disallow access for a set og usergroup id's. To set permissions,
    find the line containing "// Usergroup permissions:" and read the detailed
    instructions.
  3. New List attachments added since last visit.
    The new URL parameter "getnew=1" will list attachments added since your last
    visit. Examples for links you could set up:
    attachment_browser.php?getnew=1
    attachment_browser.php?getnew=1&sel_forumid=8,13
  4. New Added debugging setting for timing.
    Specify "debug_queries=1" in the URL to get timing information for the page.
  5. Change The default for the second-level sort is "none".
    This provides a small performance increase when the user does not want
    a second-level sort. Also, we changed the sorter not to try a second-level
    sort if the first-level sort is by attached time stamp.
  6. Fix Include forums that are not active.
    These are accessible if URL is know, so just make normal forum
    access checks.
----------------
ps: If the 'COUNT(*)' retrieval is just too slow to support sites with many thousands of attachments, then we will need an option to skip getting the count. Note that the query to get 'COUNT(*)' is not as simple as you might think. As a minimum (not incuding special search values from the Display Options form), it must deal with forum permissions, attachment 'visible', as well as check the post table for 'visible' and post deletions.

With such an option enabled, the page would not include the number of accessible/matching attachments and would not have normal page navigation. For the page navigation, since we do not know how many there are, the best we could do is support "Next Page" when we know that there is *at least one* more attachment not on the current page.

Smitty 08-19-2004 11:05 PM

I don't know what's happening with this, but I hope it continues. I just installed and it's very nice.

Question: I want the search box to be 'Open' by default. How can I do that?

CarCdr 08-28-2004 01:08 PM

Quote:

Originally Posted by Smitty
I don't know what's happening with this, but I hope it continues. I just installed and it's very nice.

Question: I want the search box to be 'Open' by default. How can I do that?

Thanks. I only noticed your post today. :o

Right, by default, the search form is displayed "collapsed" when the page is loaded. This would be a good option to have in the next release.

For now, what you can do is make two changes to the template 'attbro_FORM' (I did not test this).

Change this line:
<img id="collapseimg_attbro_disp_opts" src="$stylevar[imgdir_button]/collapse_thead_collapsed.gif" alt="" border="0" /></a>&nbsp;

to this:
<img id="collapseimg_attbro_disp_opts" src="$stylevar[imgdir_button]/collapse_thead.gif" alt="" border="0" /></a>&nbsp;

(removed the characters highlighted in red)

Then, a few lines down from that, change this line:
<tbody id="collapseobj_attbro_disp_opts" style="display:none; ">

to this:

<tbody id="collapseobj_attbro_disp_opts" style="">

Smitty 08-28-2004 02:08 PM

Thanks - I'll check it out tonight. It's not a REAL big issue, but you know how it goes. Some folks don't look so closely and miss the 'open' link (I renamed the phrase on mine to better point it out).

The biggest problem I have, actually, is checking things people upload for the file name. Many people upload stuff like 'document.doc' so the search feature has a limited function. However, I have gone in and renamed a lot of atttachments - I have to 'edit' the thread - download and rename the attachment, unattach the file in the post, and reupload the renamed file. And I watch to make sure new attachments have an appropriate name.

I rename threads a lot as well, but I do that mostly for search engines. I started doing that last December, along with some other SEO 'stuff' and my rankings, and traffic, have significantly improved.

CarCdr 08-28-2004 03:51 PM

Quote:

The biggest problem I have, actually, is checking things people upload for the file name. Many people upload stuff like 'document.doc' so the search feature has a limited function. However, I have gone in and renamed a lot of atttachments - I have to 'edit' the thread - download and rename the attachment, unattach the file in the post, and reupload the renamed file. And I watch to make sure new attachments have an appropriate name.
Yeah, I have had to do that a couple of times. I wonder how difficult it would be to add a "Rename" function to the browser for administrators? The attachment name is stored only in one place, so it should be very easy.

fiber1 09-19-2004 02:50 PM

Very nice hack, but I am confused how to get the file icons to show. If someone could help It would be apreciated.

Thanks CarCdr!

fiber

Natch 09-22-2004 12:24 AM

OK - I was researching why my board and a clients board would not show the attachment icons on the attachment listing display: and eventually found it.

This modification need only be applied by those who have altered their $stylevar[imgdir_attach] to a absolute path, this modification will need to be made.

In attachment_browser.php, Find:
Code:

function ICON_FILE_EXISTS($extension) {
        global $stylevar;
        static $attbro_icon_present;

        if (empty($attbro_icon_present["$extension"]))
                $attbro_icon_present["$extension"] = (file_exists("$stylevar[imgdir_attach]/$extension.gif"));

        return $attbro_icon_present["$extension"];
}

Replace with:
Code:

function ICON_FILE_EXISTS($extension) {
        global $stylevar;
        static $attbro_icon_present;

        if (empty($attbro_icon_present["$extension"]))
                $attbro_icon_present["$extension"] = (file_exists($_SERVER['DOCUMENT_ROOT']."$stylevar[imgdir_attach]/$extension.gif"));

        return $attbro_icon_present["$extension"];
}

HTH y'all...

CarCdr 09-22-2004 01:07 AM

Thanks Natch.

So, how do you suggest I conditionalize this so that no patch need be applied (i.e., in a future version of this hack).

What does your "$stylevar[imgdir_attach]" look like?

Natch 09-22-2004 01:15 AM

/forums/images/attach for my main style - but I think you will find that this folder will exist on all installations: the difficulty is determining the location of forumroot from $_SERVER['DOCUMENT_ROOT'] on all installs...


All times are GMT. The time now is 09:13 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.01133 seconds
  • Memory Usage 1,753KB
  • 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
  • (2)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