The Arcive of vBulletin Modifications Site. |
|
Attached images elsewhere within the post Details »»
|
|||||||||||||||||||||||||||
|
Attached images elsewhere within the post
Developer Last Online: Oct 2026
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'] = '';
}
Code:
//highlight words for search engine
if (isset($highlight) && $highlight != '') {
Show Your Support
|
|||||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
perfect, thanks alot Chen = ]
|
|
#3
|
||||
|
||||
|
Squirrel Mall
Webmall for nuts
|
|
#4
|
||||
|
||||
|
gangsta hack man.
|
|
#5
|
|||
|
|||
|
great hack, and so easy!
|
|
#6
|
||||
|
||||
|
so Chen, are your test posts always full of "assdas"?
|
|
#7
|
|||
|
|||
|
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 |
|
#8
|
||||
|
||||
|
Nice Chen.
|
|
#9
|
|||
|
|||
|
what if you use the muti attach hack? one of my boards i run uses it - friend made it though..
|
|
#10
|
||||
|
||||
|
plcguru: You might be running a very old version of PHP.
Try replacing this: Code:
if ($attachpos !== false) {
Code:
if (is_integer($attachpos)) {
|
![]() |
|
|