// To load a css file for a component, from within the component
EEHtml::asset('style.css');
// To load a js file for a module
EEHtml::asset('slide.js', 'mod_menu');
// To load an image for a module
echo EEHtml::asset('search.png', 'mod_product_search');
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$uri = parse_url($_SERVER['REQUEST_URI']); | |
$path = explode('/', $uri['path']); | |
define('IS_HOME', (empty($path[1]))); | |
define('IS_ADMIN', ($path[1] === 'admin')); | |
define('IS_NEWS', ($path[1] === 'news')); | |
define('IS_CONTACT', ($path[1] === 'contact')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$sql = sprintf( "SELECT `Password`, `DealerID` | |
FROM `DLMAST` | |
WHERE `DealerID` = %d | |
AND LOWER(`Password`) = '%s'", | |
mysql_real_escape_string( $_POST['Username'] ), | |
mysql_real_escape_string( strtolower( $_POST['Password'] ) ) ); | |
$db->Execute( $sql, 'user_pass' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // File: index.php | |
const JPATH_BASE = __DIR__; | |
require_once JPATH_BASE . '/libraries/joomla/loader.php'; | |
Joomla\Loader::registerNamespace('Joomla', JPATH_BASE . '/libraries/joomla'); | |
Joomla\Application\Web::getInstance('\\Joomla\\Application\\Web')->execute(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"require": { | |
"joomla/platform": ">=13.2" | |
}, | |
"minimum-stability": "dev", | |
"require-dev": { | |
"phpunit/phpunit": "3.7.*" | |
}, | |
"config": { | |
"bin-dir": "bin", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Proposal to auto load custom libraries and register them with the | |
* application for use. Assume the directory structure below: | |
* | |
* /libraries | |
* - import.php | |
* - /joomla | |
* - /easel // The custom library |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
abstract class JFixProtected | |
{ | |
public function __set($name, $value) | |
{ | |
$name = $this->cleanPropertyName($name); | |
$this->$name = $value; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
mysql_connect("localhost", "uname", "pass@3") or die(mysql_error()); | |
echo "Connected to MySQL<br />"; // working fine | |
mysql_select_db("dbname") or die(mysql_error()); | |
echo "Connected to Database"; // working fine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function getSubmits() | |
{ | |
$cid = JFactory::getApplication()->input->getInt('cid'); | |
$db = $this->getDbo(); | |
$query = $db->getQuery(true); | |
$query->select('a.*, i.username'); | |
$query->select('(SELECT SUM(v.vote) FROM #__rootflick_vote AS v WHERE v.sub_id = a.id) AS vote'); |