Skip to content

Instantly share code, notes, and snippets.

View katzueno's full-sized avatar

Katz Ueno katzueno

View GitHub Profile
@katzueno
katzueno / get_latest_version_number.php
Created May 7, 2014 13:16
5.6.3.1 用自動アップグレード
<?php
//defined('C5_EXECUTE') or die("Access Denied.");
ini_set("display_errors","0");
if (version_compare($_REQUEST['APP_VERSION'], '5.3.9', '>')) {
// we support the new xml method. otherwise just return old school
header('Content-Type: text/xml');
if (version_compare($_REQUEST['APP_VERSION'], '5.6.2', '>')) { // 5.6.2.1日本語版ユーザー → 5.6.3.1日本語版へ ?>
<update>
@katzueno
katzueno / library.php
Last active August 29, 2015 14:01
web/concrete/core/libraries/page_cache/library.php
public function getCacheKey($mixed) {
if ($mixed instanceof Page) {
return urlencode(trim($mixed->cID, '/'));
} else if ($mixed instanceof Request) {
return urlencode(trim($mixed->cID, '/'));
} else if ($mixed instanceof PageCacheRecord) {
return $mixed->getCacheRecordKey();
}
}
@katzueno
katzueno / vhost.conf
Created May 21, 2014 04:55
concrete5 multisite single core setting for Apache
Alias "[RELATIVE PATH OF CONCRETE FOLDER]" "[FULL SERVER PATH TO YOUR CONCRETE5 CORE]"
<Directory [FULL SERVER PATH TO EACH WEB AREA]>
<IfModule sapi_apache2.c>
php_admin_value open_basedir "[FULL SERVER PATH TO EACH WEB AREA]:[FULL SERVER PATH TO YOUR CONCRETE5 CORE]:/tmp"
</IfModule>
<IfModule mod_php5.c>
php_admin_value open_basedir "[FULL SERVER PATH TO EACH WEB AREA]:[FULL SERVER PATH TO YOUR CONCRETE5 CORE]:/tmp"
@katzueno
katzueno / event.php
Last active August 29, 2015 14:02
concrete5:イベント開始時刻・終了時刻をページ属性を使ってテーマなどに表示する方法
<?php
$week = array("(日) ", "(月) ", "(火) ", "(水) ", "(木) ", "(金) ", "(土)");
$event_start = strtotime($c->getCollectionAttributeValue("event_start"));
$event_start_d = date('Y年m月d日 ', $event_start);
$event_start_w = date("w", $event_start);
$event_end = strtotime($c->getCollectionAttributeValue("event_end"));
$event_end_d = date('Y年m月d日 ', $event_end);
$event_end_w = date("w", $event_end);
if($event_start){
@katzueno
katzueno / gist:172a559fff4f20667c1b
Last active August 29, 2015 14:02
concrete5 第4階層以降であれば、第3階層 のページタイトルを表示させる。
<h1><?php
$c = Page::getCurrentPage();
$nh = Loader::helper('navigation');
// concrete5 第4階層以降であれば、第3階層 のページタイトルを表示させる。
// [現在のページタイトル] - [第3階層のページタイトル]
// ページ属性 display_secondary_title がチェックされていれば第3階層のタイトルを表示しない
// $trail [0] はトップ
// $trail [1] は第2階層
echo h($c->getCollectionName());
if (!$c->getAttribute('display_secondary_title')){
@katzueno
katzueno / gettexts_sample.php
Last active August 29, 2015 14:02
Gettext, t() format
<?php
// Simple String
echo t('STRING');
// String with one variable
$string = 'name';
echo t('STRING %s', $string);
@katzueno
katzueno / c5HelpdeskInt8.txt
Created June 20, 2014 05:22
concrete5: Helpdesk Addon: Internaitonalization
Well wrapped for t().
I suggest for the tiny adjustment
Found a couple minor stuff
/controllers/dashboard/helpdesk/search_article.php
On line 54
[code]$this->set('message', t('"'.$name.'" has been deleted'));
[/code]
@katzueno
katzueno / _settings.scss
Last active August 29, 2015 14:02
FoundationPress の日本語フォント対応 (http://ja.katzueno.com/2014/06/3155/)
// Foundation by ZURB
// foundation.zurb.com
// Licensed under MIT Open Source
//
// FOUNDATION SETTINGS
//
// This is the default html and body font-size for the base rem value.
$rem-base: 16px;
@katzueno
katzueno / .htaccess
Last active August 29, 2015 14:03
さくら:スタンダード【旧】 concrete5 でプリティーURLを動かす方法
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?pathinfo=$1 [L,QSA]
</IfModule>
@katzueno
katzueno / page_list_pagination.html
Created June 30, 2014 07:34
concrete5: ページリストのページングのコーディング
<div id="pagination">
<div class="ccm-spacer"></div>
<div class="ccm-pagination">
<span class="ccm-page-left"><span class="ltgray">&laquo; 前</span></span>
<span class="currentPage active numbers"><strong>1</strong></span>
<span class=" numbers"><a href="/news/?ccm_paging_p_b322=2" >2</a></span>
<span class=" numbers"><a href="/news/?ccm_paging_p_b322=3" >3</a></span>
<span class=" numbers"><a href="/news/?ccm_paging_p_b322=4" >4</a></span>