วันจันทร์ที่ 25 มิถุนายน พ.ศ. 2555

[SMF] เพิ่มพื้นที่กระทู้กว้างขึ้น ด้วยการดึงข้อมูลผู้ตั้ง/ผู้ตอบกระทู้ไว้ด้านบน

บอร์ดเกี่ยวกับการถ่ายรูป ส่วนใหญ่ต้องการโชว์ภาพใหญ่ๆ ดังนั้น จึงอยากจะเอาข้อมูลของคนตอบหรือคนตั้งกระทู้จากเดิมอยู่ด้านซ้าย 
อยากย้ายไปด้านบนซะ ..ทำยังไงดี?


วันนี้ผมมีวิธีครับ
เปิดไฟล์ Themes/yourthemes/Display.template.php

ค้นหาคำสั่งนี้  // Show information about the poster of this message. เจอแล้วอย่าพึ่งทำอะไร
หาคำสั่งนี้ต่อเลย  // Show the post itself, finally!

ให้ลบคำสั่งตั้งแต่  // Show information about the poster of this message.  ลงมาจนถึง   // Show the post itself, finally! เลยครับ
แล้วเพิ่มคำสั่งนี้ไปแทนที่



    // Show information about the poster of this message.
echo '
<table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;">
<tr>
<td bgcolor="#444">';


    // Show avatars, images, etc.?
if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
echo '
        <div class="profileINFO">', $message['member']['avatar']['image'],'<br>';
       
       
                // Show their personal text?
if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
        ', $message['member']['blurb'], '<br />
        <br />';

// This shows the popular messaging icons.
echo '
        ', $message['member']['icq']['link'], '
        ', $message['member']['msn']['link'], '
        ', $message['member']['aim']['link'], '
        ', $message['member']['yim']['link'], '<br />';
       
            // 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']))
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 isn't 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>';
       
       
}
       
        echo '</div> ';

echo '<div style="float:left;padding: 5px; 10px">';

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

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

// 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'])
{
// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')
echo '
        ', $message['member']['post_group'], '<br />';
echo '
        ', $message['member']['group_stars'], '<br />';

// Is karma display enabled?  Total or +/-?
if ($modSettings['karmaMode'] == '1')
echo '
        <br />
        ', $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '<br />';
elseif ($modSettings['karmaMode'] == '2')
echo '
        <br />
        ', $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'], ';sesc=', $context['session_id'], '">', $modSettings['karmaApplaudLabel'], '</a>
        <a href="', $scripturl, '?action=modifykarma;sa=smite;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';m=', $message['id'], ';sesc=', $context['session_id'], '">', $modSettings['karmaSmiteLabel'], '</a><br />';

// 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" style="margin-top: 2px;" />' : $message['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $message['member']['online']['text'] . '</span>' : '', '<br /><br />';

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

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

}
// Otherwise, show the guest's email.
elseif (empty($message['member']['hide_email']))
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>';

// Done with the information about the poster... on to the post itself.
echo '
    </div>
</td>
</tr>



<tr>
<td valign="top" width="100%" height="100%">
    <table width="100%" border="0"><tr>
        <td valign="middle"><a href="', $message['href'], '"><img src="', $message['icon_url'] . '" alt="" border="0" /></a></td>
        <td valign="middle">
            <div style="font-weight: bold;" id="subject_', $message['id'], '">
                <a href="', $message['href'], '">', $message['subject'], '</a>
            </div>';

// If this is the first post, (#0) just say when it was posted - otherwise give the reply #.
echo '
            <div class="smalltext">« <b>', !empty($message['counter']) ? $txt[146] . ' #' . $message['counter'] : '', ' ', $txt[30], ':</b> ', $message['time'], ' »</div></td>
        <td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" height="20" 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'], ';num_replies=', $context['num_replies'], ';sesc=', $context['session_id'], '" onclick="doQuote(', $message['id'], ', \'', $context['session_id'], '\'); return false;">', $reply_button, '</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'], ';num_replies=', $context['num_replies'], ';sesc=', $context['session_id'], '">', $reply_button, '</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'], '">', $modify_button, '</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], '?\');">', $remove_button, '</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'], '">', $split_button, '</a>';

// Can do some Thank You Post things :)
if ($message['thank_you_post']['post'] && !$message['thank_you_post']['locked'])
echo '
<a href="', $scripturl, '?action=thankyou;topic=', $context['current_topic'], '.0;msg=', $message['id'], '">', $thankyoupostpost_button, '</a>';

if ($message['thank_you_post']['lock'] && $message['thank_you_post']['isThankYouPost'])
echo '
<a href="', $scripturl, '?action=thankyoupostlock;topic=', $context['current_topic'], '.0;msg=', $message['id'], '">', $message['thank_you_post']['locked'] ? $thankyoupostopen_button : $thankyoupostlock_button, '</a>';

if ($message['thank_you_post']['delete'] && $message['thank_you_post']['isThankYouPost'])
echo '
<a href="', $scripturl, '?action=thankyoupostdelete;topic=', $context['current_topic'], '.0;msg=', $message['id'], ';sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt['remove_thank_you_post'], '?\');">', $thankyoupostdelete_button, '</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" ', empty($settings['use_tabs']) ? 'onclick="document.getElementById(\'quickmodSubmit\').style.display = \'\';"' : '', ' />';

// Show the post itself, finally!



ที่เหลือก็ไปปรับแต่งให้สวยงามตามใจชอบนะครับ
พยายามจะอธิบายขั้นตอนการแต่งให้ละเอียด แต่กลัวอธิบายแล้วจะงงไปกันใหญ่
เลยเอาง่ายๆ งี้ละกันนะ :o

ไม่มีความคิดเห็น:

แสดงความคิดเห็น