Skip to content

Instantly share code, notes, and snippets.

View katzueno's full-sized avatar

Katz Ueno katzueno

View GitHub Profile
@katzueno
katzueno / concrete.php
Created November 2, 2015 09:02
concrete5.7.x 以降でテーマのカスタマイズをする方法
<?php
return array(
'seo' => array(
'title_format' => '%2$s :: %1$s'
)
);
@katzueno
katzueno / autolink.php
Last active December 9, 2015 00:59
Autolink of Forum
@katzueno
katzueno / filesize.php
Created December 20, 2015 08:47
concrete5 tips to use file size
$f = $controller->getFileObject(); // You can change it to like \File::getByID(3);
$fv = $f->getVersion();
$size = $fv->getFullSize(); // Get the file size
$size = Core::make('helper/number')->formatSize($size);
$type = strtolower($fv->getExtension()); // get the file extension
@katzueno
katzueno / readme.md
Last active December 28, 2015 01:52
concrete5.7.3: Google Map Block override sample: add "view this map in a new window" link

concrete5 Google Map Block override sample: add "view this map in a new window" link

This will add "view larger map" link to Google Map block Please save the the following view.php file onto /application/blocks/google_map/view.php

Changes from 5.7.3. default view.php

I've changed the following

  • LINE 9: added margn-top 1em
@katzueno
katzueno / readme.md
Last active January 9, 2016 12:25
concrete5.7 Theme Page Template file sample which just redirect to another page

concrete5.7.x Page Template sample which just to redirect for rich attributes in Page List or Autonav blocks / ページリストで追加の属性情報を表示させる時とかに使える、シンプルにリダイレクトをするためのページテンプレート

Sometime, "external link" doesn't fulfill your requirement for the page. You may want to display thumbnail image, additional page attribute such as topic and selector attributes to display the categories of the page.

This tutorial explains how to set-up redirect-only page with more page attributes option by creating redirect-only page template and page type in your theme.

(You may also want to customize your Page List and/or Autonav Blocks if you want to avoid additional redirect requests)

Disclaimer

@katzueno
katzueno / 0_readme.md
Last active October 26, 2018 12:08
concrete5.7.x Form Block send confirmation message to form sender

concrete5.7 Form Customization to send a confirmation email / フォームの送信者に確認メールを送る

Tested with concrete5.7.3.

Instruction

  1. Modify [SITE NAME] to your site name on the line 572 and 585 of controller.php
  2. Upload the controller.php to /application/blocks/form/ (create folder if not existed)
  3. Change or add anything you want in block_form_submission_user.php
  4. Upload the block_form_submission_user.php to /application/mail/
@katzueno
katzueno / 0_readme.md
Last active January 1, 2016 06:06
concrete5.7 サイトでイベントページとか作成している時に申込先のボタンをなんかナイスに表示したい時のサンプルコード

concrete5.7.x Event Link

concrete5.7 サイトでイベントページとか作成している時に申込先のボタンをなんかナイスに表示したい時のサンプルコード。

仕様

  1. コーディングでは Bootstrap な 「申し込み」ボタンが表示されるだけのシンプルなボタンです。
  2. URL かメールアドレスであるかを判別するようになっています。
  3. URL であれば、「詳細&申し込み」というリンクに。
  4. メールアドレスでされば「メールでお問合せ」というリンクになり、メーラーが立ち上がって、イベントタイトルや、本文に氏名・性別・住所・連絡先・備考という入力項目が自動的に入力された形で表示されるというリンクになるようにしました。
@katzueno
katzueno / profile.php
Last active January 3, 2016 03:31
Display member's personal blog RSS feed on concrete5 public profile
<?php defined('C5_EXECUTE') or die("Access Denied.");
/* This is just the portion of the code
*/
$blog_rss = h($ui->getAttribute('blog_rss'));
$isRSSValid = false;
if (preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i",$blog_rss)) {
$isRSSValid = true;
}
?>
<?php if ($blog_rss && $isRSSValid) {?>
@katzueno
katzueno / readme.md
Last active January 11, 2016 08:55
Quick fix for Dashboard - System and Settings - Conversation - Settings of concrete5.7.5.3
@katzueno
katzueno / date.php
Last active January 22, 2016 02:39
<?php
echo date('Y/m/d H:i:s e');