News:

Join the Facebook Fan Page.

Main Menu

SMF like vb help!

Started by FaNtEcH, September 03, 2007, 05:34:42 AM

Previous topic - Next topic

FaNtEcH

Hello!
I just did some editing in a display.template to look like the display of vB. But, unfortunately, i am not getting what i want.
This topic is an example of what i have right now, but i want only the avatar on the extreme left. Then, i want the username and the ranks and their images to the right of the avatar.
And the gender to be on the extreme right with the location etc...
Can anyone help me with this?
I would've switched to vB, but i like other stuff of SMF way better. And vB is expensive!

Minare

Is this what u want ?

Example display :

http://www.smfciyiz.biz/index.php?topic=3216.msg20801;topicseen#msg20801

This is a smf turkish support site, there is also english support.If this is what u want. Maybe u better register and request them to give you the way to do it.


FaNtEcH

Yes..this is exactly what i want! If you know Turkish, could you please them for their display.template copy?? I'll just use that to re-do mine!
Thnks for the quick reply!

Minare

First of all I should ask for permission, if they approve, why not, I will share here.


FaNtEcH

Thanks! Please try to do it asap!
I am in real need of it!

Minare

Admin's just come, that s why I had to wait, I have now requested it for you and waiting for the reply

FaNtEcH

Ok, i am waiting for reply too!

greyknight17

fantech: Attach your display.template.php code here. It should just require a few tweaks to get it to the proper areas. I will take a look at it and make the adjustments.

FaNtEcH

Hey!
Thanks..could you do it fast, it's getting late here and i wanna get it done before tomorrow? Thanks
and i am using Vb green theme so i would like it to match that theme.
The display.template is attatched.

greyknight17

Are the code changes you made included in that template you attached?

FaNtEcH

no..This is the original file.

greyknight17

Include the code change you made into the template and re-attach it. Give us a few lines in your next post also.

FaNtEcH

ok.. But, i didn't do that on this theme. I did it on dilber mc. Attatched.
here's some of the code:


// Show the topic information - icon, subject, etc.
echo '
<table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder" style="border-bottom: 0;">
<tr class="titlebg">
<td valign="middle" align="left" width="15%" style="padding-left: 6px;">
<img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" alt="" align="middle" /> ', $txt[29], '
</td>
<td valign="middle" align="left" width="85%" style="padding-left: 6px;">
', $txt[118], ': ', $context['subject'], ' &nbsp;(', $txt[641], ' ', $context['num_views'], ' ', $txt[642], ')
</td>
</tr>
</table>';

if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
echo '
<form action="', $scripturl, '?action=quickmod2;topic=', $context['current_topic'], '.', $context['start'], '" method="post" style="margin: 0;">';

// ------------------------------------------------------------------------------------[mod]
// Get all the messages...
while ($message = $context['get_message']())
{
echo '
<br/><table cellpadding="0" cellspacing="0" border="0" width="100%" class="bordercolor">';

echo '
<tr><td style="padding: 1px 1px 0 1px;">';

// Show the message anchor and a "new" anchor if this message is new.
if ($message['id'] != $context['first_message'])
echo '
<a name="msg', $message['id'], '"></a>', $message['first_new'] ? '<a name="new"></a>' : '';


// ------------------------------------------------------------------------------------[mod]
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="tborder" >
<tr>
<td align="left" class="catbg" width="100%">

<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td width="50%" align="left"><a href="', $message['href'], '"><img src="', $settings['images_url'], '/post/' . $message['icon'] . '.gif" alt="" border="0" /></a>&nbsp;<a href="', $message['href'], '">', $message['subject'], '</a>
    </td>
    <td width="50%" align="right"><span class="smalltext">&#171; <b>', !empty($message['counter']) ? $txt[146] . ' #' . $message['counter'] : '', ' ', $txt[30], ':</b> ', $message['time'], ' &#187;</span>
    </td>
  </tr>
</table>

    </td>
</tr>
</table>

<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr><td class="', $message['alternate'] == 0 ? 'windowbg' : 'windowbg2', '">';


// ------------------------------------------------------------------------------------[mod]
// Show information about the poster of this message.
echo '
<table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;">
<tr>
<td valign="top" width="100%" bgcolor="#000000" style="overflow: hidden;">
            <table border="0" cellpadding="0" cellspacing="0" class="bordercolor" width="100%"><tr>
            <td valign="top" width="30%" style="overflow: hidden;">';

// Show online and offline buttons?
if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
echo '
', $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'] ? '' : '', '';

echo '
<b>', $message['member']['link'], '</b><br />
<span class="smalltext">';

// Show the member's primary group (like 'Administrator') if they have one.
if (isset($message['member']['group']) && $message['member']['group'] != '')
echo '
', $message['member']['group'], '<br />';

// Don't show these things for guests.
if (!$message['member']['is_guest'])
{
if ($message['member']['post_group'] != '')
echo '
', $message['member']['post_group'], '<br />';
echo '
', $message['member']['group_stars'], '<br />';

// Show avatars, images, etc.?
if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']))
echo '
<div style="overflow: auto; width: 100%;">', $message['member']['avatar']['image'], '</div>';

// Show the member's gender icon?
if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '')
echo '
', $txt[231], ': ', $message['member']['gender']['image'], '';


// ------------------------------------------------------------------------------------[mod]
echo '
            <td valign="top" align="center" width="40%" style="overflow: hidden;">';
// Show the member's custom title, if they have one.
if (isset($message['member']['title']) && $message['member']['title'] != '')
echo '
', $message['member']['title'], '<br /><br />';

// Show their personal text?
if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
', $message['member']['blurb'], '<br />
<br />';


// ------------------------------------------------------------------------------------[mod]
echo '
    </td>
    <td valign="top" align="right" width="30%" style="overflow: hidden;">';

// Show how many posts they have made.
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />';

echo '
           ', $message['member']['registered'], '<br />';

// Is karma display enabled?  Total or +/-?
if ($modSettings['karmaMode'] == '1')
echo '

', $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '<br />';
elseif ($modSettings['karmaMode'] == '2')
echo '

', $modSettings['karmaLabel'], ' +', $message['member']['karma']['good'], '/-', $message['member']['karma']['bad'], '<br />';

// Is this user allowed to modify this member's karma?
if ($message['member']['karma']['allow'])
echo '
<a href="', $scripturl, '?action=modifykarma;sa=applaud;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.' . $context['start'], ';m=', $message['id'], '">', $modSettings['karmaApplaudLabel'], '</a>
<a href="', $scripturl, '?action=modifykarma;sa=smite;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';m=', $message['id'], '">', $modSettings['karmaSmiteLabel'], '</a><br />';

// This shows the popular messaging icons.
echo '
', $message['member']['icq']['link'], '
', $message['member']['msn']['link'], '
', $message['member']['aim']['link'], '
', $message['member']['yim']['link'], '';

// Show the profile, website, email address, and personal message buttons.
if ($settings['show_profile_buttons'])
{
// Don't show the profile button if you're not allowed to view the profile.
if ($message['member']['can_view_profile'])
echo '
<a href="', $message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.gif" alt="' . $txt[27] . '" title="' . $txt[27] . '" border="0" />' : $txt[27]), '</a>';

// Don't show an icon if they haven't specified a website.
if ($message['member']['website']['url'] != '')
echo '
<a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/www_sm.gif" alt="' . $txt[515] . '" border="0" />' : $txt[515]), '</a>';

// Don't show the email address if they want it hidden.
if (empty($message['member']['hide_email']) || $context['allow_hide_email'] != 1)
echo '
<a href="mailto:', $message['member']['email'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt[69] . '" title="' . $txt[69] . '" border="0" />' : $txt[69]), '</a>';

// Since we know this person is a guest, you *can* message them.
if ($context['can_send_pm'])
echo '
<a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['label'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . '.gif" alt="' . $message['member']['online']['label'] . '" border="0" />' : $message['member']['online']['label'], '</a>';
}
}
// Otherwise, show the guest's email.
else
echo '
<br />
<br />
<a href="mailto:', $message['member']['email'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt[69] . '" title="' . $txt[69] . '" border="0" />' : $txt[69]), '</a>';


// ------------------------------------------------------------------------------------[mod]
// Done with the information about the poster... on to the post itself.
echo '
    </td></tr></table>
   
</span>
</td>

             </tr>

<td valign="top" width="85%" height="100%">
<table width="100%" border="0"><tr>
<td align="left" valign="middle"></td>
<td align="left" valign="middle"></td>
<td align="right" valign="bottom" height="20" nowrap="nowrap" style="font-size: smaller;">';

// Can they reply?  Have they turned on quick reply?
if ($context['can_reply'] && !empty($options['display_quick_reply']))
echo '
<a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '" onclick="if (!currentSwap) doQuote(', $message['id'], '); else window.location.href = this.href; return false;">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/quote.gif" alt="' . $txt[145] . '" border="0" />' : $txt[145]), '</a>';
// So... quick reply is off, but they *can* reply?
elseif ($context['can_reply'])
echo '
<a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/quote.gif" alt="' . $txt[145] . '" border="0" />' : $txt[145]), '</a>';

// Can the user modify the contents of this post?
if ($message['can_modify'])
echo '
<a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/modify.gif" alt="' . $txt[66] . '" border="0" />' : $txt[17]), '</a>';

// How about... even... remove it entirely?!
if ($message['can_remove'])
echo '
<a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt[154], '?\');">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/delete.gif" alt="' . $txt[121] . '" border="0" />' : $txt[31]), '</a>';

// What about splitting it off the rest of the topic?
if ($context['can_split'])
echo '
<a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/split.gif" alt="' . $txt['smf251'] . '" border="0" />' : $txt['smf251']), '</a>';

// Show a checkbox for quick moderation?
if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove'])
echo '
<input type="checkbox" name="msgs[]" value="', $message['id'], '" class="check" />';

// Show the post itself, finally!
echo '
</td>
</tr></table>
<div style="overflow: auto; width: 100%;">', $message['body'], '</div>
</td>
</tr>';

// Now for the attachments, signature, ip logged, etc...
echo '
<tr>
<td valign="bottom" class="smalltext" width="85%">
<table width="100%" border="0" style="table-layout: fixed;"><tr>
<td align="left" colspan="2" class="smalltext" width="100%">';

// Assuming there are attachments...
if (!empty($message['attachment']))
{
echo '
<hr width="100%" size="1" class="hrcolor" />
<div style="overflow: auto; width: 100%;">';

foreach ($message['attachment'] as $attachment)
{
if (isset($attachment['image']))
echo '
', $attachment['image'], '<br />';
echo '
<a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a> (', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['width'] . 'x' . $attachment['height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br />';
}

echo '
</div>';
}

echo '
</td>
</tr><tr>
<td align="left" valign="bottom" class="smalltext">
' . ($settings['show_modify'] && !empty($message['modified']['name']) ? '&#171; <i>' . $txt[211] . ': ' . $message['modified']['time'] . ' ' . $txt[525] . ' ' . $message['modified']['name'] . '</i> &#187;' : '') . '
</td>
<td align="right" valign="bottom" class="smalltext">
', ($context['can_report_moderator'] ? '<a href="' . $scripturl . '?action=reporttm;topic=' . $context['current_topic'] . '.' . $message['counter'] . ';msg=' . $message['id'] . '">' . $txt['rtm1'] . '</a>&nbsp;&nbsp;' : ''), '
', ($context['user']['is_admin'] && !empty($message['member']['ip']) ? '<a href="' . $scripturl . '?action=trackip;searchip=' . $message['member']['ip'] . '"><img src="' . $settings['images_url'] . '/ip.gif" alt="" border="0" /> ' . $message['member']['ip'] . '</a>' : '<img src="' . $settings['images_url'] . '/ip.gif" alt="" border="0" /> ' . $txt[511]), '
</td>
</tr></table>';

// ------------------------------------------------------------------------------------[mod]
echo '
</td>
</tr>
</table>
</td></tr>
</table>
</td></tr>

<tr><td style="padding: 0 0 1px 0;"></td></tr>
</table>';

After this, the signature code starts.
and thanks for taking time!

greyknight17

Are you able to apply those changes to the Display.template.php file for the VB Green theme also? I thought this could be just a quick edit, but if you can't apply the same code changes to that theme, ask this question in the VB Green Theme topic.

FaNtEcH

I used the attatched display.template(in my previous post) and uploaded it to VB green theme. That worked fine, so you could even edit that! I'll just use that display.template.

jerm

Everything working properly now?

Advertisement: