Skip to content

Instantly share code, notes, and snippets.

View asika32764's full-sized avatar

Simon Asika asika32764

View GitHub Profile
@asika32764
asika32764 / addLink.php
Last active October 3, 2015 02:37
字串中網址自動加上超連結
@asika32764
asika32764 / gist:3827733
Created October 3, 2012 15:52
Joomla! Templates
JoomlArt
http://www.joomlart.com/joomla/templates/showcase
YOOTheme
http://www.yootheme.com/themes
Rockettheme
http://www.rockettheme.com/joomla-templates
Joomlabamboo
@asika32764
asika32764 / gist:4943196
Created February 13, 2013 08:59
php Test
<?php
/**
* @package Joomla.Administrator
* @subpackage com_flower
*
* @copyright Copyright (C) 2012 Asikart. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Generated by AKHelper - http://asikart.com
*/
/*
* 判斷按下的按鈕是哪一個
* @param (event) e keypress event.
* @param (mix) targetKeyChar 按鍵的編號或名稱,如果是這個按鍵,就執行 callback
* @param (function) callBack 送入callback的function,不用加()括號
*
*/
var detectKeyPress = function(e, targetKeyChar, callBack){
var keynum
<?php
public static function read($file)
{
shell_exec("/usr/bin/pdftotext {$file} {$filetmp}.txt") ;
$output = file_get_contents("{$filetmp}.txt");
return $output ;
}
<?php
public function getSchools()
{
// Get City id for query School.
$id = $this->getState('city.id');
// Get Admin Model
JModelLegacy::addIncludePath( JPATH_COMPONENT_ADMINISTRATOR . '/models' );
$model = JModel::getInstance('Schools', 'TourModel', array('ignore_request' => true)) ;
<?php
include_once AKPATH_HTML.'/grid.php' ;
// Create a new Grid
$grid = new AKGrid( array('class' => 'adminlist', 'id' => 'table_id') );
// Set Columns
$grid->setColumns( array('week_start', 'price', 'discount', 'delete') ) ;
// Add First TR Row as thead
<?php
// Put in viewapi.class.php line 59
if( !is_callable( array($model, $method) ) ) {
ApiError::raiseError(500, "Method: {$class}::{$method} is not exists.");
return false;
}
public static function raise($level, $code, $msg, $info = null, $backtrace = false)
{
if( !empty(self::$levels[$level]) ){
$level = self::$levels[$level] ;
}else{
$level = self::$levels[E_NOTICE] ;
}
return call_user_func_array( array('ApiError', 'raise'.$level), array($level, $code, $msg, $info) ) ;
}
<?php
class XXXHelperArray
{
/**
* Set a value into array or object.
*
* @param mixed $array An array to set value.
* @param string $key Array key to store this value.