Courtesy of XXL we now have a new version of BoardMOD: 2.5 SE
It works as the YaBB 1 Gold version but it will search for your index.php instead of
yabb.plI think that is useful if i'll exaplain some basic (for new mod writers
).
In
this pack you may find BoardMOD 2.5 SE when you extract files this is what you get:
BoardMOD (BoardMOD executable, log file, config file)
|
|-YaBBSE (here you have to copy SE root dir content and the Sources dir)
|-Mods
|
|-YaBB SE 1.0.0 (put here mods for 1.0.0 version)
|-YaBB SE 1.1.0 (put here mods for 1.1.0 version)
when a new version will be out you may simply create a new subdir in Mods.
Now a .mod tags overview:
<ID> this is the mod name
<Version> mod version
<Mod info> the mod description, can be longer than one line
<Author> the mod author, only one line
<Homepage> the author's homepage, only one line
<Edit file> a file within to search and edit
<Search for> one or more lines to search for in the file specified before with <Edit file>
<Add before> adds one or more lines before those which had been searched
<Replace> replaces the searched line/lines by one or more
<Add after> adds one or more lines after those which had been searched
and a .mod example:
<id>
HitCounter Tag
</id>
<version>
1.0
</version>
<mod info>
============================
== HitCounter Template Tag v1.0 ==
== Written by: Godai & M.v.Veelen ==
============================
This MOD will add the possibility to use a <yabb hitcounter> tag in your template.html
The function purpose is to show/log number of accesses to your board.
</mod info>
<author>
Godai
</author>
<homepage>
[url=http://www.YaBB.it]http://www.YaBB.it[/url]
</homepage>
<edit file>
Sources/Subs.php
</edit file>
<search for>
}
?>
</search for>
<replace>
}
function yyhitcounter()
{
$user = file("hitcounter.log");
$user = $user[0];
$user++;
$file = fopen("hitcounter.log", "r+");
fwrite($file, $user);
fclose($file);
echo $user;
}
?>
</replace>
For a complete overview you may read HOWTO.txt and Readme.txt
The problem is that with BoardMOD you cannot edit SE db, so i prepared a script:
download
herewith this script you may write sql queries then upload it in your YaBB SE dir and call it with url
and the db will be updated.
I'll exaplain. In dbmod.php you'll find these lines:
/* ### DB QUERIES START ### */
$result1 = mysql_query("CREATE TABLE {$db_prefix}test (type tinytext NOT NULL, value tinytext NOT NULL) TYPE=MyISAM;");
if(!$result1){
echo "<font color=red>Error updating the DB. SQL Error: ".mysql_error()."</font><BR>";
$error++;}
else
echo "<font color=green>Test table created!</font><BR>";
$result2 = mysql_query("CREATE TABLE {$db_prefix}test2 (type tinytext NOT NULL, value tinytext NOT NULL) TYPE=MyISAM;");
if(!$result2){
echo "<font color=red>Error updating the DB. SQL Error: ".mysql_error()."</font><BR>";
$error++;}
else
echo "<font color=green>Test2 table created!</font><BR>";
/* ### DB QUERIES END ### */
db queries must be between /* ### DB QUERIES START ### */ and /* ### DB QUERIES END ### */
the result of these example queries is this:
Now look on how you can write your queries. This is a query scheme:
$resultX = mysql_query("command {$db_prefix}table_name query_text;");
if(!$resultX){
echo "<font color=red>Error updating the DB. SQL Error: ".mysql_error()."</font><BR>";
$error++;}
else
echo "<font color=green>text_to_be_displayed_if_success</font><BR>";
X = is the query number in sequence starting from 1
command = the sql command
table_name = the table's name that you want to edit
query_text = sql instructions
text_to_be_displayed_if_success = the text that will be displayed in case of successfully update
- examples -
create a table:
$result1 = mysql_query("CREATE TABLE {$db_prefix}test TYPE=MyISAM;");
if(!$result1){
echo "<font color=red>Error updating the DB. SQL Error: ".mysql_error()."</font><BR>";
$error++;}
else
echo "<font color=green>Test table created!</font><BR>";
insert a value in settings table:
$result1 = mysql_query("INSERT INTO {$db_prefix}settings VALUES ('testvalue', '1');");
if(!$result1){
echo "<font color=red>Error updating the DB. SQL Error: ".mysql_error()."</font><BR>";
$error++;}
else
echo "<font color=green>Testvalue inserted!</font><BR>";
create a table with something into:
$result1 = mysql_query("CREATE TABLE {$db_prefix}testing (
test text NOT NULL,
test2 tinytext NOT NULL,
IP tinytext NOT NULL,
) TYPE=MyISAM;");
if(!$result1){
echo "<font color=red>Error updating the DB. SQL Error: ".mysql_error()."</font><BR>";
$error++;}
else
echo "<font color=green>Testing table created!</font><BR>";
These are only some examples you may read mySQL manual to find all the sql syntax.
If you have problems editing the db post here what you want to do, so i can try to write the query for you and it will be also an example for others