วิธีสร้าง mod เว็บบอร์ดsmfลองทำดูครับไม่ยาก!

เริ่มโดย WACHIRAPILAN, 22 ธันวาคม 2014, 22:16:04

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

WACHIRAPILAN

วิธีสร้าง mod เว็บบอร์ดsmf ใช้งานเองแบบง่ายๆ
หลายคนสงสัยว่าทำไมต้องสร้าง mod ใช้เองให้มันยุ่งยาก ในเมื่อของฝรั่งก็มีให้เลือกใช้เยอะแยะไป อันนี้ผมว่ามันก็จริงนะครับ แต่คุณรู้ไหมครับว่า mod เกือบทุกตัวมีแต่คนต่างชาติเขาเป็นคนทำ " แล้วทำไมคนไทยจะทำให้คนอื่นใช้บ้างไม่ได้ " ผมว่าความรู้ความสามารถของไทยเราก็ไม่ด้อยไปกว่าชาติใดในโลกเลยนะครับ.

"แค่เราลงมือสร้าง"
เริ่มต้นด้วยการศึกษาว่าเขาทำกันยังไงที่ลิงค์นี้ครับ http://www.simplemachines.org/community/index.php?topic=20319.0

หลังจากที่เข้าไปศึกษาวิธีสร้างตามลิงค์ข้างบนแล้ว ให้เราดาวน์โหลดไฟล์  " package-sdk_0.6.zip " ซึ่งอยู่ในไฟล์แนบของลิงค์ข้างบนแล้วแตกไฟล์ออกจะเห็นไฟล์สำหรับใช้ทำเป็น mod ติดตั้งของเว็บบอร์ด smf

หลังจากที่เราได้ไฟล์ติดตั้งมาแล้วทีนี่ก็มาถึงวิธีการสร้าง mod เพื่อใช้งานกันครับ
ขั้นตอนแรกเราจะเริ่มสร้าง mod ตัวง่ายๆกันก่อนนะครับ โดยผมจะเลือกสร้าง mod " ย้ายเวอร์ชั่นเว็บบอร์ด SMF 2.0.7 " ให้ชิดขวา

ขั้นตอนแรกให้เรานำไฟล์ต่อไปนี้มาแก้ไข 1. package-info.xml  2. modification.xml

วิธีแก้ไขไฟล์ package-info.xml
ภายในไฟล์จะประกอบไปด้วยโค๊ดเหล่านี้
<?xml version="1.0"?>
<!DOCTYPE package-info SYSTEM "http://www.simplemachines.org/xml/package-info">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This is a simplified package manifest for SMF packages.

ATTENTION: If you are trying to install this manually, you should try
the package manager.  If it will not work for you, please take a look
at the following for information on this format:
 http://www.simplemachines.org/redirect/manual_mod_install

================================================================================

This script can be used to make your package do many different things.
The following documentation should be available on the format of this
file and the things you can do with it:
 http://www.simplemachines.org/redirect/mod_package_sdk

Please see the other included file, package-info_advanced.xml, for
a more detailed description of what you can do with this file.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<package-info xmlns="http://www.simplemachines.org/xml/package-info" xmlns:smf="http://www.simplemachines.org/">
<!-- For the id, always use something unique - put your name, a colon, and then the package name. -->
<id>username:testing123</id>
<!-- Below should be the name of this package. -->
<name>Testing, 1-2-3!</name>
<!-- The version of this modification.  Keep it numeric so PHP can tell that old < new. -->
<version>1.0</version>

<!-- Type, one of: modification, avatar, language. -->
<type>modification</type>

<!-- Installation, the key part of this file. -->
<install>
 <readme>readme.txt</readme>
 <modification>install.xml</modification>
 <code>add_settings.php</code>
</install>

<!-- Don't forget something to make it uninstallable! -->
<uninstall>
 <modification reverse="true">install.xml</modification>
</uninstall>
</package-info>


จากข้างบนให้เราแก้ไขโค๊ดดังต่อไปนี้

1.<id>username:testing123</id>  แก้เป็น <id>ชื่อของเรา:ชื่อของmodที่เราสร้าง</id> (ชื่อของmodห้ามเว้นวรรคโดยเด็ดขาด)

2.<name>Testing, 1-2-3!</name> แก้เป็น <name>ชื่อของmodที่เราสร้าง</name> (ชื่อตรงนี้สามารถเว้นวรรคได้)

3.<version>1.0</version>  แก้เป็น <version>เวอร์ชั่นmodของเรา</version> (ตั้งค่าเวอร์ชั่นmodตามต้องการ)

4.<install>  แก้เป็น <install for="2.0.7"> (ใส่เวอร์ชั่นของเว็บบอร์ดที่รองรับmodนี้)
4.1 จากนั้นให้เราลบโค๊ดนี้ทิ้ง <code>add_settings.php</code>

5.<uninstall> แก้เป็น <uninstall for="2.0.7"> (ใส่เวอร์ชั่นของเว็บบอร์ดที่รองรับmodนี้)

หลังจากแก้ไขเสร็จแล้วจะมีโค๊ดอยู่2บรรทัดที่ยังไม่ได้แก้ไขคือโค๊ดต่อไปนี้
1.<readme>readme.txt</readme> คือไฟล์ readme.txt ที่เราต้องสร้างขึ้นมาใหม่เพื่อใส่ข้อมูลต่างๆเช่น อธิบายคุณสมบัติของmod วิธีใช้งานmod และที่สำคัญต้องแสดงลิขสิทธิ์ของmodด้วย

2. <modification>install.xml</modification> คือไฟล์ติดตั้ง install.xml  ที่เราจะต้องเขียนคำสั่งให้มันแก้ไขโค๊ดของเราในขั้นตอนต่อไป


วิธีแก้ไขไฟล์ modification.xml
<?xml version="1.0"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This is an example modification file for SMF packages.

ATTENTION: If you are trying to install this manually, you should try
the package manager.  If it will not work for you, please take a look
at the following for information on this format:
 http://www.simplemachines.org/redirect/manual_mod_install

================================================================================

Modification files can be used to modify files so that they do what
your package needs them to do to work properly.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
<!-- This information needs to be the same as that in the package-info.xml. -->
<id>username:testing123</id>
<version>1.0</version>

<!-- Edit a specific file.. -->
<file name="$sourcedir/Filename.php">
 <!-- A seach operation, with search rules and code to modify the file with. -->
 <operation>
  <!-- Search for this text before the code we add.  You can also search for after, and the end of the file. -->
  <search position="before"><![CDATA[
Search for some code to add stuff after.
]]></search>
  <!-- Add this text when we find it.  Note that it's on it's own line on purpose, and the CDATA keeps things clean. -->
  <add><![CDATA[
This is what to add.
]]></add>
 </operation>

 <operation>
  <search position="replace"><![CDATA[
Another search operation?
]]></search>
  <add><![CDATA[
Yes, another.  This time, replacing!
]]></add>
 </operation>
</file>
</modification>


จากไฟล์ข้างบนให้เราแก้ไขโค๊ดดังต่อไปนี้

1.<id>username:testing123</id> แก้เป็น <id>ชื่อของเรา:ชื่อของmodที่เราสร้าง</id> (ชื่อของmodห้ามเว้นวรรคโดยเด็ดขาด)

2.<version>1.0</version> แก้เป็น <version>เวอร์ชั่นmodของเรา</version> (ตั้งค่าเวอร์ชั่นmodตามต้องการ)

3.<file name="$sourcedir/Filename.php"> แก้เป็น <file name="$themedir/css/index.css"> (โค๊ดตัวนี้คือประตูทางเข้าไปจัดไฟล์ของmodเรา)

4.<operation>
  <!-- Search for this text before the code we add.  You can also search for after, and the end of the file. -->
  <search position="before"><![CDATA[
Search for some code to add stuff after.
]]></search>

แก้เป็น <!-- Search for this text before the code we add.  You can also search for after, and the end of the file. -->
  <search position="replace"><![CDATA[
#footer_section
{
text-align: center;
background: url(../images/theme/main_block.png) no-repeat 0 -820px;
padding-left: 20px;
}
]]></search>

จากข้างบนให้สังเกตุตรงจุดนี้นะครับ <search position="before"><![CDATA[
Search for some code to add stuff after.
]]></search>

จุดที่ผมแก้ไขคือ
1. <search position="before">   ผมแก้ before เป็น replace

2.<![CDATA[Search for some code to add stuff after.]]></search> ผมเปลี่ยนข้อความ "Search for some code to add stuff after." เป็นโค๊ด

5.<!-- Add this text when we find it.  Note that it's on it's own line on purpose, and the CDATA keeps things clean. -->
  <add><![CDATA[
This is what to add.
]]></add>
 </operation>

แก้เป็น
<!-- Add this text when we find it.  Note that it's on it's own line on purpose, and the CDATA keeps things clean. -->
  <add><![CDATA[
#footer_section
{
text-align: right;
background: url(../images/theme/main_block.png) no-repeat 0 -820px;
padding-left: 20px;
}
]]></add>
 </operation>

จุดที่ผมแก้ไขคือ
1.<![CDATA[This is what to add.]]></search> ผมเปลี่ยนข้อความ "This is what to add." เป็นโค๊ด


หลังจากเสร็จแล้วให้เราลบโค๊ดส่วนที่ไม่ใช้ทิ้งคือโค๊ดนี้
<operation>
  <search position="replace"><![CDATA[
Another search operation?
]]></search>
  <add><![CDATA[
Yes, another.  This time, replacing!
]]></add>
 </operation>

เสร็จแล้วให้บันทึกและเปลี่ยนชื่อไฟล์เป็น install.xml

จาก mod ที่เราสร้างก็จะมีไฟล์ทั้งหมด 3 ไฟล์หลักๆคือ
1. install.xml
2.readme.txt
3.package-info.xml

ขั้นตอนสุดท้ายให้รวมไฟล์ทั้ง3เป็นไฟล์ .zip เพียงเท่านี้เราก็จะได้ mod เว็บบอร์ด smf สร้างโดยผีมือตัวท่านเองเป็นที่เรียบร้อย
ที่มา: http://www.thailandmovingguide.com/modifications/mod-smf-1107/

ปล.ฝากผลงานด้วยนะครับ
1. http://custom.simplemachines.org/mods/index.php?mod=3829
2.http://custom.simplemachines.org/mods/index.php?mod=3835
3.http://custom.simplemachines.org/mods/index.php?mod=3838
4.http://custom.simplemachines.org/mods/index.php?mod=3844
5.http://custom.simplemachines.org/mods/index.php?mod=3868
6.http://custom.simplemachines.org/mods/index.php?mod=3934
7.http://www.thaiseoboard.com/index.php?topic=355956.0

Meaw-IE

[direct=https://bait.rmutsb.ac.th/]คณะบริหารธุรกิจ[/direct] [direct=https://fea.rmutsb.ac.th/]คณะวิศวะฯ มทร.สุวรรณภูมิ[/direct] [direct=https://suphanburi.rmutsb.ac.th/]กบส สุพรรณบุรี[/direct]

songpra


rock4u

[direct=http://shutterstock.com/g/akekalak]Gallery ใน Shutterstock[/direct]
[direct=http://www.istockphoto.com/portfolio/akekalak]Portfolio ใน iStockphoto[/direct]
[direct=https://www.123rf.com/profile_akekalak]Portfolio ใน 123rf[/direct]
[direct=https://www.dreamstime.com/akekalak_info]Portfolio ใน Dreamstime[/direct]

Minnymouse

[direct=https://www.youtube.com/watch?v=w_wxRr_Dte4]@ ถ้ามองหา..ก็มองเห็น[/direct]
[direct=https://earnmoneyguide0.blogspot.com/2021/04/1-binance.html]@ แนะนำเว็บเทรดเหรียญเบอร์หนึ่งของโลก[/direct]
[direct=https://earnmoneyguide0.blogspot.com/2018/05/blog-post.html]@ เว็บครอบลิงค์ เรทไทยแรงๆ (คัดแล้ว)[/direct]
[direct=https://www.popads.net/users/refer/916846]@ Popads ติดโฆษณาได้เงิน.. ที่ 1 ในใจ[/direct]



romance69

ขายปลั๊กอิน Wordpress ตรวจหวยออนไลน์ อัปเดตอัตโนมัติ ราคา 2,500 บาท ใส่โค้ด THAISEO10 รับส่วนลด 10%
รับเขียนเว็บไซต์, รับเขียน Theme wordpress, รับเขียน Plugin wordpress

amazegu

จะว่าไปหลักการสร้าง mod ของ smf คือมีแค่
1.filename ชื่อไฟล์ที่ต้องการจะแก้
2.operation ที่เราจะทำกับไฟล์ที่จะแก้ เช่น search position="xxx" ถ้าจะลบโค้ดนั้นๆก็ใช้ replace ถ้าใช้ before ก็คือว่าโค้ดที่เราจะ add ไว้ก่อนโค้ดนั้นๆ after ก้สลับกันคือวางไว้หลัง
ตรง add ก็คือโค้ดที่เราจะใส่ไปแทนที่หรือตามแต่ position ที่เราต้องการครับ  :wanwan003: :wanwan003: :wanwan003:



Lesson


mymo


imodxlstep

[direct=https://submit.shutterstock.com/?ref=4444966]ขายรูปออนไลน์ทั่วโลกกับเว็บไซต์ Shutterstock.com[/direct]

[direct=https://goo.gl/Miqe1v]อยากรวย ไปหาหนังสือนี้มาอ่านนะครัช[/direct]

เป็นแค่คน ๆ หนึ่ง ซึ่งรักกล้วยไม้  สนใจในกล้วยไม้ เพราะกล้วยไม้เป็นสิ่งที่ธรรมชาติ บรรจงสร้างสรรขึ้นมาเพื่อให้โลกสวยงาม ตื่นเช้ามาก็รดน้ำกล้วยไม้ ใส่ปุ๋ยกล้วยไม้ ผมรักกล้วยไม้...เว็บไซต์กล้วยไม้ [direct=http://www.tjorchid.com]TJorchid.com[/direct] [direct=http://www.tjorchid.com/?page_id=8472]วิธีจ่ายเงินซื้อของ Lazada[/direct]

fainewroad

สุดติ่งกระดิ่งแมว

ผมเคยเข้าไปหาความรู้เว็ปท่านอยู่

ขอบคุณครับ

:wanwan017:

freetukyang

https://privateladyescorts.com - Video Chat Private Lady - No Selfie - Anonymous Sex Dating -   Message Private Lady