Welcome, Guest. Please Login or Register.
November 21, 2024, 01:11:59 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  BoardMOD 2.5 SE Tutorial « previous next »
Pages: [1] 2 3 Reply Ignore Print
Author Topic: BoardMOD 2.5 SE Tutorial  (Read 117473 times)
Godai
Mod God :P
Sr. Member
****
Posts: 473


YaBB SE!!!!

ICQ - 70621553godai78@hotmail.com WWW
BoardMOD 2.5 SE Tutorial
« on: January 24, 2002, 12:05:21 PM »
Reply with quote

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 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 here

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:

/* ### 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 :)
« Last Edit: March 20, 2002, 09:23:58 PM by Godai » Logged

Emanuele 'Godai' Sparvoli
YaBB Italian Team
100% YaBB Lover
Alan Cramer
Sr. Member
****
Posts: 258


***Insert Evil Cackle Here***

WWW
Re:BoardMOD 2.5 SE Tutorial
« Reply #1 on: January 24, 2002, 01:54:13 PM »
Reply with quote

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.
Logged

Alan Cramer - Nextux - [email protected]

If you want my MSN, YIM, ICQ, AIM details, please IM me for them.  If you just want support, please use these forums, as that is what they are here for!
Godai
Mod God :P
Sr. Member
****
Posts: 473


YaBB SE!!!!

ICQ - 70621553godai78@hotmail.com WWW
Re:BoardMOD 2.5 SE Tutorial
« Reply #2 on: March 20, 2002, 09:25:24 PM »
Reply with quote

Did some corrections in codeboxes :)
Logged

Emanuele 'Godai' Sparvoli
YaBB Italian Team
100% YaBB Lover
TheJkWhoSaysNi
YaBB God
*****
Posts: 1025


I dont know what to put here, i'll leave it blank.

ICQ - 122821095TheJkWhoSaysNi@evilemail.com WWW
Re:BoardMOD 2.5 SE Tutorial
« Reply #3 on: March 26, 2002, 04:36:50 PM »
Reply with quote

ok, so how do you add a field to a table?
Logged

WARNING: THIS POST MAY CONTAIN TRACES OF PEANUT!!!
I'm listening to....
Godai
Mod God :P
Sr. Member
****
Posts: 473


YaBB SE!!!!

ICQ - 70621553godai78@hotmail.com WWW
Re:BoardMOD 2.5 SE Tutorial
« Reply #4 on: March 26, 2002, 06:28:28 PM »
Reply with quote

Do it with phpmyadmin and it will say you the instruction to use :)
Logged

Emanuele 'Godai' Sparvoli
YaBB Italian Team
100% YaBB Lover
TheJkWhoSaysNi
YaBB God
*****
Posts: 1025


I dont know what to put here, i'll leave it blank.

ICQ - 122821095TheJkWhoSaysNi@evilemail.com WWW
Re:BoardMOD 2.5 SE Tutorial
« Reply #5 on: March 26, 2002, 06:45:34 PM »
Reply with quote

yeah, thanks, i just realised that.

But what i did was make it cause an error. is there a better way to do it?
Logged

WARNING: THIS POST MAY CONTAIN TRACES OF PEANUT!!!
I'm listening to....
Godai
Mod God :P
Sr. Member
****
Posts: 473


YaBB SE!!!!

ICQ - 70621553godai78@hotmail.com WWW
Re:BoardMOD 2.5 SE Tutorial
« Reply #6 on: March 26, 2002, 10:11:18 PM »
Reply with quote

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

Emanuele 'Godai' Sparvoli
YaBB Italian Team
100% YaBB Lover
TheJkWhoSaysNi
YaBB God
*****
Posts: 1025


I dont know what to put here, i'll leave it blank.

ICQ - 122821095TheJkWhoSaysNi@evilemail.com WWW
Re:BoardMOD 2.5 SE Tutorial
« Reply #7 on: March 27, 2002, 07:29:59 PM »
Reply with quote

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?
Logged

WARNING: THIS POST MAY CONTAIN TRACES OF PEANUT!!!
I'm listening to....
Godai
Mod God :P
Sr. Member
****
Posts: 473


YaBB SE!!!!

ICQ - 70621553godai78@hotmail.com WWW
Re:BoardMOD 2.5 SE Tutorial
« Reply #8 on: March 27, 2002, 08:18:10 PM »
Reply with quote

Mmm i still offer you to make me know what you want to do :)
Logged

Emanuele 'Godai' Sparvoli
YaBB Italian Team
100% YaBB Lover
TheJkWhoSaysNi
YaBB God
*****
Posts: 1025


I dont know what to put here, i'll leave it blank.

ICQ - 122821095TheJkWhoSaysNi@evilemail.com WWW
Re:BoardMOD 2.5 SE Tutorial
« Reply #9 on: March 27, 2002, 08:20:49 PM »
Reply with quote

i've done it, lol. check the completed mods board for invisible login, its in there.
Logged

WARNING: THIS POST MAY CONTAIN TRACES OF PEANUT!!!
I'm listening to....
Godai
Mod God :P
Sr. Member
****
Posts: 473


YaBB SE!!!!

ICQ - 70621553godai78@hotmail.com WWW
Re:BoardMOD 2.5 SE Tutorial
« Reply #10 on: March 27, 2002, 08:23:45 PM »
Reply with quote

Good mod also :)
Logged

Emanuele 'Godai' Sparvoli
YaBB Italian Team
100% YaBB Lover
TheJkWhoSaysNi
YaBB God
*****
Posts: 1025


I dont know what to put here, i'll leave it blank.

ICQ - 122821095TheJkWhoSaysNi@evilemail.com WWW
Re:BoardMOD 2.5 SE Tutorial
« Reply #11 on: March 27, 2002, 08:25:16 PM »
Reply with quote

thanks  :D
Logged

WARNING: THIS POST MAY CONTAIN TRACES OF PEANUT!!!
I'm listening to....
Jedi~
Eric
Beta Tester
YaBB God
*****
Posts: 1284


WWW
Re:BoardMOD 2.5 SE Tutorial
« Reply #12 on: April 06, 2002, 08:56:02 PM »
Reply with quote

Where is BoardMod 2.5 SE? The links are both dead.  :(
Logged
Godai
Mod God :P
Sr. Member
****
Posts: 473


YaBB SE!!!!

ICQ - 70621553godai78@hotmail.com WWW
Re:BoardMOD 2.5 SE Tutorial
« Reply #13 on: April 06, 2002, 10:49:25 PM »
Reply with quote

All links are working, i checked :)
Logged

Emanuele 'Godai' Sparvoli
YaBB Italian Team
100% YaBB Lover
Jedi~
Eric
Beta Tester
YaBB God
*****
Posts: 1284


WWW
Re:BoardMOD 2.5 SE Tutorial
« Reply #14 on: April 07, 2002, 12:41:49 AM »
Reply with quote

Nope, I get a timed out error.  :(
Logged
Pages: [1] 2 3 Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  BoardMOD 2.5 SE Tutorial « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.015 seconds with 20 queries.