How do I access Joomla global variables?

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
User avatar
ferrazf
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Fri Jan 26, 2007 8:23 pm

How do I access Joomla global variables?

Post by ferrazf » Sat Feb 16, 2008 10:20 pm

Hey all,

I am running a PC game league website, and I wrote a small php system that allows me to store and display game and player statistics. I want to add some things to it which would require access to some user information, such as the username of the person accessing the page, if he or she is logged in. I wanted to re-make the whole thing using a RAD application like Delphi for PHP.

I do not want to make Joomla component out of it. Judging from a few component-building tutorials I have seen, there would be a great deal of extra work I'd have to do as opposed to running it all inside custom php modules (which is what I am currently doing). The only Joomla component tutorials I found teach me how to physically write the code for each and every object I need, such as spacers, buttons, tables, etc. Example:

Code: Select all

  function helloWorld(){
        mosMenuBar::startTable();
        mosMenuBar::apply( 'polite', 'Be Polite' );
        mosMenuBar::spacer();
        mosMenuBar::help( 'helloworld.html', true );
        mosMenuBar::endTable();


This is simply way too unecessarily over complicated and tedious. Although I am a newb at PHP, I do believe I have what little skill necessary to build this app, however it would be great to make use of an IDE's RAD features and its visual component libraries, while still having access to joomla's global variables.

I have already tried searching for a way to do this, however the few solutions I found were either outdated or way over my head.

If there is any relatively simple way to access joomla's global variables, it would be great if anyone could share it.

Thanks a million

User avatar
ferrazf
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Fri Jan 26, 2007 8:23 pm

Re: How do I access Joomla global variables?

Post by ferrazf » Sun Feb 17, 2008 1:18 am

I found a way around this by donwloading the Jumi extension, very handy. http://extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,1023/Itemid,35/

Thanks

User avatar
Rogue4ngel
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 199
Joined: Sun Nov 26, 2006 10:46 pm
Location: New York

Re: How do I access Joomla global variables?

Post by Rogue4ngel » Mon Feb 18, 2008 5:39 pm

Excellent. Glad you found something to suit your needs.
If you're not a part of the solution, you're a part of the problem.


Post Reply