Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Attached images elsewhere within the post Details »»
Attached images elsewhere within the post
Version: 1.00, by Admin (Coder) Admin is offline
Developer Last Online: Nov 2024 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 07-09-2002 Last Update: Never Installs: 14
 
No support by the author.

This is a very basic hack but pretty cool I think...
Anyway, it lets you place your attachments elsewhere in the post, i.e not at the bottom.
All you need to do is place [attachment] where you want it to show up, and voila.

Of course this mainly makes sense if you have view images turned on for attachments, so attached images show up inline.
It will also look best if you edit the "postbit_attachmentimage" template and remove the whole "$post[username] has attached this image:" part.

Anyway, installation is really easy, just one file edit. In functions.php, add this code:
Code:
	$attachpos = strpos($post['message'], '[attachment]');
	if ($attachpos !== false) {
		$post['message'] = substr($post['message'], 0, $attachpos) . $post['attachment'] . substr($post['message'], $attachpos + strlen('[attachment]'));
		$post['attachment'] = '';
	}
Right before this:
Code:
	//highlight words for search engine
	if (isset($highlight) && $highlight != '') {
A screen shot is attached...

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 07-10-2002, 07:29 PM
VeRT3X's Avatar
VeRT3X VeRT3X is offline
 
Join Date: Apr 2002
Location: Some City/ ON / ++>__CANADA
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

perfect, thanks alot Chen = ]
Reply With Quote
  #3  
Old 07-10-2002, 07:41 PM
Itworx4me's Avatar
Itworx4me Itworx4me is offline
 
Join Date: Feb 2002
Posts: 210
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Squirrel Mall
Webmall for nuts
Reply With Quote
  #4  
Old 07-10-2002, 09:00 PM
Vivi Ornitier's Avatar
Vivi Ornitier Vivi Ornitier is offline
 
Join Date: Nov 2001
Location: Black Mage Village
Posts: 442
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

gangsta hack man.
Reply With Quote
  #5  
Old 07-10-2002, 09:07 PM
Floris Floris is offline
 
Join Date: Jan 2002
Posts: 1,898
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

great hack, and so easy!
Reply With Quote
  #6  
Old 07-11-2002, 12:02 AM
ehjay's Avatar
ehjay ehjay is offline
 
Join Date: Nov 2001
Location: chicago
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

so Chen, are your test posts always full of "assdas"?
Reply With Quote
  #7  
Old 07-11-2002, 03:20 AM
plcguru plcguru is offline
 
Join Date: Mar 2002
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,
Didn't seem to work for me :disappointed:
I have 2.23 and found the code in fuctions.php
Added the recommended code after it.

posted a test post
like:

some text here.
[attachment]
some text below

attached a gif.

The post looked like:

some text here.
[attachment]
some text below

image down here as usual


Does it work with 2.2.3 and I've done something wrong? (of course, images are turned on as I see the image in the normal place below the text)
I really want to install this as it's a great feature to have.
Thanks!
Phil
Reply With Quote
  #8  
Old 07-11-2002, 04:33 AM
Neo's Avatar
Neo Neo is offline
 
Join Date: Oct 2001
Location: Anywhere
Posts: 1,817
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice Chen.
Reply With Quote
  #9  
Old 07-11-2002, 04:59 AM
RDX1 RDX1 is offline
 
Join Date: Apr 2002
Posts: 497
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what if you use the muti attach hack? one of my boards i run uses it - friend made it though..
Reply With Quote
  #10  
Old 07-11-2002, 06:14 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

plcguru: You might be running a very old version of PHP.

Try replacing this:
Code:
	if ($attachpos !== false) {
With this:
Code:
	if (is_integer($attachpos)) {
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 03:50 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04704 seconds
  • Memory Usage 2,288KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete