Trace:
Differences
This shows you the differences between the selected revision and the current version of the page.
| joomla:pdf-display-ie-bug-fixed 2009/06/01 12:07 | joomla:pdf-display-ie-bug-fixed 2009/06/01 12:22 current | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== วิธีแก้ปัญหา plugin "PDF" ไม่แสดงผลใน Internet Explorer เวอร์ชั่น 7 หรือสูงกว่า ====== | ====== วิธีแก้ปัญหา plugin "PDF" ไม่แสดงผลใน Internet Explorer เวอร์ชั่น 7 หรือสูงกว่า ====== | ||
| - | - สร้างไฟล์ใหม่ใช้ชื่อว่า browser_detection.php แล้วนำขึ้นไปใส่ไว้ใน folder ./libraries/joomla/utilities/ | + | 1. สร้างไฟล์ใหม่ใช้ชื่อว่า browser_detection.php โดย copy โ้ค้ดด้านล่างไปใส่ บันทึกแล้วนำขึ้นไปใส่ไว้ใน folder ./libraries/joomla/utilities/ |
| <?php | <?php | ||
| Line 64: | Line 64: | ||
| Jon Czerwinski | Jon Czerwinski | ||
| */ | */ | ||
| + | elseif (stristr($navigator_user_agent, "msie 8")) /* add for IE8 */ | ||
| + | { | ||
| + | $browser = 'msie8'; | ||
| + | $dom_browser = false; | ||
| + | } | ||
| + | |||
| elseif (stristr($navigator_user_agent, "msie 7")) | elseif (stristr($navigator_user_agent, "msie 7")) | ||
| { | { | ||
| Line 147: | Line 153: | ||
| - | - แก้ไขไฟล์ icon.php ที่อยู่ใน folder ./components/com_content/helpers/ โดยทำการสำรองไฟล์ icon.php ก่อนเพื่อเก็บไว้ใช้ภายหลัง โดยอาจสำรองไว้ในชื่อ icon.php.bak ซึ่งตำแหน่งที่ทำการแก้ไขมีจำนวน 2 จุดดังนี้ | + | 2. แก้ไขไฟล์ icon.php ที่อยู่ใน folder ./components/com_content/helpers/ โดยทำการสำรองไฟล์ icon.php ก่อนเพื่อเก็บไว้ใช้ภายหลัง โดยอาจสำรองไว้ในชื่อ icon.php.bak ซึ่งตำแหน่งที่ทำการแก้ไขมีจำนวน 2 จุดดังนี้ |
| - | * ไปที่บรรทัดแรกสุดของไฟล์ เิพิ่มโค้ดต่อไปนี้ โดยเว้นวรรคหนึ่งเคาะ ต่อจากเครื่องหมายเปิด Tag ของไฟล์ php"<?php.." | + | |
| + | 2.1 ไปที่บรรทัดแรกสุดของไฟล์ เว้นวรรคหนึ่งเคาะ ต่อจากเครื่องหมายเปิด Tag ของไฟล์ php"<?php.." แล้วเิพิ่มโค้ดต่อไปนี้ | ||
| require_once("libraries/joomla/utilities/browser_detection.php"); | require_once("libraries/joomla/utilities/browser_detection.php"); | ||
| - | * ไปยังบรรทัดที่ 58 ของไฟล์ | + | 2.2 ไปยังบรรทัดที่ 58 ของไฟล์ |
| แทนที่ | แทนที่ | ||
| Line 160: | Line 167: | ||
| ด้วยโค้ดต่อไปนี้ | ด้วยโค้ดต่อไปนี้ | ||
| $user_browser = browser_detection('browser'); | $user_browser = browser_detection('browser'); | ||
| - | if ($user_browser == 'msie7') { | + | if ($user_browser == 'msie7'|| $user_browser == 'msie8') { |
| $attribs['target'] = '_blank'; | $attribs['target'] = '_blank'; | ||
| } else { | } else { | ||
| Line 166: | Line 173: | ||
| } | } | ||
| + | 2.3 บันทึกจัดเก็บและนำ้ไว้วางไว้ที่ folder ./components/com_content/helpers/ | ||
| **ที่มา** | **ที่มา** | ||
