Some fixes from the platform
Use JDatabase instead of MySQL queries
Correct query format
Correct query format
Remove unnecessary empty()
There is no $request here

Is this the right way to define $request to get the limitstart parameter?
There is no $return here
Fix var name
The registry variable is named $config here
Fix silly typo
Fix getTemplate() issue which caused an undefined variable to be called.
changes for loadmodule styles
changing to default module style #1
removing commented code lines #1
Conditional to show header
 ^ [#31134] *Improving Content Languages edit and manager. Thanks
Benjamin Trenkle and Roland Dalmulder
 # [#31147] *Install sample data None does not display tooltip.
(fix #1269)
 # [#31108] Fatal erorr right after install. Thanks Klas and Michael
Babker
(Fix #1244)
 # [#30354] Invalid Javascript Redirect in JApplication::redirect() when
headers have already been sent. Thanks Ben Tasker.
(Fix #867)
 $ [#26548] [patch] incorrect error check in menus.php. Thanks Rob
Clayburn and Ben Tasker
(Fix #1012)