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 | |
/** | |
* @package Joomla.Site | |
* @subpackage com_content | |
* | |
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. | |
* @license GNU General Public License version 2 or later; see LICENSE.txt | |
*/ | |
defined('_JEXEC') or die; |
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
/** | |
* Method to truncate introtext | |
* | |
* The goal is to get the proper length plain text string with as much of | |
* the html intact as possible with all tags properly closed. | |
* | |
* @param string $html The content of the introtext to be truncated | |
* @param integer $maxLength The maximum number of charactes to render | |
* | |
* @return string The truncated string |
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
<field name="address1" type="checkboxes" | |
label="COM_CONTACT_FIELD_INFORMATION_SUBURB_LABEL" | |
description="COM_CONTACT_FIELD_INFORMATION_SUBURB_DESC" | |
multiple="true" default= "(array) blue,red" | |
> | |
<option value="red">red</option> | |
<option value="blue">blue</option> | |
</field> | |
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
if ($lang === 'jp') | |
{ | |
// Iterate through the terms and test if they contain Chinese. | |
for ($i = 0, $n = count($terms); $i < $n; $i++) | |
{ | |
$charMatches = array(); | |
$charCount = preg_match_all('#[\x{4E00}-\x{9FBF}]#mui', $terms[$i], $charMatches); | |
$charCount += preg_match_all('#[\x{3040–\x{309F}]#mui', $terms[$i], $charMatches); | |
$charCount += preg_match_all('#[\x{30A0}-\x{30FF}]#mui', $terms[$i], $charMatches); |
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
$db = $this->getDbo(); | |
$query = $db->getQuery(true); | |
//sqlsrv changes | |
$case_when = ' CASE WHEN '; | |
$case_when .= $query->charLength('a.alias'); | |
$case_when .= ' THEN '; | |
$a_id = $query->castAsChar('a.id'); | |
$case_when .= $query->concatenate(array($a_id, 'a.alias'), ':'); | |
$case_when .= ' ELSE '; |
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
I put this in a layout | |
jimport('joomla.database.database'); | |
jimport('joomla.database.databasequery'); | |
$this->tablePrefix = ''; | |
$newname = JDatabase::replacePrefix('#__somename'); | |
var_dump($newname); | |
int(0) int(638) int(0) int(638) int(0) int(143) int(0) int(11) string(8) "somename" |
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 | |
define( '_JEXEC', 1 ); | |
define('JPATH_BASE', dirname(__FILE__)); | |
require_once ( JPATH_BASE.'/libraries/import.php' ); | |
jimport( 'joomla.application.cli' ); | |
class JoomlaRocks extends JCli | |
{ | |
NewerOlder