Advertisement
Free Mambo Templates - Free Joomla Templates
Joomla Hut HomeContact UsJoomla LinksMambo Forum - Joomla ForumJoomla Downloads
Home
News
Articles
Gallery
Downloads
Tutorials
Site Reviews
Flash Tutorials
Templates Demo
Joomla Links
FAQ
Submit News
Advertise Here
Search
Advertisement
Seek Your Host
New York Web Design
Joomla Templates
Login Form





Lost Password?
No account yet? Register
Joomla Extensions
Joomla Templates
TemplatePlazza
 
Joomla Website

Creating a quick and easy Mambo component Print E-mail
Written by Doyle Lewis   
Thursday, 15 April 2004

toolbar.hello_world.html.php - Handles the toolbar output.

<?php
//hello_world Component//
/**
* Content code
* @package hello_world
* @Copyright (C) 2004 Doyle Lewis
* @ All rights reserved
* @ hello_world is Free Software
* @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
* @version 1.0
**/

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

class menuHello_world {

function TEXT_MENU() {
  mosMenuBar::startTable();
  mosMenuBar::publish('publish');
  mosMenuBar::unpublish('unpublish');
  mosMenuBar::divider();
  mosMenuBar::addNew('new');
  mosMenuBar::editList('edit', 'Edit');
  mosMenuBar::deleteList( ' ', 'delete', 'Remove' );
  mosMenuBar::endTable();
}

function EDIT_MENU() {
  mosMenuBar::startTable();
  mosMenuBar::back();
  mosMenuBar::save('save');
  mosMenuBar::spacer();
  mosMenuBar::endTable();  
}


}

?>

 

class menuHello_world {
Sets the toolbar class

function TEXT_MENU() {
  mosMenuBar::startTable();
  mosMenuBar::publish('publish');
  mosMenuBar::unpublish('unpublish');
  mosMenuBar::divider();
  mosMenuBar::addNew('new');
  mosMenuBar::editList('edit', 'Edit');
  mosMenuBar::deleteList( ' ', 'delete', 'Remove' );
  mosMenuBar::endTable();
}
This tells mosMenuBar what to print to the toolbar.The lowercase items inside the parenthesis tell admin.hello_world.php which $task to perform.

 

Well, I hope your eyes still work. This was a very basic look at how components work, and if you print it out it will still come to almost 16 pages :) I hope this helps you one your way to creating the next great Mambo component (soon to be an "Element" in 5.0)

Comments
Written by Guest on 2004-04-24 03:02:45
Thanks, it's very nice, and you learn a bit of PHP too this way.
Written by MamboHosting on 2004-04-25 19:01:03
Glad to be of help :)
good job
Written by Guest on 2004-04-26 01:21:20
Thanks for the manual. I started to discover everything by myself but this manual will be a great help for me !
Great work, but...
Written by lunepi on 2004-04-26 16:43:46
are there some mistakes in the code?  
Dear me ...
Written by Guest on 2004-04-28 09:53:17
you'll agree that this is far from bug-free, eh? :upset
incredible
Written by Guest on 2004-04-28 16:27:22
Thank you very much for this class professor :grin
Written by admin on 2004-04-29 09:42:36
Actually this tutorial meant to give you a general idea of how things work in a Mambo component, and is aimed to PHP developers with some experience who wants to move quickly to Mambo, so it's probably full of bugs, if you found one, please let's us know and we will be glad to correct it.
great advice
Written by Guest on 2004-04-29 21:47:49
just what i was looking for 8)
Awesome
Written by Guest on 2004-05-08 16:50:52
Thanks, this was a JUST IN TIME tutorial. There was only one other out there, and unfortunately unfinished. 
 
Kudos for the good work and once again, thanks!
Written by Guest on 2004-05-12 15:33:26
Quote:
it's probably full of bugs, if you found one, please let's us know and we will be glad to correct it.

 
 
Ok, I'm letting you know! :grin  
 
Check out this thread on your forum: 
http://www.mambohut.com/component/option,com_simpleboard/Itemid,25/func,view/id,152/catid,2/
Written by drhansenjr on 2004-05-12 15:37:45
The prior comment was mine, by the way -- I didn't mean to be negative. This tutorial is something that was SORELY needed, and it's great -- I'm just tearing my hair out trying to get through the final nits to get it to work. 
 
dh
admin.hello_world.php
Written by Guest on 2004-05-14 22:14:52
I was just reading through the tutorial and got to the admin.hello_world.php file. I seems like after the first switch statment on $act (which only has a default case) there is no way that $task would ever be set to anything other then "showText" for the next switch. Am I missing something? :roll
Fatal error: Cannot instantiate non-exis
Written by rodverap on 2004-05-28 02:49:39
I Keep geting this error 
 
Please Help
Fred A. Teixeira - Contritution
Written by Guest on 2004-06-11 13:33:55
How to install a mambo component.  
 
in your computer, add all these files in a zip file 
login as administrator in your mambo website 
go to menu component and hit install/uninstall. A list of all components installed will be shown 
go to the bottom of the page at "Upload new component", locate your zipped file and upload it 
again, go to menu component and hit install/uninstall. You will see your new component displayed in the list 
check in your web site. there will have some files installed under /components/com_hello_world and /administrator/components/com_hello_world. Besides that, you can check do a query to check out the component table: "select * from mos_components;" 
 
null
Written by Guest on 2004-06-18 09:24:11
:eek Very nice help, but toooooo long. 
Thanks a lot
Written by Guest on 2004-06-21 13:02:01
This helped a lot in getting me started, if any of you want to learn php go to http://3dbuzz.com and register and check out the free video tutorial there it helped me learn php and mysql a lot, which makes learning this a lot easier, also knowing basic c++ helps a lot also in understanding the concepts of classes which are heavly used in this as I noticed, but I like the whole efficient design of using object oriented class structures, it really is an amazing efficient work. 
 
-Scoutxr28
A zip file
Written by Guest on 2004-08-01 13:52:24
It could be useful to have the zip file of this tutorial to download. 
 
But thanks for this tutorial ;)
Written by Guest on 2004-08-03 14:18:48
A very nice starter for noobs!
file??
Written by gdevitry on 2004-09-16 16:36:15
As stated, copying this code can work... but did not in my case. Strange • characters show up (yes, I can remove them in an editor). Then the question, where do these files go (without a .zip installer). This is better than nothing. Thanx...
Written by mambohosting on 2004-09-17 16:20:02
hello_world.php goes in components/com_helloworld. Everything else goes in administrator/components/com_helloworld 
 
Just make sure to run the db query in mod_helloworld.xml
Written by mambohosting on 2004-09-17 16:20:41
As an edit to the last post, it's in hello_world.xml, not mod_helloworld.xml
hello world installer
Written by jpkeisala on 2004-09-19 12:15:10
Did anyone manage to make installer from this? I cant get it working.
"Hello World" Component
Written by admin on 2004-09-20 10:54:43
"Hello World" Component file is now availabe from our download section under "Tutorials" folder thanks to Nicolas Besson for making this available
Written by hleen on 2004-12-28 17:59:11
This tutorial really helped me; I was able to use it as a base for a concert calendar component!
Problem with the toolbar
Written by jrice on 2005-01-20 14:38:12
Nice tutorial - I have made a few changes for my own component - but the toolbar will not show up... 
 
any ideas?
many thanks ....
Written by mbeach on 2005-04-18 15:52:30
but if you are like me and stubled on this page a year or two late, be careful not to use '_' in your component name because it appear the folder name will have it removed when installed by mambo (did for me anyway). It's probably documented out there somewhere but I missed it and didn't have access to the php error log. took awhile to figure out that it put everything in a folder com_helloworld, so my require's failed. Seriously - thanks though. 
mb
Written by august on 2005-06-26 13:48:59
One more thing: one should replace mos_ with #__, so that is compitable with the 4.5.2 installer where you can change the prefix.
Error
Written by Guest on 2005-08-02 07:16:51
I have faced a problem when i clicked showtext ,it just display text which enter in database.how to add and edit in frontend. :upset
component
Written by Guest on 2005-08-02 15:49:01
once a component is installed how do I use it.... slightly confused about thigs right now as tried too much too fast today..... using the forum and the SEF components 
Accessing $my
Written by Guest on 2005-08-04 10:54:09
Hi, 
I read this tutorial several times. And I wanted to start my own component. The basics work well. I can install it, remove it, and view a simple textpage. But I don't get access to the $my-variable. Wether it write 
global $my; 
or not. I think I can access no global variables or functions. Has anybody an idea, what might be the problem?` 
 
I just don't know, what to try anymore... Thanks 
 
Problem in joomla
Written by NickNN on 2005-11-16 03:15:45
Hi, 
have just test the component on joomla. The installation is alright. But in the administration area it says something`s wrong with the sql syntax (near UPDATE ...), when you change the published flag.
Problem in joomla too
Written by FDitsche on 2006-02-10 00:27:32
Hello, 
i got the same problem. i found that the array $cid is not empty (count > 0) but there are no numbers inside the array. so the question is how will it be filled or read ? 
I compared the code with others, but still don't know.
Problem in joomla 2
Written by FDitsche on 2006-02-11 18:56:24
it works 
in the switch ($task) i changed every $id to $cid (i think it was 4 times)
Page 2 of tutorial error
Written by sergrodr on 2006-03-25 06:50:18
Teh page 2 not loading and show " You are not authorized to view this resource." If anything have a complete tutorial, send me please. 
 
Written by admin on 2006-03-28 10:25:23
This has been fixed!
Man...
Written by jeremyweber on 2006-05-05 08:12:44
After I install this, I get the following errors: 
 
 
Warning: require_once(C:/wamp/www/mambo/administrator/components/com_hello_world/toolbar.hello_world.html.php) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\mambo\administrator\components\com_hello_world\t oolbar.hello_world.php on line 15 
 
Fatal error: require_once() [function.require]: Failed opening required 'C:/wamp/www/mambo/administrator/components/com_hello_world/toolbar.hello_world.html.php' (include_path='.;C:\php5\pear') in C:\wamp\www\mambo\administrator\components\com_hello_world\t oolbar.hello_world.php on line 15 
 
Can anyone suggest how to fix? I tried backing out everything manually, but the same error occured on reinstall. Maybe I missed something...? 
 
Any help would be appreciated.
Fix for Joomla 1.0.x
Written by dieuleper on 2006-07-11 15:47:53
3 files fixed : 
hello_world.xml 
Code:
 
16 DROP TABLE IF EXISTS `jos_hello_world`; 
17 CREATE TABLE `jos_hello_world` ( 

 
 
admin.hello_world.html.php 
Code:
 
45 " onclick="isChecked(this.checked);" /> 

 
 
 
admin.hello_world.php 
Code:
 
29 case "publish": 
30 publishHelloWorld( $cid, 1, $option ); 
31 break; 
32 
33 case "unpublish": 
34 publishHelloWorld( $cid, 0, $option ); 
35 break; 
36 
37 case "new": 
38 editHelloWorld( 0, $option ); 
39 break; 
40  
41 case "edit": 
42 editHelloWorld( $cid[0], $option ); 
43 break; 
44  
45 case "remove": 
46 removeHelloWorld( $cid, $option ); 
47 break; 

 
 
com_Hello_World_for_joomla.zip 
 
For french people, read my website Freescript.be 
 
And take some hotel night with Hotels-moins-chers.fr 
 
Thank for this tuto ! 
 
--  
DLP (dieuleper [at] gmail.com)
Error editing 'hello world' Items with
Written by dr7tbien on 2006-07-30 07:15:55
I've load hello world component on Joomla!. I can create new Items. When I try to edit Items, or published I can't do it. When I click a Item I cannot edit the content. When I click to edit a Item, the program goes to a new one item. 
 
I've compared joomla code with mambo code links and are so differents. Somebody has the same problem? Now Im trying to compare SQL queries, etc...  
Lack of response
Written by thegent on 2006-08-27 12:59:51
Why has there been no response whatever to the many moans about this tutorial not working? 
it is so full of errors it is ridiculous

Only registered users can write comments.
Please login or register.

Powered by AkoComment 2.0!



 
< Prev   Next >
 
 
Joomla Jobs
 
 
Joomla Flash Tutorials
   
     
Home   |   Contact   |   Links   |   Forum   |   Downloads  |  Media Kit
 

© Copyright 2003 - 2006 by BUYHTTP, LLC. All rights reserved.
None of the text or images in this public website may be copied without the expressed written consent of the authors.
Powered By Joomla!

Joomla Top Sites - Your Primary Source of Joomla Traffic