Skip to content

Instantly share code, notes, and snippets.


Katz Ueno katzueno

View GitHub Profile

ConcreteCMS TIPS サンプルコード

ConcreteCMS TIPS のサンプルコードです。


katzueno / concrete.php
Created May 14, 2021
concrete5 の sitemap.xml を別のファイル名で保存する方法
View concrete.php
// appliction/config/concrete.php
return [
'sitemap_xml' => [
'file' => 'sitemap2.xml',
katzueno / controller.php
Created Apr 30, 2021
How to add jquery to Block Controller
View controller.php
class Controller extends BlockController
// 省略
public function on_start()
$al = AssetList::getInstance();
$al->register('javascript', 'jquery', 'js/jquery.js');
View login.php
namespace Application\Controller\SinglePage;
use Concrete\Controller\SinglePage\Login as CoreLogin;
class Login extends CoreLogin
public function view($type = null, $element = 'form')
katzueno / bulk_change_page_template.php
Created Jan 9, 2021 — forked from hissy/bulk_change_page_template.php
#concrete5 c5:exec command to bulk change page type & template
View bulk_change_page_template.php
* Usage:
* concrete/bin/concrete5 c5:exec bulk_change_page_template.php old_page_template_handle /parent-page-path new_page_template_handle
$filterPageTemplateHandle = $args[0];
$filterPagePath = $args[1];
$changePageTemplateHandle = $args[2];
katzueno /
Created Sep 23, 2020 — forked from crazycodr/
Batch restore deleted s3 objects by accident
# Set the bucket name and date limit that you want to scan for...
# For example, if you deleted everything at 9'ish, set the DATE_LIMIT for a
# few minutes before to ensure you find only the stuff you deleted by error
aws s3api list-object-versions --bucket "${BUCKET_NAME}" > objects.json
cat objects.json | jq --arg DATE_LIMIT "${DATE_LIMIT}" '[ .DeleteMarkers[] | select(.LastModified > $DATE_LIMIT and .IsLatest) | { file: .Key, version: .VersionId } ]' > markers-to-delete.json
katzueno / app.php
Last active May 13, 2020
concrete5 Environment switch according to host name
View app.php
// /application/bootstrap/app.php
Route::register('/ccm/request_test', function() {
header("Pragma: no-cache");
echo '<dl>';
?><dt>Application environment:</dt><dd><?php echo ($this->app->environment()) ? $this->app->environment() : 'default'; ?></dd><?php
$request = \Concrete\Core\Http\Request::getInstance();
?><dt>Client IP:</dt><dd><?php echo $request->getClientIp(); ?></dd><?php
?><dt>Host:</dt><dd><?php echo $request->getHost(); ?></dd><?php
?><dt>Port:</dt><dd><?php echo $request->getPort(); ?></dd><?php
katzueno / BasicThumbnailer.php
Last active Oct 12, 2018
src/Entity/File/Version.php & src/File/Image/BasicThumbnailer.php
View BasicThumbnailer.php
namespace Concrete\Core\File\Image;
use Concrete\Core\Application\ApplicationAwareInterface;
use Concrete\Core\Application\ApplicationAwareTrait;
use Concrete\Core\Entity\File\File;
use Concrete\Core\Entity\File\StorageLocation\StorageLocation;
use Concrete\Core\File\Image\Thumbnail\ThumbnailerInterface;
use Concrete\Core\File\Image\Thumbnail\Type\CustomThumbnail;
use Concrete\Core\File\StorageLocation\Configuration\LocalConfiguration;
View legacy_block_controller.php
namespace Application\Block\Form;
use Concrete\Core\Block\BlockController;
use Core;
use Database;
use User;
use Page;
use UserInfo;
katzueno / GravatarHelper.php
Last active Sep 22, 2022
Disable Gravatar for Mautic
View GravatarHelper.php
* @copyright 2014 Mautic Contributors. All rights reserved
* @author Mautic
* @link
* @license GNU/GPLv3