Skip to content

Instantly share code, notes, and snippets.

@atsu666
atsu666 / gist:3890331
Created October 15, 2012 00:55
#ablogcms エントリ作成時のPOSTデータを編集するサンプル
/**
* POSTモジュール処理前
* $thisModuleのプロパティを参照・操作するなど
*
* @param ACMS_POST $thisModule
*/
public function beforePostFire($thisModule)
{
$moduleName = get_class($thisModule);
@atsu666
atsu666 / gist:3984853
Created October 31, 2012 04:54
#a-blog cms カスタムフィールドグループのバリデーションサンプル
<h1>カスタムフィールドグループ demo</h1>
<table class="js-fieldgroup-sortable">
<tr>
<td><input type="button" class="item-insert" value="追加" /></td>
<td>日付</td>
<td>メールアドレス</td>
<td>削除</td>
</tr>
<!-- BEGIN sampleGroup:loop -->
<tr class="sortable-item">
@atsu666
atsu666 / gist:4086788
Created November 16, 2012 12:08
iPhoneとiPadの分離コード
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
// iPhone, iPod Touchの場合の動作
MasterViewController *masterViewController = [[[MasterViewController alloc] initWithNibName:@"MasterViewController_iPhone" bundle:nil] autorelease];
self.navigationController = [[[UINavigationController alloc] initWithRootViewController:masterViewController] autorelease];
self.window.rootViewController = self.navigationController;
} else {
// iPadの場合の動作
MasterViewController *masterViewController = [[[MasterViewController alloc] initWithNibName:@"MasterViewController_iPhone" bundle:nil] autorelease];
self.navigationController = [[[UINavigationController alloc] initWithRootViewController:masterViewController] autorelease];
self.window.rootViewController = self.navigationController;
@atsu666
atsu666 / jsdoit.css
Created December 4, 2012 00:35
2012-12-04 1st
body { background-color: #DDDDDD; font: 30px sans-serif; }
@atsu666
atsu666 / gist:b9ba07fd95de971b5321
Created August 9, 2014 09:51
ループのネスト a-blog cms - テンプレートエンジン
<?php
class ACMS_GET_CustomModule extends ACMS_GET
{
function get()
{
$Tpl = new Template($this->tpl, new ACMS_Corrector());
// 中略
@atsu666
atsu666 / gist:427b3404085993cac5fa
Created February 12, 2015 09:17
acms fieldの組み立て
<?php
class ACMS_User_POST_Sample extends ACMS_POST
{
public function post()
{
$Field =& $this->extract('field', new ACMS_Validator());
$this->saveField('eid', EID, $Field);
}
@atsu666
atsu666 / gist:9ba9635fa8b096f6bda3
Created April 24, 2015 08:26
a-blog cms 軽い変換カスタマイズ
<!-- blog custom field -->
<h2>customGroup</h2>
<table class="js-fieldgroup-sortable">
<tr>
<td><input type="button" class="item-insert acms-admin-btn-admin" value="追加" /></td>
<th>変換前</th>
<th>変換後</th>
<td>削除</td>
</tr>
<!-- BEGIN customGroup:loop -->
@atsu666
atsu666 / gist:379a1535148c58fd461b
Created May 28, 2015 09:07
メールの送信(添付ファイル付)a-blog cms
<php
...
if ( 1
and $to = $Mail->getArray('AdminTo')
and $subjectTpl = findTemplate($Mail->get('AdminSubjectTpl'))
and $bodyTpl = findTemplate($Mail->get('AdminBodyTpl'))
) {
$Mail->set('adminSubject', $this->getMailTxt($subjectTpl, $Field));
$Mail->set('adminBody', $this->getMailTxt($bodyTpl, $Field));
function loadEntryFulltext($eid)
{
$DB = DB::singleton(dsn());
$SQL = SQL::newSelect('column');
$SQL->addWhereOpr('column_entry_id', $eid);
$q = $SQL->get(dsn());
$text = '';
$meta = '';
if ( $DB->query($q, 'fetch') and ($row = $DB->fetch($q)) ) { do {
@atsu666
atsu666 / gist:bdcf6197fa21ac534e8c
Created October 30, 2015 03:11
a-blog cmsのキャッシュ処理周り
//-------
// cache
define('ZIP_USE', !DEBUG_MODE and !!ZIP_ENABLE and ('on' == config('zip_http')));
if ( 1
and !DEBUG_MODE
and ('on' == config('cache'))
and (!SID or (config('subscriber_cache') === 'on' and ACMS_RAM::userAuth(SUID) === 'subscriber' and !$Q->get('admin')))
and !(is_ajax() and config('ajax_nocache') === 'on' and $GetQuery->get('nocache') === 'yes')
and !HTTPS
and !ACMS_POST