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 = & JFactory::getURI(); | |
$absolute_url = $uri->toString(); | |
echo $absolute_url; | |
?> |
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 | |
JHtml::_('jquery.framework'); | |
?> |
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 | |
jimport( 'joomla.application.module.helper' ); | |
$module = JModuleHelper::getModule('mymodulename'); | |
$moduleParams = new JRegistry(); | |
$moduleParams->loadString($module->params); | |
// Ahora podemos llamar al parámetro | |
$param = $moduleParams->get('paramName', 'defaultValue'); | |
?> |
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 | |
// eliminamos enlaces | |
$myCleanHtml = filter_var($this->item->introtext, FILTER_SANITIZE_STRING); | |
// recortamos texto a 200 caracteres | |
if (strlen($myCleanHtml) > 200){ | |
echo substr($myCleanHtml,0,200).'...'; | |
}else{ | |
echo $myCleanHtml; | |
} |
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 | |
// cogemos imagen de introtext | |
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $this->item->introtext, $src); | |
$first_img = $src[1][0]; | |
if(!empty($src[1][0])){ | |
echo '<div class="first_img"><img src="'.$src[1][0].'" alt="" /></div>'; | |
} | |
// quitamos todas las imágenes de introtext | |
$re_cleanImages = '/<img[^>]*>/'; | |
$myCleanHtml = preg_replace($re_cleanImages,'',$this->item->introtext); |
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 getCats() | |
{ | |
$db = JFactory::getDBO(); | |
$query = $db->getQuery(true); | |
$query->select('a.id, a.title, a.level'); | |
$query->from('#__categories AS a'); | |
$query->join('LEFT', $db->quoteName('#__categories').' AS b ON a.lft > b.lft AND a.rgt where('a.extension = "com_content"'); | |
$query->where('a.published IN (0,1)'); |
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 | |
function joomlaPassword($password) { | |
$password= base64_decode($password); | |
$salt = md5(mt_rand()); | |
$encrypt = md5($password . $salt); | |
return $encrypt . ':' . $salt; | |
} | |
?> |
NewerOlder