YaBB SE Community

Development => Mod Ideas and Creation => Topic started by: Godai on January 24, 2002, 07:05:21 AM

Title: BoardMOD 2.5 SE Tutorial
Post by: Godai on January 24, 2002, 07:05:21 AM
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.pl

I think that is useful if i'll exaplain some basic (for new mod writers ;) ).

In this pack (http://dns3.omnibit.it/mangaitalia/tmp/BoardMOD.zip) 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:

Code: [Select]
<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 here (http://dns3.omnibit.it/mangaitalia/tmp/dbmod.zip)

with 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:

Code: [Select]
/* ### 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:

(http://dns3.omnibit.it/mangaitalia/tmp/dbmod.jpg)

Now look on how you can write your queries. This is a query scheme:

Code: [Select]
$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:

Code: [Select]
$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:

Code: [Select]
$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:

Code: [Select]
$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 :)
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Alan Cramer on January 24, 2002, 08:54:13 AM
In the next day or two, there will be a special installer package of BoardMod SE 2.5 to make it easier, and will include a few (not as many as BoardMod itself) Mods with it, that you may install with your boards.
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Godai on March 20, 2002, 04:25:24 PM
Did some corrections in codeboxes :)
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: TheJkWhoSaysNi on March 26, 2002, 11:36:50 AM
ok, so how do you add a field to a table?
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Godai on March 26, 2002, 01:28:28 PM
Do it with phpmyadmin and it will say you the instruction to use :)
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: TheJkWhoSaysNi on March 26, 2002, 01:45:34 PM
yeah, thanks, i just realised that.

But what i did was make it cause an error. is there a better way to do it?
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Godai on March 26, 2002, 05:11:18 PM
Send me a mail with what you want to do, i'll write the code so you can see :)
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: TheJkWhoSaysNi on March 27, 2002, 02:29:59 PM
Whoops, diddnt write my last post too well, i meant i made phpmyadmin coause an error so i could see the SQL, lol.

Is there a better way to display the sql?
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Godai on March 27, 2002, 03:18:10 PM
Mmm i still offer you to make me know what you want to do :)
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: TheJkWhoSaysNi on March 27, 2002, 03:20:49 PM
i've done it, lol. check the completed mods board for invisible login, its in there.
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Godai on March 27, 2002, 03:23:45 PM
Good mod also :)
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: TheJkWhoSaysNi on March 27, 2002, 03:25:16 PM
thanks  :D
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Jedi~ on April 06, 2002, 03:56:02 PM
Where is BoardMod 2.5 SE? The links are both dead.  :(
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Godai on April 06, 2002, 05:49:25 PM
All links are working, i checked :)
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Jedi~ on April 06, 2002, 07:41:49 PM
Nope, I get a timed out error.  :(
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Godai on April 07, 2002, 08:38:31 AM
Your problem i think :( can you see images here? are on the same host.
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Jedi~ on April 07, 2002, 09:07:48 AM
You mean images on the site or just images like your avatar? Your avatar never shows up. :(
Why not have it hosted by the main site?
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Godai on April 07, 2002, 11:57:19 AM
I thinh you have some connection problems n certain sites because you're the only one that cannot access those files. If you like i can send it to you in mail.
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Jedi~ on April 07, 2002, 12:28:57 PM
please do, grand_admiral_e@yahoo.com
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Jedi~ on April 10, 2002, 04:53:36 PM
Thanks, got them, and it's working! :)
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: ei8ht on April 15, 2002, 09:35:23 AM
tray to download files with flashget... its very good (better than get right ore something)

You can download it herehttp://gd.skycn.net/down/fgf12.exe
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: owen100 on April 18, 2002, 04:39:46 AM
Sorry for my ignorance but can't find the link to download Board Mod SE - anyone tell me where I can get it from?
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Godai on April 18, 2002, 05:45:23 PM
The first post in this thread, read it :)
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Big P on April 19, 2002, 03:20:04 PM

Sorry for my ignorance but can't find the link to download Board Mod SE - anyone tell me where I can get it from?

Ignorance is bliss...  ::)
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: ajk on October 30, 2002, 08:17:01 PM
So once you run dbmod.php and it makes the tables.  What is the next step?

Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Nemesis on October 31, 2002, 07:39:51 PM
install the mod with boardmod...  ;D
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: ajk on December 30, 2002, 04:13:23 AM

Send me a mail with what you want to do, i'll write the code so you can see :)


Hi Godai,

Is it possible to have multiple IDs?  That way, if you manage one board, all the profiles from upgrades won't get erased.  For example, I help manage 5 YaBB SE boards.
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Nemesis on January 02, 2003, 01:18:14 PM
Godai is long gone but missed....

You can't do that but what you can is have five copys of boardmod for each board. It works cause that is what I do. Here how I did it...

c:\boardmod\
    + gamerzalliance\
         + yabbse 1.3.1\
         + yabbse 1.4.1\
         + yabbse 1.5.1\
    + gotleather\
         + yabbse 1.3.1\
         + yabbse 1.4.1\
         + yabbse 1.5.1\
    + slippershack\
         + yabbse 1.3.1\
         + yabbse 1.4.1\
         + yabbse 1.5.1\
    + awestruckentertainment\
         + yabbse 1.3.1\
         + yabbse 1.4.1\
         + yabbse 1.5.1\
    + boardmodse\
         + yabbse 1.3.1\
         + yabbse 1.4.1\
         + yabbse 1.5.1\
    + modtestboard\
         + yabbse 1.3.1\
         + yabbse 1.4.1\
         + yabbse 1.5.1\

Each one of the folders under the boardmod folder was an install of boardmod then I rename the folder to reflect the site it is for. Hope that helps...
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: ajk on January 02, 2003, 06:52:10 PM
Thanks Nemisis.  I thought about that.

I'll set that up if that is the best way.

Happy New Year.
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: goosemoose on January 29, 2003, 01:01:07 AM
The db mod script is allowing duplicate tables to be created. Should this be the case? Any way to prevent it? Thanks
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Angel Skin on March 23, 2003, 03:52:11 PM
I can't seem to get boardmod working.

It wants a cgi file which I don't have?
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Nemesis on March 23, 2003, 04:12:46 PM
point it to index.php
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Angel Skin on March 24, 2003, 05:15:56 PM
Does it work with 1.5.0?
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Spaceman-Spiff on March 24, 2003, 05:22:01 PM
BoardMod program works with every version of YaBB and YaBB SE
just point it to index.php, instead of YaBB.cgi or YaBB.pl (as nemesis said)

www.boardmod.org is down at the moment though :(
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Angel Skin on March 24, 2003, 05:24:05 PM
Thanks, I was just confused as it won't download any of the mods I ask it too.

It didn't have a dropdown for 1.5.0 so I pointed it to 1.4.1
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: oldiesmann on April 06, 2003, 06:46:00 PM
BoardMod program works with every version of YaBB and YaBB SE
just point it to index.php, instead of YaBB.cgi or YaBB.pl (as nemesis said)

An easy way to get around the problem with BoardMod - just create a copy of index.php in the same directory as index.php and call it YaBB.pl or YaBB.cgi instead. This way, you can edit php files directly from BoardMod... :) - I'm in the midst of re-installing mods, so I will wait to install BoardMod SE
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Michael Prager on April 10, 2003, 03:34:14 PM
Btw I just released BoardMod 2.5.3 (http://boardmod.yabbforum.com/downloads.php#2.5.3) which focus on problems mentioned here ;)
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Spaceman-Spiff on April 10, 2003, 03:46:17 PM
cool, thanks xxl
hope it opens as fast as 252 and load the sources as fast as 251beta3 ;)

/me checks BM site
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: tuntis on April 25, 2003, 09:51:14 AM
What stupid is search and replace,search and add before and search and add after!?!?!? :P
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: Michael Prager on April 26, 2003, 06:20:03 AM
I think it's pretty obvious but for those who don't understand, there's always the FAQ (http://boardmod.yabbforum.com/faq.php#4) page available ;)
Title: Re:BoardMOD 2.5 SE Tutorial
Post by: skoen on August 24, 2003, 05:22:54 PM
Stupid! The link to the script in the first post doesn't work, and I want the Who's Online mod to work, and I need to update the database using BoardMod and that script. Anyone who has the script dbmod.zip or a dbmod.php file they can share. &%#