4 มิ.ย. 2558

เพิ่มความยาวตัวอักษรของหัวข้อกระทู้ SMF 2.0

แก้ไขไฟล์ Post.template.php ที่อยู่ใน Themes/default/Post.template.php

// Now show the subject box for this post.
   echo '
      <dt>
         <span', isset($context['post_error']['no_subject']) ? ' class="error"' : '', ' id="caption_subject">', $txt['subject'], ':</span>
      </dt>
      <dd>
         <input type="text" name="subject"', $context['subject'] == '' ? '' : ' value="' . $context['subject'] . '"', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80" class="input_text" />
      </dd>
      <dt class="clear_left">
         ', $txt['message_icon'], ':
      </dt>
      <dd>


ลองแก้ maxlength จาก 80 เป็น 200

// Now show the subject box for this post.
   echo '
      <dt>
         <span', isset($context['post_error']['no_subject']) ? ' class="error"' : '', ' id="caption_subject">', $txt['subject'], ':</span>
      </dt>
      <dd>
         <input type="text" name="subject"', $context['subject'] == '' ? '' : ' value="' . $context['subject'] . '"', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="200" class="input_text" />
      </dd>
      <dt class="clear_left">
         ', $txt['message_icon'], ':
      </dt>
      <dd>
และไฟล์ Post.php ที่อยู่ใน Sources/Post.php อีก 2 ที่คือ

// Make sure the subject isn't too long - taking into account special characters.
if ($smcFunc['strlen']($form_subject) > 100)
   $form_subject = $smcFunc['substr']($form_subject, 0, 100);

และ

// At this point, we want to make sure the subject isn't too long.
if ($smcFunc['strlen']($_POST['subject']) > 100)
   $_POST['subject'] = $smcFunc['substr']($_POST['subject'], 0, 100);


แก้จาก 100 เป็น 200
// Make sure the subject isn't too long - taking into account special characters.
if ($smcFunc['strlen']($form_subject) > 200)
   $form_subject = $smcFunc['substr']($form_subject, 0, 200);

และ

// At this point, we want to make sure the subject isn't too long.
if ($smcFunc['strlen']($_POST['subject']) > 200)
   $_POST['subject'] = $smcFunc['substr']($_POST['subject'], 0, 200);


แก้ได้มากที่สุดคือ 255

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

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