In this tutorial, you will find out how to create your own .mod.dat file that will allow you to use the Concatenation Script that I have previously scripted. You're probably reading this because you already know what the script is and are ready to use it, but if you don't know what it is check it out here: Concatenation Script Topic.
Moving on to the tutorial...
How to do it all!
If anyone has any questions or comments on this tutorial, please post them and I'll be more then happy to answer.
Moving on to the tutorial...
How to do it all!
- Step one, you must first create or open a blank file with the .mod.dat extension. Once opened and cleared of any content you must first know the simple rules of the .mod.dat files.
Number 1 is that the first 4 lines are ignored. This space is for author definition and extra info about the mod the user is about to install/run. The next thing is that the first character of any line cannot contain a number sign (#). If you are needing to add a line with the (#) in it then put a space or tab before the first character of the line (#).
Now that you know the only important rules you may know start learning about the .mod.dat syntax.
First off, lets define the author information in our file and lets name our file MyModFile.mod.dat like so:
Code:
@@ @Author: Joseph Dalrymple;
@@ @Date: January 29, 2008 at 12:23 AM;
@@ @Desc: MyMod;
@@ @Installs MyMod into MyFile;
After defining your author information you can then start with your first function. This is pretty easy so far, right?
Create a new file named MyFile.html and save it in the same directory as your .mod.dat and your install_mod.php files.
After creating MyFile.html you many then add any type of content to it, and it doesn't have to be a .html file either. Heres an example of what I did:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<body>
This is some txet.
</body>
</html>
Code:
@@ @Author: Joseph Dalrymple;
@@ @Date: January 29, 2008 at 12:23 AM;
@@ @Desc: MyMod;
@@ @Installs MyMod into MyFile;
# MyFile.html 5 add
</head>
# MyFile.html 8 replace
This is some text.
Now that we have our two functions to fix up our damaged MyFile.html script we're finished... right? Wrong. This is very important: after adding all the functions needed you MUST add the following line to the end of your file:
Code:
# EOF
Code:
@@ @Author: Joseph Dalrymple;
@@ @Date: January 29, 2008 at 12:23 AM;
@@ @Desc: MyMod;
@@ @Installs MyMod into MyFile;
# MyFile.html 5 add
</head>
# MyFile.html 8 replace
This is some text.
# EOF
- A recently added feature, SQL support, is very useful especially when installing or updating a DB dependent script. To add an SQL query to your file use the following syntax:
Code:
# sql SERVER USERNAME PASSWORD DATABASE
If anyone has any questions or comments on this tutorial, please post them and I'll be more then happy to answer.