1
burfodus
Writing a module
  • 2009/3/21 2:53

  • burfodus

  • Just popping in

  • Posts: 94

  • Since: 2008/9/2 1


Hello Guys and Gals.

Im slowly trying to learn how to program, so I can write my own module (and not rely on you guys for help all the time hehe).

And I learnt alot this weekend doing the basic module tutorial, and then the smarty template tutorial (however the code at the end of this tutorial crashes 2 local XOOPS 2.3 installs, wont even show up in modules page, page half loads)

But now I want to have a crack at constructing one, but (like i do with most code) I like to edit existing code to learn how it works.

Can someone think of and suggest a simple module for me to pick apart, not too advanced code wise, that has an admin page, data entry area in back end, form and display in front end, and some use of smarty templates so I can analyse the files and play with it.

PS I think its great how promptly and accuratelty the guys on this forum help out people like me, I just wish I had the knowledge or skills to return the favour.

Steve.
XOOPS Version - XOOPS 2.3.2
PHP Version - 5.2.6
MySQL Version - 5.0.67-community
Server API Version - apache2handler
OS Version - WINNT

2
noo-b
Re: Writing a module
  • 2009/3/21 2:59

  • noo-b

  • Just can't stay away

  • Posts: 456

  • Since: 2007/10/23


1. http://kaotik.biz/tutorial/

2. go to xuups.com serach for dummy module by trabis

3. https://xoops.org/modules/mediawiki/index.php/DevWiki_Tutorials
I Love Xoops

3
burfodus
Re: Writing a module
  • 2009/3/22 13:02

  • burfodus

  • Just popping in

  • Posts: 94

  • Since: 2008/9/2 1


Thanks for your help noob.

im working through the kaotik tutorials a few times from beginning to end, as im learning code as well as xoops, it will take me more time than most but its all making pretty good sence so far.

what im aiming for in the endo however is a module that displays data, but is mostly entered in the admin area, none of the tutorials i can find touch on adding admin pages, and im copying some from other modules to play with them but could probably do with some guidence.

do you know of a tutorial that includes an admin page/menu

thanks again.
steve.
XOOPS Version - XOOPS 2.3.2
PHP Version - 5.2.6
MySQL Version - 5.0.67-community
Server API Version - apache2handler
OS Version - WINNT

4
noo-b
Re: Writing a module
  • 2009/3/22 13:42

  • noo-b

  • Just can't stay away

  • Posts: 456

  • Since: 2007/10/23


i'm also not that good in php..

havent found a tutorial on admin/menu thing yet but if you look other module you can see the admin & menu is declare in xoops_version.php

// Admin things
$modversion['hasAdmin'] = 1;
$modversion['adminindex'] ="admin/admin.php";
$modversion['adminmenu'] = "admin/menu.php";


try search for small & simple module such as mylinks, membership, etc and look and figure out at the module structure

i really think a complete easy guide on module development should be made and put in xoops.org

the info right now is scattered everywhere

here are some other module dev info i found

1. adding pagination
http://www.customvirtualdesigns.com/modules/AMS/article.php?storyid=8

2. adding comment
http://xoobs.net/modules/smartsection/item.php?itemid=8

3. integrating search
http://xoobs.net/modules/smartsection/item.php?itemid=9

4. notification
http://xoobs.net/modules/smartsection/item.php?itemid=10


I Love Xoops

5
burfodus
Re: Writing a module
  • 2009/3/23 1:57

  • burfodus

  • Just popping in

  • Posts: 94

  • Since: 2008/9/2 1


Very Useful Noob, thanks.

I agree they are very scattered, i had done the first 2 kaotic tutorials from the XOOPS site, but only found the rest of them once you posted the link.

maybe these extra ones you sent through will enable me to learn the admin side. its all learning, and i feel more comfortable with it every day.

cheers
steve.
XOOPS Version - XOOPS 2.3.2
PHP Version - 5.2.6
MySQL Version - 5.0.67-community
Server API Version - apache2handler
OS Version - WINNT

6
burfodus
Re: Writing a module
  • 2009/3/23 2:55

  • burfodus

  • Just popping in

  • Posts: 94

  • Since: 2008/9/2 1


Any Clues to why I can install a basic variation on the tutorial module locally (apache 2.2) and it works fine, but uploading the same tutorial and testing on my server does not.

both XOOPS 2.3.x

server details
XOOPS Version - XOOPS 2.3.2
PHP Version - 5.2.5
MySQL Version - 5.0.67.d7-ourdelta-log
Server API Version - cgi-fcgi
OS Version - WINNT

im thinking it is a problem with the sql code, as it seemed different, i removed commas from around the table and field names to be consistent with the tutorials example, but when i try to load it online, after clicking the install module button it takes me back to the module page of XOOPS admin.

CREATE TABLE tutorial_myform (
tt_id int(5unsigned NOT NULL auto_increment,
namesql varchar(30NOT NULL default '',
addresssql varchar(30NOT NULL default '',
telephonesql varchar(30NOT NULL default '',
emailsql varchar(30NOT NULL default '',
PRIMARY KEY (tt_id),
KEY name (namesql)
TYPE=MyISAM;

CREATE TABLE venueuser (
userID tinyint(4NOT NULL auto_increment,
userEmail varchar(80NOT NULL,
userRef varchar(16NOT NULL,
userPassword varchar(28NOT NULL,
PRIMARY KEY  (userID),
UNIQUE KEY userEmail (userEmailuserRef)
ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=;


you will see the first half is from the tutorial with the sql added to the names.

thanks
steve
XOOPS Version - XOOPS 2.3.2
PHP Version - 5.2.6
MySQL Version - 5.0.67-community
Server API Version - apache2handler
OS Version - WINNT

7
burfodus
Re: Writing a module
  • 2009/3/23 3:53

  • burfodus

  • Just popping in

  • Posts: 94

  • Since: 2008/9/2 1


no stress, got it working, it was the XOOPS installation i was using for testing that was broken, not the tutorial.

after many many attempts i tried installing a system module which also failed, lol. moved to a new test site and works fine, thanks anyway.

steve.
XOOPS Version - XOOPS 2.3.2
PHP Version - 5.2.6
MySQL Version - 5.0.67-community
Server API Version - apache2handler
OS Version - WINNT

8
dannie
Re: Writing a module
  • 2009/4/16 14:56

  • dannie

  • Just popping in

  • Posts: 36

  • Since: 2004/2/10


I am dying to create a simple module too but I don't know any php beyond . I just bought a book on php and sql and am starting from there. I will try those tutorials you posted and the examples from the book. That should be a good start. If you find any other good tutorials or info please post here. thanks so much.

9
burfodus
Re: Writing a module
  • 2009/4/17 0:50

  • burfodus

  • Just popping in

  • Posts: 94

  • Since: 2008/9/2 1


as your starting like me, here are some resources i found very helpfull

this site has simple explanations of php and sql commands
http://www.1keydata.com/sql/sql.html
I found it helpfull
past that there several other helpfull sites for this like
http://www.w3schools.com/
http://dev.mysql.com/doc/refman/5.0/en/index.html

hope it helps.
steve.
XOOPS Version - XOOPS 2.3.2
PHP Version - 5.2.6
MySQL Version - 5.0.67-community
Server API Version - apache2handler
OS Version - WINNT

10
dannie
Re: Writing a module
  • 2009/4/18 0:23

  • dannie

  • Just popping in

  • Posts: 36

  • Since: 2004/2/10


cool. thanks a lot!

Login

Who's Online

298 user(s) are online (213 user(s) are browsing Support Forums)


Members: 0


Guests: 298


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits