ข้ามไปที่เนื้อหาหลัก

nCode Image Resizer SMF2.0.2 ย่อขยายรูปในบอร์ด smf

Mod Name: nCode Image Resizer
Created By: live627
Latest Version: 1.3.1
Compatible With: 1.1.5, 1.1.8, 1.1.9, 1.1.10, 1.1.11, 2.0 RC1, 2.0 RC1-1, 2.0 RC1.2, 2.0 RC2, 2.0 RC3
http://custom.simplemachines.org/mods/index.php?mod=1197

nCode Image Resizer SMF2.0.2 ย่อขยายรูปในบอร์ด smf

เป็น Mod ที่ใช้ย่อขนาดของรูปในเว็บที่ใหญ่เกินกำหนดจนหน้าเว็บเสียรูปหรือเกิด Scrollbar และอาจทำให้เว็บใช้เวลานานในการเปิดรูปหลายๆรูป


แก้ไขเพิ่มเติมจากต้นฉบับ
- Mod ตัวนี้ผมได้เอามาโมดิฟายแก้ไขเพิ่มเติมจากข้อผิดพลาดในไฟล์ต้นฉบับ ManageSettings.php แล้ว
- แต่งสีและขนาดตัวหนังสือที่เล็กเกินจากไฟล์ index.css
- แปลภาษาไทยเพิ่มเติมจากของเดิมที่คนไทยทำไว้นานแล้ว Modifications.thai-utf8.php

nCode Image Resizer
Manual Install Instructions for SMF 2.0.2
This Mod Below Modify BY: Admin (welovethailand.com)

File Edits แก้ไขไฟล์ ./Sources/ManageSettings.php

Find: ค้นหา


// Who's online?
array('check', 'who_enabled'),
array('int', 'lastActive'),


Add Before: เพิ่มก่อนหน้าที่หา



// nCode Image Resizer
array('select', 'ncode_imageresizer_mode', array(&$txt['ncode_imageresizer_original'], &$txt['ncode_imageresizer_enlarge_same'], &$txt['ncode_imageresizer_open_same'], &$txt['ncode_imageresizer_open_new'])),
array('int', 'ncode_imageresizer_max_width'),
array('int', 'ncode_imageresizer_max_height'),
'',

File Edits แก้ไขไฟล์ ./Sources/Subs.php


Find: ค้นหา



array(
'tag' => 'img',
'type' => 'unparsed_content',
'parameters' => array(
'alt' => array('optional' => true),
'width' => array('optional' => true, 'value' => ' width="$1"', 'match' => '(\d+)'),
'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'),
),
'content' => '<img src="$1" alt="{alt}"{width}{height} class="bbc_img resized" />',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
'disabled_content' => '($1)',
),
array(
'tag' => 'img',
'type' => 'unparsed_content',
'content' => '<img src="$1" alt="" class="bbc_img" />',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
'disabled_content' => '($1)',
),

Replace With: ทับแทนไฟล์เดิมที่หาทั้งหมด



array(
'tag' => 'img',
'type' => 'unparsed_content',
'parameters' => array(
'alt' => array('optional' => true),
'width' => array('optional' => true, 'value' => ' width="$1"', 'match' => '(\d+)'),
'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'),
),
'content' => '<img src="$1" alt="{alt}"{width}{height} border="0" onload="NcodeImageResizer.createOn(this);" class="bbc_img" />',
'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
'disabled_content' => '($1)',
),
array(
'tag' => 'img',
'type' => 'unparsed_content',
'content' => '<img src="$1" alt="" border="0" onload="NcodeImageResizer.createOn(this);" class="bbc_img" />',
'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
'disabled_content' => '($1)',
),

File Edits แก้ไขไฟล์ ./Themes/default/index.template.php
Or current theme : ./Themes/current Your theme/index.template.php

Find: ค้นหา

// Output any remaining HTML headers. (from mods, maybe?)

แทนที่ด้วย:


  echo '<!-- nCode Image Resizer -->

<script type="text/javascript" src="', $settings['default_theme_url'], '/ncode_imageresizer.js"></script>';

// What is the mode?

$mode = 'none';
if (isset($modSettings['ncode_imageresizer_mode']))
{
if ($modSettings['ncode_imageresizer_mode'] == 1)
$mode = 'enlarge';
elseif ($modSettings['ncode_imageresizer_mode'] == 2)
$mode = 'samewindow';
elseif ($modSettings['ncode_imageresizer_mode'] == 3)
$mode = 'newwindow';
}

echo '

<script language="JavaScript" type="text/javascript"><!-- // -->
NcodeImageResizer.BBURL = "', $settings['images_url'], '";
NcodeImageResizer.MODE = "', $mode, '";
NcodeImageResizer.MAXWIDTH = "', empty($modSettings['ncode_imageresizer_max_width']) ? 0 : (int) $modSettings['ncode_imageresizer_max_width'], '";
NcodeImageResizer.MAXHEIGHT = "', empty($modSettings['ncode_imageresizer_max_height']) ? 0 : (int) $modSettings['ncode_imageresizer_max_height'], '";
vbphrase = new Array();
vbphrase[\'ncode_imageresizer_warning_small\'] = \'', $txt['ncode_imageresizer_warning_small'], '\';
vbphrase[\'ncode_imageresizer_warning_filesize\'] = \'', $txt['ncode_imageresizer_warning_filesize'], '\';
vbphrase[\'ncode_imageresizer_warning_no_filesize\'] = \'', $txt['ncode_imageresizer_warning_no_filesize'], '\';
vbphrase[\'ncode_imageresizer_warning_fullsize\'] = \'', $txt['ncode_imageresizer_warning_fullsize'], '\';
// ]]></script>';

// Output any remaining HTML headers. (from mods, maybe?)


File Edits แก้ไขไฟล์ ./Themes/default/css/index.css

Or current theme : ./Themes/current Your theme/css/index.css

Find (at the end of the file): วางต่อล่างสุดของไฟล์ CSS 


table.ncode_imageresizer_warning, table.ncode_imageresizer_warning td
{
background-color: #FFD3BA; /* the bgcolor behind the text and image */
}
table.ncode_imageresizer_warning {
color: #000000; /* the font color */
border: 1px solid #CCCDCD; /* the border around the whole thing */
cursor: pointer;
}
table.ncode_imageresizer_warning td {
font-size: 11px;
vertical-align: middle;
text-decoration: none;
}

table.ncode_imageresizer_warning td.td1 {
padding: 5px;
}

File Edits แก้ไขไฟล์  ./Themes/default/languages/Modifications.thai-utf8.php
ระหว่างภาษาไทยกับไฟล์ภาษาอังกฤษด้านล่างจะลงเพียงอันใดอันหนึ่งหรือทั้ง2ก็ได้
Find (at the end of the file): ค้นหา

?>

Add Before: เติมก่อนที่หา



// --- Begin added code - Advanced Visual Verification ---
$txt['ncode_imageresizer_warning_small'] = 'ต้องการดูภาพเต็มขนาดคลิกที่นี่... ';
$txt['ncode_imageresizer_warning_filesize'] = 'ภาพนี้ได้ถูกเปลี่ยนขนาด คลิกที่นี่...เพื่อดูภาพขนาดเต็ม ภาพขนาดต้นฉบับคือ %1$sx%2$s ';
$txt['ncode_imageresizer_warning_no_filesize'] = 'ภาพนี้ได้ถูกเปลี่ยนขนาด คลิกที่นี่...เพื่อดูภาพขนาดเต็ม ภาพขนาดต้นฉบับคือ %1$sx%2$s ';
$txt['ncode_imageresizer_warning_fullsize'] = 'ต้องการดูภาพขนาดเล็กคลิกที่นี่...';
$txt['ncode_imageresizer_mode'] = '<b>nCode Image Resizer</b><br><span class="smalltext"> รูปแบบการปรับขนาด:</span>';
$txt['ncode_imageresizer_original'] = 'ย่อขนาดรูป รักษาต้นฉบับ';
$txt['ncode_imageresizer_enlarge_same'] = 'ขยายรูปเหมือนเดิม';
$txt['ncode_imageresizer_open_same'] = 'เปิดดูในหน้าต่างเดิม';
$txt['ncode_imageresizer_open_new'] = 'เปิดดูในหน้าต่างใหม่';
$txt['ncode_imageresizer_max_width'] = 'กำหนดให้รูปกว้างสุดที่:';
$txt['ncode_imageresizer_max_height'] = 'กำหนดให้รูปสูงสุดที่:<br /><span class="smalltext">ปล่อยว่างไว้ถ้าไม่ต้องการกำหนดความสูง</span>';
// --- End added code ---

File Edits แก้ไขไฟล์  ./Themes/default/languages/Modifications.english.php
Find (at the end of the file): ค้นหา


// --- Begin added code - nCode Image Resizer ---
$txt['ncode_imageresizer_warning_small'] = 'Click this bar to view the full image.';
$txt['ncode_imageresizer_warning_filesize'] = 'This image has been resized. Click this bar to view the full image. The original image is sized %1$sx%2$s and weighs %3$sKB.';
$txt['ncode_imageresizer_warning_no_filesize'] = 'This image has been resized. Click this bar to view the full image. The original image is sized %1$sx%2$s.';
$txt['ncode_imageresizer_warning_fullsize'] = 'Click this bar to view the small image.';
$txt['ncode_imageresizer_mode'] = '<b>nCode Image Resizer</b><br><span class="smalltext">Resize Mode:</span>';
$txt['ncode_imageresizer_original'] = 'Keep original size';
$txt['ncode_imageresizer_enlarge_same'] = 'Enlarge in same document';
$txt['ncode_imageresizer_open_same'] = 'Open in same window';
$txt['ncode_imageresizer_open_new'] = 'Open in new window';
$txt['ncode_imageresizer_max_width'] = 'Maximum width:';
$txt['ncode_imageresizer_max_height'] = 'Maximum height:<br /><span class="smalltext">Leave blank for no max height.</span>';
// --- End added code ---

File Operations:
Move the included file "ncode_imageresizer.js" to "./Themes/default".
ดาวน์โหลดไฟล์ ncode_imageresizer.js ที่ไฟล์แนบแล้วอัพโหลดไปไว้ที่ /Themes/default/ncode_imageresizer.js
Or current theme : ./Themes/current Your theme/ncode_imageresizer.js

ติดตั้งเสร็จเข้าไปตั้งค่าที่ ผู้ดูแล/ปรับแต่งบอร์ด/Features and Options/ทั่วไป โปรดดูที่ไฟล์แนบ



load ncode_imageresizer.js >>> http://www.mediafire.com/?c2753cno45hg12c



ความคิดเห็น

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

โพสต์ยอดนิยมจากบล็อกนี้

การแปลงวันที่และเวลาโดยใช้ SQL Server

รูปแบบวันที่ของ SQL Server มีหลายรูปแบบใช้ตัวเลือกรูปแบบวันที่พร้อมกับฟังก์ชั่น เช่น - ต้องการรูปแบบ YYYY-MM-DD ใช้คำสั่งคือ  SELECT CONVERT(varchar, getdate(), 23) -  ต้องการรูปแบบ  MM/DD/YYYY  ใช้คำสั่งคือ   SELECT CONVERT(varchar, getdate(), 1)   ด้านล่างนี้เป็นรายการรูปแบบและตัวอย่างของผลลัพธ์   DATE ONLY FORMATS Format # Query Sample 1 select convert(varchar, getdate(), 1) 12/30/06 2 select convert(varchar, getdate(), 2) 06.12.30 3 select convert(varchar, getdate(), 3) 30/12/06 4 select convert(varchar, getdate(), 4) 30.12.06 5 select convert(varchar, getdate(), 5) 30-12-06 6 select convert(varchar, getdate(), 6) 30 Dec 06 7 select convert(varchar, getdate(), 7) Dec 30, 06 10 select convert(varchar, getdate(), 10) 12-30-06 11 select convert(varchar, getdate(), 11) 06/12/30 12 select convert(varchar, getdate(), 12) 061230 23 select convert(varchar, getdate(), 23) 2006-12-30 101 select convert(varchar, getda...

ตรวจสอบว่ามีตัวอักษรในข้อความหรือไม่ contains()

contains() Method  : contains(CharSequence char) Returns  : boolean ใช้เมื่อเราต้องหารตรวจสอบว่ามีตัวอักษรในข้อความหรือไม่  EX.ต้องการหาว่า มีตัว "a" ใน String "Hello" หรือไม่  ถ้ามี ผลลัพธ์ จะเป็น true ถ้าไม่มี ผลลัพธ์ จะเป็น false Example String str 1 = "Hello" ; String str2 = "a" ; boolean b = str 1 . contains ( str2 ); ผลลัพธ์ false

วิธีสำรองข้อมูลระบบปฏิบัติการ Linux โดยใช้คำสั่ง “dd”

1. เราสามารถสร้างไฟล์ Backup ของฮาร์ดดิสก์และบันทึกลงในอุปกรณ์จัดเก็บข้อมูลอื่นๆ มีข้อดีหลายประการในการสำรองข้อมูลของคุณไปเป็นอิมเมจ อีกประการหนึ่งคือความสะดวกในการใช้งาน โดยทั่วไปวิธีนี้จะเร็วกว่าการสำรองข้อมูลประเภทอื่น ทำให้คุณสามารถกู้คืนข้อมูลได้อย่างรวดเร็วหลังเกิดเหตุที่ไม่คาดคิดขึ้น ใช้คำสั่งด้านล่างเพื่อสำรองข้อมูลฮาร์ดดิสก์ /dev/sda ไปเป็นไฟล์อิมเมจของดิสก์  # dd if=/dev/sda of=/var/tmp/sda_disk.img   if: ไดรฟ์ต้นทาง (/dev/sda)  of: ไดรฟ์ปลายทาง (/dev/sdb)   2.ในการกู้คืนฮาร์ดดิสก์ด้วยไฟล์อิมเมจที่เราสร้างขึ้น ให้ใช้คำสั่ง dd ต่อไปนี้   # dd if=sda_disk.img of=/dev/sdc   if: ไดรฟ์ต้นทาง (/dev/sda)  of: ไดรฟ์ปลายทาง (/dev/sdb)