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 Descriptions (https://vborg.vbsupport.ru/showthread.php?t=80265)

akanevsky 04-19-2005 10:00 PM

Attachment Descriptions
 
/*================================================= =====================*\
|| Attachment Descriptions for vBulletin 3.0.7
|| Author : Psionic Vision
\*================================================ ======================*/

What is this:
It enchances attachment upload interface with a new 'attachment description' field :)

Features:
  • Conveniently enchances attachment upload screen with the description field (see screenshots)
  • Displays attachment descriptions in:
    Attachment Manager, Post Edit (newthread, newreply, editpost) and Attachment List (in posts)

Lizard King 04-20-2005 09:19 PM

Just a couple questions. Does this add another query also can you give a screenshot off thread with an attachment ?

akanevsky 04-20-2005 09:22 PM

No, it does not add any additional queries at all :)
Yes, I can post the screenshot. One second please...

EDIT: Screenshot has been added.

nexialys 04-20-2005 09:59 PM

?: does this work with multiple attachements popup?!...
(when you add the attachments)

akanevsky 04-20-2005 10:25 PM

It works perfectly with the standard vB3 attachment engine.

Lionel 04-21-2005 05:08 AM

Dark Visor you are the best. A thousand thank you. The vbulletin developper owe you one. For 2 or 3 years they have been trying to do that one. They even had the unused description field in attachment table. When I questioned them about it, no straight answer could be given.

I installed it, tested, edited deleted, changed attachment in same post, beat it up etc... that description behaved exactly like you said.

For months I have been trying to do this.

One thing, you might want to correct the "alter table add" statement since it is already there. I just replaced the existing varchar with TINYTEXT

For my need, I also placed it under thumbnail, not just the "alt".

Let me bother you with one question, if you are familiar with vbadvanced news.php module. How to display it in front page too?

shiva 04-21-2005 07:59 AM

Oh My. This could be real handy to say the least. Quick question.

Ability to have multiple fields? I have a lot of file uploads, would be nice to state the author, and a couple other fields.

Also, if there was one thing the attachment system needed, it's the ability to use a URL instead of uploading a file. I have ton's of files needed to be added on my server, and a very slow connection. If you can ever figure that out, many people would be very happy, as it's requested a lot.
Looks awesome.

Ghostsuit 04-21-2005 01:56 PM

Fantastic idea.

The Realist 04-21-2005 03:10 PM

Well done.

Ticked install :)

j_86 04-21-2005 05:15 PM

Incompatiable with the Geek Article System 3.5.0 I think, which makes use of the column "description" in the table attatchments.

Lionel 04-21-2005 05:17 PM

Quote:

Originally Posted by JimpsEd
Incompatiable with the Geek Article System 3.5.0 I think, which makes use of the column "description" in the table attatchments.

negative. I am using it there.

j_86 04-21-2005 05:24 PM

Both running together well?

Lionel 04-21-2005 05:26 PM

Quote:

Originally Posted by JimpsEd
Both running together well?

Geek placed it in template, but never used that column. He probably provisionned for later. I am going to let him know.

akanevsky 04-21-2005 05:54 PM

Quote:

They even had the unused description field in attachment table. When I questioned them about it, no straight answer could be given.
Are you sure about this? I didn't have that field prior to creating the hack.

Quote:

Let me bother you with one question, if you are familiar with vbadvanced news.php module. How to display it in front page too?
1. Add it into the template - sorry don't have it installed, cannot help you with this.
2. In news.php, find:

Code:

iif ($vba_options['portal_news_showattachments'], ', attachment.filename, attachment.filesize, attachment.visible,
replace with:

Code:

iif ($vba_options['portal_news_showattachments'], ', attachment.filename, attachment.filesize, attachment.visible, attachment.description,
3. Done.

Quote:

Ability to have multiple fields?
I assume it would be a good exercise for your finger muscles to manually type whatever you need, as it is not a lot at all.

Quote:

Also, if there was one thing the attachment system needed, it's the ability to use a URL
This does not have anything to do with the current hack, however, I will look into it.

Quote:

Geek placed it in template, but never used that column. He probably provisionned for later. I am going to let him know.
I appreciate that :)

Thanks everyone for positive comments :)

j_86 04-21-2005 06:08 PM

I have it installed, but getting this script error after uploading something:

Line: 337
Char: 273
Unterminated string constant

Line 337 is:
Code:

        attachlist.innerHTML = "<div style=\"margin:2px\"><img class=\"inlineimg\" src=\"images/attach/rtf.gif\" alt=\"magnetic field questions.rtf\" border=\"0\" /> <a href=\"attachment.php?attachmentid=5&amp;stc=1\" target=\"_blank\">magnetic field questions.rtf</a> (758.2 KB)
Any ideas?

j_86 04-21-2005 06:09 PM

Quote:

Originally Posted by Lionel
Geek placed it in template, but never used that column. He probably provisionned for later. I am going to let him know.

The coloumn 'description' already exists on my install, though. I have also seen it as part of the table-installer in GASinstall I think.

akanevsky 04-21-2005 06:12 PM

Make sure you did everything right. If you get outside the DIV, you get that error...

j_86 04-21-2005 06:27 PM

Ah, I always put a comment in templates when I use a hack that modifies them, such as;

<!-- attatch descript hack edit above -->

Don't know what template did not like this, but it was one. Removed all comments and working fine :)

Lionel 04-21-2005 06:29 PM

Quote:

Originally Posted by JimpsEd
The coloumn 'description' already exists on my install, though. I have also seen it as part of the table-installer in GASinstall I think.

yes you are right. He added that column, but never used it. I simply altered it from varchar to TINYTXT.

I told him about it so he should not be bothered working on it.

The Geek 04-21-2005 06:58 PM

The attachemnt description field in gas was provisioned for future release. If you have installed GAS 3.x than you will already have an description field in your attachment table. I hadnt yet put the UI in place for it (and now I dont! :) ). I pushed it into the first 3.0 release so I could import v3articles and keep their descrptions.

This hack should be totally compatible. You may get an error doing an alter table as the column already exists - but everything else should slot in nicely.

Good job - it is a seriously missing element of vB :)

xony 04-23-2005 02:53 PM

Quote:

Originally Posted by Lionel

For my need, I also placed it under thumbnail, not just the "alt".


Like put a the description under the image? please it is to me of much utility. Thanks.

akanevsky 04-24-2005 03:33 PM

UPDATED TO VERSION 1.01
Redo changes in newattachment.php

Ghostsuit 04-25-2005 11:53 PM

What was the change between 1.0 and 1.01?

akanevsky 04-26-2005 12:45 PM

Major one - a bug that prevented a _regular_ user to edit his descriptions.

Ghostsuit 04-26-2005 12:58 PM

Is it just a case of applying the file changes again?

akanevsky 04-26-2005 05:54 PM

Yeah. Just remove the old pieces of hack code, and add the new pieces instead.

Allan 05-02-2005 12:14 AM

Work with Geek's article hack ?, no prob ?

akanevsky 05-02-2005 09:26 AM

Yes.

Allan 05-02-2005 10:17 AM

Quote:

Originally Posted by Dark Visor
Yes.

oki, thanks :)

Samira 05-02-2005 06:41 PM

Quote:

Originally Posted by Lionel
For my need, I also placed it under thumbnail, not just the "alt".

Would you mind sharing the code you used for this? The only way I can seem to do it is to have attachments in a vertical line, rather than horizontal, which greatly slows scrolling.

Lionel 05-02-2005 07:33 PM

I simply placed this in postbit_attachmentthumbnail template
Quote:

<div align="left"> >$attachment[description]</div>

kmike 05-05-2005 09:05 AM

Small proposal: add another <if> to postbit_attachmentimage, to remove caption tooltip when description is empty.
Also, I added title parameter as it is more standards compliant than ALT (i.e. tooltip will work in Mozilla/Firefox, too).
Code:

###########################################################################################################################
# postbit_attachmentimage
###########################################################################################################################

---------------------------------------------------------------------------------------------------------------------------
FIND:
---------------------------------------------------------------------------------------------------------------------------

alt=""

---------------------------------------------------------------------------------------------------------------------------
REPLACE WITH:
---------------------------------------------------------------------------------------------------------------------------

alt="<if condition="!empty($attachment[description])">$vbphrase[attachdescription_caption] $attachment[description]" title="$vbphrase[attachdescription_caption] $attachment[description]</if>"


akanevsky 05-05-2005 08:55 PM

kmike,

I completely agree with you, thanks for sharing.
I will update the hack with your postbit_attachmentimage later on.

YLP1 05-06-2005 07:19 PM

Quote:

Originally Posted by Lionel
I simply placed this in postbit_attachmentthumbnail template

Where should this snippet of code go in this template? <div align="left"> >$attachment[description]</div>

I added a description to test it out on my forum and when I mouseover the graphic I get this:

Description: [ARG:4 Undefined]

Edited to add that I fixed the above..quite by accident LOL

Code:

In postbit_attachmentthumbnail my title part looks like this:
title="<phrase 1="$attachment[filename]" 2="$attachment[counter]" 3="$attachment[filesize]" 4="$attachment[description]">$vbphrase[image_larger_version_x_y_z]</phrase>" /></a>

But I still can't get the description to show under the thumbnail...

Any help is greatly appreciated.

akanevsky 05-06-2005 07:45 PM

It should be:
Code:

<div align="left">$attachment[description]</div>
instead of
Code:

<div align="left"> >$attachment[description]</div>

YLP1 05-06-2005 08:52 PM

Quote:

Originally Posted by Dark Visor
It should be:
Code:

<div align="left">$attachment[description]</div>
instead of
Code:

<div align="left"> >$attachment[description]</div>

Yep...I did change that but I still cannot get the description to appear under the thumbnail.

kmike 05-12-2005 11:06 AM

Quote:

Originally Posted by JimpsEd
I have it installed, but getting this script error after uploading something:

Line: 337
Char: 273
Unterminated string constant

Line 337 is:
Code:

        attachlist.innerHTML = "<div style=\"margin:2px\"><img class=\"inlineimg\" src=\"images/attach/rtf.gif\" alt=\"magnetic field questions.rtf\" border=\"0\" /> <a href=\"attachment.php?attachmentid=5&amp;stc=1\" target=\"_blank\">magnetic field questions.rtf</a> (758.2 KB)
Any ideas?

I got bitten by this, too. It appears IE doesn't like multi-line initializations in Javascript, so every multi-line descriptions will trigger this warning. Also you can 100% trigger this by placing unnecessary new line break in newpost_attachmentbit template.

I got it resolved by rolling back the change in newpost_attachmentbit template. I don't see why it is needed there at all.

akanevsky 05-12-2005 07:17 PM

I would suggest replacing your newpost_attachmentbit template and newpost_attachment templates to their vBulletin originals. Then this will work.

YLP1 05-12-2005 11:45 PM

Quote:

Originally Posted by Dark Visor
I would suggest replacing your newpost_attachmentbit template and newpost_attachment templates to their vBulletin originals. Then this will work.

I wasn't sure if this post was for me or the one just below mine...but I tried it anyway and I still cannot seem to place the caption of the attachment below the attachment.

Any ideas?

akanevsky 05-12-2005 11:56 PM

YLP1,

My post was addressed to kmike. About you, well you are placing the code in a wrong place... Place your code outside of the <img ...> tag. Right after it.


All times are GMT. The time now is 03:58 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.01529 seconds
  • Memory Usage 1,826KB
  • 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
  • (10)bbcode_code_printable
  • (17)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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