vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Attachment Browser (https://vborg.vbsupport.ru/showthread.php?t=103519)

El_Muerte 12-21-2005 10:00 PM

Attachment Browser
 
This plugin adds an attachment browser to selected forums. The attachment browsers shows all the thumbnails of attached images in all posts in the current from.

Installation
Install the product xml and edit the FORUMDISPLAY template. Add the following code whereever you like:
Code:

<if condition="$show['attachments']">
$attachmentbrowser
</if>

I put it above the thread list.

In order to enable the thumbnail browser for a forum you will have to set "Show attachment browser" to yes in the forum manager (AdminCP).

System changes
This plugin adds two templates:

attbrs_attachment : the main block of the attachment browser
attbrs_attachment_bit : the thumbnail part for each attachment

and two phrases:

ab_image_larger_version_x_y_z : a copy of 'image_larger_version_x_y_z', the original was not available in the scope it was needed
ab_title : the title used in the browser

It also modifies the forum table, it will add a new field called 'gallery'. The field is created during installation and removed on uninstall.

This plugin has one setting in it's own category which controls the maximum number of thumbnails to show per page.

Live demo
http://el-muerte.student.utwente.nl/...splay.php?f=23

Change log
Changes since v1.0.1:
  • Fixed table prefix
  • Added new option 'enable pager'. Width this you can disable the pager which can be a performance hit on large forums.
  • Added new option 'Browser width'. Which will set the fallback browser width to use for MSIE. MSIE doesn't properly size the scrollable area in the default template, this is a dirty workaround.

Changes since v1.1.0:
  • Templates are now grouped
  • Installer is a bit more safe (e.g. no serious error when the table already has a `gallery` field)
  • Attachment browser is now collapsable
  • Thread title can be trimmed to a certain length

Changes since v1.2.0:
  • Browser is not shown when the user has to permissions to view attachments

El_Muerte 12-22-2005 12:55 PM

Doh, forgot to properly link the username, it's fixed now in 1.0.1

The Chief 12-22-2005 02:03 PM

lookin good, though I don't need ;)

El_Muerte 12-22-2005 02:48 PM

Ok, there's a little issue with MSIE, as usual it doesn't handle dimensions correctly. So there's no scrollbar, instead it's displayed in full, streching the page a lot.

A quick fix is to edit the 'attbrs_attachment' template and change the div in the 2nd row to:
Code:

<div style="overflow: auto; width: auto !important; width: 800px; margin: auto;">
This will give the browser a fixed width of 800px in MSIE only.

Wachtmeister 12-22-2005 04:53 PM

Really very interesting. I'll wait until the MSIE thing is "fixed" ;) Really a very good idea!

klaush 12-22-2005 05:18 PM

Thanks, but:

Table 'xxxx.attachment' doesn't exist

Looking for the correct Prefix? Where to change it?

El_Muerte 12-22-2005 07:09 PM

Quote:

Originally Posted by klaush
Thanks, but:

Table 'xxxx.attachment' doesn't exist

Looking for the correct Prefix? Where to change it?

oh crap, completely forgot about table prefixes

Chris M 12-22-2005 07:35 PM

Looks rather interesting :)

Chris

silurius 12-22-2005 09:47 PM

Nice one, El_Muerte! Can't wait to install.

*Clicks install and awaits final version*

cbr929rrerion 12-23-2005 12:50 AM

OK.. I have to admit but can you or someone make it do thumbnails that are like 150 X 150 or so.. I have my thumbs set large so it dont work too well, is there a way to add a way to set thumb size ?

If we can get the images smaller I will enable it in a heartbeat...

El_Muerte 12-23-2005 05:35 AM

Quote:

Originally Posted by cbr929rrerion
OK.. I have to admit but can you or someone make it do thumbnails that are like 150 X 150 or so.. I have my thumbs set large so it dont work too well, is there a way to add a way to set thumb size ?

If we can get the images smaller I will enable it in a heartbeat...

afaik there is no nice way to scale thumbnails, or at least not widthout a lot of extra processing. But you could force dimensions by editing the 'attbrs_attachment_bit' template and add `height="100"` to the img tag, or something like that.

Wachtmeister 12-23-2005 10:54 AM

Can this add on also be shown only in seperate threads or categories?

I have a huge Avatar and Smiley compilation and would love to have this one only on those threads or forums.

Before i import the product, i ask ;)

Thanks, Wachtmeister

silurius 12-23-2005 06:20 PM

How should I edit the product to address the dupe column name?

Code:

Database error in vBulletin 3.5.2:

Invalid SQL:
ALTER TABLE forum ADD gallery SMALLINT(6) DEFAULT '0' NOT NULL;

MySQL Error  : Duplicate column name 'gallery'
Error Number : 1060
Date        : Friday, December 23rd 2005 @ 12:16:57 PM
Script      : http://www.examplesite.com/forum/admincp/plugin.php
Referrer    : http://www.examplesite.com/forum/admincp/plugin.php?do=productadd
IP Address  : 71.131.12.1
Username    :
Classname    : vb_database

Never mind I got it. Changed "gallery" to "atb_gallery" in plugin.

cbr929rrerion 12-24-2005 02:57 AM

Quote:

Originally Posted by El_Muerte
afaik there is no nice way to scale thumbnails, or at least not widthout a lot of extra processing. But you could force dimensions by editing the 'attbrs_attachment_bit' template and add `height="100"` to the img tag, or something like that.

I did that and added my theme to it and a scroll style.. looks sweet.. My members love it..

tamborinegal 12-24-2005 05:25 AM

Wow El_Muerte, this looks really neat. I'm too busy with Christmas stuff to install it now but I'll be coming back to look at this again for sure.

Thanks

Clancy

cbr929rrerion 12-26-2005 12:46 PM

on all the attachements on my board there is the thumb and the attachment.. could you not have it putt the thumb for the image?if so where would you change that one part?

El_Muerte 12-27-2005 11:39 AM

It does use the thumb, and the thumb only. Attachments without a thumbnail are not displayed.

cbr929rrerion 12-30-2005 03:18 PM

oh.. ok.. question... can we set the the default to be yes in show attachement browser? I have lots of forums and its a job going in and setting them all to yes..

Any way to make the xml default to yes not no?

YLP1 12-30-2005 04:28 PM

I installed as per instructions but nothing shows on my forumdisplay page. I aslo cannot find the two templates that were supposed to be added. I am fairly new to all of this so any help is very greatly appreciated.

Edited to add: I took a peek at the manage products in admincp for this modificiation and this is what the install code says:

Quote:

$res = $db->query("DESCRIBE " . TABLE_PREFIX . "forum gallery");
if ($colinfo = $db->fetch_array($res))
{
if (!preg_match("#int\(#", $colinfo["Type"]))
{
print_dots_stop();
print_cp_message('Unable to install this plugin because the forum table is not compatible. (column gallery has an invalid type.)');
}
}
else {
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "forum ADD gallery SMALLINT(6) DEFAULT '0' NOT NULL");
}
Is this why the templates were not added and how do I fix this?

Thanks in advance, again.

El_Muerte 12-30-2005 07:00 PM

Quote:

Originally Posted by cbr929rrerion
oh.. ok.. question... can we set the the default to be yes in show attachement browser? I have lots of forums and its a job going in and setting them all to yes..

Any way to make the xml default to yes not no?

Yes, in the ALTER TABLE db query just change the "DEFAULT '0'" to "DEFAULT '1'"

Quote:

Originally Posted by YLP1
I installed as per instructions but nothing shows on my forumdisplay page. I aslo cannot find the two templates that were supposed to be added. I am fairly new to all of this so any help is very greatly appreciated.

The templates are grouped in the group "Attachment Browser".

cbr929rrerion 12-30-2005 09:25 PM

ok.. I changed this
Code:

$db->query_write("ALTER TABLE " . TABLE_PREFIX . "forum ADD gallery SMALLINT(6) DEFAULT '1' NOT NULL");
and reinstalled the xml, still says no..

Did I change the wrong thing or what do I need to do?

El_Muerte 12-31-2005 08:36 AM

you need to uninstall and then reinstall, during upgrading the uninstall code isn't executed.

or you could simple execute a db query setting all values of gallery to 1, e.g.

update forum set gallery = 1;

cbr929rrerion 12-31-2005 04:25 PM

Quote:

Originally Posted by El_Muerte
you need to uninstall and then reinstall, during upgrading the uninstall code isn't executed.

or you could simple execute a db query setting all values of gallery to 1, e.g.

update forum set gallery = 1;


Thank you, I did the db query and it took less than the blink of an eye to do all 178 ..

That was so helpful.. BTW.. my members love your work, I appreciate it.

Mastar 12-31-2005 08:20 PM

I can't get it to show on my forum. I had Gallery installed but I saw the conflick, now I deleted Gallery and still doesn't show. Help!!

cbr929rrerion 01-10-2006 04:21 PM

I have a question, it works perfectly except 1 thing..

If your not a registered user, it shows everything except where the pics are its just the blank image place holder. Any way to make a default gif to put there or just not show it at all if not registered?

It looks terriable to non-members..

El_Muerte 01-10-2006 06:05 PM

uhm.. do you have a restriction on viewing images on your forum?

Club3G 01-10-2006 06:16 PM

[high]* Club3G clicks install
[/high]

Couple of quick questions:

Is there a way to get it to span the same width as the forum tables? The fixed width looks a little off at higher resolutions.

Also, a non-fixed height would be awesome. The horizontal scrollbar is great, but the vertical just looks ugly.

Screenshot:

http://www.club3g.com/members/chris/attachplugin.jpg

Great mod otherwise, thank you! :D

cbr929rrerion 01-10-2006 07:14 PM

of course I do, only members can see images...

I dont want non-members to be able to view images.

So is there a way to make it load a non-member gif that I can make or just not show up at all to non members? I would prefer the image of my choice in its place, maybe an if statement or something?

cbr929rrerion 01-11-2006 02:26 AM

anyone know how to add an if statement to have it show a predetermind image to non-members?

El_Muerte 01-11-2006 05:08 PM

Quote:

Originally Posted by Club3G
[high]* Club3G clicks install
[/high]

Couple of quick questions:

Is there a way to get it to span the same width as the forum tables? The fixed width looks a little off at higher resolutions.

Also, a non-fixed height would be awesome. The horizontal scrollbar is great, but the vertical just looks ugly.

Screenshot:

http://www.club3g.com/members/chris/attachplugin.jpg

Great mod otherwise, thank you! :D

Only MSIE has a fixed width, the reason for this is because MSIE is broken and doesn't properly size the table cell. So unless you can find a way to make MSIE behave properly it can't be fixed.

Quote:

Originally Posted by cbr929rrerion
anyone know how to add an if statement to have it show a predetermind image to non-members?

PHP Code:

<if condition="$bbuserinfo['userid'] == 0">
// ...
</if> 

(not tested)

cbr929rrerion 01-13-2006 07:19 PM

Quote:

Originally Posted by El_Muerte
Only MSIE has a fixed width, the reason for this is because MSIE is broken and doesn't properly size the table cell. So unless you can find a way to make MSIE behave properly it can't be fixed.



PHP Code:

<if condition="$bbuserinfo['userid'] == 0">
// ...
</if> 

(not tested)


Nope.. Dont work...

Club3G 01-14-2006 04:46 PM

Working fine in IE for me (aside from the spanning issue), however the thumbs aren't showing up in Mozilla.

Edit: 'Doh, wasn't logged in. :D

cbr929rrerion 01-14-2006 09:22 PM

Yeah.. looks like crap with missing images if your a non-member..

Is there any way to limit it to the last 5 attachements..

I am going to disable this until someone can find a way to either 1) apply a default image for non-members to see or 2) hide it completely to non-members. Sorry but it just looks like crap to non-members and looks like its broke..

Club3G 01-14-2006 11:08 PM

Unstalling as well unfortunately. The MSIE bug, plus the fact that the vertical scrollbar looks rediculous, along with what cbr929 mentioned about the non-members getting an ugly blurb of text outweigh the cool factor of it.

cbr929rrerion 01-15-2006 03:16 PM

I really like this and I really want to use it, I found out how to limit it to show just 5 latest attachements and all that but the non-member still can only see an ungly missing image and it looks broken.

Can some one please write something that if they are not a registerd member or if the user group is not, #,#,#, then it will display an image such as nonmember.gif

El_Muerte 01-16-2006 06:35 PM

Version 1.2.1 should hide the attachment browser when the user has no permission to view attachments in the selected forum. E.g. the same check as the attachment code uses.

El_Muerte 01-16-2006 06:37 PM

Quote:

Originally Posted by Club3G
Unstalling as well unfortunately. The MSIE bug, plus the fact that the vertical scrollbar looks rediculous

You can always change the template so it looks different.

cbr929rrerion 01-16-2006 08:11 PM

Did the update.. works flawless..

Thank you.. The only thing I would change for a future upgrade is have it show a default gif, that way they know they are missing out on images unless they join.. help to entice membership...

Thanks for this much tho..

LBmtb 01-24-2006 04:45 AM

Any way to make it display attachments from sub-forums?

bashy 02-05-2006 03:07 PM

This i would like to see in the next update

Quote:

Originally Posted by LBmtb
Any way to make it display attachments from sub-forums?


Also when i selct a page no. manualy i get nothing, as good as a blank page.
If i click my nice prev or next buttons then all is well!!

Any thoughts?


All times are GMT. The time now is 05:49 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.01386 seconds
  • Memory Usage 1,839KB
  • 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
  • (4)bbcode_code_printable
  • (2)bbcode_php_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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