News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Box around avatar

Started by Digit8, November 05, 2004, 11:28:55 AM

Previous topic - Next topic

Digit8

Hi,

How would you put a box around the avatar and online info, to make it look more separated from the post?

A.M.A

in Display.template.php look for:

<div style="overflow: auto; width: 100%;">', $message['member']['avatar']['image'], '</div><br />';
replace with:
<table border="1" cellpadding="0" cellspacing="0" width="100%"><tr><td width="100%"><div style="overflow: auto; width: 100%;">', $message['member']['avatar']['image'], '</div></td></tr></table><br />';

', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $message['member']['online']['image_href'] . '" alt="' . $message['member']['online']['text'] . '" border="0" align="middle" />' : $message['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $message['member']['online']['text'] . '</span>' : '', '<br /><br />';
replace with:
<table border="1" cellpadding="0" cellspacing="0" width="100%"><tr><td width="100%">', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $message['member']['online']['image_href'] . '" alt="' . $message['member']['online']['text'] . '" border="0" align="middle" />' : $message['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $message['member']['online']['text'] . '</span>' : '', '</td></tr></table><br /><br />';

What I did is simply surrounding them with a table .. you could try doing it with CSS but do not think it will fit right.
Really sorry .. real life is demanding my full attention .. will be back soon hopefully :)

Lum-chan

Well, I gave this a try but it gives me a parse error as soon as I paste the 2nd part. The first part works...
I'm using SMF 1.0 RC2

Lum-chan


A.M.A

Are you sure that you copied it exactly! I doubled check and it is working without any errors.
Really sorry .. real life is demanding my full attention .. will be back soon hopefully :)

Lum-chan

#4
Erm yes. I tried twice. ???  Can it be because I use the default theme? Just switched to smfCurve (Great theme by the way) but haven't tried it on this new theme.

I give it another try and will report here again.

[update]

I tried again and it gave me this error:

Template Parse Error!
There was a problem loading the /Themes/default/Display.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.


When I access the file directly I get this:

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /data/members/paid/l/u/lum-chan.com/htdocs/forum/Themes/default/Display.template.php on line 317


Dunno what's going wrong. As I'm not very familair with coding php, I don't know what went wrong  ???

I used the provided code you provided with copy & paste by selecting the whole line from start to end.

Any suggestions?

If you need to see this file, I'll be more than happy to attach it here.

Lum-chan


A.M.A

Yes .. please PM a link or e-mail me your Display.template.php with the changes you have made.
Really sorry .. real life is demanding my full attention .. will be back soon hopefully :)

Digit8

Quote from: A.M.A on November 05, 2004, 01:02:01 PM
in Display.template.php look for:

<div style="overflow: auto; width: 100%;">', $message['member']['avatar']['image'], '</div><br />';
replace with:
<table border="1" cellpadding="0" cellspacing="0" width="100%"><tr><td width="100%"><div style="overflow: auto; width: 100%;">', $message['member']['avatar']['image'], '</div></td></tr></table><br />';

', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $message['member']['online']['image_href'] . '" alt="' . $message['member']['online']['text'] . '" border="0" align="middle" />' : $message['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $message['member']['online']['text'] . '</span>' : '', '<br /><br />';
replace with:
<table border="1" cellpadding="0" cellspacing="0" width="100%"><tr><td width="100%">', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $message['member']['online']['image_href'] . '" alt="' . $message['member']['online']['text'] . '" border="0" align="middle" />' : $message['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $message['member']['online']['text'] . '</span>' : '', '</td></tr></table><br /><br />';

What I did is simply surrounding them with a table .. you could try doing it with CSS but do not think it will fit right.

Thanks  :)

admactanium

hello, i followed these instructions and they seem to create a behavior different than i was expecting. from what i read in the original post i assumed he requested a vertical line that separates the name, avatar and title from the message itself. when i followed these instructions it seemed to draw a border around the avatar and nothing else. it seems the desired behavior, at least from me, is simliar to the vbulletin style where the user info is in a separate but adjacent box than the message.

A.M.A

please check his last post directly above yours.
Really sorry .. real life is demanding my full attention .. will be back soon hopefully :)

admactanium

okay, i retried this coding change. again, it's giving me a behavior that i wasn't expecting. perhaps that's what the original poster was asking for. i'll just post pictures since i'm finding it hard to explain myself.

here's what my board looked like before the mod:



here's what it looks like after the code changes in this thread (at least how it's working for me):



but here's what I would like it to look like (via photoshop):



am i doint something weird or is that what the after picture what the original poster was asking for?

Jerry

try looking for:
<table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;">
<tr>
<td valign="top" width="16%" rowspan="2" style="overflow: hidden;">
<b>', $message['member']['link'], '</b>


and replace with
<table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;">
<tr>
<td valign="top" width="16%" rowspan="2" style="border-right: 1px solid #000; overflow: hidden;">
<b>', $message['member']['link'], '</b>


change border-right: 1px solid #000; the #000 part to the color you would like :)


- Jerry
Find me on:
Facebook
Twitter
PlanetSMF

"If all you look for is the negative in things, you will never see the positive."

admactanium


A.M.A

well .. a box is four lines after all :) .. glad you have found what you are looking for thanks to Jerry.
Really sorry .. real life is demanding my full attention .. will be back soon hopefully :)

admactanium

thanks for your help ama. i'm sure i was just being obtuse in my explanation. :D

Advertisement: