![]() |
[Solved] Image-attachment from another post
Hello!
On our forum image-attachment (when quoted) or used in another posts instead of showing as image showed as link "Attachment 422". You can see: Сообщение от Yana Посмотреть сообщение Я вот на какой агрегат наткнулась в Sur La Table Вложение 422 <<<--- Wanted Image и такие пельменницы)) Вложение 423 <<<--- Wanted Image Please give me advice how can I show attachment as image in any posts ? AFAIK it's needed to customize source code. Thank you for advance |
Corrected original post - not only quoted attachment.
I'm talking about using attachments in any posts. |
This hack will show linked attachments as inline images.
You will need to edit the /includes/class_bbcode.php file. Find this comment: "Display the attachment with no link to bigger image" change the variable just below the comment: $attachment['filename'] to $attachmentid Find this comment: Belongs to another post so we know nothing about it ... comment out the two lines of code: Code:
$addtarget = (empty($this->attachments["$attachmentid"]) OR $attachment['newwindow']) ? 'target="_blank"' : ''; Code:
$replace[] = "<a href=\"{$this->registry->options['bburl']}/attachment.php?{$this->registry->session->vars['sessionurl']}attachmentid=\\1" . (!empty($attachment['dateline']) ? "&d=$attachment[dateline]" : "") . "\" $addtarget>$vbphrase[attachment] \\1</a>"; Then add this block of code just bellow the last comment out line: Code:
$replace[] = "<img src=\"{$this->registry->options['bburl']}/attachment.php?{$this->registry->session->vars['sessionurl']}attachmentid=\\1&d=$attachment[dateline]\" border=\"0\" alt=\"" |
Andy, thank you very much.
It works! |
All times are GMT. The time now is 01:34 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|