Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
[attachment]id[/attachment] BBcode Details »
[attachment]id[/attachment] BBcode
Mod Version: 1.00, by Benjy (Member) Benjy is offline
Developer Last Online: Nov 2010 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.0.3 Rating: (1 vote - 5.00 average) Installs: 8
Released: 19 Aug 2004 Last Update: Never Downloads: 11
Not Supported Template Edits Code Changes Additional Files Re-usable Code Translations  

What it does
This hack is a "clone" of the IPB [attachmentid=xxx] BBcode feature. It allows you to insert anywhere in your posts a link to an attachment, using its ID (therefore making it an inline attachment). It also detects the file type and shows either the thumbnail (with a link to the full image), the full image or a text link.
If the attachment doesn't exist or has been moderated, nothing will be shown.
By the way, maybe this should be a VB feature?


What is required
- 1 PHP file edit ("includes/functions_showthread.php")
- 1 CSS style edit
- 1 image upload ("images/misc/inlineattach.gif")


What can be done
- hide the [attachment] BBcode in the search results page
- handle (hide?) the [attachment] BBcode in the printable version
- handle (hide?) the [attachment] BBcode in the archive


Notes
- This hack will add 1 query per attachment BBcode, and the usual amount of queries for the "attachment.php" file call in case of a thumbnail or an inline image.
- The "howto.txt" is provided because it includes the indented code that VB loses with PHP and CODE tags.
- The PSD of the image is provided for personal editing.
- The french version of the image is provided (don't forget to rename it).
- This is my first released hack, so please be cool


Support
I may not be able to provide support for this hack.


Howto (also provided in "howto.txt")
1. Open "includes/functions_showthread.php".

2. Go to (around line 604):
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Add below:
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

3. Go to (at the end of the file):
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Add below:
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

4. Save and upload "includes/functions_showthread.php".

5. Upload "inlineattach.gif" in "images/misc/".

6. Edit your style(s) Main CSS, and add this to your additional CSS (bottom of the page):
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

(NB: #336699 is the background color of "inlineattach.gif")


Usage
[attachment]id[/attachment]


Demo
Have a look at the attached screenshots.

Download Now

Only licensed members can download files, Click Here for more information.

Screenshots

Click image for larger version

Name:	screenshot_1.gif
Views:	489
Size:	29.1 KB
ID:	20274   Click image for larger version

Name:	screenshot_2.gif
Views:	617
Size:	26.0 KB
ID:	20275  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Comments
  #2  
Old 19 Aug 2004, 16:42
Polo's Avatar
Polo Polo is offline
 
Join Date: Jun 2004
Nice, will install

Thanks for sharing with the community

*clicks install*
__________________
God180 <--------------------- My Modified vBulletin
Reply With Quote
  #3  
Old 19 Aug 2004, 16:56
AN-net's Avatar
AN-net AN-net is offline
 
Join Date: Dec 2003
very interesting
Reply With Quote
  #4  
Old 19 Aug 2004, 19:14
ranger2kxlt ranger2kxlt is offline
 
Join Date: Jan 2003
Real name: Justin
I like the concept, just afraid my members wouldn't know how to find the ID #....Would there be a way to make a list of the last 15-20 images uploaded with there ID's? Maybe in a pop-up window in the post screen?
Reply With Quote
  #5  
Old 20 Aug 2004, 03:08
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Real name: Joe Velez
good job Benjy

I like the concept, just afraid my members wouldn't know how to find the ID #....Would there be a way to make a list of the last 15-20 images uploaded with there ID's? Maybe in a pop-up window in the post screen?
I have a similar BBCODE hack already at http://www.gthelp.com but, it's only for images. (no query).

ranger2kxlt,
To display attachment ID add code into newattachmentbit template (I can't remember if I edited any files to make the below code work):

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

To display the above in newpost_attachmentbit you will need to hack your files.
Attached Images
File Type: png attachm.png (6.0 KB, 108 views)
__________________
Former vBulletin.org Staff Member

Latest Articles:
Liquid Layout = Less Ad Revenue?
How to Monetize Your Site
Improve Web Page Performance
How To Write For The Web


If it needs instructions, there's room for improvement.
Give users what they actually want, not what they say they want. And whatever you do, don't give them new features just because your competitors have them!

Last edited by Princeton; 20 Aug 2004 at 03:15.
Reply With Quote
  #6  
Old 21 Aug 2004, 16:20
MrNase's Avatar
MrNase MrNase is offline
 
Join Date: May 2003
Real name: Dominik
very nice, I'll make some changes (recent uploads or stuff like that) and use it on my forums. Thank you
Reply With Quote
  #7  
Old 24 Sep 2004, 22:23
Johnny's Avatar
Johnny Johnny is offline
 
Join Date: Jun 2002
is their anyway to have it so the attachment box on the postbit doesnt display when using the bbcode.
Reply With Quote
  #8  
Old 05 Oct 2004, 08:57
Benjy's Avatar
Benjy Benjy is offline
 
Join Date: Nov 2001
This would require to detect the attachment's original postid and tweak a bit more the construct_postbit function...
A very quick solution would be to set $show['attachments'] to false, thus forcing people to add the BBcode into their post. Of course that doesn't work with older posts because it will hide the attachments...
Maybe someone could propose another solution because I don't really have time to get into this for now
__________________
Communauté informatique
Reply With Quote
  #9  
Old 16 May 2005, 10:52
kmike kmike is offline
 
Join Date: Oct 2002
I wonder if anyone is really using it? Nice hack, but I found a bug where this new bbcode is only being parsed on the 1st post view. Because of this bug, parsed presentation isn't saved to post_parsed table, and consequent views of post will show unparsed [attachment]...[/attachment] code.

The solution is to move line starting with
$post['message'] = preg_replace_callback(...
ABOVE the line starting with
$post['message'] = parse_bbcode($post...
in an original code.

The effect is that attachment bbcode will be parsed before all other bbcodes, and parsed post presentation will be stored correctly afterwards by parse_bbcode() function.

UPDATE: did some testing, the above won't work either. All parsing should be done in parse_bbcode2() from functions_bbcodeparse.php. I was able to fix this, if anyone interested, I can release the necessary updates here.

Last edited by kmike; 16 May 2005 at 11:24.
Reply With Quote
  #10  
Old 16 May 2005, 17:47
YLP1 YLP1 is offline
 
Join Date: Aug 2004
I have been looking for a way to control how the attachements show in a post...this looks promising.

I have a question on the upload attachments feature with this mod.

This mod looks like the poster must have the url to the attachment and put that url between the attachment bbcode.

Is there a way to use insert the attachment bbcode then click where you want the attachment to be then upload?

Or after the attachment has been uploaded, is there a way to drag that graphic or file or ??? in between the attachment bbcode??

I see this option frequently with other boards (without the use of the bbcode) but I do not know PHP so don't know if this is possible.
Reply With Quote
  #11  
Old 16 May 2005, 17:52
YLP1 YLP1 is offline
 
Join Date: Aug 2004
Originally Posted by kmike
I wonder if anyone is really using it? Nice hack, but I found a bug where this new bbcode is only being parsed on the 1st post view. Because of this bug, parsed presentation isn't saved to post_parsed table, and consequent views of post will show unparsed [attachment]...[/attachment] code.

The solution is to move line starting with
$post['message'] = preg_replace_callback(...
ABOVE the line starting with
$post['message'] = parse_bbcode($post...
in an original code.

The effect is that attachment bbcode will be parsed before all other bbcodes, and parsed post presentation will be stored correctly afterwards by parse_bbcode() function.

UPDATE: did some testing, the above won't work either. All parsing should be done in parse_bbcode2() from functions_bbcodeparse.php. I was able to fix this, if anyone interested, I can release the necessary updates here.
I would like to give this hack a whirl with your fix.
Reply With Quote
  #12  
Old 25 Jun 2005, 14:57
artonex's Avatar
artonex artonex is offline
 
Join Date: Mar 2005
has anyone made any updates to this?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 22:30.

Layout Options | Width: Wide Color: