How to check for Joomla 1.0.x or 1.5.x version?

Discussion and education for beginner / novice programmers interested in embarking on the development process to take advantage of the extensible nature of the Joomla! CMS.
Locked
User avatar
stevent
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 123
Joined: Thu Sep 15, 2005 6:05 pm
Location: Nijmegen, Netherlands
Contact:

How to check for Joomla 1.0.x or 1.5.x version?

Post by stevent » Sat Jun 28, 2008 2:28 pm

I'm creating a component for Joomla 1.0.x, that will work in Joomla 1.5 legacy mode. But I would like to use Joomla 1.5 specific classes if the component is installed on Joomla 1.5. Is there a way to check which version of Joomla is installed? Joomla 1.5 has the JVersion class to check the version, but you can only check versions 1.5 or above.

romszone_com
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Mon Jan 14, 2008 8:02 pm
Contact:

Re: How to check for Joomla 1.0.x or 1.5.x version?

Post by romszone_com » Thu Jul 03, 2008 5:52 am

I really need something like this too, and I am sure every other component developer does as well. So any help on this would be greatly appreciated.

romszone_com
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Mon Jan 14, 2008 8:02 pm
Contact:

Re: How to check for Joomla 1.0.x or 1.5.x version?

Post by romszone_com » Thu Jul 10, 2008 8:13 pm

I found this in the Jevents events component http://www.jevents.net

Code: Select all

// Joomla 1.5
global $_VERSION;
if (floatval($_VERSION->getShortVersion())>=1.5){
	J1.5.x code here
else {
	1.0.x code here
}
CMS TopSites
Lets Affiliates automatically trade links with your Joomla / Mambo site and more...
View project and Demo at http://9zr.net/
Also get free games and more at http://romszone.com


Locked

Return to “Joomla! Coding 101”