หน้าเว็บ

วันจันทร์ที่ 13 สิงหาคม พ.ศ. 2555

วิธีแก้ไข (Change) Community builder profile title

Community builde (THE Social Community Solution for Joomla) หรือเรียกอย่างย่อว่า CB เป็น extension สำหรับ Joomla เพื่อใช้จัดการบริการและใช้งานสำหรับ สมาชิกในเว็บที่ทำด้วย Joomla ปัจจุบัน version ที่พัฒนาออกมาล่าสุดของ Community builder ณ วันที่เขียนบทความนี้ คือ version Community Builder 1.8.1

การแสดง Title สำหรับ URL ของ user ในเว็บ Joomla ที่ใช้ entension CB จะแสดง title เป็นชื่อ login หรือชื่อเต็มของผู้ใช้ตอนลงทะเบียน หาก webmaster ที่ต้องการ เปลี่ยน page title ของ user สามารถทำได้ดังนี้

  1. ftp เข้า hosting แล้วโหลดไฟล์ comprofiler.html.php ที่อยู่ใน direcotry components/com_comprofiler
  2. ทำสำรอง file comprofiler.html.php ไว้ในเครื่องเพื่อป้องกันสิ่งผิดพลาดที่อาจเกิดขึ้นอย่างไม่คาดคิด
  3. เปิด comprofiler.html.php ที่โหลดมาด้วย โปรแกรม text editor
  4. เลื่อนไปบรรทัดประมาณ 435 หรือค้นหาบรรทัด $_CB_framework->setPageTitle (ใน static function userProfile)
code บรรทัดที่ต้องแก้ไขคือ

$_CB_framework->setPageTitle( cbUnHtmlspecialchars(getNameFormat($user->name,$user->username,$ueConfig['name_format'])));

ตัวอย่างการแก้ไขเปลี่ยนแปลง page title

$_CB_framework->setPageTitle("User Profile - ". $user->username);

แก้ไข code ให้ถูกต้องแล้วบันทึกลองทดสอบดูใน localhost หากไม่มีอะไรผิดพลาดให้ ftp file comprofiler.html.php ไปไว้ที่เดิมทับของเดิม ใน directory
direcotry components/com_comprofiler

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

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