Skip to content

Instantly share code, notes, and snippets.

View katzueno's full-sized avatar

Katz Ueno katzueno

View GitHub Profile
@katzueno
katzueno / theme.php
Created October 19, 2014 22:45
Get URL parameter and change the area to display
<?php
if (isset($_GET['area'])) $area = $_GET['area'];
if ($area = 'a') {
$a = new Area('Main_A');
$a->display($c);
}
if ($area = 'b') {
$a = new Area($area);
@katzueno
katzueno / GitHub.hook.sample.php
Last active August 29, 2015 14:12
GitHub Hook sample in PHP
<?php
/**
* Originally found at
* http://behindcompanies.com/2014/01/a-simple-script-for-deploying-code-with-githubs-webhooks/
* and logging function added
* This script is for easily deploying updates to Github repos to your local server. It will automatically git clone or
* git pull in your repo directory every time an update is pushed to your $BRANCH (configured below).
*
* INSTRUCTIONS:
@katzueno
katzueno / .gitignore
Last active August 29, 2015 14:12
Bitbucket & GitHub deployment code
#
# .gitignore sample for concrete5 & WordPress projects
#
# ignore system files
.DS_Store
thumbs.db
__MACOSX
._*
@katzueno
katzueno / vew.php
Last active August 31, 2018 07:06
concrete5 Manual Nav custom template to support external link's new window and nav_target page attribute
<?php defined('C5_EXECUTE') or die(_("Access Denied."));
/**
* concrete5.6.x Package 'Manual Nav' Custom Template
* @package Manual Nav
* @author Jordan Lev
* @author Katz Ueno
* @copyright Copyright (c) 2015 Katz Ueno. (http://katzueno.com)
* @license http://www.concrete5.org/license/ MIT License
* to support External Link's tareget="_blank"
* and page attribute 'nav_target'
@katzueno
katzueno / bootstrap-layout.php
Last active November 13, 2015 01:49
[concrete5]/model/layout.php to override concrete5.6.x layout system to support Foundation & Bootstrap CSS Framework
<?php
defined('C5_EXECUTE') or die("Access Denied.");
// Bootstrap CSS Hack for concrete5.6.x
// Rename this file as laytout.php and place it under [concrete5]/models/ folder/
class Layout extends Concrete5_Model_Layout {
function display( $c=NULL, $a=NULL ){
if(!$c) global $c;
@katzueno
katzueno / page_list_view.php
Last active August 29, 2015 14:14
News Category Image Label Sample Script
<?php
defined('C5_EXECUTE') or die("Access Denied.");
/*
* Page List * Page List Plus concrete5 custom templates sample
* ページリスト & ページリストプラスのカスタムテンプレートサンプル
* How to display category lebel by using Localizer add-on
* Localizer アドオンを使って、カテゴリラベルの色分け表示の色分け表示をする
*
* 1. You need to prepare CSS class that define the category label color
* 2. Create Select type Page attribute, name it with "news_type" handle
@katzueno
katzueno / page_list_view.php
Created February 3, 2015 00:46
Event Category Label (Image) Sample Script
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$th = Loader::helper('text');
$dh = Loader::helper('date');
$v = View::getInstance();
?>
<ul class="event__list">
<?php foreach ($pages as $page):
$title = $th->entities($page->getCollectionName());
@katzueno
katzueno / controller.php
Created February 11, 2015 04:00
concrete5.7 Theme controller.php
<?php
namespace Concrete\Package\【パッケージ名】;
use Concrete\Core\Block\BlockType\BlockType; // ブロックを登録する時
use Concrete\Core\Page\Template as PageTemplate; // ページテンプレートを登録する時
use Concrete\Core\Page\Theme\Theme as PageTheme; // テーマを登録する時
use Concrete\Core\Asset\Asset; // アセットを登録する時
use Concrete\Core\Asset\AssetList;
defined('C5_EXECUTE') or die('Access Denied.');
@katzueno
katzueno / menu_list_item.php
Last active August 29, 2015 14:17
concrete5 公式活用ガイドブック ページリスト 5.7 対応版
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$th = Loader::helper('text');
$c = Page::getCurrentPage();
$dh = Core::make('helper/date'); /* @var $dh \Concrete\Core\Localization\Service\Date */
$ih = Loader::helper('image');
?>
<?php if ( $c->isEditMode() && $controller->isBlockEmpty()) { ?>
<div class="ccm-edit-mode-disabled-item"><?php echo t('Empty Page List Block.')?></div>
@katzueno
katzueno / .htaccess
Last active January 30, 2018 00:27 — forked from hissy/.htaccess
Whitelisting IP for concrete5 dashboard / IP アドレス制限
## -- concrete5 urls start --
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Change RewriteBase path if this concrete5 is installed on subdirectory / concrete5 がサブディレクトリにインストールされていたら、RewriteBase の変更が必要です。
# IP address restriction starts here / IP アドレス制限、アクセス許可するのIPの設定
RewriteCond %{REMOTE_ADDR} !123\.4\.56\.789
RewriteCond %{REMOTE_ADDR} !123\.123\.123\.123
# Add more lines is you have more IP / もっとIPがある場合は、行を追加してください