• Modifications – PART 2

    28

    In my previous post, I explained how easy it was to create a modification in PhantasyBB. Things have now got a lot more simpler.

    PhantasyBB provides a mods language folder to hold all modification lang files and a mods folder in the admin. We use these to separate the boards main features from the modifications/modules.

    Although PhantasyBB requires files edits, you do not have to perform these as PhantasyBB does this for you.. more of a “READY-SET-GO!” method, as I like to call it.

    Before PhantasyBB performs any file edits, it automatically creates a backup file of the original file that it’s going to edit and stores it in a backup folder. If anything goes wrong, you can access it under the BACKUP tab in the mod manager.

    In order for PhantasyBB to do the file edits, you need to create an XML fill called install.xml.

    The XML file can be imported from the administration. It can handle File edits, file copying and Database queries, along with Javascript and AJAX.

    Now.. let’s get started. This is an example install.xml.

    
    
    
    	
    Example Mod 1.0 Example Author www,example.com example@example.com
    admin/templates/mods/adm_example.html admin/templates/img/icon/example.png admin/mods/example.php lang/en/mods/lg_example.php lang/ main/class/class_send.php

    checks to see if a file or folder already exists.

    The

    
    

    to close it at the end of the file.

    The

    tags acts like HTMl header tags do. The name tags acts as the page title and the version tags is the mod version.

    No need to explain what the

    and in between tags do.

    I assume I can skip the description tags too.

    Unfornately, Wordpress sucks at displaying code, completely wiped my last post, so I’ll post this manually.

    The

    These tags are there for if you have any queries that needed to be inserted manually into the database. It is most likely not needed but it can be used to insert modification details into the database. This is the query that would be used.

    INSERT INTO `pbb_mods` (`mod_name`, `mod_real_name`, `mod_status`, `mod_version`, `mod_description`, `mod_author`, `mod_email`, `mod_website`, `mod_type`) VALUES ('example_mod', 'Example Mod', 1, '1.0', 'Example Description', 'Example Author', 'example@example.com', 'example.com', 1);

    The

    tells PhantasyBB that your mod is ready for file edits.

    tells PhantasyBB which files to copy. Either to the current directory or to backup. Doesn’t matter which, it’ll do both automatically. If the file exists in the current direct, it’ll overwrite or do nothing and continue as normal.

    The

    prepares files for the system to copy.

    The

    path/file.php

    loads and copies the file.

    Opens the files you would like the edit.

    Tells PhantasyBB which line to find in the file you opened.

    replaces the line you told PhantasyBB to find.

    adds a line after the line you told PhantasyBB to find.

    
    

    tells PhantasyBB to insert queries into the database. You will need to use

    for each SQL statement.

    You do NOT need to use any PHP statements. Just use normal SQL statements..

    ALTER TABLE `pbb_calendar` ADD `c_category` INT DEFAULT '1' NOT NULL;

    tells PhantasyBB that all files edits are done and stops editing files. No code goes between these tags.

    Please note: When putting PHP, Javascript, SQL or HTML between the XML tags, please wrap them in

    There are more tags but just not listed.

    Officially documentation will explain these a lot better.