View Full Version : [Release] Attached Image will be small..
This modication to the postbit_attachment template will make your image attachment smaller, so it doesn't mess op the forumlook, after clicking it will apear bigger.
__________________________________________________ _
Open your adminCP and scroll down to Templates > Edit > Expand > Postbit Templates > Postbit_attachmentimage
Replace the whole code with:
<!--<p>--><smallfont>$post[username] has attached this image:<br>
<a href="attachment.php?=$session[sessionhash]&postid=$post[postid]" target="_blank"><img src="attachment.php?s=$session[sessionhash]&postid=$post[postid]" border="0" alt="" width="200" vspace="8" hspace="4"></a>
</smallfont><!--</p>-->
__________________________________________________ __
In this example the width of an attached image is 200, edit it the way you would like to have it ;x
For this modification, in your adminCP goto:
Options > Attachments:
Preview images in thread; this MUST be on!!
Here's a screenshot, enjoy ;p
Dean C
05-07-2003, 03:54 PM
flup this was released [url=https://vborg.vbsupport.ru/showthread.php?s=&threadid=52344] here and you even posted in the thread :S?
- miSt
This is a VBcode
Mine is a template mod ;x
gmarik
05-18-2003, 03:17 PM
This is not serious.
wyzzor
05-18-2003, 08:43 PM
thx
Boofo
05-18-2003, 08:49 PM
flup, go ahead and attach a smilie and see what it does. ;)
filburt1
05-18-2003, 08:53 PM
Precisely; it will fail for small images.
Boofo
05-18-2003, 08:57 PM
Is there a way to have the image stay the same size on up until a set size and it will automatically go into a link instead of being viewed?
bit of a stupid mod indeed, forgot to look @ small images :)
chrisvonc
07-13-2003, 01:36 PM
Installed all good on my test forum. Works nice! Does exactly what I want since most of my users with be using the "attach" option for their pictures rather than the vbcode.
Thanks!
Chris
chrisvonc
07-13-2003, 10:08 PM
I just tried the smaller image test and now I also would be interested if there is a way to get it to ignore the pictures up to the size you set. I really know nothing about coding so I can only sit here and wish I could contribute. LOL
Thanks,
Chris
There's a way with php functions, i'll try to make another version soon :)
The code wud become:
<?php
$size = getimagesize("attachment.php?s=$session[sessionhash]&postid=$post[postid]");
if ($size[1]>200) {
<a href="attachment.php?s=$session[sessionhash]&postid=$post[postid]" target="_blank"><img src="attachment.php?s=$session[sessionhash]&postid=$post[postid]" width="200" border="0" alt="" vspace="8" hspace="4"></a>
}
elseif ($size[1]=200) {
<img src="attachment.php?s=$session[sessionhash]&postid=$post[postid]" border="0" alt="" vspace="8" hspace="4">
}
else {
<img src="attachment.php?s=$session[sessionhash]&postid=$post[postid]" border="0" alt="" vspace="8" hspace="4">
}
?>
Such thing should work, but i dunno were to put it...
chrisvonc
10-22-2003, 12:03 AM
Dont know if you are still checking in with this thread but I have installed the vB Attachments - Including Multiple Attachements hack (https://vborg.vbsupport.ru/showthread.php?t=52294&page=1&pp=15&highlight=vb3+images).
The problem is that with that hack I have to modify the postbit_attachment template with that hacks code and the 2 dont play well. Not knowing too much at what I am looking at to figure out what is wrong, I can get it to a point where it still thumbnails the pictures, and lets me do the multiple attachments, but all the links to the larger picture all point back to the 1st picture in the post.
Any ideas?
Here is the code I have mashed together so far:
*******
<p><smallfont>$post[username] has attached this image:<br>
<a href="attachment.php?=$session[sessionhash]&postid=$post[postid]" target="_blank">
<img src="attachment.php?s=$session[sessionhash]&attachmentid=$value[attachmentid]" border="0" alt="" width="150" vspace="8" hspace="4">
</smallfont></p>
*******
Thanks in advance. I will also post in the vB3 Attachment thread to see if I get any input from that author.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.