Nhận giải đáp mọi thắc mắc về SMF (Simple Machine Forum)

Started by saos@ngmo, 14/09/07, 13:16

Previous topic - Next topic

saos@ngmo

Nhận giải đáp mọi thắc mắc về SMF (Simple Machine Forum)
Thể theo yêu cầu của chú nauda qua Yahoo, hỏi về việc enable chức năng trả lời nhanh. Mình đáp ứng yêu cầu này qua diễn đàn để có ai quan tâm thì lấy topic này làm chỗ để hỏi đáp theo dạng tip and trick

Hỏi: Làm thế nào để bật chức năng trả lời nhanh khi xem 1 chủ đề
Trả lời: Có 2 cách
Cách 1: Bảo các thành viên vào phần Hồ sơ của họ và sửa tham số, như sau:
- Chọn Hồ sơ, chọn chức năng Giao diện và các yếu tố (của các bạn có thể sẽ khác vì đây là vấn đề chuyển ngữ tiếng Việt, nhưng ở hTy, nó là chức năng đứng thứ ba từ trên xuống dưới trong mục Sửa đổi hồ sơ)
- Tìm tới giá trị Sử dụng chức năng trả lời nhanh trong các chủ đề: và chọn Hiển thị: Bật bởi mặc định
- Lưu lại
- Xong

Cách 2: Bật chức năng Trả lời nhanh cho mọi thành viên của diễn đàn qua admin panel, như sau:
- Vào  admin, chọn mục Theme and Layout (ở phía dưới cái Configuration)
- Chọn tiếp Layout and Options
- Chọn Reset Options
--> Sẽ có những theme của bạn đang dùng cho diễn đàn, bạn cần quan tâm tới tức năng Reset all member's current options for this theme tương ứng với theme mà bạn đang dùng làm theme mặc định cho diễn đàn. <-- Chọn cái chức năng Reset all member's current options for this theme
- Chọn  Sử dụng chức năng trả lời nhanh trong các chủ đề: --> Chọn Change từ drop list --> Chọn Hiển thị: Bật bởi mặc định
(xem thêm hình dưới)


Lưu lại các thay đổi
Xong

saos@ngmo

anhlt
QuoteBác cho em hỏi: Làm thế nào để đưa cái Lastes Post/Recent Post của SMF lên trên đầu thê, em làm chỉ được ở dưới. Bác chỉ giáo em với nhé!!

saos@ngmo

Chúc cần nói là chú dùng template nào anh mới hướng dẫn được, nó liên quan tới code của file Board.template.php thuộc thư mục theme chú đang sử dụng.
Cần sửa file đó, nhưng mỗi theme viết mỗi khác.

anhlt

À!! Em đang dùng của thằng ApolloBB bác ạ.

http://www.thecongfc.vno.vn/forum

Và cũng thông báo với bác, kể từ ngày dc bác trợ giúp homepage và forum của em đang trên đà fát triển. Chân thành cảm ơn bác

saos@ngmo

Chúc mừng chú
Đợi anh tí, đang down cái theme đó về để xem phải customize cái gì!

saos@ngmo

okie, mở file BoardIndex.template.php ra và xoá toàn bộ từ dòng 269 tới dòng 316
dòng 269 có chữ 
// This is the "Recent Posts" bar
dòng 316 có chữ

}


Sau đó mở file index.template.php và tìm tới dòng 457, phía dưới dòng đó (tức dòng 458 có chữ sau
// The main content should go here.
Và thêm vào đoạn mã sau:


// This is the "Recent Posts" bar.saosangmo hacked
if (!empty($settings['number_recent_posts']))
{
echo '<table>
<tr>
<td class="titlebg" colspan="2">', $txt[214], '</td>
</tr>
<tr>
<td class="windowbg" width="20" valign="middle" align="center">
<a href="', $scripturl, '?action=recent"><img src="', $settings['images_url'], '/post/xx.gif" alt="', $txt[214], '" /></a>
</td>
<td class="windowbg2">';

// Only show one post.
if ($settings['number_recent_posts'] == 1)
{
// latest_post has link, href, time, subject, short_subject (shortened with...), and topic. (its id.)
echo '
<b><a href="', $scripturl, '?action=recent">', $txt[214], '</a></b>
<div class="smalltext">
', $txt[234], ' &quot;', $context['latest_post']['link'], '&quot; ', $txt[235], ' (', $context['latest_post']['time'], ')<br />
</div>';
}
// Show lots of posts.
elseif (!empty($context['latest_posts']))
{
echo '
<table cellpadding="0" cellspacing="0" width="100%">';

/* Each post in latest_posts has:
board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
subject, short_subject (shortened with...), time, link, and href. */
foreach ($context['latest_posts'] as $post)
echo '
<tr>
<td class="windowbg" valign="middle" width="40%" style="padding-left: 10px; font-size:85%">', $post['link'], '</td>
<td class="windowbg" valign="middle" width="15%" style="padding-left: 10px; font-size:85%" nowrap="nowrap">', $post['poster']['link'], '</td>
<td class="windowbg" valign="middle" width="25%" style="padding-left: 10px; font-size:85%" nowrap="nowrap">', $post['board']['link'], '</td>
<td class="windowbg" valign="middle" width="20%" style="padding-left: 10px; font-size:85%" nowrap="nowrap">', $post['time'], '</td>

</tr>';
echo '
</table>';
}
echo '
</td>
</tr></table>';
}

// End the "Recent Posts" bar. saosangmo hacked



Done, have fun!

anhlt

Bác sao xem lại hộ em cái. template trong file index.template.php không có đoạn // The main content should go here.

saos@ngmo


saos@ngmo

okie man, thêm đoạn code vào phía trên của dòng 499
   //Below the menu ads

nội dung cần thêm ở đây


// Start "Recent Posts" bar - hacked by saosangmo.
if (!empty($settings['number_recent_posts']))
{
echo '<div class="tborder><table width="100%">
<tr>
<td class="titlebg" colspan="2">', $txt[214], '</td>
</tr>
<tr>
<td class="windowbg" width="20" valign="middle" align="center">
<a href="', $scripturl, '?action=recent"><img src="', $settings['images_url'], '/post/xx.gif" alt="', $txt[214], '" /></a>
</td>
<td class="windowbg2">';

// Only show one post.
if ($settings['number_recent_posts'] == 1)
{
// latest_post has link, href, time, subject, short_subject (shortened with...), and topic. (its id.)
echo '
<strong><a href="', $scripturl, '?action=recent">', $txt[214], '</a></strong>
<div class="smalltext">
', $txt[234], ' &quot;', $context['latest_post']['link'], '&quot; ', $txt[235], ' (', $context['latest_post']['time'], ')<br />
</div>';
}
// Show lots of posts.
elseif (!empty($context['latest_posts']))
{
echo '
<table cellpadding="0" cellspacing="0" width="100%">';

/* Each post in latest_posts has:
board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
subject, short_subject (shortened with...), time, link, and href. */
foreach ($context['latest_posts'] as $post)
echo '
<tr>
<td class="windowbg" valign="middle" width="40%" style="padding-left: 10px; font-size:85%">', $post['link'], '</td>
<td class="windowbg" valign="middle" width="15%" style="padding-left: 10px; font-size:85%" nowrap="nowrap">', $post['poster']['link'], '</td>
<td class="windowbg" valign="middle" width="25%" style="padding-left: 10px; font-size:85%" nowrap="nowrap">', $post['board']['link'], '</td>
<td class="windowbg" valign="middle" width="20%" style="padding-left: 10px; font-size:85%" nowrap="nowrap">', $post['time'], '</td>

</tr>';
echo '
</table>';
}
echo '
</td>
</tr></table></div>';
}
// End "Recent Posts" bar - hacked by saosangmo


saos@ngmo


SEO ngành nghề, cỏ nhân tạo, chuyên sửa máy rửa bát tại hà nội, tình yêu độ xe Mercedes, chuyên sửa chữa tivi tại nhà ở Hà Nội, đặt hàng tượng phật đồ thờ tâm linh làng nghề Sơn Đồng | Điện lạnh Bách Khoa Hà Nội