PDA

View Full Version : Attachment alignment, source hack needed


tfw2005
08-25-2004, 07:15 PM
Hey guys,

I am trying to find the code/template where the $attachment image string is created. Right now, whenever you call $attachment in the code, it creates a linked thumbnail (going to the larger image). However, this makes it so that if you call $attachment, you cannot insert it within an image tag, and therefore cannot align text next to it.

For example, if you did ...$attachment $ news.... it would put the news text info next to the image, but starting at the bottom of the image.

What I am looking for is a way to top left align all text next to attachment images and thumbnails automatically. If there is a code I can apply to $attachment via PHP that I do not know about, cool. Otherwise, whatever template or file that needs to be modded at the core so that the equivalent of

< a href=attachmentimagefull >< img src=attachmentthumbnail align=left></a> text text text......

can be outputted would be great. Ive tried looking in functions_images.php, functions_file.php, attachments.php, and global.php , but could find no HTML based output strings.

This is a mod for images in news on the main page.

Quick help would be greatly appreciated.

Brian
08-26-2004, 02:52 PM
The code for attachments is in your 'postbit_attachment' template.

Our Sponsors
 

tfw2005
08-27-2004, 04:00 PM
Thanks Brain,

That is exactly what I was looking for. Unfortunately when I added the align="left" code into (any) of the attachment bits, it did not do the trick.

If you, or anyone, knows how to get that to parse properly thru ADV, let me know. The table way of splitting the image and text next to each other sucks on condensed pages. Otherwise, this featue is perfect with some mods to the placement.

socals
08-27-2004, 08:55 PM
This ended up being easier than I thought.

I took the code used to display the avatar, and copied it to the area where it displayed the attachment. I also added another condition to the avatar check, to only display the avatar if there wasn't a news attachment. ( AND !$news['attachmentid']") Not sure if the !$.. is proper PHP for what I was trying to accomplish, but it works. I'm mainly a windows, vb, c++, asp programmer starting to learn PHP.

If you were using the 2 column image hack (which I started with), this was removed since I wanted the text to flow with the image just like it did with the avatar image.

Check out my website for an example of what it looks like.

www.globware.com

I also included my version of the adv_portal_newsbits template so you can see my exact code.

I attach the exact image I wanted to display in my news, so I also made this change:

-----------------
/modules/news.php
-----------------

Search for, and delete the following:

&amp;thumb=1


This will show the original image, and not the thumbnail.

Sorry I don't have individual template fixes, but I didn't anticipate on posting it ahead of time :)

Our Sponsors
 

tfw2005
09-13-2004, 07:29 AM
Thanks man, that is perfect. I know others were looking for this, you may want to post it over at vbulletin.org as well.

Again, THANKS!