Skip to content

Instantly share code, notes, and snippets.

<?php
class ACMS_POST_Entry_Duplicate extends ACMS_POST_Entry
{
function post()
{
$eid = idval($this->Post->get('eid', EID));
if (!$this->validate($eid)) {
die();
}
@atsu666
atsu666 / Apply.php
Created November 1, 2019 10:47
php/ACMS/POST/Publish/Apply.php
<?php
class ACMS_POST_Publish_Apply extends ACMS_POST_Publish
{
var $pointer= null;
function post()
{
if ( !IS_LICENSED ) return false;
#!/bin/sh
DIR="./media"
find $DIR -name "*.jpg" -type f -exec cwebp -o {}.webp {} \;
find $DIR -name "*.jpeg" -type f -exec cwebp -o {}.webp {} \;
find $DIR -name "*.png" -type f -exec cwebp -o {}.webp {} \;
server {
server_name example.com;
root /var/www/html;
location ~ ^/(private|themes|extension)/ {
return 403;
}
# Block access to "hidden" files.
location ~ (^|/)\. {
<!-- BEGIN_MODULE Touch_Entry -->
<!-- BEGIN_MODULE Touch_SessionWithContribution -->
<script>
ACMS.addListener('acmsDialogOpened', function () {
<!-- BEGIN_MODULE Config -->
(function () {
<!-- BEGIN_IF [{entry_edit_status_label}/nem] -->
$('#entry-status-label').html("{entry_edit_status_label}");
<!-- END_IF -->
<!-- BEGIN_IF [{entry_edit_title_label}/nem] -->
@atsu666
atsu666 / EntrySummary.php
Created April 15, 2019 03:30
php/ACMS/GET/Category/EntrySummary.php
function preBuildUnit()
{
$entryIds = array();
$blogIds = array();
$userIds = array();
$categoryIds = array();
foreach ($this->entries as $entry) {
if (!empty($entry['entry_id'])) $entryIds[] = $entry['entry_id'];
if (!empty($entry['entry_blog_id'])) $blogIds[] = $entry['entry_blog_id'];
@atsu666
atsu666 / Hook.php
Created December 20, 2018 13:07
extension/acms/Hook.php
public function beforeShutdown()
{
if (1
&& is_int(strpos(MIME_TYPE, 'html'))
&& !is_ajax()
) {
global $bench;
global $bench_build;
global $bench_rewrite_path;
global $bench_boot;
@atsu666
atsu666 / script.php
Last active March 28, 2019 07:18
a-blog cmsのサービスを外部から動かす。
<?php
define('REQUEST_TIME', time());
define('START_TIME', microtime(true));
define('UNLIMITED_NUMBER_OF_USERS', 5);
set_time_limit(0);
/**
* config.server.php
@atsu666
atsu666 / Download.php
Created December 3, 2018 06:55
php/ACMS/POST/Log/Form/Download.php
<?php
class ACMS_POST_Log_Form_Download extends ACMS_POST
{
function post()
{
if ( !$this->authorityCheck() ) {
return fasle;
}
backend default {
.host = "127.0.0.1";
.port = "8080";
}
sub vcl_recv {
set req.http.Host = req.http.host;
set req.http.X-Real-IP = client.ip;
set req.http.X-Forwarded-Host = req.http.host;
set req.http.X-Forwarded-Server = req.http.host;