===__!Creating a Custom Package in bitweaver__===
~~--FF0000:(WARNING - THIS TUTORIAL IS IN DEVELOPMENT - IT WILL BE FINISHED SOON!)~~

__Introduction__
Hello, my name is [http://www.bitweaver.org/users/index.php?fHomepage=fire|Fire!] I am writing this tutorial to aid new developers who are interested in expanding bitweaver's [http://www.bitweaver.org/wiki/index.php?page=bitweaverFeatures|features] for themselves, their organization, or simply, for your own enjoyment! bitweaver is a nicely coded application, and I believe, once you complete this tutorial, you will be well on your way to develop powerful new communities for the net!

To get an understanding of bitweaver and is possibilities spiderr graciously donated some of his time on IRC, and stepped me through the process, I have extracted as much information as I could from that conversation and have listed it below - I hope you find it useful! So... without further adieu, lets work together and see what we can create!!!

!Step 1: Getting the tools!

a) Downloading the [http://sourceforge.net/cvs/?group_id=33044|CVS] source
Before you can begin, you will need to download the latest code from bitweaver.org.
* If you are using windows, there are several programs available you can use to connect to the [http://sourceforge.net/cvs/?group_id=33044|CVS] repository, the one I used was [http://www.tortoisecvs.org/|Turtoise]
* If you are using Linux, you will need to install [http://sourceforge.net/cvs/?group_id=33044|CVS] if you don't already have it.
Download bitweaver to a directory of your web server.
Once downloaded, navigate to the directory with your web browser, and follow the installation instructions, the installer is very straight forward.


!Step 2: Get an IRC Program
[http://www.irc.org/links.html|Install an IRC Program] to talk to the developers if you need help


!Step 3: Lets begin!
* Login to your bitweaver site, and go to Administration-> Custom Modules
* Enter a name for your module
* Now enter some HTML in the Data text field
{img src=http://www.highview.co.kr/paul/img/bitweaver_tutorials/tiki_tut1.jpg width=296 height=364 align=center desc="creating a custom module" link= }
* Now press the save button
* your custom module should now appear in the Custom Modules table
{img src=http://www.highview.co.kr/paul/img/bitweaver_tutorials/tiki_tut2.jpg width=478 height=149 align=center desc=" link= }
* Congrats! You just created your own custom module, now, click the Active Modules, click on the drop down box, and find your module (it will should be named: "Custom -> moduleName"
* Select which groups will have access to the module (hold down the shift key and click to select multiple groups)
{img src=http://www.highview.co.kr/paul/img/bitweaver_tutorials/tiki_tut3.jpg width=500 height=317 align=center desc= link= }
* when you are finished, you can choose where it is displayed, the left column, or the right...
to do this, click on configure layout... I'll let you figure this one out - its pretty straight forward (:cool:) - Put it on the right for now, at position 1.

!Addon - Exemple: adding rss feeds to the wiki section.
* first create a custom module called " wikirss"
* grab RSS 1&2 icons from google image search and copy them to your server.
* paste this code into you module:
{code}
<a href="http://fusion.google.com/add?feedurl=http%3A//www.youBitweaver.org/wiki/wiki_rss.php%3Fversion%3D2"><img src="http://buttons.googlesyndication.com/fusion/add.gif" width="104" height="17" border="0" alt="Add to Google"></a>


<a href="http://www.youBitweaver.org/wiki/wiki_rss.php?version=1"><img src="/themes/styles/native/images/rss1.gif" width="80" height="15" border="0" alt="RSS1"></a>


<a href="http://www.youBitweaver.org/wiki/wiki_rss.php?version=2"><img src="/themes/styles/native/images/rss2.gif" width="80" height="15" border="0" alt="RSS2"></a>


{/code}
* You can do the same with articles and so on, just change href! Note that you've got RSS1&2 and google syndication.
* Next, you'll have to display this custom module in the wiki pages, to do so, login as admin, go to: look&feel>layout and select WIKI from the first dropdown menu.
* then, choose your freshly created module under the module dropdown and fill in the others attributes as needed.
* Don't forget to add also the kernel> paquage menu as adding this to wiki layout will replace the ' site defaults ' layout.
You're done!

!Step 4 - The Cool Step! Displaying A Table from a Database!
Ok! Now we're gonna add a little power baby! We are going to put a link in our module, that, when pressed, displays a nice little table in the center column of bitweaver! If you complete this step, you should be on your way to make some cool new features!

* 1) First you will need to create a table to grab data from! To do this you will need to log into your servers root. (You may need to use an SSH program. Spiderr recommended Putty - you can get it [http://www.chiark.greenend.org.uk/~sgtatham/putty/|here]) If you already have a table skip the table creation step.
** I'm gonna create a table called fav_colors using postgres sql. Its gonna have the following fields: ~~--FF0000:user_id~~, and ~~--FF0000:favorite_color
** To create the table, load up !psql from the command line:
***psql yourdatabasename
***type \d to display the existing tables
*** create table favorite_color(user_id int, fav_color VARCHAR(40));
*** insert into favorite_color(user_id,fav_color) VALUES (1,'blue');
* Great! Thats it! You now have a table with some data - time to create a package and display the data in bitweaver!

~~ 2) Navigate to your the root of your bitweaver installation.
* 2) Follow the commands below:
** mkdir fire (replace fire with a cool package name you choose)
** cd fire
** mkdir fire/modules
** cd modules
* Now create a file called fire/modules/mod_fire.tpl, you can use pico to edit this if you like - its a nice unix file editor - simply type "pico mod_fire.tpl" in the modules directory. ~~--FF0000:Any file in the modules directory named "mod_*" automatically appears in the modules list in the admin drop down menu!!!! Cool eh?~~
* mod_fire.tpl is the template file we will use with all the presentation code to display your data. Later we will create mod_fire.php that has all the necessary logic to fill all the variables in the tpl file (woah... I'm getting ahead of myself!!! Lets go!
* In mod_fire.tpl add the following code:
** COMING SOON GUYS - I need to download the file from bonnie! Stay tuned!
* In mod_fire.php add the following code:
** COMING SOON GUYS - I need to download the file from bonnie! Stay tuned!
Page History
Date/CommentUserIPVersion
08 Jun 2006 (15:28 UTC)
realname212.27.36.13
Current • Source
realname212.27.36.12
View • Compare • Difference • Source
fire221.157.168.691
View • Compare • Difference • Source